Skip to content

Commit 362c8ac

Browse files
committed
[FIX] l10n_ar_tax: Fix wth validation for payments in secondary currency
closes #1338 Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
1 parent 1357bf4 commit 362c8ac

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

l10n_ar_tax/models/l10n_ar_payment_withholding.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ def _compute_base_amount(self):
4343
sorted_to_pay_lines = sorted(
4444
wth.payment_id.to_pay_move_line_ids, key=lambda a: a.date_maturity or a.date
4545
)
46+
4647
# last line to be reconciled
4748
partial_line = sorted_to_pay_lines[-1]
48-
if -partial_line.amount_residual < -wth.payment_id.withholdable_advanced_amount:
49+
50+
if (
51+
-partial_line.amount_residual < -wth.payment_id.withholdable_advanced_amount
52+
and not wth.payment_id.withholding_warning
53+
):
4954
raise UserError(
5055
_(
5156
"Seleccionó deuda por %s pero aparentente desea pagar %s. En la deuda seleccionada hay algunos comprobantes de mas que no van a poder ser pagados (%s). Deberá quitar dichos comprobantes de la deuda seleccionada para poder hacer el correcto cálculo de las retenciones."

0 commit comments

Comments
 (0)