Fix in invoice pay
This commit is contained in:
parent
834c1faae6
commit
1b33413de2
|
@ -7630,9 +7630,15 @@ class CfdiPagos(BaseModel):
|
||||||
tipo_factor = 'Cuota'
|
tipo_factor = 'Cuota'
|
||||||
|
|
||||||
import_dr = round(tax.importe * tax_proporcion, 2)
|
import_dr = round(tax.importe * tax_proporcion, 2)
|
||||||
xml_importe = FORMAT.format(import_dr)
|
|
||||||
base_dr = round(tax.base * tax_proporcion, 2)
|
base_dr = round(tax.base * tax_proporcion, 2)
|
||||||
|
|
||||||
|
new_import_tax = round(base_dr * tax.impuesto.tasa, 2)
|
||||||
|
while new_import_tax > import_dr:
|
||||||
|
base_dr -= Decimal(0.01)
|
||||||
|
new_import_tax = round(base_dr * tax.impuesto.tasa, 2)
|
||||||
|
|
||||||
xml_tax_base = FORMAT.format(base_dr)
|
xml_tax_base = FORMAT.format(base_dr)
|
||||||
|
xml_importe = FORMAT.format(import_dr)
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
"BaseDR": xml_tax_base,
|
"BaseDR": xml_tax_base,
|
||||||
|
@ -7641,6 +7647,7 @@ class CfdiPagos(BaseModel):
|
||||||
"TasaOCuotaDR": str(tax.impuesto.tasa),
|
"TasaOCuotaDR": str(tax.impuesto.tasa),
|
||||||
"ImporteDR": xml_importe,
|
"ImporteDR": xml_importe,
|
||||||
}
|
}
|
||||||
|
|
||||||
tax_key = tax.impuesto.key
|
tax_key = tax.impuesto.key
|
||||||
if tax.impuesto.tipo == 'T':
|
if tax.impuesto.tipo == 'T':
|
||||||
traslados.append(values)
|
traslados.append(values)
|
||||||
|
@ -7739,6 +7746,10 @@ class CfdiPagos(BaseModel):
|
||||||
|
|
||||||
current_tax = f'{tax_type}|{tax_tasa}'
|
current_tax = f'{tax_type}|{tax_tasa}'
|
||||||
if current_tax == TAX_IVA_16:
|
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)
|
||||||
total_tax_iva_16_base += tax_base
|
total_tax_iva_16_base += tax_base
|
||||||
total_tax_iva_16_importe += importe
|
total_tax_iva_16_importe += importe
|
||||||
elif current_tax == TAX_IVA_0:
|
elif current_tax == TAX_IVA_0:
|
||||||
|
|
Loading…
Reference in New Issue