3
When financially voiding a cheque the code that is executed generates one journal line to reverse the cheque and one journal line to reverse the balancing entry. If the Bal. Account Type has been extended and is therefore not in the original MS code it hits the CASE else statement:

GenJnlLine2."Bal. Account Type" := CheckLedgEntry."Bal. Account Type";
GenJnlLine2.Validate("Bal. Account No.", CheckLedgEntry."Bal. Account No.");
GenJnlLine2."Shortcut Dimension 1 Code" := '';
GenJnlLine2."Shortcut Dimension 2 Code" := '';
GenJnlLine2."Dimension Set ID" := 0;
OnFinancialVoidCheckOnBeforePostBalAccLine(GenJnlLine2, CheckLedgEntry);
GenJnlPostLine.RunWithCheck(GenJnlLine2);
OnFinancialVoidCheckOnAfterPostBalAccLine(GenJnlLine2, CheckLedgEntry, GenJnlPostLine);

Neither of the provided events allow access to the calling code or variables and there is no provision in this else statement to set the variable BalanceAmountLCY which means that the next piece of code causes an error:


// rounding error from currency conversion
if CheckAmountLCY + BalanceAmountLCY <> 0 then
PostRoundingAmount(BankAcc, CheckLedgEntry, ConfirmFinancialVoid.GetVoidDate, -(CheckAmountLCY + BalanceAmountLCY));

It is intended to post rounding differences between currencies however because BalanceAmountLCY is never set, nor is it possible to set it, the system errors if the transaction was in LCY.

Suggestions - Add BalanceAmountLCY to either event OR just add to the else statement BalanceAmountLCY += GenJnlLine2."Amount (LCY)"; after the first event has been called.

Regards,
Dan
STATUS DETAILS
Inactive