Friday, March 8, 2019

AX 2012 R3 - Retail statement posting error "Update for voucher XXXX has been canceled to avoid oversettlement. The settled customer or vendor balance for the transaction must not exceed the transaction amount."


When you post a retail statement in AX 2012 R3, you may face an issue which will restrict to post the statement as follows:

"Update for voucher XXXXX has been canceled to avoid oversettlement. The settled customer or vendor balance for the transaction must not exceed the transaction amount."

Even from AR parameter to give a cushion amount in Maximum overpayment or underpayment value will not work in this case with or without Prompt for over/under payment checkbox.

A temporary work around in the code can be in this case in a class method as follows:

\Classes\RetailStatementPaymentJournal\postPaymentJournalForSales

Find and change the X++ line toSettle = true; to toSettle = false; and after posting the retail statement revert the code change.

Original code:

            toSettle = true;
            totalCreditAmountCur = totalRoundAmountCur;
            lastInvoiceId = transTable.invoiceId;

Fixed temporarily as:

            toSettle = false;
            totalCreditAmountCur = totalRoundAmountCur;
            lastInvoiceId = transTable.invoiceId;