Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4377,6 +4378,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10993,6 +10995,26 @@ table 39 "Purchase Line"
FieldError(Quantity, StrSubstNo(CorrectiveCreditMemoQtyIncreaseErr, xPurchaseLine.Quantity));
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

[IntegrationEvent(false, false)]
local procedure OnAfterInitDefaultDimensionSources(var PurchaseLine: Record "Purchase Line"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
begin
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/BE/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3690,6 +3690,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4296,6 +4297,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10411,6 +10413,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/CH/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3692,6 +3692,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4295,6 +4296,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10304,6 +10306,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3688,6 +3688,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4293,6 +4294,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10303,6 +10305,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/ES/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3692,6 +3692,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4299,6 +4300,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10327,6 +10329,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/FI/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3689,6 +3689,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4286,6 +4287,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10296,6 +10298,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/GB/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3705,6 +3705,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4318,6 +4319,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10347,6 +10349,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
22 changes: 22 additions & 0 deletions src/Layers/IT/BaseApp/Purchases/Document/PurchaseLine.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,7 @@ table 39 "Purchase Line"
begin
NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
CheckNonDedVATPctConsistencyForZeroLine();
Comment thread
neeleshsinghal marked this conversation as resolved.
UpdateAmounts();
end;
}
Expand Down Expand Up @@ -4544,6 +4545,7 @@ table 39 "Purchase Line"
InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
DifferentNonDedVATRatesSameVATIdentifierErr: Label 'You cannot set different Non-Deductible VAT % for the combinations of business and product groups with the same VAT identifier.\The following combination with the same VAT identifier has different Non-Deductible VAT %: business group %1, product group %2', Comment = '%1 = VAT business posting group code, %2 = VAT product posting group code';

protected var
Currency: Record Currency;
Expand Down Expand Up @@ -10582,6 +10584,26 @@ table 39 "Purchase Line"
exit("Matched Inv./Cr. Memo Lines" > 0);
end;

local procedure CheckNonDedVATPctConsistencyForZeroLine()
var
PurchLine: Record "Purchase Line";
begin
if "Non-Deductible VAT %" <> 0 then
exit;
if "VAT Identifier" = '' then
exit;
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
exit;

PurchLine.SetRange("Document Type", "Document Type");
Comment thread
neeleshsinghal marked this conversation as resolved.
PurchLine.SetRange("Document No.", "Document No.");
PurchLine.SetFilter("Line No.", '<>%1', "Line No.");
PurchLine.SetRange("VAT Identifier", "VAT Identifier");
PurchLine.SetFilter("Non-Deductible VAT %", '<>%1', "Non-Deductible VAT %");
if PurchLine.FindFirst() then
Error(DifferentNonDedVATRatesSameVATIdentifierErr, PurchLine."VAT Bus. Posting Group", PurchLine."VAT Prod. Posting Group");
end;

local procedure CheckCorrectiveCreditMemoQtyIncrease(xPurchaseLine: Record "Purchase Line")
begin
if not ("Copied From Posted Doc." and IsCreditDocType()) then
Expand Down
Loading
Loading