1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
<?xml version="1.0" encoding="ISO-8859-1"?> |
2 |
|
|
3 |
<form tabbed="top" title="Productos" height="19" width="70"> |
<!-- GNUe Forms 0.5.0 Migration Tool |
4 |
<!-- <maintoolbar enabled=""/> --> |
Saved on: 2003-02-11 17:42:14 --> |
5 |
<datasource name="focusDataSource" cache="1"/> |
|
6 |
<datasource name="searchDataSource" cache="1"/> |
<form title="Productos"> |
7 |
<!-- |
<datasource name="taxDataSource" connection="papo" table="_tax_data"> |
8 |
datasource usado para la búsqueda (primer pantaia) |
<condition> |
9 |
--> |
<null> |
10 |
<datasource name="productResultDataSource" database="papo" |
<cfield name="_end_t"/> |
11 |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
</null> |
12 |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
</condition> |
13 |
cache="15" order_by="_product_data.canonical_name"> |
</datasource> |
14 |
|
<datasource name="countryDataSource" connection="papo" order_by="name" |
15 |
|
table="_country_data"> |
16 |
|
<condition> |
17 |
|
<null> |
18 |
|
<cfield name="_end_t"/> |
19 |
|
</null> |
20 |
|
</condition> |
21 |
|
</datasource> |
22 |
|
<datasource name="physicalStructureDataSource" connection="papo" |
23 |
|
order_by="name" table="_physical_structure_data"> |
24 |
|
<condition> |
25 |
|
<null> |
26 |
|
<cfield name="_end_t"/> |
27 |
|
</null> |
28 |
|
</condition> |
29 |
|
</datasource> |
30 |
|
<datasource name="productClassificationDataSource" connection="papo" |
31 |
|
order_by="name" table="_product_classification_data"> |
32 |
|
<condition> |
33 |
|
<and> |
34 |
|
<null> |
35 |
|
<cfield name="_end_t"/> |
36 |
|
</null> |
37 |
|
</and> |
38 |
|
</condition> |
39 |
|
</datasource> |
40 |
|
<datasource name="productDataSource" connection="papo" |
41 |
|
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" order_by="_product_data.canonical_name,_product_code_data.code" |
42 |
|
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data"> |
43 |
<condition> |
<condition> |
44 |
<and> |
<and> |
|
<!-- pega product con su _data --> |
|
45 |
<eq> |
<eq> |
46 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
47 |
<cfield name="_product_data._table"/> |
<cfield name="_product_data._table"/> |
48 |
</eq> |
</eq> |
|
<!-- descarta productos muertos --> |
|
49 |
<null> |
<null> |
50 |
<cfield name="_product_data._end_t"/> |
<cfield name="_product_data._end_t"/> |
51 |
</null> |
</null> |
|
<!-- pega product con price --> |
|
52 |
<eq> |
<eq> |
53 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
54 |
<cfield name="_price_data.product"/> |
<cfield name="_price_data.product"/> |
55 |
</eq> |
</eq> |
|
<!-- pega price con su _data --> |
|
56 |
<eq> |
<eq> |
57 |
<cfield name="price.id"/> |
<cfield name="price.id"/> |
58 |
<cfield name="_price_data._table"/> |
<cfield name="_price_data._table"/> |
59 |
</eq> |
</eq> |
|
<!-- solamente lista 1 --> |
|
60 |
<eq> |
<eq> |
61 |
<cfield name="_price_data.price_type"/> |
<cfield name="_price_data.price_type"/> |
62 |
<cconst value="1"/> |
<cconst value="1"/> |
63 |
</eq> |
</eq> |
|
<!-- descarta precios muertos --> |
|
64 |
<null> |
<null> |
65 |
<cfield name="_price_data._end_t"/> |
<cfield name="_price_data._end_t"/> |
66 |
</null> |
</null> |
|
<!-- pega product con product_code --> |
|
67 |
<eq> |
<eq> |
68 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
69 |
<cfield name="_product_code_data.product"/> |
<cfield name="_product_code_data.product"/> |
70 |
</eq> |
</eq> |
|
<!-- pega product_code con su _data --> |
|
71 |
<eq> |
<eq> |
72 |
<cfield name="product_code.id"/> |
<cfield name="product_code.id"/> |
73 |
<cfield name="_product_code_data._table"/> |
<cfield name="_product_code_data._table"/> |
74 |
</eq> |
</eq> |
|
<!-- solamente códigos internos (id 1) --> |
|
75 |
<eq> |
<eq> |
76 |
<cfield name="_product_code_data.product_code_type"/> |
<cfield name="_product_code_data.product_code_type"/> |
77 |
<cconst value="1"/> |
<cconst value="1"/> |
78 |
</eq> |
</eq> |
|
<!-- descarta códigos de producto muertos --> |
|
79 |
<null> |
<null> |
80 |
<cfield name="_product_code_data._end_t"/> |
<cfield name="_product_code_data._end_t"/> |
81 |
</null> |
</null> |
|
<!-- pega product con product_tax --> |
|
82 |
<eq> |
<eq> |
83 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
84 |
<cfield name="_product_tax_data.product"/> |
<cfield name="_product_tax_data.product"/> |
85 |
</eq> |
</eq> |
|
<!-- pega product_tax con su _data --> |
|
86 |
<eq> |
<eq> |
87 |
<cfield name="product_tax.id"/> |
<cfield name="product_tax.id"/> |
88 |
<cfield name="_product_tax_data._table"/> |
<cfield name="_product_tax_data._table"/> |
89 |
</eq> |
</eq> |
|
<!-- descarta product_taxes muertos --> |
|
90 |
<null> |
<null> |
91 |
<cfield name="_product_tax_data._end_t"/> |
<cfield name="_product_tax_data._end_t"/> |
92 |
</null> |
</null> |
|
<!-- solamente 'IVA' (id 1) --> |
|
93 |
<eq> |
<eq> |
94 |
<cfield name="_product_tax_data.tax"/> |
<cfield name="_product_tax_data.tax"/> |
95 |
<cconst value="1"/> |
<cconst value="1"/> |
96 |
</eq> |
</eq> |
|
<!-- pega product con product_store --> |
|
97 |
<eq> |
<eq> |
98 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
99 |
<cfield name="_product_store_data.product"/> |
<cfield name="_product_store_data.product"/> |
100 |
</eq> |
</eq> |
|
<!-- pega product_store con su _data --> |
|
101 |
<eq> |
<eq> |
102 |
<cfield name="product_store.id"/> |
<cfield name="product_store.id"/> |
103 |
<cfield name="_product_store_data._table"/> |
<cfield name="_product_store_data._table"/> |
104 |
</eq> |
</eq> |
|
<!-- descarta product_stores muertos --> |
|
105 |
<null> |
<null> |
106 |
<cfield name="_product_store_data._end_t"/> |
<cfield name="_product_store_data._end_t"/> |
107 |
</null> |
</null> |
|
<!-- FALTA: product_store.storehouse --> |
|
108 |
</and> |
</and> |
109 |
</condition> |
</condition> |
110 |
</datasource> |
</datasource> |
111 |
|
<datasource name="productResultDataSource" cache="15" connection="papo" |
112 |
<!-- lo mismo que arriba, el anterior es para buscar, este para |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" order_by="_product_data.canonical_name" |
113 |
ABM de uno en particular (segunda pantaia) --> |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data"> |
|
<datasource name="productDataSource" database="papo" |
|
|
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
|
|
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
|
|
order_by="_product_data.canonical_name,_product_code_data.code"> |
|
114 |
<condition> |
<condition> |
115 |
<and> |
<and> |
|
<!-- pega product con su _data --> |
|
116 |
<eq> |
<eq> |
117 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
118 |
<cfield name="_product_data._table"/> |
<cfield name="_product_data._table"/> |
119 |
</eq> |
</eq> |
|
<!-- descarta productos muertos --> |
|
120 |
<null> |
<null> |
121 |
<cfield name="_product_data._end_t"/> |
<cfield name="_product_data._end_t"/> |
122 |
</null> |
</null> |
|
<!-- pega product con price --> |
|
123 |
<eq> |
<eq> |
124 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
125 |
<cfield name="_price_data.product"/> |
<cfield name="_price_data.product"/> |
126 |
</eq> |
</eq> |
|
<!-- pega price con su _data --> |
|
127 |
<eq> |
<eq> |
128 |
<cfield name="price.id"/> |
<cfield name="price.id"/> |
129 |
<cfield name="_price_data._table"/> |
<cfield name="_price_data._table"/> |
130 |
</eq> |
</eq> |
|
<!-- solamente lista 1 --> |
|
131 |
<eq> |
<eq> |
132 |
<cfield name="_price_data.price_type"/> |
<cfield name="_price_data.price_type"/> |
133 |
<cconst value="1"/> |
<cconst value="1"/> |
134 |
</eq> |
</eq> |
|
<!-- descarta precios muertos --> |
|
135 |
<null> |
<null> |
136 |
<cfield name="_price_data._end_t"/> |
<cfield name="_price_data._end_t"/> |
137 |
</null> |
</null> |
|
<!-- pega product con product_code --> |
|
138 |
<eq> |
<eq> |
139 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
140 |
<cfield name="_product_code_data.product"/> |
<cfield name="_product_code_data.product"/> |
141 |
</eq> |
</eq> |
|
<!-- pega product_code con su _data --> |
|
142 |
<eq> |
<eq> |
143 |
<cfield name="product_code.id"/> |
<cfield name="product_code.id"/> |
144 |
<cfield name="_product_code_data._table"/> |
<cfield name="_product_code_data._table"/> |
145 |
</eq> |
</eq> |
|
<!-- solamente códigos internos (id 1) --> |
|
146 |
<eq> |
<eq> |
147 |
<cfield name="_product_code_data.product_code_type"/> |
<cfield name="_product_code_data.product_code_type"/> |
148 |
<cconst value="1"/> |
<cconst value="1"/> |
149 |
</eq> |
</eq> |
|
<!-- descarta códigos de producto muertos --> |
|
150 |
<null> |
<null> |
151 |
<cfield name="_product_code_data._end_t"/> |
<cfield name="_product_code_data._end_t"/> |
152 |
</null> |
</null> |
|
<!-- pega product con product_tax --> |
|
153 |
<eq> |
<eq> |
154 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
155 |
<cfield name="_product_tax_data.product"/> |
<cfield name="_product_tax_data.product"/> |
156 |
</eq> |
</eq> |
|
<!-- pega product_tax con su _data --> |
|
157 |
<eq> |
<eq> |
158 |
<cfield name="product_tax.id"/> |
<cfield name="product_tax.id"/> |
159 |
<cfield name="_product_tax_data._table"/> |
<cfield name="_product_tax_data._table"/> |
160 |
</eq> |
</eq> |
|
<!-- descarta product_taxes muertos --> |
|
161 |
<null> |
<null> |
162 |
<cfield name="_product_tax_data._end_t"/> |
<cfield name="_product_tax_data._end_t"/> |
163 |
</null> |
</null> |
|
<!-- solamente 'IVA' (id 1) --> |
|
164 |
<eq> |
<eq> |
165 |
<cfield name="_product_tax_data.tax"/> |
<cfield name="_product_tax_data.tax"/> |
166 |
<cconst value="1"/> |
<cconst value="1"/> |
167 |
</eq> |
</eq> |
|
<!-- pega product con product_store --> |
|
168 |
<eq> |
<eq> |
169 |
<cfield name="product.id"/> |
<cfield name="product.id"/> |
170 |
<cfield name="_product_store_data.product"/> |
<cfield name="_product_store_data.product"/> |
171 |
</eq> |
</eq> |
|
<!-- pega product_store con su _data --> |
|
172 |
<eq> |
<eq> |
173 |
<cfield name="product_store.id"/> |
<cfield name="product_store.id"/> |
174 |
<cfield name="_product_store_data._table"/> |
<cfield name="_product_store_data._table"/> |
175 |
</eq> |
</eq> |
|
<!-- descarta product_stores muertos --> |
|
176 |
<null> |
<null> |
177 |
<cfield name="_product_store_data._end_t"/> |
<cfield name="_product_store_data._end_t"/> |
178 |
</null> |
</null> |
|
<!-- FALTA: product_store.storehouse --> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<!-- datasources para dropdowns: con buscar los not null en _data estamos --> |
|
|
|
|
|
<datasource name="productClassificationDataSource" database="papo" |
|
|
table="_product_classification_data" order_by="name"> |
|
|
<condition> |
|
|
<and> |
|
|
<null> |
|
|
<cfield name="_end_t"/> |
|
|
</null> |
|
179 |
</and> |
</and> |
180 |
</condition> |
</condition> |
181 |
</datasource> |
</datasource> |
182 |
|
<datasource name="searchDataSource" cache="1"/> |
183 |
<datasource name="physicalStructureDataSource" database="papo" |
<datasource name="focusDataSource" cache="1"/> |
|
table="_physical_structure_data" order_by="name"> |
|
|
<condition> |
|
|
<null> |
|
|
<cfield name="_end_t"/> |
|
|
</null> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="countryDataSource" database="papo" |
|
|
table="_country_data" order_by="name"> |
|
|
<condition> |
|
|
<null> |
|
|
<cfield name="_end_t"/> |
|
|
</null> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="taxDataSource" database="papo" table="_tax_data"> |
|
|
<condition> |
|
|
<null> |
|
|
<cfield name="_end_t"/> |
|
|
</null> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
184 |
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
185 |
import tempfile |
import tempfile |
186 |
import os |
import os |
196 |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
197 |
file = tempfile.mktemp('.product.html') |
file = tempfile.mktemp('.product.html') |
198 |
os.system("grcvs -D file -d %s --filter html ../report/product.grd" % file) |
os.system("grcvs -D file -d %s --filter html ../report/product.grd" % file) |
199 |
os.system(gConfig('PrintCommand') % (file)) |
os.system(gConfig('PrintCommand') % file) |
200 |
os.unlink(file) |
os.unlink(file) |
201 |
|
|
202 |
self._object.dispatchEvent(GFEvent('endWAIT')) |
self._object.dispatchEvent(GFEvent('endWAIT')) |
203 |
|
|
204 |
]]></trigger> |
]]></trigger> |
|
|
|
205 |
<trigger name="productCommitTrigger" type="NAMED"><![CDATA[ |
<trigger name="productCommitTrigger" type="NAMED"><![CDATA[ |
206 |
from hack import a2f |
from hack import a2f |
207 |
bad=0 |
bad=0 |
218 |
productBlock.productTaxEntry = 1 |
productBlock.productTaxEntry = 1 |
219 |
productBlock.levelEntry = 0 |
productBlock.levelEntry = 0 |
220 |
productBlock.commit() |
productBlock.commit() |
221 |
productBlock.jumpRecord(2) |
productBlock.gotoRecord(2) |
222 |
else: |
else: |
223 |
productBlock.commit() |
productBlock.commit() |
224 |
]]></trigger> |
]]></trigger> |
|
|
|
|
|
|
225 |
<trigger name="productDeleteTrigger" type="NAMED"><![CDATA[ |
<trigger name="productDeleteTrigger" type="NAMED"><![CDATA[ |
226 |
import hack |
import hack |
227 |
hack.deleteCurrentRecord(productBlock) |
hack.deleteCurrentRecord(productBlock) |
228 |
]]></trigger> |
]]></trigger> |
|
|
|
229 |
<trigger name="productRollbackTrigger" type="NAMED"><![CDATA[ |
<trigger name="productRollbackTrigger" type="NAMED"><![CDATA[ |
230 |
import hack |
import hack |
231 |
hack.rollback(productBlock) |
hack.rollback(productBlock) |
232 |
]]></trigger> |
]]></trigger> |
|
|
|
233 |
<trigger name="askForChangesTrigger" type="NAMED"><![CDATA[ |
<trigger name="askForChangesTrigger" type="NAMED"><![CDATA[ |
234 |
import hack |
import hack |
235 |
|
|
236 |
hack.confirmPageChanges(self, 'productCommitTrigger', productBlock) |
hack.confirmPageChanges(self, 'productCommitTrigger', productBlock) |
237 |
]]></trigger> |
]]></trigger> |
|
|
|
238 |
<trigger name="productSearchTrigger" type="NAMED"><![CDATA[ |
<trigger name="productSearchTrigger" type="NAMED"><![CDATA[ |
239 |
try: |
try: |
240 |
from gnue.forms.GFEvent import GFEvent |
from gnue.forms.GFEvent import GFEvent |
244 |
setStatusText('buscando...') |
setStatusText('buscando...') |
245 |
|
|
246 |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
247 |
productResultBlock.processRollback() |
productResultBlock.rollback() |
248 |
productResultBlock.initQuery() |
productResultBlock.initQuery() |
249 |
if str(productSearchBlock.searchCodeEntry): |
if str(productSearchBlock.searchCodeEntry): |
250 |
productResultBlock.codeListEntry = str(productSearchBlock.searchCodeEntry)+'%' |
productResultBlock.codeListEntry = str(productSearchBlock.searchCodeEntry)+'%' |
251 |
if str(productSearchBlock.searchNameEntry): |
if str(productSearchBlock.searchNameEntry): |
252 |
productResultBlock.nameListEntry = '%'+str(productSearchBlock.searchNameEntry)+'%' # |
productResultBlock.nameListEntry = '%'+str(productSearchBlock.searchNameEntry)+'%' # |
253 |
productResultBlock.processQuery() |
productResultBlock.executeQuery() |
254 |
|
|
255 |
setStatusText('Ok') |
setStatusText('Ok') |
256 |
self._object.dispatchEvent(GFEvent('endWAIT')) |
self._object.dispatchEvent(GFEvent('endWAIT')) |
261 |
productSearchBlock.funnyLabel ='%6d registros encontrados' % productResultBlock.getRecordCount() |
productSearchBlock.funnyLabel ='%6d registros encontrados' % productResultBlock.getRecordCount() |
262 |
|
|
263 |
]]></trigger> |
]]></trigger> |
264 |
|
<logic> |
265 |
<page name="Productos"> |
<block name="productSearchBlock" datasource="searchDataSource"> |
266 |
<trigger type="Pre-Focusout"><![CDATA[ |
<field name="searchNameEntry"/> |
267 |
productBlock.processRollback() |
<field name="searchCodeEntry"/> |
268 |
if productResultBlock.getRecordCount() > 0 and not productResultBlock.getCurrentRecord().isEmpty(): |
<field name="funnyLabel"/> |
|
productBlock.initQuery() |
|
|
productBlock.productIdEntry = ("%s" % productResultBlock.productIdREntry) |
|
|
productBlock.processQuery() |
|
|
]]></trigger> |
|
|
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock="y"> |
|
|
<label text="Ingrese los datos del producto a buscar:" x="1" y="1"/> |
|
|
<label text="el Nombre (canónico):" x="1" y="2"/> |
|
|
<entry name="searchNameEntry" x="23" y="2" width="35"/> |
|
|
<label text=" ó el Código Interno:" x="1" y="3"/> |
|
|
<entry name="searchCodeEntry" x="23" y="3" width="19"/> |
|
|
<button x="60" y="2" trigger="productSearchTrigger" width="9" label="Buscar" |
|
|
name="searchBtn" height="1"/> |
|
|
<button x="60" y="20" trigger="printTrigger" width="9" label="Imprimir" |
|
|
name="searchBtn" height="1"/> |
|
|
<entry name="funnyLabel" width="40" x="40" y="4" style="label"/> |
|
|
</block> |
|
|
<block name="productResultBlock" datasource="productResultDataSource" transparentBlock="y"> |
|
|
<entry name="productIdREntry" field="product.id" hidden="y" x="1" y="1" width="20" /> |
|
|
<label text="Resultado" x="1" y="4"/> |
|
|
<entry name="codeListEntry" field="_product_code_data.code" |
|
|
x="1" y="5" width="16" rows="15"/> |
|
|
<entry name="nameListEntry" field="_product_data.canonical_name" |
|
|
x="17" y="5" width="50" rows="15"/> |
|
|
<scrollbar page="12" x="68" y="5" width="1" height="15"/> |
|
|
</block> |
|
|
</page> |
|
|
<page name="Producto"> |
|
|
<!-- new_schema_begin --> |
|
|
<block name="searchingProductClassificationBlock" datasource="productClassificationDataSource"> |
|
|
<entry name="idEntry" field="_table" |
|
|
x="1" y="1" hidden="y"/> |
|
|
<entry name="nameEntry" field="name" |
|
|
x="1" y="1" hidden="y"/> |
|
269 |
</block> |
</block> |
270 |
<block name="searchingPhysicalStructureBlock" datasource="physicalStructureDataSource"> |
<block name="productResultBlock" datasource="productResultDataSource"> |
271 |
<entry name="idEntry" field="_table" |
<field name="productIdREntry" field="product.id"/> |
272 |
x="1" y="1" hidden="y"/> |
<field name="codeListEntry" field="_product_code_data.code" readonly="y"/> |
273 |
<entry name="nameEntry" field="name" |
<field name="nameListEntry" field="_product_data.canonical_name" |
274 |
x="1" y="1" hidden="y"/> |
readonly="y"/> |
275 |
</block> |
</block> |
276 |
<block name="searchingCountryBlock" datasource="countryDataSource"> |
<block name="productBlock" datasource="productDataSource"> |
277 |
<entry name="idEntry" field="_table" |
<field name="priceTypeEntry" field="_price_data.price_type"/> |
278 |
x="1" y="1" hidden="y"/> |
<field name="productCodeTypeEntry" |
279 |
<entry name="iso3Entry" field="iso3" |
field="_product_code_data.product_code_type"/> |
280 |
x="1" y="1" hidden="y"/> |
<field name="productIdEntry" field="product.id"/> |
281 |
<entry name="nameEntry" field="name" |
<field name="canonical_nameEntry" field="_product_data.canonical_name"/> |
282 |
x="1" y="1" hidden="y"/> |
<field name="product_classificationEntry" |
283 |
|
field="_product_data.product_classification" fk_description="description" fk_key="_table" |
284 |
|
fk_source="productClassificationDataSource"/> |
285 |
|
<field name="physical_structureEntry" field="_product_data.location" |
286 |
|
fk_description="name" fk_key="_table" fk_source="physicalStructureDataSource"/> |
287 |
|
<field name="countryEntry" field="_product_data.country" |
288 |
|
fk_description="name" fk_key="_table" fk_source="countryDataSource"/> |
289 |
|
<field name="priceEntry" field="_price_data.unit_price"/> |
290 |
|
<field name="productTaxEntry" field="_product_tax_data.tax"/> |
291 |
|
<field name="productVATEntry" default="21" |
292 |
|
field="_product_tax_data.amount"/> |
293 |
|
<field name="codeEntry" field="_product_code_data.code"/> |
294 |
|
<field name="levelEntry" field="_product_store_data.level"/> |
295 |
|
<field name="lowaterEntry" field="_product_store_data.lowater"/> |
296 |
|
<field name="hiwaterEntry" field="_product_store_data.hiwater"/> |
297 |
</block> |
</block> |
298 |
<trigger type="Pre-Focusin"><![CDATA[ |
</logic> |
299 |
if str(productResultBlock.productIdREntry)!='': |
<layout xmlns:c="GNUe:Layout:Char" c:height="22" tabbed="top" c:width="70"> |
300 |
if str(productBlock.product_classificationIdEntry)!='': |
<page name="Productos"> |
301 |
searchingProductClassificationBlock.processRollback () |
<trigger type="Pre-Focusout"><![CDATA[ |
302 |
searchingProductClassificationBlock.initQuery () |
productBlock.rollback() |
303 |
searchingProductClassificationBlock.idEntry= str(productBlock.product_classificationIdEntry) |
if productResultBlock.getRecordCount() > 0 and not productResultBlock.getCurrentRecord().isEmpty(): |
304 |
searchingProductClassificationBlock.processQuery () |
productBlock.initQuery() |
305 |
productBlock.product_classificationNameEntry= str(searchingProductClassificationBlock.nameEntry) |
productBlock.productIdEntry = ("%s" % productResultBlock.productIdREntry) |
306 |
else: |
productBlock.executeQuery() |
|
productBlock.product_classificationEntry= '' |
|
|
|
|
|
if str(productBlock.physical_structureIdEntry)!='': |
|
|
searchingPhysicalStructureBlock.processRollback () |
|
|
searchingPhysicalStructureBlock.initQuery () |
|
|
searchingPhysicalStructureBlock.idEntry= str(productBlock.physical_structureIdEntry) |
|
|
searchingPhysicalStructureBlock.processQuery () |
|
|
productBlock.physical_structureNameEntry= str(searchingPhtsicalStructureBlock.nameEntry) |
|
|
else: |
|
|
productBlock.physical_structureEntry= '' |
|
|
|
|
|
if str(productBlock.countryIdEntry)!='': |
|
|
searchingCountryBlock.processRollback () |
|
|
searchingCountryBlock.initQuery () |
|
|
searchingCountryBlock.idEntry= str(productBlock.countryIdEntry) |
|
|
searchingCountryBlock.processQuery () |
|
|
productBlock.countryIso3Entry= str(searchingCountryBlock.iso3Entry) |
|
|
productBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
|
|
else: |
|
|
productBlock.countryIso3Entry= '' |
|
|
productBlock.countryNameEntry= '' |
|
307 |
]]></trigger> |
]]></trigger> |
308 |
<!-- new_schema_end --> |
<label text="Ingrese los datos del producto a buscar:" c:x="1" c:y="1"/> |
309 |
|
<label text="el Nombre (canónico):" c:x="1" c:y="2"/> |
310 |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
<entry block="productSearchBlock" field="searchNameEntry" c:width="35" |
311 |
<box label="Datos" x="0" y="0" height="20" width="70"> |
c:x="23" c:y="2"/> |
312 |
<block name="productBlock" datasource="productDataSource" restrictInsert="y" transparentBlock="y"> |
<label text=" ó el Código Interno:" c:x="1" c:y="3"/> |
313 |
<entry x="0" y="0" name="priceTypeEntry" |
<entry block="productSearchBlock" field="searchCodeEntry" c:width="19" |
314 |
field="_price_data.price_type" hidden="y"/> |
c:x="23" c:y="3"/> |
315 |
<entry x="0" y="0" name="productCodeTypeEntry" |
<button name="searchBtn" c:height="1" label="Buscar" c:width="9" |
316 |
field="_product_code_data.product_code_type" hidden="y"/> |
c:x="60" c:y="2"> |
317 |
<entry name="productIdEntry" field="product.id" hidden="y" |
<trigger src="productSearchTrigger" type="On-Action"/> |
318 |
x="1" y="1" width="20"/> |
</button> |
319 |
<label text="Nombre Canónico:" x="1" y="1"/> |
<button name="searchBtn" c:height="1" label="Imprimir" c:width="9" |
320 |
<entry name="canonical_nameEntry" field="_product_data.canonical_name" |
c:x="60" c:y="20"> |
321 |
x="2" y="2" width="48"/> |
<trigger src="printTrigger" type="On-Action"/> |
322 |
<button x="57" y="2" width="10" height="1" label="Nuevo" trigger="newProductTrigger"> |
</button> |
323 |
<trigger type="NAMED" name="newProductTrigger"><![CDATA[ |
<entry block="productSearchBlock" field="funnyLabel" style="label" |
324 |
from hack import confirmRollback |
c:width="40" c:x="40" c:y="4"/> |
325 |
|
<entry block="productResultBlock" field="productIdREntry" hidden="y" |
326 |
confirmRollback (self, productBlock, 'productCommitTrigger', productBlock.canonical_nameEntry) |
c:width="20" c:x="1" c:y="1"/> |
327 |
|
<label text="Resultado" c:x="1" c:y="4"/> |
328 |
|
<entry block="productResultBlock" field="codeListEntry" rows="15" |
329 |
|
c:width="16" c:x="1" c:y="5"/> |
330 |
|
<entry block="productResultBlock" field="nameListEntry" rows="15" |
331 |
|
c:width="50" c:x="17" c:y="5"/> |
332 |
|
<scrollbar block="productResultBlock" c:height="15" page="12" |
333 |
|
c:width="1" c:x="68" c:y="5"/> |
334 |
|
</page> |
335 |
|
<page name="Producto"> |
336 |
|
<trigger src="askForChangesTrigger" type="pre-Focusout"/> |
337 |
|
<box c:height="20" label="Datos" c:width="70" c:x="0" c:y="0"/> |
338 |
|
<entry block="productBlock" field="priceTypeEntry" hidden="y" c:x="1" |
339 |
|
c:y="1"/> |
340 |
|
<entry block="productBlock" field="productCodeTypeEntry" hidden="y" |
341 |
|
c:x="1" c:y="1"/> |
342 |
|
<entry block="productBlock" field="productIdEntry" hidden="y" |
343 |
|
c:width="20" c:x="2" c:y="2"/> |
344 |
|
<label text="Nombre Canónico:" c:x="2" c:y="2"/> |
345 |
|
<entry block="productBlock" field="canonical_nameEntry" c:width="48" |
346 |
|
c:x="3" c:y="3"/> |
347 |
|
<button c:height="1" label="Nuevo" c:width="10" c:x="58" c:y="3"> |
348 |
|
<trigger name="newProductTrigger" type="NAMED"><![CDATA[ |
349 |
|
productBlock.newRecord() |
350 |
|
setFocus(productBlock.canonical_nameEntry) |
351 |
]]></trigger> |
]]></trigger> |
352 |
</button> |
<trigger src="newProductTrigger" type="On-Action"/> |
353 |
<label text="Clasificación:" x="1" y="3"/> |
</button> |
354 |
<entry name="product_classificationIdEntry" field="_product_data.product_classification" |
<label text="Clasificación:" c:x="2" c:y="4"/> |
355 |
x="1" y="1" hidden="y"/> |
<entry block="productBlock" field="product_classificationEntry" |
356 |
<!-- new_schema_begin --> |
style="dropdown" c:width="40" c:x="3" c:y="5"/> |
357 |
<entry name="product_classificationNameEntry" |
<button name="product_classificationButton" c:height="1" label="..." |
358 |
x="2" y="4" width="40"/> |
c:width="5" c:x="46" c:y="5"> |
359 |
<button name="searchClassificationButton" label="Buscar" trigger="searchClassificationTrigger" |
<trigger name="product_classificationTrigger" type="NAMED"><![CDATA[ |
|
x="42" y="4" width="10" height="1"> |
|
|
<trigger name="searchClassificationTrigger" type="NAMED"><![CDATA[ |
|
|
try: |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
setStatusText('buscando...') |
|
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
|
|
|
|
|
def setClassification (recNo): |
|
|
if recNo>=0: |
|
|
searchingProductClassificationBlock.jumpRecord (recNo) |
|
|
productBlock.product_classificationIdEntry= str(searchingProductClassificationBlock.idEntry) |
|
|
productBlock.product_classificationNameEntry= str(searchingProductClassificationBlock.nameEntry) |
|
|
|
|
|
# look for the name... |
|
|
searchingProductClassificationBlock.processRollback () |
|
|
searchingProductClassificationBlock.initQuery () |
|
|
searchingProductClassificationBlock.nameEntry= str(productBlock.product_classificationNameEntry)+'%' |
|
|
searchingProductClassificationBlock.processQuery () |
|
|
|
|
|
# are there too much results? |
|
|
resultCount= searchingProductClassificationBlock.getRecordCount () |
|
|
if resultCount>1: |
|
|
# do the select-man |
|
|
runForm ('productClassificationSelect.gfd', { |
|
|
'data': searchingProductClassificationBlock, |
|
|
'callback': setClassification |
|
|
}) |
|
|
setStatusText('Ok') |
|
|
elif resultCount==1: |
|
|
setClassification (0) |
|
|
setStatusText('Ok') |
|
|
else: |
|
|
setStatusText(' no se encontraron registros') |
|
|
|
|
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
|
|
]]></trigger> |
|
|
</button> |
|
|
<!-- new_schema_end --> |
|
|
<button x="53" y="4" name="product_classificationButton" |
|
|
label="..." width="5" height="1" trigger="product_classificationTrigger"> |
|
|
<trigger type="NAMED" name="product_classificationTrigger"><![CDATA[ |
|
360 |
runForm('product_classification.gfd'); |
runForm('product_classification.gfd'); |
361 |
]]></trigger> |
]]></trigger> |
362 |
</button> |
<trigger src="product_classificationTrigger" type="On-Action"/> |
363 |
<label text="Ubicación:" x="1" y="5"/> |
</button> |
364 |
<entry name="physical_structureIdEntry" field="_product_data.location" |
<label text="Ubicación:" c:x="2" c:y="6"/> |
365 |
x="1" y="1" hidden="y"/> |
<entry block="productBlock" field="physical_structureEntry" |
366 |
<!-- new_schema_begin --> |
style="dropdown" c:width="40" c:x="3" c:y="7"/> |
367 |
<entry name="physical_structureNameEntry" |
<button name="physical_structureButton" c:height="1" label="..." |
368 |
x="2" y="6" width="40"/> |
c:width="5" c:x="46" c:y="7"> |
369 |
<button name="searchLocationButton" label="Buscar" trigger="searchLocationTrigger" |
<trigger name="physical_structureTrigger" type="NAMED"><![CDATA[ |
|
x="42" y="6" width="10" height="1"> |
|
|
<trigger name="searchLocationTrigger" type="NAMED"> |
|
|
# aca deberia haber algo parecido a lo que hay en los otros trigger similares. |
|
|
self.genericBox('No implementado', ['Ok']); |
|
|
</trigger> |
|
|
</button> |
|
|
<!-- new_schema_end --> |
|
|
<button x="53" y="6" name="physical_structureButton" |
|
|
label="..." width="5" height="1" trigger="physical_structureTrigger"> |
|
|
<trigger type="NAMED" name="physical_structureTrigger"> |
|
370 |
self.genericBox('No implementado', ['Ok']); |
self.genericBox('No implementado', ['Ok']); |
|
</trigger> |
|
|
</button> |
|
|
<label text="País de Origen:" x="1" y="7"/> |
|
|
<entry name="countryIdEntry" field="_product_data.country" |
|
|
x="1" y="1" hidden="y"/> |
|
|
<!-- new_schema_begin --> |
|
|
<entry name="countryIso3Entry" |
|
|
x="2" y="8" width="4"/> |
|
|
<entry name="countryNameEntry" |
|
|
x="6" y="8" width="36"/> |
|
|
<button name="searchCountryButton" label="Buscar" trigger="searchCountryTrigger" |
|
|
x="42" y="8" width="10" height="1"> |
|
|
<trigger name="searchCountryTrigger" type="NAMED"><![CDATA[ |
|
|
try: |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
|
|
setStatusText('buscando...') |
|
|
|
|
|
def setCountry (recNo): |
|
|
if recNo>=0: |
|
|
searchingCountryBlock.jumpRecord (recNo) |
|
|
productBlock.countryIdEntry= str(searchingCountryBlock.idEntry) |
|
|
productBlock.countryIso3Entry= str(searchingCountryBlock.iso3Entry) |
|
|
productBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
|
|
|
|
|
# look for the name... |
|
|
searchingCountryBlock.processRollback () |
|
|
searchingCountryBlock.initQuery () |
|
|
searchingCountryBlock.iso3Entry= str(productBlock.countryIso3Entry)+'%' |
|
|
searchingCountryBlock.nameEntry= str(productBlock.countryNameEntry)+'%' |
|
|
searchingCountryBlock.processQuery () |
|
|
|
|
|
# are there too much results? |
|
|
resultCount= searchingCountryBlock.getRecordCount () |
|
|
if resultCount>1: |
|
|
# do the select-man |
|
|
runForm ('countrySelect.gfd', { |
|
|
'data': searchingCountryBlock, |
|
|
'callback': setCountry |
|
|
}) |
|
|
setStatusText('Ok') |
|
|
elif resultCount==1: |
|
|
setCountry (0) |
|
|
setStatusText('Ok') |
|
|
else: |
|
|
setStatusText(' no se encontraron registros') |
|
|
|
|
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
|
371 |
]]></trigger> |
]]></trigger> |
372 |
</button> |
<trigger src="physical_structureTrigger" type="On-Action"/> |
373 |
<!-- new_schema_end --> |
</button> |
374 |
<button x="53" y="8" name="countryButton" |
<label text="País de Origen:" c:x="2" c:y="8"/> |
375 |
label="..." width="5" height="1" trigger="countryTrigger"> |
<entry block="productBlock" field="countryEntry" style="dropdown" |
376 |
<trigger type="NAMED" name="countryTrigger"><![CDATA[ |
c:width="40" c:x="3" c:y="9"/> |
377 |
|
<button name="countryButton" c:height="1" label="..." c:width="5" |
378 |
|
c:x="46" c:y="9"> |
379 |
|
<trigger name="countryTrigger" type="NAMED"><![CDATA[ |
380 |
runForm('country.gfd'); |
runForm('country.gfd'); |
381 |
]]></trigger> |
]]></trigger> |
382 |
</button> |
<trigger src="countryTrigger" type="On-Action"/> |
383 |
<label x="1" y="9" text="Precio unitario base"/> |
</button> |
384 |
<entry x="1" y="10" name="priceEntry" field="_price_data.unit_price"/> |
<label text="Precio unitario base" c:x="2" c:y="10"/> |
385 |
<label x="30" y="9" text="% IVA"/> |
<entry block="productBlock" field="priceEntry" c:x="2" c:y="11"/> |
386 |
<entry x="30" y="10" hidden="y" name="productTaxEntry" field="_product_tax_data.tax"/> |
<label text="% IVA" c:x="31" c:y="10"/> |
387 |
<entry x="30" y="10" name="productVATEntry" field="_product_tax_data.amount" default="21"/> |
<entry block="productBlock" field="productTaxEntry" hidden="y" c:x="31" |
388 |
<label x="1" y="11" text="Código interno"/> |
c:y="11"/> |
389 |
<entry x="1" y="12" name="codeEntry" field="_product_code_data.code"/> |
<entry block="productBlock" field="productVATEntry" c:x="31" c:y="11"/> |
390 |
<label x="1" y="13" text="Nivel mínimo"/> |
<label text="Código interno" c:x="2" c:y="12"/> |
391 |
<entry x="1" y="14" hidden="y" name="levelEntry" field="_product_store_data.level"/> |
<entry block="productBlock" field="codeEntry" c:x="2" c:y="13"/> |
392 |
<entry x="1" y="14" name="lowaterEntry" field="_product_store_data.lowater"/> |
<label text="Nivel mínimo" c:x="2" c:y="14"/> |
393 |
<label x="30" y="13" text="Nivel máximo"/> |
<entry block="productBlock" field="levelEntry" hidden="y" c:x="2" |
394 |
<entry x="30" y="14" name="hiwaterEntry" field="_product_store_data.hiwater"/> |
c:y="15"/> |
395 |
<button x="1" y="17" trigger="productCommitTrigger" width="9" label="Aceptar" |
<entry block="productBlock" field="lowaterEntry" c:x="2" c:y="15"/> |
396 |
name="productCommitBtn" height="1"/> |
<label text="Nivel máximo" c:x="31" c:y="14"/> |
397 |
<button x="11" y="17" trigger="productDeleteTrigger" width="9" label="Borrar" |
<entry block="productBlock" field="hiwaterEntry" c:x="31" c:y="15"/> |
398 |
name="productDeleteBtn" height="1"/> |
<button name="productCommitBtn" c:height="1" label="Aceptar" c:width="9" |
399 |
<button x="21" y="17" trigger="productRollbackTrigger" width="9" label="Cancelar" |
c:x="2" c:y="18"> |
400 |
name="productRollbackBtn" height="1"/> |
<trigger src="productCommitTrigger" type="On-Action"/> |
401 |
</block> |
</button> |
402 |
</box> |
<button name="productDeleteBtn" c:height="1" label="Borrar" c:width="9" |
403 |
</page> |
c:x="12" c:y="18"> |
404 |
|
<trigger src="productDeleteTrigger" type="On-Action"/> |
405 |
|
</button> |
406 |
|
<button name="productRollbackBtn" c:height="1" label="Cancelar" |
407 |
|
c:width="9" c:x="22" c:y="18"> |
408 |
|
<trigger src="productRollbackTrigger" type="On-Action"/> |
409 |
|
</button> |
410 |
|
</page> |
411 |
|
</layout> |
412 |
</form> |
</form> |