[FIX] 11.0 l10n_es_aeat_sii: amount total tax line incorrect Add cherry pick 73444252ec3eb4f08b7683c2e1f31934db60d885 and chage funcionality to work in V11
[FIX] 11.0 l10n_es_aeat_sii: amount total tax line incorrect
Add cherry pick 73444252ec3eb4f08b7683c2e1f31934db60d885 and chage funcionality to work in V11

This FIX solves the information sent to the SII in invoices that have a different currency. If you have an invoice with:
Base imponible: 605,16£
Cuota de IVA: 127,08£
Our company is Spanish so we have to report these amounts in Euros:
Base imponible: 0,899030 / 605,16£ = 673,13€
Cuota de IVA: 0,899030 / 127,08£ = 141,35€
Without this FIX we would be sending to the SII a total amount of (673,13€ + 127,08£) 800,21€. This is not correct, because the amount of 673,13 is reported in euros but we are adding the VAT in GBP 127,08.
With this correction the amount that we are left to add as VAT fee is the currency of the company using the amount_company field resulting in (673,13€ + 141,35€) 814,48€ which is correct.

factorlibre/l10n-spain,factorlibre/l10n-spain,factorlibre/l10n-spain