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"/> |
7 |
<datasource name="clientResultDataSource" database="papo" |
<datasource name="clientResultDataSource" database="papo" |
8 |
table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data" |
table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data" |
9 |
historytable="_entity_data, _alien_entity_data, _persona_data, _client_data" |
historytable="_entity_data, _alien_entity_data, _persona_data, _client_data" |
10 |
order_by="_entity_data.name"> |
order_by="_entity_data.name"> |
280 |
</datasource> |
</datasource> |
281 |
|
|
282 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
283 |
|
print 'commitTrigger' |
284 |
if not str(clientBlock.priceTypeEntry): |
if not str(clientBlock.priceTypeEntry): |
285 |
clientBlock.priceTypeEntry = "1" |
clientBlock.priceTypeEntry = "1" |
286 |
if clientBlock.getCurrentRecord().isInserted(): |
if clientBlock.getCurrentRecord().isInserted(): |
287 |
|
print 'commitTrigger.then' |
288 |
# entity_type 7 es cliente |
# entity_type 7 es cliente |
289 |
clientBlock.clientEntityTypeEntry = 7 |
clientBlock.clientEntityTypeEntry = 7 |
290 |
creditLimit1Block.newRecord() |
creditLimit1Block.newRecord() |
303 |
clientBlock.clientIdEntry = tmpId |
clientBlock.clientIdEntry = tmpId |
304 |
clientBlock.processQuery() |
clientBlock.processQuery() |
305 |
else: |
else: |
306 |
|
print 'commitTrigger.else' |
307 |
clientBlock.commit() |
clientBlock.commit() |
308 |
</trigger> |
</trigger> |
309 |
|
|
315 |
<trigger name="clientRollbackTrigger" type="NAMED"> |
<trigger name="clientRollbackTrigger" type="NAMED"> |
316 |
import hack |
import hack |
317 |
hack.rollback(clientBlock) |
hack.rollback(clientBlock) |
|
hack.rollback(showPriceTypeNameBlock) |
|
318 |
</trigger> |
</trigger> |
319 |
|
|
320 |
<trigger name="askForChangesTrigger" type="NAMED"> |
<trigger name="askForChangesTrigger" type="NAMED"> |
385 |
setStatusText('buscando...') |
setStatusText('buscando...') |
386 |
|
|
387 |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
self._object.dispatchEvent(GFEvent('beginWAIT')) |
388 |
|
|
389 |
clientResultBlock.processRollback() |
clientResultBlock.processRollback() |
390 |
clientResultBlock.initQuery() |
clientResultBlock.initQuery() |
391 |
if str(clientSearchBlock.searchCodeEntry): |
if str(clientSearchBlock.searchCodeEntry): |
450 |
searchingPriceTypeBlock.processQuery () |
searchingPriceTypeBlock.processQuery () |
451 |
|
|
452 |
# ... and show it |
# ... and show it |
453 |
showPriceTypeNameBlock.newRecord () |
clientBlock.priceTypeNameEntry= str(searchingPriceTypeBlock.nameEntry) |
|
showPriceTypeNameBlock.priceTypeNameEntry= str(searchingPriceTypeBlock.nameEntry) |
|
|
showPriceTypeNameBlock.commit () |
|
454 |
</trigger> |
</trigger> |
455 |
<!-- new_schema_end --> |
<!-- new_schema_end --> |
456 |
<trigger type="Pre-Focusout" src="askForChangesTrigger"/> |
<trigger type="Pre-Focusout" src="askForChangesTrigger"/> |
465 |
x="1" y="1"/> |
x="1" y="1"/> |
466 |
<entry name="nameEntry" field="_entity_data.name" |
<entry name="nameEntry" field="_entity_data.name" |
467 |
x="1" y="2" width="40"/> |
x="1" y="2" width="40"/> |
468 |
|
<button name="newButton" label="Nuevo" trigger="newTrigger" |
469 |
|
x="42" y="2" width="9" height="1"> |
470 |
|
<trigger name="newTrigger" type="NAMED"><![CDATA[ |
471 |
|
from hack import confirmRollback |
472 |
|
|
473 |
|
confirmRollback (self, clientBlock, 'commitTrigger', clientBlock.nameEntry) |
474 |
|
]]></trigger> |
475 |
|
</button> |
476 |
<label text="Puntaje" |
<label text="Puntaje" |
477 |
x="1" y="3"/> |
x="1" y="3"/> |
478 |
<entry name="scoreEntry" field="_client_data.score" typecast="number" default="0" |
<entry name="scoreEntry" field="_client_data.score" typecast="number" default="0" |
479 |
x="1" y="4" width="10"/> |
x="1" y="4" width="10"/> |
480 |
<label text="Lista de precios asociada " |
<label text="Lista de precios asociada " |
481 |
x="1" y="5"/> |
x="1" y="5"/> |
|
<!-- entry x="1" y="6" field="_client_data.price_type" |
|
|
name="priceTypeEntry" |
|
|
width="35" style="dropdown" foreign_key="priceTypeDataSource._table" |
|
|
foreign_key_description="name"/ --> |
|
482 |
<entry name="priceTypeEntry" field="_client_data.price_type" |
<entry name="priceTypeEntry" field="_client_data.price_type" |
483 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
484 |
|
<entry name="priceTypeNameEntry" |
485 |
|
x="1" y="6" width="35"/> |
486 |
<button x="37" y="6" width="10" trigger="searchPriceTypeTrigger" |
<button x="37" y="6" width="10" trigger="searchPriceTypeTrigger" |
487 |
label="Buscar" name="priceTypeBtn" height="1"> |
label="Buscar" name="priceTypeBtn" height="1"> |
488 |
<!-- new_schema_begin --> |
<!-- new_schema_begin --> |
490 |
def setPriceType (recNo): |
def setPriceType (recNo): |
491 |
if recNo>=0: |
if recNo>=0: |
492 |
searchingPriceTypeBlock.jumpRecord (recNo) |
searchingPriceTypeBlock.jumpRecord (recNo) |
493 |
clientBlock.priceTypeEntry= str(searchingPriceTypeBlock.idEntry) |
clientBlock.priceTypeEntry= str(searchingPriceTypeBlock.idEntry) |
494 |
showPriceTypeNameBlock.priceTypeNameEntry= str(searchingPriceTypeBlock.nameEntry) |
clientBlock.priceTypeNameEntry= str(searchingPriceTypeBlock.nameEntry) |
495 |
|
|
496 |
|
try: |
497 |
|
# gnue version <= 0.4 |
498 |
|
from gnue.forms.GFEvent import GFEvent |
499 |
|
except ImportError: |
500 |
|
# gnue version >= 0.5 |
501 |
|
from gnue.common.events.Event import Event as GFEvent |
502 |
|
|
503 |
|
# busy clock |
504 |
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
505 |
|
setStatusText('buscando...') |
506 |
|
|
507 |
# look for the name... |
# look for the name... |
508 |
searchingPriceTypeBlock.processRollback () |
searchingPriceTypeBlock.processRollback () |
509 |
searchingPriceTypeBlock.initQuery () |
searchingPriceTypeBlock.initQuery () |
510 |
searchingPriceTypeBlock.nameEntry= str(showPriceTypeNameBlock.priceTypeNameEntry)+'%' |
searchingPriceTypeBlock.nameEntry= str(clientBlock.priceTypeNameEntry)+'%' |
511 |
searchingPriceTypeBlock.processQuery () |
searchingPriceTypeBlock.processQuery () |
512 |
|
|
513 |
# are there too much results? |
# are there too much results? |
518 |
'data': searchingPriceTypeBlock, |
'data': searchingPriceTypeBlock, |
519 |
'callback': setPriceType |
'callback': setPriceType |
520 |
}) |
}) |
521 |
|
setStatusText('Ok') |
522 |
elif resultCount==1: |
elif resultCount==1: |
523 |
setPriceType (0) |
setClassification (0) |
524 |
|
setStatusText('Ok') |
525 |
|
else: |
526 |
|
setStatusText(' no se encontraron registros') |
527 |
|
|
528 |
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
529 |
</trigger> |
</trigger> |
530 |
<!-- new_schema_end --> |
<!-- new_schema_end --> |
531 |
</button> |
</button> |
532 |
<button x="49" y="6" width="5" trigger="callPriceTypeTrigger" |
<button x="49" y="6" width="5" trigger="callPriceTypeTrigger" |
533 |
label=" ... " name="priceTypeBtn" height="1"> |
label=" ... " name="priceTypeBtn" height="1"> |
534 |
<trigger type="NAMED" name="callPriceTypeTrigger"> |
<trigger type="NAMED" name="callPriceTypeTrigger"> |
|
#runForm('priceType-new.gfd', {'initId': str(clientBlock.priceTypeEntry)}) |
|
535 |
runForm('priceType.gfd') |
runForm('priceType.gfd') |
536 |
</trigger> |
</trigger> |
537 |
</button> |
</button> |
545 |
name="clientDeleteBtn" height="1"/> |
name="clientDeleteBtn" height="1"/> |
546 |
<button x="21" y="17" trigger="clientRollbackTrigger" width="9" label="Cancelar" |
<button x="21" y="17" trigger="clientRollbackTrigger" width="9" label="Cancelar" |
547 |
name="clientRollbackBtn" height="1"/> |
name="clientRollbackBtn" height="1"/> |
|
<button x="31" y="17" width="9" trigger="newTrigger" label="Nuevo" |
|
|
name="newButton" height="1"> |
|
|
<trigger name="newTrigger" type="NAMED"> |
|
|
#clientBlock.newRecord () |
|
|
#setFocus (clientBlock.nameEntry) |
|
|
changed = filter(lambda t: not t.isSaved(), self._object._blockList) |
|
|
res = 0 |
|
|
if len(changed) > 0: |
|
|
res = self.genericBox('Hay cambios pendientes \n¿ Qué desea hacer ?',['Grabar','Deshacer', 'Cancelar']) |
|
|
if res == 1: |
|
|
self.callTrigger(commitTrigger) |
|
|
elif res == 2: |
|
|
rollback(clientBlock) |
|
|
if res in (1,2): |
|
|
clientBlock.newRecord() |
|
|
setFocus(clientBlock.nameEntry) |
|
|
</trigger> |
|
|
</button> |
|
548 |
</block> |
</block> |
549 |
|
|
|
<!-- new_schema_begin --> |
|
|
<datasource name="showNames" cache="1"/> |
|
|
<block name="showPriceTypeNameBlock" datasource="showNames"> |
|
|
<entry name="priceTypeNameEntry" field="priceTypeName" |
|
|
x="1" y="6" width="35"/> |
|
|
</block> |
|
|
<!-- new_schema_end --> |
|
550 |
</box> |
</box> |
551 |
</page> |
</page> |
552 |
|
|