1 from com.sun.star.table
import CellRangeAddress
6 import LeenoDialogs
as DLG
12 Ricava i dati dalla voce di COMPUTO / CONTABILITA
20 i = sStRange.RangeAddress.StartRow
21 f = sStRange.RangeAddress.EndRow
24 num = oSheet.getCellByPosition(0, i+1).String
25 art = oSheet.getCellByPosition(1, i+1).String
26 desc = oSheet.getCellByPosition(2, i+1).String
27 quantP = oSheet.getCellByPosition(9, f).Value
28 mdo = oSheet.getCellByPosition(30, f).Value
29 sic = oSheet.getCellByPosition(17, f).Value
33 if oSheet.Name
in (
'CONTABILITA'):
38 data = oSheet.getCellByPosition(1, i+2).String
39 um = oSheet.getCellByPosition(9, i+1).String
40 Nlib = int(oSheet.getCellByPosition(19, i+1).Value)
41 Plib = int(oSheet.getCellByPosition(20, i+1).Value)
42 flag = oSheet.getCellByPosition(22, i+1).String
43 nSal = int(oSheet.getCellByPosition(23, i+1).Value)
44 prezzo = oSheet.getCellByPosition(13, f).Value
45 importo = oSheet.getCellByPosition(15, f).Value
46 sic = oSheet.getCellByPosition(17, f).Value
47 mdo = oSheet.getCellByPosition(30, f).Value
49 REG = ((num +
'\n' + art +
'\n' + data), desc, Nlib, Plib, um, quantP,
50 quantN, prezzo, importo)
55 SAL = (art, desc, um, quant, prezzo, importo, sic, mdo)
57 elif oSheet.Name
in (
'COMPUTO',
'VARIANTE'):
58 um = oSheet.getCellByPosition(8, f).String.split(
'[')[-1].split(
'[')[0]
59 prezzo = oSheet.getCellByPosition(11, f).Value
60 importo = oSheet.getCellByPosition(18, f).Value
61 voce = (num, art, desc, um, quantP, prezzo, importo, sic, mdo)
67 lrow { int } : riga di riferimento per
68 la selezione dell'intera voce
70 Circoscrive una voce di COMPUTO, VARIANTE o CONTABILITÀ
71 partendo dalla posizione corrente del cursore
79 if oSheet.getCellByPosition(0, lrow).CellStyle
in (
80 'comp progress',
'comp 10 s',
81 'Comp Start Attributo',
'Comp End Attributo',
82 'Comp Start Attributo_R',
'comp 10 s_R',
83 'Comp End Attributo_R',
'Livello-0-scritta',
84 'Livello-1-scritta',
'livello2 valuta'):
86 while oSheet.getCellByPosition(0, y).CellStyle
not in (
'Comp End Attributo',
'Comp End Attributo_R'):
91 while oSheet.getCellByPosition(0, y).CellStyle
not in (
'Comp Start Attributo',
'Comp Start Attributo_R'):
97 elif oSheet.getCellByPosition(0, lrow).CellStyle ==
'Ultimus_centro_bordi_lati':
98 for y
in reversed (range(0, lrow)):
99 if oSheet.getCellByPosition(0, y).CellStyle !=
'Ultimus_centro_bordi_lati':
103 if oSheet.getCellByPosition(0, y).CellStyle !=
'Ultimus_centro_bordi_lati':
106 elif 'ULTIMUS' in oSheet.getCellByPosition(0, lrow).CellStyle:
111 celle = oSheet.getCellRangeByPosition(0, lrowS, 250, lrowE)
137 oSheetto = oDoc.getSheets().getByName(
'S5')
139 oRangeAddress = oSheetto.getCellRangeByPosition(0, 8, 42, 11).getRangeAddress()
140 oCellAddress = oSheet.getCellByPosition(0, lrow).getCellAddress()
142 oSheet.getRows().insertByIndex(lrow, 4)
143 oSheet.copyRange(oCellAddress, oRangeAddress)
146 iSheet = oSheet.RangeAddress.Sheet
147 oCellRangeAddr = CellRangeAddress()
148 oCellRangeAddr.Sheet = iSheet
149 oCellRangeAddr.StartColumn = 0
150 oCellRangeAddr.EndColumn = 0
151 oCellRangeAddr.StartRow = lrow + 2
152 oCellRangeAddr.EndRow = lrow + 2
153 oSheet.group(oCellRangeAddr, 1)
156 oSheet.getCellByPosition(13, lrow + 3).Formula =
'=J' + str(lrow + 4)
157 oSheet.getCellByPosition(35, lrow + 3).Formula =
'=B' + str(lrow + 2)
159 if oSheet.getCellByPosition(31,lrow - 1).CellStyle
in (
164 oSheet.getCellByPosition(31, lrow + 3).Value = oSheet.getCellByPosition(31, lrow - 1).Value
165 oSheet.getCellByPosition(32, lrow + 3).Value = oSheet.getCellByPosition(32, lrow - 1).Value
166 oSheet.getCellByPosition(33,lrow + 3).Value = oSheet.getCellByPosition(33, lrow - 1).Value
173 Se cod è presente, viene usato come codice di voce
176 oSheet = oDoc.CurrentController.ActiveSheet
180 lrow = PL.LeggiPosizioneCorrente()[1]
181 stile = oSheet.getCellByPosition(0, lrow).CellStyle
182 if stile
in stili_cat:
184 elif stile
in (noVoce + stili_computo):
192 oSheet.getCellByPosition(1, lrow + 1).String = cod
194 PL._gotoCella(1, lrow + 1)