Skip to content

Commit

Permalink
Merge PR #3089 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed May 22, 2024
2 parents f23bd5c + 8b6f4ed commit b5adc03
Show file tree
Hide file tree
Showing 7 changed files with 652 additions and 15 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 @@ -208,6 +208,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 @@ -301,6 +302,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 @@ -590,6 +592,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 @@ -611,6 +614,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 @@ -626,6 +632,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 @@ -644,10 +651,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
Loading

0 comments on commit b5adc03

Please sign in to comment.