Overpay error when paying invoice with lower exchange rate using pay wizard.
When using the Pay wizard on an invoice with different currency the following error is raised:
Payment lines amount on invoice "1" can not be greater than the invoice amount.
This is the case when the exchange rate at the payment date is lower than the exchange rate at the day when the invoice was posted. So despite paying the amount due Tryton complains about paying more due to exchange rate.
Using the "Writeoff" option and selecting a Writeoff method does not makes the behaviour change.
The problem is because the line with the extra amount is added to the invoice before the writeoff method is created, raising the error.
I found the issue on 6.0 series, but it is also reproducible on latest trunk. I attach a tests scenario that can be issued to reproduce the problem.
I'm not sure how to fix the problem without deactivating the validation (at least temporally). So any tip will be much appreciated.
Files
Download | Creator | Timestamp | Type |
---|---|---|---|
scenario_invoice_alternate_currency_overpay.rst | @pokoli | 2022-07-27 10:32:31.065000 UTC | text/x-rst |