2 |
<!DOCTYPE form SYSTEM "gnue-forms.dtd"> |
<!DOCTYPE form SYSTEM "gnue-forms.dtd"> |
3 |
|
|
4 |
<form tabbed="top" title="Listas de Precios" |
<form tabbed="top" title="Listas de Precios" |
5 |
height="25" width="84"> |
height="30" width="84"> |
6 |
<datasource name="searchDataSource" cache="1"/> |
<datasource name="searchDataSource" cache="1"/> |
7 |
<datasource database="papo" name="priceTypeDataSource" table="pricetype"/> |
<datasource database="papo" name="priceTypeDataSource" table="pricetype"/> |
8 |
<datasource name="productDataSource" database="papo" |
<datasource name="productDataSource" database="papo" |
56 |
<block name="priceTipeBlock" datasource="pricetypeDataSource"> |
<block name="priceTipeBlock" datasource="pricetypeDataSource"> |
57 |
<label name="priceTipeLbl" text="tipo de lista" x="1" y="1"/> |
<label name="priceTipeLbl" text="tipo de lista" x="1" y="1"/> |
58 |
<entry name="priceTipename" field="name" x="1" y="2" width="40"/> |
<entry name="priceTipename" field="name" x="1" y="2" width="40"/> |
59 |
<entry name="priceTipeid" field="id" x="40" y="2" width="10" /> |
<entry name="priceTipeid" field="id" x="40" y="2" width="10" hidden=""/> |
60 |
</block> |
</block> |
61 |
</box> |
</box> |
62 |
<!-- búsqueda --> |
<!-- búsqueda --> |
64 |
<datasource name="searchProductByNameDataSource" cache="1"/> |
<datasource name="searchProductByNameDataSource" cache="1"/> |
65 |
<datasource name="searchProductByCodeDataSource" cache="1"/> |
<datasource name="searchProductByCodeDataSource" cache="1"/> |
66 |
<trigger name="searchProductTrigger" type="NAMED"> |
<trigger name="searchProductTrigger" type="NAMED"> |
|
|
|
67 |
#armado de la lista de recorrido del arbol |
#armado de la lista de recorrido del arbol |
68 |
search_id= priceTipeBlock.priceTipeid |
search_id= priceTipeBlock.priceTipeid |
69 |
priceListsChain=[] |
priceListsChain=[] |
73 |
treePriceTypeBlock.processQuery() |
treePriceTypeBlock.processQuery() |
74 |
search_id = treePriceTypeBlock.treePriceTypeParentId |
search_id = treePriceTypeBlock.treePriceTypeParentId |
75 |
priceListsChain.append("%s" %treePriceTypeBlock.treePriceTypeId) |
priceListsChain.append("%s" %treePriceTypeBlock.treePriceTypeId) |
|
print "resultado" |
|
|
for pricetype_id in priceListsChain: |
|
|
print pricetype_id |
|
76 |
resultProductBlock.processRollback() |
resultProductBlock.processRollback() |
77 |
resultProductBlock.initQuery() |
resultProductBlock.initQuery() |
78 |
resultProductBlock.productNameListEntry = ("%s" % searchProductByNameBlock.searchProductByNameEntry)+"%" |
resultProductBlock.productNameListEntry = ("%s" % searchProductByNameBlock.searchProductByNameEntry)+"%" |
79 |
resultProductBlock.productCodeListEntry = ("%s" % searchProductByCodeBlock.searchProductByCodeEntry)+"%" |
resultProductBlock.productCodeListEntry = ("%s" % searchProductByCodeBlock.searchProductByCodeEntry)+"%" |
80 |
resultProductBlock.productCodeTypeListEntry = "1" |
resultProductBlock.productCodeTypeListEntry = "1" |
81 |
resultProductBlock.processQuery() |
resultProductBlock.processQuery() |
82 |
print ("%s" % searchProductByNameBlock.searchProductByNameEntry) |
# cargar la parte visible de modificacion de precios |
|
# cargar el input |
|
|
print "numero de cuentas" |
|
83 |
resultProductBlock.firstRecord() |
resultProductBlock.firstRecord() |
84 |
product_id_anterior=-1; |
product_id_anterior=-1; |
85 |
priceModifyBlock.processRollback() |
priceModifyBlock.processRollback() |
91 |
priceModifyBlock.priceModifyNameListEntry= ("%s" %resultProductBlock.productNameListEntry) |
priceModifyBlock.priceModifyNameListEntry= ("%s" %resultProductBlock.productNameListEntry) |
92 |
priceModifyBlock.priceModifyCodeListEntry= ("%s" %resultProductBlock.productCodeListEntry) |
priceModifyBlock.priceModifyCodeListEntry= ("%s" %resultProductBlock.productCodeListEntry) |
93 |
priceModifyBlock.priceModifyPriceTypeListEntry= ("%s" %resultProductBlock.productPriceTypeListEntry) |
priceModifyBlock.priceModifyPriceTypeListEntry= ("%s" %resultProductBlock.productPriceTypeListEntry) |
94 |
priceModifyBlock.priceModifyPriceListEntry= ("%s" %resultProductBlock.productPriceListEntry) |
priceModifyBlock.priceModifyPriceListEntry= ("%s" %resultProductBlock.productPriceListEntry) |
95 |
priceModifyBlock.priceModifyProductIdListEntry =("%s" %resultProductBlock.productIdListEntry) |
priceModifyBlock.priceModifyPricePreviousListEntry= ("%s" %resultProductBlock.productPriceListEntry) |
96 |
|
priceModifyBlock.priceModifyProductIdListEntry= ("%s" %resultProductBlock.productIdListEntry) |
97 |
|
priceModifyBlock.priceModifyPriceListIdListEntry= ("%s" %resultProductBlock.productPriceTypeIdListEntry) |
98 |
priceModifyBlock.newRecord() |
priceModifyBlock.newRecord() |
99 |
product_id_anterior=product_id |
product_id_anterior=product_id |
100 |
resultProductBlock.nextRecord() |
resultProductBlock.nextRecord() |
|
|
|
101 |
</trigger> |
</trigger> |
102 |
|
<trigger name="priceModifyCommitTrigger" type="NAMED"> |
103 |
|
priceModifyBlock.firstRecord() |
104 |
|
for index in range(priceModifyBlock.getRecordCount()): |
105 |
|
if ("%s" % priceModifyBlock.priceModifyPriceListEntry) != ("%s" % priceModifyBlock.priceModifyPricePreviousListEntry): |
106 |
|
if ("%s" % priceTipeBlock.priceTipeid ) == ("%s" % priceModifyBlock.priceModifyPriceListIdListEntry ): |
107 |
|
priceCommitDataBlock.processRollback() |
108 |
|
priceCommitDataBlock.initQuery() |
109 |
|
priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry) |
110 |
|
priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % priceTipeBlock.priceTipeid ) |
111 |
|
priceCommitDataBlock.processQuery() |
112 |
|
priceCommitDataBlock.priceCommitPriceEntry = ("%s" % priceModifyBlock.priceModifyPriceListEntry) |
113 |
|
priceCommitDataBlock.commit() |
114 |
|
print "modifica" |
115 |
|
else: |
116 |
|
priceCommitDataBlock.processRollback() |
117 |
|
priceCommitDataBlock.newRecord() |
118 |
|
priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry) |
119 |
|
priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % priceTipeBlock.priceTipeid ) |
120 |
|
priceCommitDataBlock.priceCommitPriceEntry = ("%s" % priceModifyBlock.priceModifyPriceListEntry) |
121 |
|
priceCommitDataBlock.commit() |
122 |
|
print "inserta" |
123 |
|
priceModifyBlock.nextRecord() |
124 |
|
#esto es una chanchada, proximamente llamar al trigger "searchProductTrigger" |
125 |
|
#armado de la lista de recorrido del arbol |
126 |
|
#armado de la lista de recorrido del arbol |
127 |
|
search_id= priceTipeBlock.priceTipeid |
128 |
|
priceListsChain=[] |
129 |
|
while search_id >= 1 : |
130 |
|
treePriceTypeBlock.initQuery() |
131 |
|
treePriceTypeBlock.treePriceTypeId= search_id |
132 |
|
treePriceTypeBlock.processQuery() |
133 |
|
search_id = treePriceTypeBlock.treePriceTypeParentId |
134 |
|
priceListsChain.append("%s" %treePriceTypeBlock.treePriceTypeId) |
135 |
|
resultProductBlock.processRollback() |
136 |
|
resultProductBlock.initQuery() |
137 |
|
resultProductBlock.productNameListEntry = ("%s" % searchProductByNameBlock.searchProductByNameEntry)+"%" |
138 |
|
resultProductBlock.productCodeListEntry = ("%s" % searchProductByCodeBlock.searchProductByCodeEntry)+"%" |
139 |
|
resultProductBlock.productCodeTypeListEntry = "1" |
140 |
|
resultProductBlock.processQuery() |
141 |
|
# cargar la parte visible de modificacion de precios |
142 |
|
resultProductBlock.firstRecord() |
143 |
|
product_id_anterior=-1; |
144 |
|
priceModifyBlock.processRollback() |
145 |
|
for index in range(resultProductBlock.getRecordCount()): |
146 |
|
product_id=("%s" %resultProductBlock.productIdListEntry) |
147 |
|
if product_id != product_id_anterior: |
148 |
|
for pricetype in priceListsChain: |
149 |
|
if pricetype == ("%s" %resultProductBlock.productPriceTypeIdListEntry): |
150 |
|
priceModifyBlock.priceModifyNameListEntry= ("%s" %resultProductBlock.productNameListEntry) |
151 |
|
priceModifyBlock.priceModifyCodeListEntry= ("%s" %resultProductBlock.productCodeListEntry) |
152 |
|
priceModifyBlock.priceModifyPriceTypeListEntry= ("%s" %resultProductBlock.productPriceTypeListEntry) |
153 |
|
priceModifyBlock.priceModifyPriceListEntry= ("%s" %resultProductBlock.productPriceListEntry) |
154 |
|
priceModifyBlock.priceModifyPricePreviousListEntry= ("%s" %resultProductBlock.productPriceListEntry) |
155 |
|
priceModifyBlock.priceModifyProductIdListEntry= ("%s" %resultProductBlock.productIdListEntry) |
156 |
|
priceModifyBlock.priceModifyPriceListIdListEntry= ("%s" %resultProductBlock.productPriceTypeIdListEntry) |
157 |
|
priceModifyBlock.newRecord() |
158 |
|
product_id_anterior=product_id |
159 |
|
resultProductBlock.nextRecord() |
160 |
|
#fin de la chanchada |
161 |
|
</trigger> |
162 |
|
<trigger name="priceModifyRollbackTrigger" type="NAMED"> |
163 |
|
priceCommitDataBlock.processRollback() |
164 |
|
priceModifyBlock.processRollback() |
165 |
|
</trigger> |
166 |
|
|
167 |
|
|
168 |
<box label="Búsqueda de producto" x="0" y="4" height="5" width="84"> |
<box label="Búsqueda de producto" x="0" y="4" height="5" width="84"> |
169 |
|
|
179 |
<label text="Código" |
<label text="Código" |
180 |
x="21" y="1"/> |
x="21" y="1"/> |
181 |
<entry name="searchProductByCodeEntry" |
<entry name="searchProductByCodeEntry" |
182 |
x="21" y="2" width="15"> |
x="21" y="2" width="15" > |
183 |
<trigger type="Pre-Focusout" src="searchProductTrigger" /> |
<trigger type="Pre-Focusout" src="searchProductTrigger" /> |
184 |
</entry> |
</entry> |
185 |
</block> |
</block> |
187 |
<!-- Parte oculta --> |
<!-- Parte oculta --> |
188 |
<!--búsqueda del arbol de lista de precios --> |
<!--búsqueda del arbol de lista de precios --> |
189 |
<datasource database="papo" name="treePriceTypeDataSource" table="pricetype"/> |
<datasource database="papo" name="treePriceTypeDataSource" table="pricetype"/> |
|
<box label="oculto" x="5" y="10" height="5" width="84"> |
|
190 |
<block name="treePriceTypeBlock" datasource="treePriceTypeDataSource"> |
<block name="treePriceTypeBlock" datasource="treePriceTypeDataSource"> |
191 |
<entry name="treePriceTypeParentId" field="parent" x="1" y="2" width="40"/> |
<entry name="treePriceTypeParentId" field="parent" x="1" |
192 |
<entry name="treePriceTypeId" field="id" x="40" y="2" width="10" /> |
y="2" width="40" hidden=""/> |
193 |
|
<entry name="treePriceTypeId" field="id" x="40" y="2" width="10" hidden="" /> |
194 |
</block> |
</block> |
|
</box> |
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
<!--/busqueda del arbol de lista de precios raiz --> |
<!--/busqueda del arbol de lista de precios raiz --> |
|
|
|
|
|
|
196 |
<datasource database="papo" name="productResultDataSource" |
<datasource database="papo" name="productResultDataSource" |
197 |
table="productcodetype,productcode,product,price,pricetype" |
table="productcodetype,productcode,product,price,pricetype" |
198 |
order_by = "product.name,pricetype.id desc" > |
order_by = "product.name,pricetype.id desc" > |
|
|
|
199 |
<condition> |
<condition> |
200 |
<and> |
<and> |
201 |
<eq> |
<eq> |
214 |
<cfield name="pricetype.id"/> |
<cfield name="pricetype.id"/> |
215 |
<cfield name="price.type"/> |
<cfield name="price.type"/> |
216 |
</eq> |
</eq> |
217 |
|
<null> |
218 |
|
<cfield name="price.end_t"/> |
219 |
|
</null> |
220 |
</and> |
</and> |
221 |
</condition> |
</condition> |
222 |
</datasource> |
</datasource> |
223 |
|
<block name="resultProductBlock" datasource="productResultDataSource"> |
224 |
<box label="esto se va a ocultar" x="0" y="8" height="11" width="84"> |
<entry name="productNameListEntry" field="product.name" x="1" y="1" width="15" rows="2" hidden=""/> |
225 |
<block name="resultProductBlock" datasource="productResultDataSource"> |
<entry name="productIdListEntry" field="product.id" x="15" y="1" width="5" rows="2" hidden=""/> |
226 |
<entry name="productNameListEntry" field="product.name" x="1" y="1" width="15" rows="8"/> |
<entry name="productCodeListEntry" field="productcode.code" x="20" y="1" width="10" rows="2" hidden=""/> |
227 |
<entry name="productIdListEntry" field="product.id" x="15" y="1" width="5" rows="8"/> |
<entry name="productCodeTypeListEntry" field="productcode.type" x="30" y="1" width="5" rows="2" hidden=""/> |
228 |
<entry name="productCodeListEntry" field="productcode.code" x="20" y="1" width="10" rows="8"/> |
<entry name="productPriceTypeListEntry" field="pricetype.name" x="35 " y="1" width="10" rows="2" hidden=""/> |
229 |
<entry name="productCodeTypeListEntry" field="productcode.type" x="30" y="1" width="5" rows="8"/> |
<entry name="productPriceTypeIdListEntry" field="pricetype.id" x="45" y="1" width="5" rows="2" hidden=""/> |
230 |
<entry name="productPriceTypeListEntry" field="pricetype.name" x="35 " y="1" width="10" rows="8"/> |
<entry name="productPriceListEntry" field="price.unit_price" |
231 |
<entry name="productPriceTypeIdListEntry" field="pricetype.id" x="45" y="1" width="5" rows="8"/> |
x="50" y="1" width="20" rows="2" hidden=""/> |
|
<entry name="productPriceListEntry" field="price.unit_price" x="50" y="1" width="20" rows="8"/> |
|
232 |
</block> |
</block> |
233 |
</box> |
<!-- /parte oculta--> |
|
<!-- /parte oculta--> |
|
234 |
<!-- ingreso visible --> |
<!-- ingreso visible --> |
235 |
<datasource name="priceModifyDataSource" cache="100"/> |
<datasource name="priceModifyDataSource" cache="100"/> |
236 |
<box label="esto se va a ver" x="0" y="18" height="11" width="84"> |
<box label="Modificacion de precios" x="0" y="8" height="14" width="84"> |
237 |
<block name="priceModifyBlock" datasource="priceModifyDataSource"> |
<block name="priceModifyBlock" datasource="priceModifyDataSource"> |
238 |
<label name="priceModifyNameListLabel" text="Nombre" x="1" y="1"/> |
<label name="priceModifyNameListLabel" text="Nombre" x="1" y="1"/> |
239 |
<label name="priceModifyCodeListLabel" text="Código" x="20" y="1"/> |
<label name="priceModifyCodeListLabel" text="Código" x="20" y="1"/> |
242 |
<entry name="priceModifyNameListEntry" x="1" y="2" width="20" rows="8"/> |
<entry name="priceModifyNameListEntry" x="1" y="2" width="20" rows="8"/> |
243 |
<entry name="priceModifyCodeListEntry" x="20" y="2" width="15" rows="8"/> |
<entry name="priceModifyCodeListEntry" x="20" y="2" width="15" rows="8"/> |
244 |
<entry name="priceModifyPriceTypeListEntry" x="35 " y="2" width="20" rows="8"/> |
<entry name="priceModifyPriceTypeListEntry" x="35 " y="2" width="20" rows="8"/> |
245 |
<entry name="priceModifyPriceListEntry" x="55" y="2" |
<entry name="priceModifyPriceListEntry" x="55" y="2" width="10" rows="8"/> |
246 |
width="10" rows="8"/> |
<entry name="priceModifyPricePreviousListEntry" x="65" y="2" |
247 |
<entry name="priceModifyProductIdListEntry" x="65" y="2" |
width="10" rows="8" hidden=""/> |
248 |
width="5" rows="8"/> |
<entry name="priceModifyProductIdListEntry" x="75" y="2" |
249 |
</block> |
width="5" rows="8" hidden=""/> |
250 |
|
<entry name="priceModifyPriceListIdListEntry" x="80" y="2" |
251 |
|
width="5" rows="8" hidden=""/> |
252 |
|
<scrollbar page="3" x="65" y="2" width="1" height="8"/> |
253 |
|
<button x="1" y="11" trigger="priceModifyCommitTrigger" width="9" label="Aceptar" |
254 |
|
name="priceModifyCommitBtn" height="1"/> |
255 |
|
<button x="11" y="11" trigger="priceModifyRollbackTrigger" width="9" label="Cancelar" |
256 |
|
name="priceModifyRollbackBtn" height="1"/> |
257 |
|
</block> |
258 |
</box> |
</box> |
259 |
<!-- /ingreso visible --> |
<!-- /ingreso visible --> |
260 |
|
<!-- carga oculta--> |
261 |
|
<datasource database="papo" name="priceCommitDataSource" table="price" > |
262 |
|
<condition> |
263 |
|
<null> |
264 |
|
<cfield name="price.end_t"/> |
265 |
|
</null> |
266 |
|
</condition> |
267 |
|
</datasource> |
268 |
|
<block name="priceCommitDataBlock" datasource="priceCommitDataSource"> |
269 |
|
<entry name="priceCommitProductIdEntry" field="product" x="1" y="2" width="20" hidden=""/> |
270 |
|
<entry name="priceCommitPriceTypeEntry" field="type" x="20" y="2" width="20" hidden=""/> |
271 |
|
<entry name="priceCommitPriceEntry" field="unit_price" x="40" y="2" width="20" hidden=""/> |
272 |
|
</block> |
273 |
|
|
274 |
|
<!-- /carga oculta--> |
275 |
</page> |
</page> |
276 |
</form> |
</form> |
277 |
|
|