Fix for CFDI egreso for General Public
This commit is contained in:
parent
410a7080da
commit
5057ac57ae
|
@ -28,6 +28,7 @@ log = Logger('XML')
|
||||||
CFDI_ACTUAL = 'cfdi40'
|
CFDI_ACTUAL = 'cfdi40'
|
||||||
NOMINA_ACTUAL = 'nomina12'
|
NOMINA_ACTUAL = 'nomina12'
|
||||||
PUBLIC = 'PUBLICO EN GENERAL'
|
PUBLIC = 'PUBLICO EN GENERAL'
|
||||||
|
CFDI_EGRESO = 'E'
|
||||||
|
|
||||||
DEFAULT = {
|
DEFAULT = {
|
||||||
'exportacion': '01',
|
'exportacion': '01',
|
||||||
|
@ -142,6 +143,7 @@ class CFDI(object):
|
||||||
self._carta_porte = False
|
self._carta_porte = False
|
||||||
self._comercio_exterior = False
|
self._comercio_exterior = False
|
||||||
self._divisas = ''
|
self._divisas = ''
|
||||||
|
self._tipo_de_comprobante = ''
|
||||||
self.error = ''
|
self.error = ''
|
||||||
|
|
||||||
def _now(self):
|
def _now(self):
|
||||||
|
@ -288,6 +290,8 @@ class CFDI(object):
|
||||||
if not 'Exportacion' in attributes:
|
if not 'Exportacion' in attributes:
|
||||||
attributes['Exportacion'] = DEFAULT['exportacion']
|
attributes['Exportacion'] = DEFAULT['exportacion']
|
||||||
|
|
||||||
|
self._tipo_de_comprobante = attributes['TipoDeComprobante']
|
||||||
|
|
||||||
self._cfdi = ET.Element('{}:Comprobante'.format(self._pre), attributes)
|
self._cfdi = ET.Element('{}:Comprobante'.format(self._pre), attributes)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -319,8 +323,9 @@ class CFDI(object):
|
||||||
|
|
||||||
def _receptor(self, datos):
|
def _receptor(self, datos):
|
||||||
receptor_name = datos['Nombre'].upper()
|
receptor_name = datos['Nombre'].upper()
|
||||||
if receptor_name != PUBLIC:
|
if receptor_name == PUBLIC and self._tipo_de_comprobante == CFDI_EGRESO:
|
||||||
datos['Nombre'] = receptor_name
|
receptor_name = datos['Nombre']
|
||||||
|
datos['Nombre'] = receptor_name
|
||||||
node_name = '{}:Receptor'.format(self._pre)
|
node_name = '{}:Receptor'.format(self._pre)
|
||||||
emisor = ET.SubElement(self._cfdi, node_name, datos)
|
emisor = ET.SubElement(self._cfdi, node_name, datos)
|
||||||
return
|
return
|
||||||
|
|
|
@ -998,7 +998,7 @@ function set_client(row){
|
||||||
}
|
}
|
||||||
lst.setValue(lst.getPopup().getList().getFirstId())
|
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)
|
show('cmd_show_global_information', true)
|
||||||
}else{
|
}else{
|
||||||
show('cmd_show_global_information', false)
|
show('cmd_show_global_information', false)
|
||||||
|
|
Loading…
Reference in New Issue