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): 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':