Agregar nodo para domicilio en Carta Porte
This commit is contained in:
parent
8bbd2ba62b
commit
0f041ed975
|
@ -473,7 +473,6 @@ class CFDI(object):
|
|||
|
||||
if self._carta_porte:
|
||||
datos = datos['cartaporte']
|
||||
print('\nDatos', datos)
|
||||
ubicaciones = datos.pop('ubicaciones')
|
||||
mercancias = datos.pop('mercancias', ())
|
||||
tiposfigura = datos.pop('tiposfigura', ())
|
||||
|
@ -486,9 +485,12 @@ class CFDI(object):
|
|||
|
||||
node = ET.SubElement(node_carta, f'{prefix}:Ubicaciones')
|
||||
for ubicacion in ubicaciones:
|
||||
domicilio = ubicacion.pop('domicilio', {})
|
||||
dt = parser.parse(ubicacion['FechaHoraSalidaLlegada'])
|
||||
ubicacion['FechaHoraSalidaLlegada'] = dt.isoformat()[:19]
|
||||
ET.SubElement(node, f'{prefix}:Ubicacion', ubicacion)
|
||||
sub_node = ET.SubElement(node, f'{prefix}:Ubicacion', ubicacion)
|
||||
if domicilio:
|
||||
ET.SubElement(sub_node, f'{prefix}:Domicilio', domicilio)
|
||||
|
||||
attr = mercancias
|
||||
mercancias = attr.pop('mercancias')
|
||||
|
|
|
@ -641,9 +641,9 @@ def get_cert(args):
|
|||
|
||||
def make_xml(data, certificado):
|
||||
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
|
||||
if DEBUG:
|
||||
data['emisor']['Rfc'] = certificado.rfc
|
||||
data['emisor']['RegimenFiscal'] = '603'
|
||||
# ~ if DEBUG:
|
||||
# ~ data['emisor']['Rfc'] = certificado.rfc
|
||||
# ~ data['emisor']['RegimenFiscal'] = '603'
|
||||
|
||||
cfdi = CFDI()
|
||||
xml = ET.parse(BytesIO(cfdi.get_xml(data).encode()))
|
||||
|
|
Loading…
Reference in New Issue