...
"Shipped Not Invoiced (LCY)" := 0;
"Return Rcd. Not Invd." := 0;
"Return Rcd. Not Invd. (LCY)" := 0;
END ELSE BEGIN
GetSalesHeader;
// Delete the following lines.
IF SalesHeader.Status = SalesHeader.Status::Released THEN
AmountInclVAT := "Amount Including VAT"
ELSE
// End of the lines.
IF SalesHeader."Prices Including VAT" THEN
AmountInclVAT := "Line Amount" - "Inv. Discount Amount"
ELSE
IF "VAT Calculation Type" = "VAT Calculation Type"::"Sales Tax" THEN
AmountInclVAT :=
"Line Amount" - "Inv. Discount Amount" +
ROUND(
SalesTaxCalculate.CalculateTax(
"Tax Area Code","Tax Group Code","Tax Liable",SalesHeader."Posting Date",
"Line Amount" - "Inv. Discount Amount","Quantity (Base)",SalesHeader."Currency Factor"),
Currency."Amount Rounding Precision")
ELSE
AmountInclVAT :=
ROUND(
("Line Amount" - "Inv. Discount Amount") *
(1 + "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100)),
Currency."Amount Rounding Precision");
VALIDATE(
"Outstanding Amount",
ROUND(
AmountInclVAT * "Outstanding Quantity" / Quantity,
Currency."Amount Rounding Precision"));
...
...
"Shipped Not Invoiced (LCY)" := 0;
"Return Rcd. Not Invd." := 0;
"Return Rcd. Not Invd. (LCY)" := 0;
END ELSE BEGIN
GetSalesHeader;
IF SalesHeader."Prices Including VAT" THEN
AmountInclVAT := "Line Amount" - "Inv. Discount Amount"
ELSE
IF "VAT Calculation Type" = "VAT Calculation Type"::"Sales Tax" THEN
AmountInclVAT :=
"Line Amount" - "Inv. Discount Amount" +
ROUND(
SalesTaxCalculate.CalculateTax(
"Tax Area Code","Tax Group Code","Tax Liable",SalesHeader."Posting Date",
"Line Amount" - "Inv. Discount Amount","Quantity (Base)",SalesHeader."Currency Factor"),
Currency."Amount Rounding Precision")
ELSE
AmountInclVAT :=
ROUND(
("Line Amount" - "Inv. Discount Amount") *
(1 + "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100)),
Currency."Amount Rounding Precision");
VALIDATE(
"Outstanding Amount",
ROUND(
AmountInclVAT * "Outstanding Quantity" / Quantity,
Currency."Amount Rounding Precision"));
...