1 |
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- xml -*- --> |
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- xml -*- --> |
2 |
|
|
3 |
<form tabbed="top" title="Productes" height="18" width="64"> |
<form tabbed="top" title="Productos" height="18" width="64"> |
4 |
<!-- <maintoolbar enabled=""/> --> |
<!-- <maintoolbar enabled=""/> --> |
5 |
<datasource name="focusDataSource" cache="1"/> |
<datasource name="focusDataSource" cache="1"/> |
6 |
<datasource name="searchDataSource" cache="1"/> |
<datasource name="searchDataSource" cache="1"/> |
9 |
FIXME: faltan cosas (ver productDS) |
FIXME: faltan cosas (ver productDS) |
10 |
--> |
--> |
11 |
<datasource name="productResultDataSource" database="papo" |
<datasource name="productResultDataSource" database="papo" |
12 |
table="product, _product_data, price, _price_data" |
table="product, _product_data, price, _price_data, product_code, _product_code_data" |
13 |
historytable="_product_data, _price_data"> |
historytable="_product_data, _price_data, _product_code_data"> |
14 |
<condition> |
<condition> |
15 |
<and> |
<and> |
16 |
<!-- pega product con su _data --> |
<!-- pega product con su _data --> |
18 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
19 |
<cfield name="_product_data._table"/> |
<cfield name="_product_data._table"/> |
20 |
</eq> |
</eq> |
21 |
<!-- pega product con su price --> |
<!-- descarta productos muertos --> |
22 |
|
<null> |
23 |
|
<cfield name="_product_data._end_t"/> |
24 |
|
</null> |
25 |
|
<!-- pega product con price --> |
26 |
<eq> |
<eq> |
27 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
28 |
<cfield name="_price_data.product"/> |
<cfield name="_price_data.product"/> |
32 |
<cfield name="price.id"/> |
<cfield name="price.id"/> |
33 |
<cfield name="_price_data._table"/> |
<cfield name="_price_data._table"/> |
34 |
</eq> |
</eq> |
35 |
<!-- solamente el price base (type 1) --> |
<!-- solamente lista 1 --> |
36 |
<eq> |
<eq> |
37 |
<cfield name="_price_data.price_type"/> |
<cfield name="_price_data.price_type"/> |
38 |
<cconst value="1"/> |
<cconst value="1"/> |
39 |
</eq> |
</eq> |
40 |
<!-- descarta productos muertos --> |
<!-- descarta precios muertos --> |
41 |
<null> |
<null> |
42 |
<cfield name="_product_data._end_t"/> |
<cfield name="_price_data._end_t"/> |
43 |
|
</null> |
44 |
|
<!-- pega product con product_code --> |
45 |
|
<eq> |
46 |
|
<cfield name="product.id"/> |
47 |
|
<cfield name="_product_code_data.product"/> |
48 |
|
</eq> |
49 |
|
<!-- pega product_code con su _data --> |
50 |
|
<eq> |
51 |
|
<cfield name="product_code.id"/> |
52 |
|
<cfield name="_product_code_data._table"/> |
53 |
|
</eq> |
54 |
|
<!-- solamente códigos internos (id 1) --> |
55 |
|
<eq> |
56 |
|
<cfield name="_product_code_data.product_code_type"/> |
57 |
|
<cconst value="1"/> |
58 |
|
</eq> |
59 |
|
<!-- descarta códigos de producto muertos --> |
60 |
|
<null> |
61 |
|
<cfield name="_product_code_data._end_t"/> |
62 |
</null> |
</null> |
63 |
</and> |
</and> |
64 |
</condition> |
</condition> |
67 |
<!-- lo mismo que arriba, el anterior es para buscar, este para |
<!-- lo mismo que arriba, el anterior es para buscar, este para |
68 |
ABM de uno en particular (segunda pantaia) --> |
ABM de uno en particular (segunda pantaia) --> |
69 |
<datasource name="productDataSource" database="papo" |
<datasource name="productDataSource" database="papo" |
70 |
table="product, _product_data, price, _price_data" |
table="product, _product_data, price, _price_data, product_code, _product_code_data" |
71 |
historytable="_product_data, _price_data"> |
historytable="_product_data, _price_data, _product_code_data"> |
72 |
<condition> |
<condition> |
73 |
<and> |
<and> |
74 |
<!-- pega product con su _data --> |
<!-- pega product con su _data --> |
76 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
77 |
<cfield name="_product_data._table"/> |
<cfield name="_product_data._table"/> |
78 |
</eq> |
</eq> |
79 |
<!-- pega product con su price --> |
<!-- descarta productos muertos --> |
80 |
|
<null> |
81 |
|
<cfield name="_product_data._end_t"/> |
82 |
|
</null> |
83 |
|
<!-- pega product con price --> |
84 |
<eq> |
<eq> |
85 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
86 |
<cfield name="_price_data.product"/> |
<cfield name="_price_data.product"/> |
90 |
<cfield name="price.id"/> |
<cfield name="price.id"/> |
91 |
<cfield name="_price_data._table"/> |
<cfield name="_price_data._table"/> |
92 |
</eq> |
</eq> |
93 |
<!-- solamente el price base (type 1) --> |
<!-- solamente lista 1 --> |
94 |
<eq> |
<eq> |
95 |
<cfield name="_price_data.price_type"/> |
<cfield name="_price_data.price_type"/> |
96 |
<cconst value="1"/> |
<cconst value="1"/> |
97 |
</eq> |
</eq> |
98 |
<!-- descarta productos muertos --> |
<!-- descarta precios muertos --> |
99 |
<null> |
<null> |
100 |
<cfield name="_product_data._end_t"/> |
<cfield name="_price_data._end_t"/> |
101 |
|
</null> |
102 |
|
<!-- pega product con product_code --> |
103 |
|
<eq> |
104 |
|
<cfield name="product.id"/> |
105 |
|
<cfield name="_product_code_data.product"/> |
106 |
|
</eq> |
107 |
|
<!-- pega product_code con su _data --> |
108 |
|
<eq> |
109 |
|
<cfield name="product_code.id"/> |
110 |
|
<cfield name="_product_code_data._table"/> |
111 |
|
</eq> |
112 |
|
<!-- solamente códigos internos (id 1) --> |
113 |
|
<eq> |
114 |
|
<cfield name="_product_code_data.product_code_type"/> |
115 |
|
<cconst value="1"/> |
116 |
|
</eq> |
117 |
|
<!-- descarta códigos de producto muertos --> |
118 |
|
<null> |
119 |
|
<cfield name="_product_code_data._end_t"/> |
120 |
</null> |
</null> |
121 |
</and> |
</and> |
122 |
</condition> |
</condition> |
123 |
</datasource> |
</datasource> |
124 |
|
|
125 |
|
|
126 |
<datasource name="product_measureDataSource" database="papo" table="product_measure, _product_measure_data" historytable="_product_measure_data"/> |
<datasource name="product_measureDataSource" database="papo" table="product_measure, _product_measure_data" historytable="_product_measure_data"/> |
127 |
|
|
128 |
<!-- datasources para dropdowns: con buscar los not null en _data estamos --> |
<!-- datasources para dropdowns: con buscar los not null en _data estamos --> |
164 |
|
|
165 |
<trigger name="productCommitTrigger" type="NAMED"> |
<trigger name="productCommitTrigger" type="NAMED"> |
166 |
productBlock.priceTypeEntry = 1 |
productBlock.priceTypeEntry = 1 |
167 |
|
productBlock.productCodeTypeEntry = 1 |
168 |
productBlock.commit() |
productBlock.commit() |
169 |
|
productBlock.jumpRecord(2) |
170 |
</trigger> |
</trigger> |
171 |
|
|
172 |
|
|
173 |
<trigger name="productDeleteTrigger" type="NAMED"> |
<trigger name="productDeleteTrigger" type="NAMED"> |
174 |
import hack |
import hack |
182 |
|
|
183 |
<trigger name="askForChangesTrigger" type="NAMED"> |
<trigger name="askForChangesTrigger" type="NAMED"> |
184 |
import hack |
import hack |
185 |
hack.confirmPageChanges(self, self.productCommitTrigger, productBlock) |
|
186 |
|
def foo(): |
187 |
|
productBlock.priceTypeEntry = 1 |
188 |
|
productBlock.productCodeTypeEntry = 1 |
189 |
|
productBlock.commit() |
190 |
|
productBlock.jumpRecord(2) |
191 |
|
|
192 |
|
hack.confirmPageChanges(self, foo, productBlock) |
193 |
</trigger> |
</trigger> |
194 |
|
|
195 |
<trigger name="productSearchTrigger" type="NAMED"> |
<trigger name="productSearchTrigger" type="NAMED"> |
196 |
import hack |
import hack |
197 |
hack.search(productResultBlock, |
|
198 |
productSearchBlock.searchNameEntry, |
hack.search(productResultBlock, productSearchBlock.searchNameEntry, productResultBlock.nameListEntry) |
|
productResultBlock.productIdREntry) |
|
199 |
</trigger> |
</trigger> |
200 |
|
|
201 |
<page name="Productos"> |
<page name="Productos"> |
220 |
</trigger> |
</trigger> |
221 |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock=""> |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock=""> |
222 |
<label text="Nombre canónico del producto a buscar" x="1" y="1"/> |
<label text="Nombre canónico del producto a buscar" x="1" y="1"/> |
223 |
<entry name="searchNameEntry" x="1" y="2" width="35"/> |
<entry name="searchNameEntry" x="1" y="2" width="35"/> |
224 |
<button x="36" y="2" trigger="productSearchTrigger" width="9" label="Buscar" |
<button x="36" y="2" trigger="productSearchTrigger" width="9" label="Buscar" |
225 |
name="searchBtn" height="1"/> |
name="searchBtn" height="1"/> |
226 |
</block> |
</block> |
227 |
<block name="productResultBlock" datasource="productResultDataSource"> |
<block name="productResultBlock" datasource="productResultDataSource"> |
228 |
<entry name="productIdREntry" field="product.id" hidden="true" x="1" y="1" width="20" /> |
<entry name="productIdREntry" field="product.id" hidden="true" x="1" y="1" width="20" /> |
238 |
<block name="productBlock" datasource="productDataSource"> |
<block name="productBlock" datasource="productDataSource"> |
239 |
<entry x="0" y="0" name="priceTypeEntry" |
<entry x="0" y="0" name="priceTypeEntry" |
240 |
field="_price_data.price_type" hidden="sure thing"/> |
field="_price_data.price_type" hidden="sure thing"/> |
241 |
|
<entry x="0" y="0" name="productCodeTypeEntry" |
242 |
|
field="_product_code_data.product_code_type" hidden="yeap"/> |
243 |
<entry name="productIdEntry" field="product.id" hidden="true" |
<entry name="productIdEntry" field="product.id" hidden="true" |
244 |
x="1" y="1" width="20"/> |
x="1" y="1" width="20"/> |
245 |
<label text="Nombre Canónico:" x="1" y="1"/> |
<label text="Nombre Canónico:" x="1" y="1"/> |
262 |
foreign_key_description="name"/> |
foreign_key_description="name"/> |
263 |
<label x="1" y="9" text="Precio unitario base"/> |
<label x="1" y="9" text="Precio unitario base"/> |
264 |
<entry x="1" y="10" name="priceEntry" field="_price_data.unit_price"/> |
<entry x="1" y="10" name="priceEntry" field="_price_data.unit_price"/> |
265 |
|
<label x="1" y="11" text="Código interno"/> |
266 |
|
<entry x="1" y="12" name="priceEntry" field="_product_code_data.code"/> |
267 |
<button x="1" y="17" trigger="productCommitTrigger" width="9" label="Aceptar" |
<button x="1" y="17" trigger="productCommitTrigger" width="9" label="Aceptar" |
268 |
name="productCommitBtn" height="1"/> |
name="productCommitBtn" height="1"/> |
269 |
<button x="11" y="17" trigger="productDeleteTrigger" width="9" label="Borrar" |
<button x="11" y="17" trigger="productDeleteTrigger" width="9" label="Borrar" |