Compare commits
No commits in common. "6570d82f1b0e0805286bc2513d25d3ebd7205e70" and "76df7a62e5a7d9ea1fac094d260c9819cfb14e7f" have entirely different histories.
6570d82f1b
...
76df7a62e5
|
@ -294,20 +294,19 @@ class DictToCfdi():
|
|||
for i, doc in enumerate(docs):
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}DoctoRelacionado"
|
||||
node_doc = ET.SubElement(node_pago, node_name, doc)
|
||||
if taxesd[i]:
|
||||
doc_taxes = taxesd[i]
|
||||
if taxesd:
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}ImpuestosDR"
|
||||
node_taxes_doc = ET.SubElement(node_doc, node_name)
|
||||
if 'retenciones' in doc_taxes:
|
||||
if 'retenciones' in taxesd:
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}RetencionesDR"
|
||||
node_taxes_dr = ET.SubElement(node_taxes_doc, node_name)
|
||||
for r in doc_taxes['retenciones']:
|
||||
for r in taxesd['retenciones']:
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}RetencionDR"
|
||||
ET.SubElement(node_taxes_dr, node_name, r)
|
||||
if 'traslados' in doc_taxes:
|
||||
if 'traslados' in taxesd:
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}TrasladosDR"
|
||||
node_taxes_dt = ET.SubElement(node_taxes_doc, node_name)
|
||||
for t in doc_taxes['traslados']:
|
||||
for t in taxesd['traslados']:
|
||||
node_name = f"{{{self._PAGOS['xmlns']}}}TrasladoDR"
|
||||
ET.SubElement(node_taxes_dt, node_name, t)
|
||||
|
||||
|
@ -359,7 +358,7 @@ class DictToCfdi():
|
|||
node_name = f"{{{self._COMERCIO['xmlns']}}}Receptor"
|
||||
attr = {}
|
||||
if 'NumRegIdTrib' in receptor:
|
||||
attr = {'NumRegIdTrib': receptor.pop('NumRegIdTrib')}
|
||||
attr = {'NumRegIdTrib': emisor.pop('NumRegIdTrib')}
|
||||
node_receptor = ET.SubElement(node_comercio, node_name, attr)
|
||||
|
||||
node_name = f"{{{self._COMERCIO['xmlns']}}}Domicilio"
|
||||
|
@ -608,7 +607,6 @@ class DataToDict():
|
|||
taxes = {}
|
||||
traslados = []
|
||||
retenciones = []
|
||||
|
||||
for i in range(0, len(data), 6):
|
||||
type_tax = data[i]
|
||||
tax = {
|
||||
|
@ -617,9 +615,9 @@ class DataToDict():
|
|||
'TipoFactor': data[i + 3],
|
||||
}
|
||||
if data[i + 4]:
|
||||
tax['TasaOCuota'] = data[i + 4]
|
||||
tax['TasaOCuota'] : data[i + 4]
|
||||
if data[i + 5]:
|
||||
tax['Importe'] = data[i + 5]
|
||||
tax['Importe'] : data[i + 5]
|
||||
|
||||
if type_tax == self.TRASLADO:
|
||||
traslados.append(tax)
|
||||
|
@ -629,7 +627,6 @@ class DataToDict():
|
|||
taxes['traslados'] = traslados
|
||||
if retenciones:
|
||||
taxes['retenciones'] = retenciones
|
||||
|
||||
return taxes
|
||||
|
||||
def _conceptos(self, data):
|
||||
|
@ -743,7 +740,7 @@ class DataToDict():
|
|||
self._cfdi['complementos']['pagos'] = version
|
||||
self._cfdi['complementos']['pagos']['docs'] = []
|
||||
self._cfdi['complementos']['pagos']['taxes'] = {}
|
||||
self._cfdi['complementos']['pagos']['taxesd'] = []
|
||||
self._cfdi['complementos']['pagos']['taxesd'] = {}
|
||||
elif self._complement == '2':
|
||||
self._cfdi['complementos']['comercio'] = version
|
||||
|
||||
|
@ -961,7 +958,7 @@ class DataToDict():
|
|||
|
||||
if self._complement == '1':
|
||||
attr = self._get_taxes_by_doc(data)
|
||||
self._cfdi['complementos']['pagos']['taxesd'].append(attr)
|
||||
self._cfdi['complementos']['pagos']['taxesd'] = attr
|
||||
elif self._complement == '2':
|
||||
fields = (
|
||||
'NoIdentificacion',
|
||||
|
|
Loading…
Reference in New Issue