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="18" width="46"> |
<form tabbed="top" title="Productos" height="19" width="70"> |
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"/> |
103 |
<datasource name="productDataSource" database="papo" |
<datasource name="productDataSource" database="papo" |
104 |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
105 |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
106 |
order_by="_product_data.canonical_name"> |
order_by="_product_data.canonical_name,_product_code_data.code"> |
107 |
<condition> |
<condition> |
108 |
<and> |
<and> |
109 |
<!-- pega product con su _data --> |
<!-- pega product con su _data --> |
230 |
</condition> |
</condition> |
231 |
</datasource> |
</datasource> |
232 |
|
|
233 |
<trigger name="printTrigger" type="NAMED"> |
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
234 |
import os |
import tempfile |
235 |
os.system("grcvs -D file -d /tmp/product.html --filter html ../report/product.grd") |
import os |
236 |
os.system("galeon -w /tmp/product.html") |
|
237 |
</trigger> |
try: |
238 |
|
# gnue version <= 0.4 |
239 |
|
from gnue.forms.GFEvent import GFEvent |
240 |
|
except ImportError: |
241 |
|
# gnue version >= 0.5 |
242 |
|
from gnue.common.events.Event import Event as GFEvent |
243 |
|
|
244 |
|
# busy clock |
245 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
246 |
|
file = tempfile.mktemp('.product.html') |
247 |
|
os.system("grcvs -D file -d %s --filter html ../report/product.grd" % file) |
248 |
|
os.system(gConfig('PrintCommand') % file) |
249 |
|
os.unlink(file) |
250 |
|
|
251 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
252 |
|
|
253 |
|
]]></trigger> |
254 |
|
|
255 |
<trigger name="productCommitTrigger" type="NAMED"> |
<trigger name="productCommitTrigger" type="NAMED"> |
256 |
from hack import a2f |
from hack import a2f |
291 |
</trigger> |
</trigger> |
292 |
|
|
293 |
<trigger name="productSearchTrigger" type="NAMED"> |
<trigger name="productSearchTrigger" type="NAMED"> |
294 |
|
try: |
295 |
|
from gnue.forms.GFEvent import GFEvent |
296 |
|
except ImportError: |
297 |
|
from gnue.common.events.Event import Event as GFEvent |
298 |
|
|
299 |
|
setStatusText('buscando...') |
300 |
|
|
301 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
302 |
productResultBlock.processRollback() |
productResultBlock.processRollback() |
303 |
productResultBlock.initQuery() |
productResultBlock.initQuery() |
304 |
productResultBlock.nameListEntry = '%'+str(productSearchBlock.searchNameEntry)+'%' # |
if str(productSearchBlock.searchCodeEntry): |
305 |
|
productResultBlock.codeListEntry = str(productSearchBlock.searchCodeEntry)+'%' |
306 |
|
if str(productSearchBlock.searchNameEntry): |
307 |
|
productResultBlock.nameListEntry = '%'+str(productSearchBlock.searchNameEntry)+'%' # |
308 |
productResultBlock.processQuery() |
productResultBlock.processQuery() |
309 |
|
|
310 |
|
setStatusText('Ok') |
311 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
312 |
|
|
313 |
|
if productResultBlock.isEmpty(): |
314 |
|
productSearchBlock.funnyLabel = ' no se encontraron registros' |
315 |
|
else: |
316 |
|
productSearchBlock.funnyLabel ='%6d registros encontrados' % productResultBlock.getRecordCount() |
317 |
|
|
318 |
</trigger> |
</trigger> |
319 |
|
|
320 |
<page name="Productos"> |
<page name="Productos"> |
326 |
productBlock.processQuery() |
productBlock.processQuery() |
327 |
</trigger> |
</trigger> |
328 |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock=""> |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock=""> |
329 |
<label text="Nombre canónico del producto a buscar" x="1" y="1"/> |
<label text="Ingrese los datos del producto a buscar:" x="1" y="1"/> |
330 |
<entry name="searchNameEntry" x="1" y="2" width="35"/> |
<label text="el Nombre (canónico):" x="1" y="2"/> |
331 |
<button x="36" y="2" trigger="productSearchTrigger" width="9" label="Buscar" |
<entry name="searchNameEntry" x="23" y="2" width="35"/> |
332 |
|
<label text=" ó el Código Interno:" x="1" y="3"/> |
333 |
|
<entry name="searchCodeEntry" x="23" y="3" width="19"/> |
334 |
|
<button x="60" y="2" trigger="productSearchTrigger" width="9" label="Buscar" |
335 |
name="searchBtn" height="1"/> |
name="searchBtn" height="1"/> |
336 |
<button x="36" y="3" trigger="printTrigger" width="9" label="Imprimir" |
<button x="60" y="20" trigger="printTrigger" width="9" label="Imprimir" |
337 |
name="searchBtn" height="1"/> |
name="searchBtn" height="1"/> |
338 |
|
<entry name="funnyLabel" width="40" x="40" y="4" style="label"/> |
339 |
</block> |
</block> |
340 |
<block name="productResultBlock" datasource="productResultDataSource"> |
<block name="productResultBlock" datasource="productResultDataSource"> |
341 |
<entry name="productIdREntry" field="product.id" hidden="y" x="1" y="1" width="20" /> |
<entry name="productIdREntry" field="product.id" hidden="y" x="1" y="1" width="20" /> |
342 |
<label text="Resultado" x="1" y="3"/> |
<label text="Resultado" x="1" y="4"/> |
343 |
<entry name="nameListEntry" field="_product_data.canonical_name" |
<entry name="codeListEntry" field="_product_code_data.code" |
344 |
x="1" y="5" width="40" rows="15"/> |
x="1" y="5" width="16" rows="15" readonly="y"/> |
345 |
<scrollbar page="12" x="42" y="5" width="1" height="15"/> |
<entry name="nameListEntry" field="_product_data.canonical_name" |
346 |
|
x="17" y="5" width="50" rows="15" readonly="y"/> |
347 |
|
<scrollbar page="12" x="68" y="5" width="1" height="15"/> |
348 |
</block> |
</block> |
349 |
</page> |
</page> |
350 |
<page name="Producto"> |
<page name="Producto"> |