diff --git a/l10n_ar_tax/models/account_payment.py b/l10n_ar_tax/models/account_payment.py index 80f1d881b..08dd2ecb0 100644 --- a/l10n_ar_tax/models/account_payment.py +++ b/l10n_ar_tax/models/account_payment.py @@ -73,7 +73,15 @@ def _get_withholding_move_line_default_values(self): def _compute_payment_total(self): super()._compute_payment_total() for rec in self: - rec.payment_total += sum(rec.l10n_ar_withholding_line_ids.mapped("amount")) + amount_sum = sum(rec.l10n_ar_withholding_line_ids.mapped("amount")) + if rec.payment_type == "inbound": + # Receive money. + withholding_sum = amount_sum + else: + # Send money. + withholding_sum = -amount_sum + + rec.payment_total += withholding_sum # por ahora no nos funciona computarlas, se duplica el importe. Igual conceptualemnte el onchange acá por ahí # está bien porque en realidad es una "sugerencia" actualizar el amount al usuario