From c1f08305c94558c5ee26c3ad0542278626c186cc Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Tue, 31 Oct 2017 20:01:03 -0600 Subject: [PATCH 1/2] Fix - Agregar varios productos --- source/app/models/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/app/models/main.py b/source/app/models/main.py index a62f82b..f95dcd2 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -1308,10 +1308,11 @@ class Facturas(BaseModel): FacturasDetalle.create(**product) for tax in p.impuestos: if tax.id in totals_tax: - totals_tax[tax.id]['importe'] += product['importe'] + totals_tax[tax.id].importe += product['importe'] else: tax.importe = product['importe'] totals_tax[tax.id] = tax + #~ totals_tax[tax.id]['importe'] = product['importe'] for tax in totals_tax.values(): if tax.tipo == 'E' or tax.tipo == 'R': From 295f1c80c5227e26f66079b191c1582c7624179f Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Tue, 31 Oct 2017 20:08:18 -0600 Subject: [PATCH 2/2] Fix - PDF con varios productos --- source/app/controllers/util.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 979dacc..0c1af30 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -673,6 +673,23 @@ class LIBO(object): cell_4 = self._set_cell('{cantidad}', cantidad, value=True) cell_5 = self._set_cell('{valorunitario}', valor_unitario, value=True) cell_6 = self._set_cell('{importe}', importe, value=True) + else: + row = cell_2.getCellAddress().Row + 1 + self._sheet.getRows().insertByIndex(row, 1) + if cell_1: + self._copy_cell(cell_1) + cell_1 = self._set_cell(v=key, cell=cell_1) + if cell_3: + self._copy_cell(cell_3) + cell_3 = self._set_cell(v=unidad, cell=cell_3) + self._copy_cell(cell_2) + self._copy_cell(cell_4) + self._copy_cell(cell_5) + self._copy_cell(cell_6) + cell_2 = self._set_cell(v=description, cell=cell_2) + cell_4 = self._set_cell(v=cantidad, cell=cell_4, value=True) + cell_5 = self._set_cell(v=valor_unitario, cell=cell_5, value=True) + cell_6 = self._set_cell(v=importe, cell=cell_6, value=True) return def _totales(self, data):