Skip to content

Commit 2e07216

Browse files
committed
[IMP] l10n_ar_account_tax_settlement: add backward compatibility
1 parent 80ae3ec commit 2e07216

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

l10n_ar_account_tax_settlement/models/account_journal.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,8 @@ def misiones_files_values(self, move_lines):
13741374
)
13751375
cant_ret = 0
13761376
for withholding in retenciones_pago_fact_original:
1377-
if withholding.tax_id == line.withholding_id.tax_id:
1377+
line_withholding_tax_id = line.withholding_id._get_withholding_tax()
1378+
if withholding.tax_id == line_withholding_tax_id:
13781379
origin_withholding_cr = withholding
13791380
cant_ret += 1
13801381
if cant_ret != 1 or origin_withholding_cr.amount != line.withholding_id.amount:
@@ -1513,16 +1514,17 @@ def retenciones_iva_files_values(self, move_lines):
15131514
payment = line.payment_id
15141515
if payment:
15151516
# regimen (long 3)
1516-
codigo_regimen = line.withholding_id.tax_id.l10n_ar_code
1517+
line_withholding_tax_id = line.withholding_id._get_withholding_tax()
1518+
codigo_regimen = line_withholding_tax_id.l10n_ar_code
15171519
if not codigo_regimen:
15181520
raise ValidationError(
15191521
_('No hay código de régimen en la configuración del impuesto "%s"')
1520-
% (line.withholding_id.tax_id.name)
1522+
% (line_withholding_tax_id.name)
15211523
)
15221524
if len(codigo_regimen) < 3:
15231525
raise ValidationError(
15241526
_('El código de régimen tiene que tener 3 dígitos en la configuración del impuesto "%s"')
1525-
% (line.withholding_id.tax_id.name)
1527+
% (line_withholding_tax_id.name)
15261528
)
15271529
content += codigo_regimen[:3]
15281530

@@ -1533,7 +1535,7 @@ def retenciones_iva_files_values(self, move_lines):
15331535
content += fields.Date.from_string(payment.date).strftime("%d/%m/%Y")
15341536

15351537
# número comprobante (long 16)
1536-
content += re.sub(r"[^0-9\.]", "", line.withholding_id.name).ljust(16, "0")
1538+
content += re.sub(r"[^0-9\.]", "", line_withholding_tax_id.name).ljust(16, "0")
15371539

15381540
# Aclaración importante: estamos agregando ceros entre el número de comprobante y el importe de retención
15391541
# esto contradice la especificación que dice que debe haber espacios pero en la tarea 31418 nos indicaron

0 commit comments

Comments
 (0)