From 5ac614e079e5f00eed29f602cb29ad60404d0241 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sun, 7 Oct 2018 20:29:14 -0500 Subject: [PATCH] Error #295 --- source/app/models/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/app/models/main.py b/source/app/models/main.py index 79f0de0..0f2daca 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -5369,7 +5369,13 @@ class FacturasPagos(BaseModel): fac = Facturas.get(Facturas.id==int(i)) this_pay = values['this_pay'] importe = values['importe'] - type_change = round(this_pay / importe, 6) + 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 = { 'movimiento': mov,