From 25e86cd28c8c380b684e43f4fd8d70c270abf345 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Wed, 1 Sep 2021 21:45:21 -0500 Subject: [PATCH] Remove modifi precition in decimal context --- source/app/controllers/pycfdi.py | 2 +- source/app/models/main.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/app/controllers/pycfdi.py b/source/app/controllers/pycfdi.py index f098330..d023490 100644 --- a/source/app/controllers/pycfdi.py +++ b/source/app/controllers/pycfdi.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from decimal import Decimal, getcontext -getcontext().prec = 6 +# ~ getcontext().prec = 6 import lxml.etree as ET from requests.structures import CaseInsensitiveDict as CIDict diff --git a/source/app/models/main.py b/source/app/models/main.py index a1d006b..59ec507 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -5049,7 +5049,9 @@ class Facturas(BaseModel): (total_trasladados or 0) - (total_retenciones or 0) \ + locales_traslados - locales_retenciones total = round(total, DECIMALES) + # ~ exchange_rate = float(invoice.tipo_cambio) total_mn = round(total * invoice.tipo_cambio, DECIMALES) + # ~ total_mn = round(total * exchange_rate, DECIMALES) data = { 'subtotal': subtotal, 'descuento': descuento_cfdi,