Skip to content

Commit

Permalink
[IMP] l10n_br_account: if the fiscal operation is not deductible, add…
Browse files Browse the repository at this point in the history
… the amount_tax_not_included to the total
  • Loading branch information
marcelsavegnago committed Apr 16, 2024
1 parent ed58b17 commit d34a615
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def create(self, vals_list):
amount_tax_not_included=values.get(
"amount_tax_not_included", 0
),
amount_tax_withholding=values.get("amount_tax_withholding", 0),
amount_total=fiscal_line.amount_total,
currency_id=move_id.currency_id,
company_id=move_id.company_id,
Expand Down Expand Up @@ -268,6 +269,7 @@ def write(self, values):
exclude_from_invoice_tab=line.exclude_from_invoice_tab,
amount_tax_included=line.amount_tax_included,
amount_tax_not_included=line.amount_tax_not_included,
amount_tax_withholding=line.amount_tax_withholding,
amount_total=line.amount_total,
currency_id=line.currency_id,
company_id=line.company_id,
Expand Down Expand Up @@ -536,6 +538,7 @@ def _get_amount_credit_debit(
exclude_from_invoice_tab=None,
amount_tax_included=None,
amount_tax_not_included=None,
amount_tax_withholding=None,
amount_total=None,
currency_id=None,
company_id=None,
Expand All @@ -557,6 +560,9 @@ def _get_amount_credit_debit(
amount_tax_not_included=self.amount_tax_not_included
if amount_tax_not_included is None
else amount_tax_not_included,
amount_tax_withholding=self.amount_tax_withholding
if amount_tax_withholding is None
else amount_tax_withholding,
amount_total=self.amount_total if amount_total is None else amount_total,
currency_id=self.currency_id if currency_id is None else currency_id,
company_id=self.company_id if company_id is None else company_id,
Expand All @@ -572,6 +578,7 @@ def _get_amount_credit_debit_model(
exclude_from_invoice_tab,
amount_tax_included,
amount_tax_not_included,
amount_tax_withholding,
amount_total,
currency_id,
company_id,
Expand All @@ -590,10 +597,13 @@ def _get_amount_credit_debit_model(
amount_currency = 0
else:
if move_id.fiscal_operation_id.deductible_taxes:
amount_currency = amount_total
amount_currency = amount_total + amount_tax_withholding
else:
amount_total = amount_total + amount_tax_withholding
amount_currency = (
amount_total - amount_tax_included - amount_tax_not_included
amount_total
- (amount_tax_included - amount_tax_withholding)
- amount_tax_not_included
)

amount_currency = amount_currency * sign
Expand Down

0 comments on commit d34a615

Please sign in to comment.