From 4221db615cbb6410cfcc47de4209f9bc4af3a3ed Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Mon, 8 Jan 2018 16:00:55 -0600 Subject: [PATCH] Soporte para pedimentos --- source/app/controllers/util.py | 7 +++++++ source/static/js/controller/invoices.js | 4 ++-- source/static/js/controller/util.js | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 4ea557c..b8561c2 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1070,12 +1070,19 @@ def _conceptos(doc, version): values['noidentificacion'], values['ClaveProdServ']) values['unidad'] = '({})\n{}'.format( values['ClaveUnidad'], values['unidad']) + n = c.find('{}CuentaPredial'.format(PRE[version])) if n is not None: v = CaseInsensitiveDict(n.attrib.copy()) info = '\nCuenta Predial Número: {}'.format(v['numero']) values['descripcion'] += info + n = c.find('{}InformacionAduanera'.format(PRE[version])) + if n is not None: + v = CaseInsensitiveDict(n.attrib.copy()) + info = '\nNúmero Pedimento: {}'.format(v['numeropedimento']) + values['descripcion'] += info + data.append(values) return data diff --git a/source/static/js/controller/invoices.js b/source/static/js/controller/invoices.js index 04785c3..c6d31c6 100644 --- a/source/static/js/controller/invoices.js +++ b/source/static/js/controller/invoices.js @@ -918,8 +918,8 @@ function grid_details_before_edit_stop(state, editor){ if(editor.column == 'pedimento'){ state.value = state.value.trim() - if(state.value.length > 21){ - msg = 'El Pedimento tiene más de 21 caracteres, será ' + if(state.value.length != 21){ + msg = 'El Pedimento debe ser de 21 caracteres, será ' msg += 'rechazado por el SAT. Edita estalo hasta que ya ' msg += 'no veas este mensaje de error.
' msg += '
Caracteres: ' + state.value.length diff --git a/source/static/js/controller/util.js b/source/static/js/controller/util.js index 8c31ce7..fec50c5 100644 --- a/source/static/js/controller/util.js +++ b/source/static/js/controller/util.js @@ -359,6 +359,6 @@ function validate_regexp(value, pattern){ function validate_pedimento(value){ - var pattern = '[0-9]{2} [0-9]{2} [0-9]{4} [0-9]{7}' + var pattern = '[0-9]{2} [0-9]{2} [0-9]{4} [0-9]{7}' return validate_regexp(value, pattern) }