...
PrepmtSalesLine@1002 : TEMPORARY Record 37;
DocDim@1001 : Record 357;
SalesPost@1000 : Codeunit 80;
TempSalesLine@1003 : TEMPORARY Record 37;
// Delete the following lines.
BEGIN
CLEAR(SalesLine);
CLEAR(SalesPost);
VATAmountLine.DELETEALL;
SalesLine.DELETEALL;
SalesPost.GetSalesLines("Sales Header",SalesLine,0);
SalesLine.CalcVATAmountLines(0,"Sales Header",SalesLine,VATAmountLine);
SalesLine.UpdateVATOnLines(0,"Sales Header",SalesLine,VATAmountLine);
// End of the lines.
VATAmount := VATAmountLine.GetTotalVATAmount;
VATBaseAmount := VATAmountLine.GetTotalVATBase;
VATDiscountAmount :=
VATAmountLine.GetTotalVATDiscount("Sales Header"."Currency Code","Sales Header"."Prices Including VAT");
...
...
PrepmtSalesLine@1002 : TEMPORARY Record 37;
DocDim@1001 : Record 357;
SalesPost@1000 : Codeunit 80;
TempSalesLine@1003 : TEMPORARY Record 37;
// Add the following lines.
SalesLineDisc@1004 : TEMPORARY Record 37;
BEGIN
CLEAR(SalesLine);
CLEAR(SalesPost);
CLEAR(SalesLineDisc);
VATAmountLine.DELETEALL;
SalesLine.DELETEALL;
SalesLineDisc.DELETEALL;
SalesPost.GetSalesLines("Sales Header",SalesLine,0);
SalesLine.CalcVATAmountLines(0,"Sales Header",SalesLine,VATAmountLine);
SalesLine.UpdateVATOnLines(0,"Sales Header",SalesLine,VATAmountLine);
SalesPost.GetSalesLines("Sales Header",SalesLineDisc,1);
SalesLineDisc.CalcVATAmountLines(1,"Sales Header",SalesLineDisc,VATAmountLine);
SalesLineDisc.UpdateVATOnLines(1,"Sales Header",SalesLineDisc,VATAmountLine);
SalesLine."Inv. Discount Amount" := VATAmountLine."Invoice Discount Amount";
// End of the lines.
VATAmount := VATAmountLine.GetTotalVATAmount;
VATBaseAmount := VATAmountLine.GetTotalVATBase;
VATDiscountAmount :=
VATAmountLine.GetTotalVATDiscount("Sales Header"."Currency Code","Sales Header"."Prices Including VAT");
...