overpayment must be in company currency
The overpayment is used as debit/credit so it must be in the company currency and not in the invoice currency. Also the amount in second currency is set to every lines even if there is an overpayment. But indeed in this case we should use the overpayment in the invoice currency.