From 3ddf99075eeaeee025f06a17e346ac6ca3e9b623 Mon Sep 17 00:00:00 2001 From: El Mau Date: Sat, 29 Jan 2022 20:47:30 -0600 Subject: [PATCH 1/3] Reporte #49, arreglado --- CHANGELOG.md | 5 +++++ VERSION | 2 +- source/app/models/main.py | 4 +++- source/app/settings.py | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c729b4..b51344e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +v 1.46.1 [29-Ene-2022] +---------------------- + - Error: Issue #49 + + v 1.46.0 [27-Ene-2022] ---------------------- - Mejora: Issue #45 diff --git a/VERSION b/VERSION index a8ada98..40453c5 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -1.46.0 +1.46.1 diff --git a/source/app/models/main.py b/source/app/models/main.py index 226c08f..bf5932c 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -4685,7 +4685,9 @@ class Facturas(BaseModel): for n in node: d = util.get_dict(n.attrib) name = VALUES_PDF['TAX'].get(d['impuesto']) - tasa = f"{float(d['tasaocuota']):.2f}" + tasa = '' + if 'tasaocuota' in d: + tasa = f"{float(d['tasaocuota']):.2f}" title = f"{type_tax} {name} {tasa}" importe = util.format_currency(d['importe'], currency) data['totales'].append((title, importe)) diff --git a/source/app/settings.py b/source/app/settings.py index 3d6f63e..7f0d30e 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -42,7 +42,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.46.0' +VERSION = '1.46.1' EMAIL_SUPPORT = ('soporte@empresalibre.mx',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION) From a7080bf954c98d230b150a47bc78efb45562c5ae Mon Sep 17 00:00:00 2001 From: El Mau Date: Sun, 30 Jan 2022 14:47:34 -0600 Subject: [PATCH 2/3] =?UTF-8?q?Agregar=20validaci=C3=B3n=20para=20distanci?= =?UTF-8?q?a=20en=20origen=20de=20Carta=20Porte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app/models/main.py | 12 ++++++++---- source/static/js/controller/invoices.js | 13 +++++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/source/app/models/main.py b/source/app/models/main.py index bf5932c..c0d2d99 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -5368,10 +5368,14 @@ class Facturas(BaseModel): ubicaciones = values['ubicaciones'] for ubicacion in ubicaciones: - if 'DistanciaRecorrida' in ubicacion and ubicacion['DistanciaRecorrida']: - total_distance += float(ubicacion['DistanciaRecorrida']) - if isinstance(ubicacion['DistanciaRecorrida'], (int, float)): - ubicacion['DistanciaRecorrida'] = f"{ubicacion['DistanciaRecorrida']:.2f}" + if 'DistanciaRecorrida' in ubicacion: + if ubicacion['TipoUbicacion'] == 'Origen': + del ubicacion['DistanciaRecorrida'] + elif ubicacion['DistanciaRecorrida']: + total_distance += float(ubicacion['DistanciaRecorrida']) + if isinstance(ubicacion['DistanciaRecorrida'], (int, float)): + ubicacion['DistanciaRecorrida'] = f"{ubicacion['DistanciaRecorrida']:.2f}" + municipio = ubicacion.pop('Municipio') estado = ubicacion.pop('Estado') pais = ubicacion.pop('Pais') diff --git a/source/static/js/controller/invoices.js b/source/static/js/controller/invoices.js index 8ff65b5..e5026ea 100644 --- a/source/static/js/controller/invoices.js +++ b/source/static/js/controller/invoices.js @@ -1122,12 +1122,21 @@ function grid_details_before_edit_start(id){ function grid_carta_ubicaciones_before_edit_stop(state, editor){ + var g = $$('grid_carta_ubicaciones') + var row = g.getItem(editor.row) + if(editor.column != 'CodigoPostal'){ + if(editor.column == 'DistanciaRecorrida' && row['TipoUbicacion'] == 'Origen'){ + msg = 'En el Origen, la distancia recorrida debe estar vacía' + msg_error(msg) + g.blockEvent() + state.value = '' + g.editCancel() + g.unblockEvent() + } return true } - var g = $$('grid_carta_ubicaciones') - var row = g.getItem(editor.row) var cp = state.value.trim() if(!cp){ From d6a8c1e3fae1c87ae0c146705f0d5d47c28658a4 Mon Sep 17 00:00:00 2001 From: El Mau Date: Sun, 30 Jan 2022 14:48:32 -0600 Subject: [PATCH 3/3] Actualizar lista de cambios --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b51344e..ebc3041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ v 1.46.1 [29-Ene-2022] ---------------------- - Error: Issue #49 + - Mejora: Agregar validación para distancia en origen de Carta Porte. v 1.46.0 [27-Ene-2022]