Fix in complement pay without taxes

This commit is contained in:
el Mau 2023-01-12 00:33:39 -06:00
commit 8e2446e8f5
3 changed files with 18 additions and 10 deletions

View File

@ -594,7 +594,9 @@ class CFDI(object):
for row in relacionados:
taxes = row.pop('taxes')
node = ET.SubElement(node_pago, f'{pre}:DoctoRelacionado', row)
node_tax = ET.SubElement(node, f'{pre}:ImpuestosDR')
nodex_tax = None
if taxes['traslados'] or taxes['retenciones']:
node_tax = ET.SubElement(node, f'{pre}:ImpuestosDR')
if taxes['retenciones']:
node = ET.SubElement(node_tax, f'{pre}:RetencionesDR')
for tax in taxes['retenciones']:
@ -604,7 +606,8 @@ class CFDI(object):
for tax in taxes['traslados']:
ET.SubElement(node, f'{pre}:TrasladoDR', tax)
node_tax = ET.SubElement(node_pago, f'{pre}:ImpuestosP')
if taxes_pay['traslados'] or taxes_pay['retenciones']:
node_tax = ET.SubElement(node_pago, f'{pre}:ImpuestosP')
if taxes_pay['retenciones']:
node = ET.SubElement(node_tax, f'{pre}:RetencionsP')
for key, importe in taxes_pay['retenciones'].items():

View File

@ -7581,7 +7581,10 @@ class CfdiPagos(BaseModel):
# REVISAR
r['EquivalenciaDR'] = '1'
r['ObjetoImpDR'] = '02'
r['ObjetoImpDR'] = '01'
if r['taxes']['traslados'] or r['taxes']['retenciones']:
r['ObjetoImpDR'] = '02'
r['ImpSaldoAnt'] = FORMAT.format(r['ImpSaldoAnt'])
r['ImpPagado'] = FORMAT.format(r['ImpPagado'])
@ -7610,10 +7613,11 @@ class CfdiPagos(BaseModel):
taxes_pay['traslados'][k]['BaseP'] = FORMAT.format(tax_base)
taxes_pay['traslados'][k]['ImporteP'] = FORMAT.format(importe)
taxes_pay['totales'] = {
'TotalTrasladosBaseIVA16': FORMAT.format(total_tax_iva_16_base),
'TotalTrasladosImpuestoIVA16': FORMAT.format(total_tax_iva_16_importe),
}
if taxes_pay['traslados']:
taxes_pay['totales'] = {
'TotalTrasladosBaseIVA16': FORMAT.format(total_tax_iva_16_base),
'TotalTrasladosImpuestoIVA16': FORMAT.format(total_tax_iva_16_importe),
}
return related, taxes_pay
@ -10718,8 +10722,6 @@ def get_cp(cp):
else:
data['colonia'] = [r[3] for r in rows]
print('CP', cp, data)
return data

View File

@ -953,6 +953,7 @@ function cmd_complemento_pago_click(){
}
set_data_pay(row)
$$('chk_pay_close_when_stamp').setValue(false)
$$('multi_bancos').setValue('bank_pay')
}
@ -1013,7 +1014,9 @@ function send_stamp_cfdi_pay(id_mov){
}
})
$$('multi_bancos').setValue('banco_home')
if(close){
$$('multi_bancos').setValue('banco_home')
}
}