...
BankAccNo := BankAccNo + 1;
Window.UPDATE(1,ROUND(BankAccNo / BankAccNoTotal * 10000,1));
TempJnlLineDim.RESET;
TempJnlLineDim.DELETEALL;
...
...
// Add the following line.
TempEntryNoAmountBuf.DELETEALL;
BankAccNo := BankAccNo + 1;
Window.UPDATE(1,ROUND(BankAccNo / BankAccNoTotal * 10000,1));
TempJnlLineDim.RESET;
TempJnlLineDim.DELETEALL;
...
...
END;
END;
TotalAdjAmount := TotalAdjAmount + AdjAmount;
Window.UPDATE(4,TotalAdjAmount);
END ELSE
CurrReport.SKIP;
...
...
END;
END;
TotalAdjAmount := TotalAdjAmount + AdjAmount;
Window.UPDATE(4,TotalAdjAmount);
// Add the following lines.
IF TempEntryNoAmountBuf.Amount <> 0 THEN BEGIN
TempJnlLineDim.RESET;
TempJnlLineDim.DELETEALL;
TempDimBuf.RESET;
TempDimBuf.DELETEALL;
DimBufMgt.GetDimensions(TempEntryNoAmountBuf."Entry No.",TempDimBuf);
DimMgt.CopyDimBufToJnlLineDim(
TempDimBuf,TempJnlLineDim,GenJnlLine."Journal Template Name",
GenJnlLine."Journal Batch Name",GenJnlLine."Line No.");
IF TempEntryNoAmountBuf.Amount > 0 THEN BEGIN
Currency.TESTFIELD("Realized Gains Acc.");
PostAdjmt(
Currency."Realized Gains Acc.",-TempEntryNoAmountBuf.Amount,TempEntryNoAmountBuf.Amount2,
"Currency Code",TempJnlLineDim,PostingDate,'');
END ELSE BEGIN
Currency.TESTFIELD("Realized Losses Acc.");
PostAdjmt(
Currency."Realized Losses Acc.",-TempEntryNoAmountBuf.Amount,TempEntryNoAmountBuf.Amount2,
"Currency Code",TempJnlLineDim,PostingDate,'');
END;
END;
//End of the lines.
END ELSE
CurrReport.SKIP;
...