Skip to content

Commit

Permalink
Se quita el tag data y se agrega el binding_model
Browse files Browse the repository at this point in the history
closes #200

closes #203

Signed-off-by: Nicolas Mac Rouillon <[email protected]>
  • Loading branch information
ica-adhoc authored and pablohmontenegro committed May 22, 2023
1 parent 198fabb commit 113643e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion l10n_ar_account_tax_settlement/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Tax Settlements For Argentina',
'version': "15.0.1.4.0",
'version': "15.0.1.5.0",
'category': 'Accounting',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand Down
57 changes: 57 additions & 0 deletions l10n_ar_account_tax_settlement/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class AccountJournal(models.Model):
('iibb_aplicado_api', 'TXT Perc/Ret IIBB aplicadas API'),
('iibb_aplicado_sircar', 'TXT Perc/Ret IIBB aplicadas SIRCAR'),
('iibb_aplicado_dgr_mendoza', 'TXT Perc/Ret IIBB aplicado DGR Mendonza'),
('retenciones_iva', 'TXT Retenciones/Percepciones Sufridas IVA'),
# ('other', 'Other')
])

Expand Down Expand Up @@ -1345,3 +1346,59 @@ def misiones_files_values(self, move_lines):
'txt_filename': ('Retenciones ' if payment else 'Percepciones ') + 'Misiones.txt',
'txt_content': content,
}]

def retenciones_iva_files_values(self, move_lines):
""" Implementado segun especificación indicada en ticket 54274."""
self.ensure_one()
content = ''
for line in move_lines.sorted(key=lambda r: (r.date, r.id)):
payment = line.payment_id
if payment:
# regimen (long 3)
codigo_regimen = payment.tax_withholding_id.codigo_regimen
if not codigo_regimen:
raise ValidationError(_('No hay código de régimen en la configuración del impuesto "%s"') % (
payment.tax_withholding_id.name))
if len(codigo_regimen) < 3:
raise ValidationError(_('El código de régimen tiene que tener 3 dígitos en la configuración del impuesto "%s"') % (payment.tax_withholding_id.name))
content += codigo_regimen[:3]

# cuit agente (long 11)
content += payment.partner_id.ensure_vat()

# fecha retención (long 10)
content += fields.Date.from_string(payment.date).strftime('%d/%m/%Y')

# número comprobante (long 16)
content += re.sub('[^0-9\.-]', '', payment.name)[1:].ljust(16)

# importe retención (long 16)
content += '%16.2f' % payment.amount
content += '\r\n'
elif line.move_id.is_invoice():
# regimen (long 3)
codigo_regimen = line.tax_line_id.codigo_regimen
if not codigo_regimen:
raise ValidationError(_('No hay código de régimen en la configuración del impuesto "%s"') % (
line.tax_withholding_id.name))
if len(codigo_regimen) < 3:
raise ValidationError(_('El código de régimen tiene que tener 3 dígitos en la configuración del impuesto "%s"') % (line.tax_withholding_id.name))
content += codigo_regimen[:3]

# cuit agente (long 11)
content += line.move_id.partner_id.ensure_vat()

# fecha retención (long 10)
content += fields.Date.from_string(line.move_id.invoice_date).strftime('%d/%m/%Y')

# número comprobante (long 16)
content += line.move_id.l10n_latam_document_number.ljust(16)

# importe retención (long 16)
content += '%16.2f' % line.balance
content += '\r\n'

return [{
'txt_filename': ('Retenciones' if payment else 'Percepciones') + '_iva.txt',
'txt_content': content,
}]

0 comments on commit 113643e

Please sign in to comment.