Fix type change in deposit

This commit is contained in:
el Mau 2023-02-21 22:09:42 -06:00
parent 968c2744ec
commit a37b3a5c23
1 changed files with 6 additions and 4 deletions

View File

@ -7260,12 +7260,14 @@ class FacturasPagos(BaseModel):
fac = Facturas.get(Facturas.id==int(i))
this_pay = values['this_pay']
importe = values['importe']
type_change = round(1 / values['type_change'], 6)
validate = round(this_pay / type_change, 2)
while validate > importe:
type_change += 0.000001
type_change = 1.00
if mov.moneda != fac.moneda:
type_change = round(1 / values['type_change'], 6)
validate = round(this_pay / type_change, 2)
while validate > importe:
type_change += 0.000001
validate = round(this_pay / type_change, 2)
mov_ant, numero = cls._movimiento_anterior(cls, mov, fac)
nuevo = {