From cff2294601cdd278d7ef1fc0def8fee83753f063 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Mon, 28 Oct 2019 19:35:03 -0600 Subject: [PATCH] Fix - al generar PDF --- CHANGELOG.md | 5 +++++ VERSION | 2 +- source/app/controllers/helper.py | 4 +++- source/app/models/main.py | 11 ++++++++++- source/app/settings.py | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e3b2a..9d58d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +v 1.31.2 [28-oct-2019] +---------------------- + - Error: Al generar PDF con tags en las series + + v 1.31.1 [28-ago-2019] ---------------------- - Error: Al agregar nuevo impuesto #369 diff --git a/VERSION b/VERSION index 6bae540..3492b09 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.31.1 +1.31.2 diff --git a/source/app/controllers/helper.py b/source/app/controllers/helper.py index 4b01b2b..6c11337 100644 --- a/source/app/controllers/helper.py +++ b/source/app/controllers/helper.py @@ -6,6 +6,8 @@ import smtplib import ssl import collections +from xml.sax.saxutils import escape + from collections import OrderedDict from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase @@ -582,7 +584,7 @@ class TemplateInvoice(BaseDocTemplate): if 'spaceBefore' in v['estilo']: v['estilo']['spaceBefore'] = v['estilo']['spaceBefore'] * cm ps = ParagraphStyle(**v['estilo']) - p = Paragraph(data[k], ps) + p = Paragraph(escape(data[k]), ps) ls.append(p) elif k=='formametodopago': ps = ParagraphStyle(**v['estilo']) diff --git a/source/app/models/main.py b/source/app/models/main.py index 59fcd25..115a183 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -9987,6 +9987,7 @@ def _exportar_documentos(): month = str(n.month) without_stamp = [] + with_error = [] filters = { 'year': year, @@ -10009,13 +10010,21 @@ def _exportar_documentos(): rfc, year, month.zfill(2), name) if util.exists(path): continue - Facturas.get_pdf(row['id'], rfc, True) + try: + Facturas.get_pdf(row['id'], rfc, True) + except Exception as e: + with_error.append(f"{row['serie']}-{row['folio']}") + print(e) msg = '\tPDF generado...' log.info(msg) log.info('Documentos exportados...') + log.info('Sin sellar...') for i in without_stamp: log.info(i) + log.info('Con error...') + for i in with_error: + log.info(i) return diff --git a/source/app/settings.py b/source/app/settings.py index dbe8d15..d9752e8 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -47,7 +47,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.31.1' +VERSION = '1.31.2' EMAIL_SUPPORT = ('soporte@empresalibre.mx',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)