...
IF "Gen. Posting Type" = "Gen. Posting Type"::Settlement THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount";
// Delete the following line.
IF "VAT Currency Factor" <> "Currency Factor" THEN
InsertVAT(
GLEntry.Amount,"VAT Amount to Report (LCY)","VAT Base Amt. to Report (LCY)","Source Currency Code",
GLEntry."Additional-Currency Amount",AddCurrGLEntryVATAmt,"Source Curr. VAT Base Amount")
// Delete the following line.
ELSE
InsertVAT(
...
...
IF "Gen. Posting Type" = "Gen. Posting Type"::Settlement THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount";
// Add the following lines.
IF "VAT Currency Factor" <> "Currency Factor" THEN BEGIN
CurrencyFactor := GenJnlLine."VAT Currency Factor";
// End of the lines.
InsertVAT(
GLEntry.Amount,"VAT Amount to Report (LCY)","VAT Base Amt. to Report (LCY)","Source Currency Code",
GLEntry."Additional-Currency Amount",AddCurrGLEntryVATAmt,"Source Curr. VAT Base Amount")
// Add the following line.
END ELSE
InsertVAT(
...