3 |
|
|
4 |
<form tabbed="top" title="Listas de Precios" |
<form tabbed="top" title="Listas de Precios" |
5 |
height="23" width="74"> |
height="23" width="74"> |
6 |
|
|
7 |
|
<parameter name="initId" default=""/> |
8 |
|
|
9 |
<datasource name="searchDataSource" cache="1"/> |
<datasource name="searchDataSource" cache="1"/> |
10 |
<datasource database="papo" name="priceTypeResultDataSource" table="price_type, _price_type_data" historytable="_price_type_data"> |
<datasource database="papo" name="priceTypeResultDataSource" table="price_type, _price_type_data" historytable="_price_type_data"> |
11 |
<condition> |
<condition> |
38 |
<datasource database="papo" name="parentPriceTypeDataSource" table="_price_type_data"> |
<datasource database="papo" name="parentPriceTypeDataSource" table="_price_type_data"> |
39 |
<condition> |
<condition> |
40 |
<and> |
<and> |
41 |
<null> |
<eq> |
42 |
<cfield name="_price_type_data.parent"/> |
<cfield name="_price_type_data.is_active"/> |
43 |
</null> |
<cconst value="S"/> |
44 |
|
</eq> |
45 |
<null> |
<null> |
46 |
<cfield name="_price_type_data._end_t"/> |
<cfield name="_price_type_data._end_t"/> |
47 |
</null> |
</null> |
64 |
</condition> |
</condition> |
65 |
</datasource> |
</datasource> |
66 |
|
|
67 |
|
<trigger type="On-Startup"> |
68 |
|
#print "parameter = '%s'" % getParameter('initId') |
69 |
|
</trigger> |
70 |
|
|
71 |
<trigger name="askForChangesTrigger" type="NAMED"> |
<trigger name="askForChangesTrigger" type="NAMED"> |
72 |
import hack |
import hack |
73 |
hack.confirmPageChanges(self, self.commitTrigger, priceTypeBlock) |
hack.confirmPageChanges(self, self.commitTrigger, priceTypeBlock) |
74 |
</trigger> |
</trigger> |
75 |
|
|
76 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
77 |
if priceTypeBlock.getCurrentRecord().isInserted(): |
if str(priceTypeBlock.priceTypeIdEntry) == "1": |
78 |
priceTypeBlock.commit() |
genericBox('La lista base no se puede modificar',['OK']) |
79 |
priceTypeBlock.jumpRecord(2) |
priceTypeBlock.processRollback(1) |
|
tmpId = str(priceTypeBlock.priceTypeIdEntry) |
|
|
priceTypeBlock.processRollback() |
|
|
priceTypeBlock.initQuery() |
|
|
priceTypeBlock.priceTypeIdEntry = tmpId |
|
|
priceTypeBlock.processQuery() |
|
80 |
else: |
else: |
81 |
priceTypeBlock.commit() |
if not str(priceTypeBlock.parentPriceTypeEntry): |
82 |
|
genericBox('Debe seleccionar la lista en que se basa esta.',['OK']) |
83 |
|
elif str(priceTypeBlock.parentPriceTypeEntry) == str(priceTypeBlock.priceTypeIdEntry): |
84 |
|
genericBox('La lista no puede basarse en si misma.',['OK']) |
85 |
|
else: |
86 |
|
if priceTypeBlock.getCurrentRecord().isInserted(): |
87 |
|
priceTypeBlock.commit() |
88 |
|
priceTypeBlock.jumpRecord(2) |
89 |
|
tmpId = str(priceTypeBlock.priceTypeIdEntry) |
90 |
|
priceTypeBlock.processRollback() |
91 |
|
priceTypeBlock.initQuery() |
92 |
|
priceTypeBlock.priceTypeIdEntry = tmpId |
93 |
|
priceTypeBlock.processQuery() |
94 |
|
else: |
95 |
|
priceTypeBlock.commit() |
96 |
</trigger> |
</trigger> |
97 |
|
|
98 |
<trigger name="priceTypeDeleteTrigger" type="NAMED"> |
<trigger name="priceTypeDeleteTrigger" type="NAMED"> |
121 |
if priceTypeResultBlock.getRecordCount() > 0 and not priceTypeResultBlock.getCurrentRecord().isEmpty(): |
if priceTypeResultBlock.getRecordCount() > 0 and not priceTypeResultBlock.getCurrentRecord().isEmpty(): |
122 |
priceTypeBlock.initQuery() |
priceTypeBlock.initQuery() |
123 |
priceTypeBlock.priceTypeIdEntry = ("%s" % priceTypeResultBlock.priceTypeIdREntry) |
priceTypeBlock.priceTypeIdEntry = ("%s" % priceTypeResultBlock.priceTypeIdREntry) |
|
print "priceTypeBlock.priceTypeIdEntry", priceTypeBlock.priceTypeIdEntry |
|
|
print "priceTypeResultBlock.priceTypeIdREntry",priceTypeResultBlock.priceTypeIdREntry |
|
124 |
priceTypeBlock.processQuery() |
priceTypeBlock.processQuery() |
125 |
</trigger> |
</trigger> |
126 |
<block name="searchPriceListBlock" datasource="searchDataSource" transparentBlock=""> |
<block name="searchPriceListBlock" datasource="searchDataSource" transparentBlock=""> |
161 |
<label text="Esta lista esta basada en la lista ..." |
<label text="Esta lista esta basada en la lista ..." |
162 |
x="1" y="5"/> |
x="1" y="5"/> |
163 |
<entry x="1" y="6" field="_price_type_data.parent" |
<entry x="1" y="6" field="_price_type_data.parent" |
164 |
name="taxProfileEntry" |
name="parentPriceTypeEntry" |
165 |
width="35" style="dropdown" foreign_key="parentPriceTypeDataSource._table" |
width="35" style="dropdown" foreign_key="parentPriceTypeDataSource._table" |
166 |
foreign_key_description="name" /> |
foreign_key_description="name"> |
167 |
|
<trigger type="PRE-FOCUSOUT" name="fo"> |
168 |
|
if str(priceTypeBlock.priceTypeIdEntry) == "1": |
169 |
|
priceTypeBlock.processRollback(1) |
170 |
|
</trigger> |
171 |
|
</entry> |
172 |
<button x="1" y="17" trigger="commitTrigger" width="9" label="Aceptar" |
<button x="1" y="17" trigger="commitTrigger" width="9" label="Aceptar" |
173 |
name="priceTypeCommitBtn" height="1"/> |
name="priceTypeCommitBtn" height="1"/> |
174 |
<button x="11" y="17" trigger="priceTypeDeleteTrigger" width="9" label="Borrar" |
<button x="11" y="17" trigger="priceTypeDeleteTrigger" width="9" label="Borrar" |
303 |
x="1" y="1"/> |
x="1" y="1"/> |
304 |
<entry name="searchProductByNameEntry" |
<entry name="searchProductByNameEntry" |
305 |
x="1" y="2" width="15"> |
x="1" y="2" width="15"> |
306 |
<trigger type="Pre-Focusout" src="searchProductTrigger" /> |
<!-- <trigger type="Pre-Focusout" src="searchProductTrigger" /> --> |
307 |
</entry> |
</entry> |
308 |
</block> |
</block> |
309 |
<block name="searchProductByCodeBlock" datasource="searchProductByCodeDataSource" transparentBlock=""> |
<block name="searchProductByCodeBlock" datasource="searchProductByCodeDataSource" transparentBlock=""> |
311 |
x="21" y="1"/> |
x="21" y="1"/> |
312 |
<entry name="searchProductByCodeEntry" |
<entry name="searchProductByCodeEntry" |
313 |
x="21" y="2" width="15" > |
x="21" y="2" width="15" > |
|
<trigger type="Pre-Focusout" src="searchProductTrigger" /> |
|
314 |
</entry> |
</entry> |
315 |
|
<button x="37" y="2" trigger="searchProductTrigger" width="9" label="Buscar" |
316 |
|
name="searchBtn" height="1"/> |
317 |
</block> |
</block> |
318 |
</box> |
</box> |
319 |
<!-- Parte oculta --> |
<!-- Parte oculta --> |
335 |
<cfield name="product_code_type.id"/> |
<cfield name="product_code_type.id"/> |
336 |
<cfield name="_product_code_type_data._table"/> |
<cfield name="_product_code_type_data._table"/> |
337 |
</eq> |
</eq> |
338 |
|
<null> |
339 |
|
<cfield name="_product_code_type_data._end_t"/> |
340 |
|
</null> |
341 |
<eq> |
<eq> |
342 |
<cfield name="product_code.id"/> |
<cfield name="product_code.id"/> |
343 |
<cfield name="_product_code_data._table"/> |
<cfield name="_product_code_data._table"/> |
344 |
</eq> |
</eq> |
345 |
|
<null> |
346 |
|
<cfield name="_product_code_data._end_t"/> |
347 |
|
</null> |
348 |
<eq> |
<eq> |
349 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
350 |
<cfield name="_product_data._table"/> |
<cfield name="_product_data._table"/> |
351 |
</eq> |
</eq> |
352 |
|
<null> |
353 |
|
<cfield name="_product_data._end_t"/> |
354 |
|
</null> |
355 |
<eq> |
<eq> |
356 |
<cfield name="price.id"/> |
<cfield name="price.id"/> |
357 |
<cfield name="_price_data._table"/> |
<cfield name="_price_data._table"/> |
358 |
</eq> |
</eq> |
359 |
|
<null> |
360 |
|
<cfield name="_price_data._end_t"/> |
361 |
|
</null> |
362 |
<eq> |
<eq> |
363 |
<cfield name="price_type.id"/> |
<cfield name="price_type.id"/> |
364 |
<cfield name="_price_type_data._table"/> |
<cfield name="_price_type_data._table"/> |
365 |
</eq> |
</eq> |
366 |
|
<null> |
367 |
|
<cfield name="_price_type_data._end_t"/> |
368 |
|
</null> |
369 |
<eq> |
<eq> |
370 |
<cfield name="product_code_type.id"/> |
<cfield name="product_code_type.id"/> |
371 |
<cfield name="_product_code_type_data._table"/> |
<cfield name="_product_code_data.product_code_type"/> |
372 |
</eq> |
</eq> |
373 |
<eq> |
<eq> |
374 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
382 |
<cfield name="price_type.id"/> |
<cfield name="price_type.id"/> |
383 |
<cfield name="_price_data.price_type"/> |
<cfield name="_price_data.price_type"/> |
384 |
</eq> |
</eq> |
|
<null> |
|
|
<cfield name="_price_data._end_t"/> |
|
|
</null> |
|
385 |
</and> |
</and> |
386 |
</condition> |
</condition> |
387 |
</datasource> |
</datasource> |
388 |
<block name="resultProductBlock" datasource="productResultDataSource"> |
<block name="resultProductBlock" datasource="productResultDataSource"> |
389 |
<entry name="productNameListEntry" field="_product_data.canonical_name" x="1" y="1" width="15" rows="2" hidden=""/> |
<entry name="productNameListEntry" field="_product_data.canonical_name" x="1" y="1" width="15" rows="2" hidden=""/> |
390 |
<entry name="productIdListEntry" field="_product_data.id" x="15" y="1" width="5" rows="2" hidden=""/> |
<entry name="productIdListEntry" field="_product_data._table" x="15" y="1" width="5" rows="2" hidden=""/> |
391 |
<entry name="productCodeListEntry" field="_product_code_data.code" x="20" y="1" width="10" rows="2" hidden=""/> |
<entry name="productCodeListEntry" field="_product_code_data.code" x="20" y="1" width="10" rows="2" hidden=""/> |
392 |
<entry name="productCodeTypeListEntry" field="_product_code_data.product_code_type" x="30" y="1" width="5" rows="2" hidden=""/> |
<entry name="productCodeTypeListEntry" field="_product_code_data.product_code_type" x="30" y="1" width="5" rows="2" hidden=""/> |
393 |
<entry name="productPriceTypeListEntry" field="_price_type_data.name" x="35 " y="1" width="10" rows="2" hidden=""/> |
<entry name="productPriceTypeListEntry" field="_price_type_data.name" x="35 " y="1" width="10" rows="2" hidden=""/> |