Skip to content

Commit

Permalink
[FIX] l10n_it_withholding_tax: amount_net_pay_residual can't be negative
Browse files Browse the repository at this point in the history
This happens in case of refund reconciliation
  • Loading branch information
eLBati authored and OCA-git-bot committed Dec 13, 2024
1 parent dc53639 commit b3044b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions l10n_it_withholding_tax/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def _compute_amount_withholding_tax(self):
for line in reconciled_amls:
if not line.withholding_tax_generated_by_move_id:
amount_net_pay_residual -= line.debit or line.credit
if amount_net_pay_residual < 0:
amount_net_pay_residual = 0
invoice.amount_net_pay_residual = float_round(
amount_net_pay_residual, dp_obj.precision_get("Account")
)
Expand Down

0 comments on commit b3044b9

Please sign in to comment.