Skip to content

Commit

Permalink
[ADD] l10n_uy_edi: Nuevas disposiciones de DGI
Browse files Browse the repository at this point in the history
Task: 33669
  • Loading branch information
mem-adhoc committed Oct 27, 2023
1 parent 3165d54 commit 25594f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 10 additions & 5 deletions l10n_uy_edi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,20 @@ def _amount_total_company_currency(self):
# Helpers

def _uy_found_related_cfe(self):
""" return the related/origin cfe of a given cfe """
""" return the related/origin cfe of a given cfe
Segun cambios en formatos de CFE v.24
los cfe relacionados deben estar aceptados por DGI
"""
# next version review to merge this with l10n_ar_edi _found_related_invoice method
self.ensure_one()
res = self.browse()
if self.l10n_latam_document_type_id.internal_type == 'credit_note':
return self.reversed_entry_id
res = self.reversed_entry_id
elif self.l10n_latam_document_type_id.internal_type == 'debit_note':
return self.debit_origin_id
else:
return self.browse()
res = self.debit_origin_id
if res and res.l10n_uy_cfe_state != 'accepted':
raise UserError('El comprobante que estas anexando como referencia no es un comprobante valido para DGI(aceptado)')
return res

def _is_uy_cfe(self):
return bool(self.journal_id.l10n_latam_use_documents and self.company_id.country_code == "UY"
Expand Down
9 changes: 5 additions & 4 deletions l10n_uy_edi/models/l10n_uy_cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,11 +1142,12 @@ def _l10n_uy_get_cfe_referencia(self):
' también electrónico'))
res.append({
'NroLinRef': k,
'TpoDocRef': tpo_doc_ref,
'Serie': document_number[0],
'NroCFERef': document_number[1],
'TpoDocRef': tpo_doc_ref, #F3 Indica el CFE o CFC de referencia
'Serie': document_number[0],#F4 Serie asignada al comprobante
'NroCFERef': document_number[1],#F5 Nº asignado al comprobante
# 'FechaCFEref': 2015-01-31, TODO inform?
})
})

return res

def action_l10n_uy_get_pdf(self):
Expand Down

0 comments on commit 25594f0

Please sign in to comment.