From 88bb6d9411bec6dc1139b483e960cbabcbbafedb Mon Sep 17 00:00:00 2001 From: El Mau Date: Wed, 19 Jan 2022 00:17:29 -0600 Subject: [PATCH] =?UTF-8?q?Agregar=20ubicaciones=20a=20representaci=C3=B3n?= =?UTF-8?q?=20impresa=20de=20Carta=20Porte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app/controllers/util.py | 22 +++++++++++----------- source/app/models/main.py | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 088795e..2b7c45f 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -969,14 +969,14 @@ class LIBO(object): cell_5 = self._set_cell('{cp.Domicilio}', domicilio) row = cell_1.CellAddress.Row + 1 - try: - self._sheet.Rows.insertByIndex(row, count) - except Exception as e: - print(e) - # ~ self._copy_paste_rows(cell_1, count) - # ~ row = cell_1.getCellAddress().Row - # ~ else: - # ~ cell_1 = self._set_cell(v=tipo, cell=cell_1) + self._sheet.getRows().insertByIndex(row, count) + self._copy_paste_rows(cell_1, count) + else: + cell_1 = self._set_cell(v=tipo, cell=cell_1) + cell_2 = self._set_cell(v=nombre, cell=cell_2) + cell_3 = self._set_cell(v=rfc, cell=cell_3) + cell_4 = self._set_cell(v=fecha, cell=cell_4) + cell_5 = self._set_cell(v=domicilio, cell=cell_5) return @@ -1202,14 +1202,15 @@ class LIBO(object): self._nomina(data['nomina']) else: self._totales(data['totales']) - self._timbre(data['timbre']) + self._donataria(data['donataria']) self._ine(data['ine']) - self._divisas(data.get('divisas', {})) self._leyendas(data.get('leyendas', '')) self._carta_porte(data.get('carta_porte', {})) + self._timbre(data['timbre']) + self._cancelado(data['cancelada']) self._others_values(data) self._clean() @@ -1224,7 +1225,6 @@ class LIBO(object): def pdf(self, path, data, ods=False): options = {'AsTemplate': True, 'Hidden': True} log.debug('Abrir plantilla...') - self._template = self._doc_open(path, options) if self._template is None: return b'' diff --git a/source/app/models/main.py b/source/app/models/main.py index 43897f6..9eed9c8 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -4785,6 +4785,7 @@ class Facturas(BaseModel): values = cls._get_not_in_xml(cls, obj, emisor) data = util.get_data_from_xml(obj, values) + data.update(utils.CfdiToDict(obj.xml).values) doc = util.to_pdf(data, emisor.rfc, True) return doc, name