forked from elmau/empresa-libre
Fix - Issue #143
This commit is contained in:
commit
c1cb34ba3e
|
@ -741,6 +741,13 @@ class LIBO(object):
|
||||||
self._set_cell('{receptor.%s}' % k, v)
|
self._set_cell('{receptor.%s}' % k, v)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def _copy_row(self, cell):
|
||||||
|
row = cell.getCellAddress().Row
|
||||||
|
source = self._sheet.getRows().getByIndex(row)
|
||||||
|
nc = self._next_cell(cell)
|
||||||
|
self._sheet.copyRange(nc.getCellAddress(), source.getRangeAddress())
|
||||||
|
return
|
||||||
|
|
||||||
def _conceptos(self, data):
|
def _conceptos(self, data):
|
||||||
first = True
|
first = True
|
||||||
for concepto in data:
|
for concepto in data:
|
||||||
|
@ -761,16 +768,15 @@ class LIBO(object):
|
||||||
if len(data) > 1:
|
if len(data) > 1:
|
||||||
row = cell_1.getCellAddress().Row + 1
|
row = cell_1.getCellAddress().Row + 1
|
||||||
self._sheet.getRows().insertByIndex(row, len(data)-1)
|
self._sheet.getRows().insertByIndex(row, len(data)-1)
|
||||||
source = self._sheet.getRows().getByIndex(row - 1)
|
|
||||||
nc = self._next_cell(cell_1)
|
|
||||||
self._sheet.copyRange(nc.getCellAddress(), source.getRangeAddress())
|
|
||||||
else:
|
else:
|
||||||
|
self._copy_row(cell_1)
|
||||||
cell_1 = self._set_cell(v=key, cell=cell_1)
|
cell_1 = self._set_cell(v=key, cell=cell_1)
|
||||||
cell_2 = self._set_cell(v=description, cell=cell_2)
|
cell_2 = self._set_cell(v=description, cell=cell_2)
|
||||||
cell_3 = self._set_cell(v=unidad, cell=cell_3)
|
cell_3 = self._set_cell(v=unidad, cell=cell_3)
|
||||||
cell_4 = self._set_cell(v=cantidad, cell=cell_4, value=True)
|
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_5 = self._set_cell(v=valor_unitario, cell=cell_5, value=True)
|
||||||
cell_6 = self._set_cell(v=importe, cell=cell_6, value=True)
|
cell_6 = self._set_cell(v=importe, cell=cell_6, value=True)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _add_totales(self, data):
|
def _add_totales(self, data):
|
||||||
|
|
|
@ -4097,7 +4097,7 @@ class PreFacturasDetalle(BaseModel):
|
||||||
productos = PreFacturasDetalle.select().where(
|
productos = PreFacturasDetalle.select().where(
|
||||||
PreFacturasDetalle.factura==id)
|
PreFacturasDetalle.factura==id)
|
||||||
|
|
||||||
for p in productos:
|
for p in reversed(productos):
|
||||||
row = {'id': p.producto.id}
|
row = {'id': p.producto.id}
|
||||||
row['clave'] = p.producto.clave
|
row['clave'] = p.producto.clave
|
||||||
row['descripcion'] = p.descripcion
|
row['descripcion'] = p.descripcion
|
||||||
|
|
Loading…
Reference in New Issue