diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aecb8d..5fd5b75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v 1.40.0 [20-12-2020] +---------------------- + - Error: Al parsear XML en Python 3.9+ + - Mejora: Agregar versión de Empresa Libre a plantilla. + + v 1.39.1 [17-sep-2020] ---------------------- - Error: Esquema para complemento IEDU diff --git a/README.md b/README.md index 826f193..e9fde91 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,17 @@ Este proyecto está en continuo desarrollo, contratar un esquema de soporte, nos ayuda a continuar su desarrollo. Ponte en contacto con nosotros para contratar: administracion ARROBA empresalibre.net -#### Ahora también puede aportar con Bitcoin Cash (BCH): +#### Ahora también puede aportar con criptomonedas: -`pq763fj7kxxf2wtf360lfsy5ydw84yz72q76hanhxq` +BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d` +BTC: `3FhiXcXmAesmQzrNEngjHFnvaJRhU1AGWV` ### Requerimientos: * Servidor web, recomendado Nginx * uwsgi -* python3.6+ +* python3.7+ * xsltproc * openssl * xmlsec diff --git a/VERSION b/VERSION index 0c11aad..32b7211 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.39.1 +1.40.0 diff --git a/requirements.txt b/requirements.txt index d33642b..a007210 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,9 @@ pypng reportlab psycopg2-binary cryptography + +# escpos +# pyusb +# pyserial +# qrcode + diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index aade77a..0163de6 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1339,9 +1339,15 @@ class LIBO(object): self._leyendas(data.get('leyendas', '')) self._cancelado(data['cancelada']) + self._others_values(data) self._clean() return + def _others_values(self, data): + version = data['version'] + self._set_cell('{version}', version) + return + def pdf(self, path, data, ods=False): options = {'AsTemplate': True, 'Hidden': True} log.debug('Abrir plantilla...') @@ -1818,7 +1824,7 @@ def _get_relacionados(doc, version): if node is None: return '' - uuids = ['UUID: {}'.format(n.attrib['UUID']) for n in node.getchildren()] + uuids = ['UUID: {}'.format(n.attrib['UUID']) for n in list(node)] return '\n'.join(uuids) @@ -1933,7 +1939,8 @@ def _conceptos(doc, version, options): data = [] conceptos = doc.find('{}Conceptos'.format(PRE[version])) - for c in conceptos.getchildren(): + # ~ for c in conceptos.getchildren(): + for c in list(conceptos): values = CaseInsensitiveDict(c.attrib.copy()) if is_nomina: values['noidentificacion'] = values['ClaveProdServ'] @@ -2002,7 +2009,8 @@ def _totales(doc, cfdi, version): node = imp.find('{}Traslados'.format(PRE[version])) if node is not None: - for n in node.getchildren(): + # ~ for n in node.getchildren(): + for n in list(node): tmp = CaseInsensitiveDict(n.attrib.copy()) if version == '3.3': tasa = round(float(tmp['tasaocuota']), DECIMALES) @@ -2013,7 +2021,8 @@ def _totales(doc, cfdi, version): node = imp.find('{}Retenciones'.format(PRE[version])) if node is not None: - for n in node.getchildren(): + # ~ for n in node.getchildren(): + for n in list(node): tmp = CaseInsensitiveDict(n.attrib.copy()) if version == '3.3': title = 'Retención {} {}'.format( @@ -2196,6 +2205,7 @@ def get_data_from_xml(invoice, values): if data['pagos']: data['pays'] = _cfdipays(doc, data, version) data['pakings'] = values.get('pakings', []) + data['version'] = values['version'] return data diff --git a/source/app/models/main.py b/source/app/models/main.py index 464633b..e1f9c1d 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -49,6 +49,7 @@ from settings import ( PATHS, URL, VALUES_PDF, + VERSION, RFCS, ) @@ -3965,7 +3966,7 @@ class Facturas(BaseModel): def _get_not_in_xml(self, invoice, emisor): pdf_from = Configuracion.get_('make_pdf_from') or '1' - values = {} + values = {'version': VERSION} values['notas'] = invoice.notas values['fechadof'] = str(emisor.fecha_dof) diff --git a/source/app/settings.py b/source/app/settings.py index 9346afe..72ced22 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -47,7 +47,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.39.1' +VERSION = '1.40.0' EMAIL_SUPPORT = ('soporte@empresalibre.mx',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION) diff --git a/source/templates/plantilla_factura.ods b/source/templates/plantilla_factura.ods index 0505175..d54d86d 100644 Binary files a/source/templates/plantilla_factura.ods and b/source/templates/plantilla_factura.ods differ