Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_out: fix issue OCA#3670
Browse files Browse the repository at this point in the history
fix case use downpayment on e-invoice

Co-authored-by: Marcoapu
  • Loading branch information
matteoopenf committed Aug 2, 2024
1 parent e86cae7 commit ba39033
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion l10n_it_fatturapa_out/wizard/wizard_export_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,21 @@ def _key(tax_id):
tax_line_id = tax_id.tax_line_id
aliquota = format_numbers(tax_line_id.amount)
key = _key(tax_line_id)
if invoice.move_type == "out_invoice":
if tax_id.credit == 0.0 and tax_id.debit:
tax_amount = -tax_id.balance
if tax_id.credit and tax_id.debit == 0.0:
tax_amount = abs(tax_id.balance)
if tax_id.credit == 0 and tax_id.debit == 0:
tax_amount = 0
else:
tax_amount = abs(tax_id.balance)
out_computed[key] = {
"AliquotaIVA": aliquota,
"Natura": tax_line_id.kind_id.code,
# 'Arrotondamento':'',
"ImponibileImporto": tax_id.tax_base_amount,
"Imposta": tax_id.price_total,
"Imposta": tax_amount,
"EsigibilitaIVA": tax_line_id.payability,
}
if tax_line_id.law_reference:
Expand Down

0 comments on commit ba39033

Please sign in to comment.