Fix in complement pay without taxes

This commit is contained in:
el Mau 2023-01-12 00:33:11 -06:00
parent 5aece843bf
commit 482a0385cd
3 changed files with 18 additions and 10 deletions

View File

@ -594,6 +594,8 @@ class CFDI(object):
for row in relacionados:
taxes = row.pop('taxes')
node = ET.SubElement(node_pago, f'{pre}:DoctoRelacionado', row)
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')
@ -604,6 +606,7 @@ class CFDI(object):
for tax in taxes['traslados']:
ET.SubElement(node, f'{pre}:TrasladoDR', tax)
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')

View File

@ -7581,6 +7581,9 @@ class CfdiPagos(BaseModel):
# REVISAR
r['EquivalenciaDR'] = '1'
r['ObjetoImpDR'] = '01'
if r['taxes']['traslados'] or r['taxes']['retenciones']:
r['ObjetoImpDR'] = '02'
r['ImpSaldoAnt'] = FORMAT.format(r['ImpSaldoAnt'])
@ -7610,6 +7613,7 @@ class CfdiPagos(BaseModel):
taxes_pay['traslados'][k]['BaseP'] = FORMAT.format(tax_base)
taxes_pay['traslados'][k]['ImporteP'] = FORMAT.format(importe)
if taxes_pay['traslados']:
taxes_pay['totales'] = {
'TotalTrasladosBaseIVA16': FORMAT.format(total_tax_iva_16_base),
'TotalTrasladosImpuestoIVA16': FORMAT.format(total_tax_iva_16_importe),
@ -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){
}
})
if(close){
$$('multi_bancos').setValue('banco_home')
}
}