Skip to content

Commit

Permalink
[FIX][l10n_it_fatturapa_out] fix case the invois is a credit not
Browse files Browse the repository at this point in the history
  • Loading branch information
matteoopenf committed Mar 12, 2024
1 parent a6f7387 commit 2f11fcc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions l10n_it_fatturapa_out/wizard/efattura.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2f11fcc

Please sign in to comment.