Dear Tryton Community,
I have a problem with the account_invoice module where I have cases in which invoices payments cannot be processes because the following UserError exception pops up:
“Payment lines amount on invoice “#####” can not be greater than the invoice amount.”
Now this exception originates in the Invoice.check_payment_lines() function that basically blocks attempts to process a payment in which the payment amount is greater than the invoice amount to pay (overpayment). In common sense, this is a correct behavior, however there are cases that this “overpaid” amount will surface due to a currency exchange rate fluctuation. I will explain with the following example:
The company’s currency is in USD and we use a secondary currency which is CRC (Costa Rican Colon). We create an invoice for an item that cost $10USD and the customer will pay in CRC. The exchange rate at the moment of issue was 580 CRC = 1 USD. So the total invoice amount was 5800 CRC. We will ignore the taxes for now to keep the example simple. Internally Tryton stores the amount owned as $10USD in the receivables account.
Now 30 days later, when the customer pays the invoice (30 day credit payment term was used), the exchange rate happened to drop to 570 CRC = 1 USD. The customer proceeds to pay the 5800 CRC that was originally printed in the invoice, so now upon processing the payment, Tryton generates the reconcile lines for the amount in the company’s currency which is 5800 / 570 = $10.1754 USD. There is an overpayment amount of $0.1754 USD and the payment checks raises the exception.
Now, to my humble opinion, the correct way to process this overpayment amount is to handle it like a writeoff that goes into a exchange rate difference account.
Right now my solution is to disable this check, but I don’t know yet if there is any implication on doing so. Anyone have any comments about this?