Fix in taxes in invoice pay

This commit is contained in:
el Mau 2023-03-13 14:01:26 -06:00
commit a078e27703
1 changed files with 5 additions and 4 deletions

View File

@ -7676,6 +7676,7 @@ class CfdiPagos(BaseModel):
return impuestos
def _get_related_xml(self, id_mov, currency):
#TAX ToDo
TAX_IVA_16 = '002|0.160000'
TAX_IVA_0 = '002|0.000000'
@ -7746,10 +7747,10 @@ class CfdiPagos(BaseModel):
current_tax = f'{tax_type}|{tax_tasa}'
if current_tax == TAX_IVA_16:
new_import_tax = round(Decimal(tax_tasa) * tax_base, 2)
while new_import_tax > importe:
tax_base -= Decimal(0.01)
new_import_tax = round(Decimal(tax_tasa) * tax_base, 2)
# ~ new_import_tax = round(Decimal(tax_tasa) * tax_base, 2)
# ~ while new_import_tax > importe:
# ~ tax_base -= Decimal(0.01)
# ~ new_import_tax = round(Decimal(tax_tasa) * tax_base, 2)
total_tax_iva_16_base += tax_base
total_tax_iva_16_importe += importe
elif current_tax == TAX_IVA_0: