From fff89fb44941eab72d13e623e96eadffefa3917d Mon Sep 17 00:00:00 2001 From: Borruso Date: Wed, 10 May 2023 11:16:09 +0200 Subject: [PATCH 1/4] [FIX] l10n_it_fatturapa_out: remove unused template Co-authored-by: TheMule71 --- .../data/invoice_it_template.xml | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/l10n_it_fatturapa_out/data/invoice_it_template.xml b/l10n_it_fatturapa_out/data/invoice_it_template.xml index 49d737617f9a..d834a10d9302 100644 --- a/l10n_it_fatturapa_out/data/invoice_it_template.xml +++ b/l10n_it_fatturapa_out/data/invoice_it_template.xml @@ -222,29 +222,6 @@ e 'line' per riga di fattura (a seconda del livello in cui sono chiamati) - @@ -74,9 +74,22 @@ t-esc="format_price(line, get_sign(line.move_id))" /> - + + + + From f44a42df6aeb684dc49c3de49e976fc10fb9eb09 Mon Sep 17 00:00:00 2001 From: matteoopenf Date: Tue, 12 Mar 2024 16:18:01 +0100 Subject: [PATCH 4/4] [FIX][l10n_it_fatturapa_out] fix case the invois is a credit note and reverse charge invoice --- l10n_it_fatturapa_out/wizard/efattura.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/l10n_it_fatturapa_out/wizard/efattura.py b/l10n_it_fatturapa_out/wizard/efattura.py index 6c58c1fc0573..a4d70f93fb52 100644 --- a/l10n_it_fatturapa_out/wizard/efattura.py +++ b/l10n_it_fatturapa_out/wizard/efattura.py @@ -75,14 +75,21 @@ def format_price(line, sign=1, original_currency=False): # e quantity (vd. format_quantity) if line.quantity < 0: res = -res - # force EUR unless we want the original currency if not original_currency: - res = fpa_to_eur(res, line=line) + res = fpa_to_eur(res, line) + + price = sign * res + if ( + line.move_id.move_type == "out_refund" + and price > 0 + and line.move_id.rc_purchase_invoice_id + ): + price = price * -1 # XXX arrotondamento? res = "{prezzo:.{precision}f}".format( - prezzo=sign * res, precision=price_precision + prezzo=price, precision=price_precision ) return res