Ejemplo mínimo de CFDI 3.3 con Carta Porte 2.0 funcional
This commit is contained in:
parent
caeb73975d
commit
2f30bba8b4
|
@ -1,3 +1,3 @@
|
||||||
conf.py
|
conf.py
|
||||||
.envi/
|
.pyenv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
"comprobante" : {
|
||||||
|
"Moneda": "XXX",
|
||||||
|
"TipoDeComprobante": "T",
|
||||||
|
"LugarExpedicion": "06850",
|
||||||
|
"SubTotal": "0",
|
||||||
|
"Total": "0"
|
||||||
|
},
|
||||||
|
"emisor": {
|
||||||
|
"Rfc": "EKU9003173C9",
|
||||||
|
"RegimenFiscal": "603"
|
||||||
|
},
|
||||||
|
"receptor": {
|
||||||
|
"Rfc": "EKU9003173C9",
|
||||||
|
"UsoCFDI": "P01"
|
||||||
|
},
|
||||||
|
"conceptos": [
|
||||||
|
{
|
||||||
|
"ClaveProdServ": "10111301",
|
||||||
|
"Cantidad": "1",
|
||||||
|
"ClaveUnidad": "ACT",
|
||||||
|
"Descripcion": "Carta Porte",
|
||||||
|
"ValorUnitario": "0.00",
|
||||||
|
"Importe": "0.00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cartaporte": {
|
||||||
|
"TranspInternac": "No",
|
||||||
|
"TotalDistRec": "150",
|
||||||
|
"ubicaciones": [
|
||||||
|
{
|
||||||
|
"TipoUbicacion": "Origen",
|
||||||
|
"RFCRemitenteDestinatario": "XIQB891116QE4",
|
||||||
|
"FechaHoraSalidaLlegada": "2021-05-18T12:00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"TipoUbicacion": "Destino",
|
||||||
|
"RFCRemitenteDestinatario": "XIQB891116QE4",
|
||||||
|
"FechaHoraSalidaLlegada": "2020-05-25T12:00:00",
|
||||||
|
"DistanciaRecorrida": "150"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"mercancias": {
|
||||||
|
"PesoBrutoTotal": "10.00",
|
||||||
|
"UnidadPeso": "X4A",
|
||||||
|
"NumTotalMercancias": "1",
|
||||||
|
"mercancias": [
|
||||||
|
{
|
||||||
|
"BienesTransp": "10111301",
|
||||||
|
"Descripcion": "Carta Porte",
|
||||||
|
"Cantidad": "1",
|
||||||
|
"ClaveUnidad": "ACT",
|
||||||
|
"PesoEnKg": "10"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autotransporte": {
|
||||||
|
"PermSCT": "TPAF03",
|
||||||
|
"NumPermisoSCT": "Transporte privado de carga",
|
||||||
|
"identificacion": {
|
||||||
|
"ConfigVehicular": "C3",
|
||||||
|
"PlacaVM": "YYY1234",
|
||||||
|
"AnioModeloVM": "2020"
|
||||||
|
},
|
||||||
|
"seguros": {
|
||||||
|
"AseguraRespCivil": "Compañia Aseguradora",
|
||||||
|
"PolizaRespCivil": "1234567890"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tiposfigura": [
|
||||||
|
{
|
||||||
|
"TipoFigura": "01",
|
||||||
|
"RFCFigura": "XIQB891116QE4",
|
||||||
|
"NumLicencia": "1234567890"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -292,6 +292,7 @@ class CFDI(object):
|
||||||
def _cartaporte(self, complemento, data):
|
def _cartaporte(self, complemento, data):
|
||||||
ubicaciones = data.pop('ubicaciones')
|
ubicaciones = data.pop('ubicaciones')
|
||||||
mercancias = data.pop('mercancias')
|
mercancias = data.pop('mercancias')
|
||||||
|
tiposfigura = data.pop('tiposfigura', ())
|
||||||
|
|
||||||
if not 'Version' in data:
|
if not 'Version' in data:
|
||||||
data['Version'] = self.CARTAPORTE['version']
|
data['Version'] = self.CARTAPORTE['version']
|
||||||
|
@ -328,6 +329,13 @@ class CFDI(object):
|
||||||
node_name = f"{{{self.CARTAPORTE['prefix']}}}Seguros"
|
node_name = f"{{{self.CARTAPORTE['prefix']}}}Seguros"
|
||||||
ET.SubElement(sub_node, node_name, seguros)
|
ET.SubElement(sub_node, node_name, seguros)
|
||||||
|
|
||||||
|
if tiposfigura:
|
||||||
|
node_name = f"{{{self.CARTAPORTE['prefix']}}}FiguraTransporte"
|
||||||
|
node = ET.SubElement(node_carta, node_name)
|
||||||
|
for figura in tiposfigura:
|
||||||
|
node_name = f"{{{self.CARTAPORTE['prefix']}}}TiposFigura"
|
||||||
|
ET.SubElement(node, node_name, figura)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue