When we try to make an overpayment of an invoice, we can’t do it if is different company’s currency, it shows you this message "Payment lines amount on invoice “9” can not be greater than the invoice amount. "
For example, we have an invoice with Total: 1.500€ and the company’s currency is $, some days later you have a superior amount because of rates, now you have 1.501€ (you have an overpayment) when you try to do it the system don’t allow it showing that warning.
When the system tries to do the account move, the payment lines are in the company’s currency, and when tries to do the move, it can’t because of the amount of payment lines is higher when do the currency exchange.
We tried to do it in the demo and it doesn’t work either. When we use the overpayment wizard to pay an invoice with a different currency than the company currency, Tryton does not allow it, due to the difference in exchange rates there is a difference between the payment lines and the invoice amount. We have seen that the problem is in the check_payment_lines.
@ced thanks for doing this feature. I had a look at this and it looks like there were two subsequent commits that fixed the issue for @mariaeugenia
However, I notice that the solution is putting the overpayment amount back into Accounts Receivable.
I think it would be more useful to have an account for realized currency gain/loss. The overpayment line of every payment would then go to that gain/loss account.