...
IF SalesHeader."Prices Including VAT" THEN BEGIN
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
BEGIN
"VAT+EC Base" :=
...
...
IF SalesHeader."Prices Including VAT" THEN BEGIN
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
// Add the following line.
"VAT Calculation Type"::"No taxable VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
BEGIN
"VAT+EC Base" :=
...
...
ROUND(
("Line Amount" - "Invoice Discount Amount") / (1 + ("VAT %" + "EC %") / 100),
Currency."Amount Rounding Precision") - "VAT Difference";
// Delete the following lines.
"VAT Amount" :=
"VAT Difference" +
ROUND(
PrevVatAmountLine."VAT Amount" +
("Line Amount" - "VAT+EC Base" - "VAT Difference") *
("VAT %" / ("VAT %" + "EC %")) *
(1 - SalesHeader."VAT Base Discount %" / 100),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
"EC Amount" :=
"EC Difference" +
ROUND(
PrevVatAmountLine."EC Amount" +
("Line Amount" - "VAT+EC Base" - "EC Difference") *
("EC %" / ("VAT %" + "EC %")) *
(1 - SalesHeader."VAT Base Discount %" / 100),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
// End of the lines.
"Amount Including VAT+EC" := "VAT+EC Base" + "VAT Amount" + "EC Amount";
IF Positive THEN
PrevVatAmountLine.INIT
...
...
ROUND(
("Line Amount" - "Invoice Discount Amount") / (1 + ("VAT %" + "EC %") / 100),
Currency."Amount Rounding Precision") - "VAT Difference";
// Add the following lines.
IF ("VAT %" <> 0) OR ("EC %" <> 0) THEN BEGIN
"VAT Amount" :=
"VAT Difference" +
ROUND(
PrevVatAmountLine."VAT Amount" +
("Line Amount" - "VAT+EC Base" - "VAT Difference") *
("VAT %" / ("VAT %" + "EC %")) *
(1 - SalesHeader."VAT Base Discount %" / 100),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
"EC Amount" :=
"EC Difference" +
ROUND(
PrevVatAmountLine."EC Amount" +
("Line Amount" - "VAT+EC Base" - "EC Difference") *
("EC %" / ("VAT %" + "EC %")) *
(1 - SalesHeader."VAT Base Discount %" / 100),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
END;
// End of the lines.
"Amount Including VAT+EC" := "VAT+EC Base" + "VAT Amount" + "EC Amount";
IF Positive THEN
PrevVatAmountLine.INIT
...
...
END ELSE BEGIN
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
BEGIN
"VAT+EC Base" := "Line Amount" - "Invoice Discount Amount";
...
...
END ELSE BEGIN
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
// Add the following line.
"VAT Calculation Type"::"No taxable VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
BEGIN
"VAT+EC Base" := "Line Amount" - "Invoice Discount Amount";
...