diff --git a/l10n_it_fatturapa_out/wizard/efattura.py b/l10n_it_fatturapa_out/wizard/efattura.py index 6c58c1fc0573..5df890df7ae4 100644 --- a/l10n_it_fatturapa_out/wizard/efattura.py +++ b/l10n_it_fatturapa_out/wizard/efattura.py @@ -75,14 +75,17 @@ 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: + price = price * -1 # XXX arrotondamento? res = "{prezzo:.{precision}f}".format( - prezzo=sign * res, precision=price_precision + prezzo=price, precision=price_precision ) return res