Support paying invoice from statement with different currency
A company may post invoice in a currency but receive the payments on an bank account in different currency. In this case the bank usually apply a conversion rate (and fees) to book in the account currency. Often the initial amount in foreign currency is available in the statement.
For now we limit the invoice that can be linked to a statement line to invoice in the same currency as the journal currency (so the bank account currency). But since 2b9a72775e4c we support to reconcile invoices in foreign currency and deal with the currency exchange error.
So we could add an optional second currency amount on the statement line and then use this second currency to filter the available invoices. This second currency amount would be used to fill the second currency amount in the account move line.
This feature would have a limitation in case 3 currencies are involved like company in currency1, statement journal in currency2 and second currency of in currency3. So we would have 1 extra currency that we can not store. To avoid this scenario, I think we should limit the available second currency to be different from the journal currency (of course) but also if the journal currency is different from the company currency, then only the company currency is allowed.
Of course if the second currency is the company currency than we use this amount directly instead of converting the amount using the currency exchange rate.