...
END ELSE BEGIN
// Delete the following lines.
VATAmount :=
TempVATAmountLineRemainder."VAT Amount" +
VATAmountLine."VAT Amount" *
("Line Amount" - "Inv. Discount Amount") /
(VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
NewAmountIncludingVAT :=
TempVATAmountLineRemainder."Amount Including VAT" +
VATAmountLine."Amount Including VAT" *
("Line Amount" - "Inv. Discount Amount") /
(VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
// End of the deleted lines.
END;
...
...
END ELSE BEGIN
// Add the following lines.
Factor := VATAmountLine.CalcPurchLineAmountFactor(PurchLine);
VATAmount :=
TempVATAmountLineRemainder."VAT Amount" +
VATAmountLine."VAT Amount" * Factor;
NewAmountIncludingVAT :=
VATAmountLine.CalcRoundedAmount(VATAmountLine."Amount Including VAT" * Factor,
TempVATAmountLineRemainder."Amount Including VAT");
NewVATBaseAmtNonDeduct :=
VATAmountLine.CalcRoundedAmount(VATAmountLine."VAT Base (Non Deductible)" * Factor,
TempVATAmountLineRemainder."VAT Base (Non Deductible)");
VATAmtNonDeduct :=
VATAmountLine.CalcRoundedAmount(VATAmountLine."VAT Amount (Non Deductible)" * Factor,
TempVATAmountLineRemainder."VAT Amount (Non Deductible)");
//End of the added lines.
END;
...
...
VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
END;
...
...
VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
// Add the following lines.
NewVATBaseAmtNonDeduct :=
("Line Amount" - "Inv. Discount Amount") * "VAT % (Non Deductible)" / 100;
IF NewVATBaseAmtNonDeduct = 0 THEN
VATAmtNonDeduct:= 0
ELSE
VATAmtNonDeduct :=
VATAmountLine.CalcRoundedAmount(
VATAmountLine."VAT Amount (Non Deductible)" * NewAmount / VATAmountLine."VAT Base",
TempVATAmountLineRemainder."VAT Amount (Non Deductible)");
// End of the added lines.
END;
...
...
IF Type IN [Type::"G/L Account",Type::Item,Type::"Fixed Asset"] THEN BEGIN
// Delete the following lines.
"VAT Base (Non Deductible)" :=
ROUND(
"VAT Base Amount" * "VAT % (Non Deductible)" / 100,
Currency."Amount Rounding Precision");
"VAT Amount (Non Deductible)" :=
ROUND(
"VAT Base (Non Deductible)" * "VAT %" / 100,
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
// End of the deleted lines.
...
...
IF Type IN [Type::"G/L Account",Type::Item,Type::"Fixed Asset"] THEN BEGIN
// Add the following lines.
"VAT Base (Non Deductible)" := ROUND(NewVATBaseAmtNonDeduct,Currency."Amount Rounding Precision");
"VAT Amount (Non Deductible)" := ROUND(VATAmtNonDeduct,Currency."Amount Rounding Precision");
// End of the added lines.
END;
...
...
// Delete the following lines.
TempVATAmountLineRemainder."Amount Including VAT" :=
NewAmountIncludingVAT - ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision");
// End of the deleted lines.
TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
...
...
TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
...