...
IncrAmounts(PrepmtInvLineBuf,TotalPrepmtInvLineBuf,SalesHeader,DummySalesLine,FALSE,0);
IF SalesHeader."Currency Code" <> '' THEN BEGIN
VAT := PrepmtInvLineBuf.Amount <> PrepmtInvLineBuf."Amount Incl. VAT";
// Delete the following lines.
PrepmtInvLineBuf."Amount Incl. VAT" :=
AmountToLCY(
SalesHeader,TotalPrepmtInvLineBuf."Amount Incl. VAT",TotalPrepmtInvLineBufLCY."Amount Incl. VAT");
// End of the lines.
IF VAT THEN
PrepmtInvLineBuf.Amount := ROUND(PrepmtInvLineBuf."Amount Incl. VAT" / (1 + PrepmtInvLineBuf."VAT %" / 100))
ELSE
PrepmtInvLineBuf.Amount := PrepmtInvLineBuf."Amount Incl. VAT";
PrepmtInvLineBuf."VAT Amount" := PrepmtInvLineBuf."Amount Incl. VAT" - PrepmtInvLineBuf.Amount;
IF PrepmtInvLineBuf."VAT Base Amount" <> 0 THEN
PrepmtInvLineBuf."VAT Base Amount" := PrepmtInvLineBuf.Amount;
END;
IncrAmounts(PrepmtInvLineBuf,TotalPrepmtInvLineBufLCY,SalesHeader,DummySalesLine,FALSE,0);
...
...
IncrAmounts(PrepmtInvLineBuf,TotalPrepmtInvLineBuf,SalesHeader,DummySalesLine,FALSE,0);
IF SalesHeader."Currency Code" <> '' THEN BEGIN
VAT := PrepmtInvLineBuf.Amount <> PrepmtInvLineBuf."Amount Incl. VAT";
// Add the following lines.
PrepmtInvLineBuf."Amount Incl. VAT" :=
ROUND(
AmountToLCY(
SalesHeader,TotalPrepmtInvLineBuf."Amount Incl. VAT",TotalPrepmtInvLineBufLCY."Amount Incl. VAT"),
GLSetup."Amount Rounding Precision");
// End of the lines.
IF VAT THEN
PrepmtInvLineBuf.Amount := ROUND(PrepmtInvLineBuf."Amount Incl. VAT" / (1 + PrepmtInvLineBuf."VAT %" / 100))
ELSE
PrepmtInvLineBuf.Amount := PrepmtInvLineBuf."Amount Incl. VAT";
PrepmtInvLineBuf."VAT Amount" := PrepmtInvLineBuf."Amount Incl. VAT" - PrepmtInvLineBuf.Amount;
IF PrepmtInvLineBuf."VAT Base Amount" <> 0 THEN
PrepmtInvLineBuf."VAT Base Amount" := PrepmtInvLineBuf.Amount;
END;
IncrAmounts(PrepmtInvLineBuf,TotalPrepmtInvLineBufLCY,SalesHeader,DummySalesLine,FALSE,0);
...