Fix for CFDI egreso for General Public

This commit is contained in:
El Mau 2023-11-05 22:13:45 -06:00
parent 410a7080da
commit 5057ac57ae
2 changed files with 8 additions and 3 deletions

View File

@ -28,6 +28,7 @@ log = Logger('XML')
CFDI_ACTUAL = 'cfdi40'
NOMINA_ACTUAL = 'nomina12'
PUBLIC = 'PUBLICO EN GENERAL'
CFDI_EGRESO = 'E'
DEFAULT = {
'exportacion': '01',
@ -142,6 +143,7 @@ class CFDI(object):
self._carta_porte = False
self._comercio_exterior = False
self._divisas = ''
self._tipo_de_comprobante = ''
self.error = ''
def _now(self):
@ -288,6 +290,8 @@ class CFDI(object):
if not 'Exportacion' in attributes:
attributes['Exportacion'] = DEFAULT['exportacion']
self._tipo_de_comprobante = attributes['TipoDeComprobante']
self._cfdi = ET.Element('{}:Comprobante'.format(self._pre), attributes)
return
@ -319,8 +323,9 @@ class CFDI(object):
def _receptor(self, datos):
receptor_name = datos['Nombre'].upper()
if receptor_name != PUBLIC:
datos['Nombre'] = receptor_name
if receptor_name == PUBLIC and self._tipo_de_comprobante == CFDI_EGRESO:
receptor_name = datos['Nombre']
datos['Nombre'] = receptor_name
node_name = '{}:Receptor'.format(self._pre)
emisor = ET.SubElement(self._cfdi, node_name, datos)
return

View File

@ -998,7 +998,7 @@ function set_client(row){
}
lst.setValue(lst.getPopup().getList().getFirstId())
if(row.nombre == PUBLICO && row.rfc == RFC_PUBLICO){
if(row.nombre.toUpperCase() == PUBLICO && row.rfc == RFC_PUBLICO){
show('cmd_show_global_information', true)
}else{
show('cmd_show_global_information', false)