From 175269cd3afcda8804da2cc96af1e92a07d42cd4 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Thu, 1 Mar 2018 13:50:27 -0600 Subject: [PATCH] Fix - Prefacturas con descuentos --- source/app/models/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/app/models/main.py b/source/app/models/main.py index 76f85ef..c8502e0 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -4676,12 +4676,12 @@ class PreFacturas(BaseModel): product['cantidad'] = cantidad product['valor_unitario'] = valor_unitario - product['descuento'] = descuento + product['descuento'] = round(descuento * cantidad, DECIMALES) product['precio_final'] = precio_final product['importe'] = round(cantidad * valor_unitario, DECIMALES) - descuento_cfdi += descuento - subtotal += importe + descuento_cfdi += product['descuento'] + subtotal += product['importe'] PreFacturasDetalle.create(**product) @@ -4736,7 +4736,7 @@ class PreFacturas(BaseModel): + locales_traslados - locales_retenciones total_mn = round(total * invoice.tipo_cambio, DECIMALES) data = { - 'subtotal': subtotal + descuento, + 'subtotal': subtotal, 'descuento': descuento_cfdi, 'total': total, 'total_mn': total_mn,