Fix - Issue #143

This commit is contained in:
Mauricio Baeza 2018-01-23 16:10:45 -06:00
commit a0db6d1f13
1 changed files with 10 additions and 8 deletions

View File

@ -678,7 +678,10 @@ class LIBO(object):
self._search.EndRow
)
self._sd = self._sheet.createSearchDescriptor()
self._sd.SearchCaseSensitive = False
try:
self._sd.SearchCaseSensitive = False
except:
print ('SD', self._sd)
return
def _next_cell(self, cell):
@ -740,7 +743,6 @@ class LIBO(object):
def _conceptos(self, data):
first = True
copy = False
for concepto in data:
key = concepto.get('noidentificacion', '')
description = concepto['descripcion']
@ -756,14 +758,14 @@ 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
if not copy:
if len(data) > 1:
row = cell_1.getCellAddress().Row + 1
self._sheet.getRows().insertByIndex(row, len(data)-1)
copy = True
source = self._sheet.getRows().getByIndex(row - 1)
source = self._sheet.getRows().getByIndex(row - 1)
nc = self._next_cell(cell_1)
self._sheet.copyRange(nc.getCellAddress(), source.getRangeAddress())
else:
cell_1 = self._set_cell(v=key, cell=cell_1)
self._sheet.copyRange(cell_1.getCellAddress(), source.getRangeAddress())
cell_2 = self._set_cell(v=description, cell=cell_2)
cell_3 = self._set_cell(v=unidad, cell=cell_3)
cell_4 = self._set_cell(v=cantidad, cell=cell_4, value=True)