6 |
use PAPO; |
use PAPO; |
7 |
my $uniqed=0; |
my $uniqed=0; |
8 |
</neb:Block> |
</neb:Block> |
|
<datasource name="searchDataSource"/> |
|
|
<datasource name="tmpValuesDataSource" cache="1"/> |
|
|
<datasource name="resultDataSource" database="papo" table="own_document,_entity_data, _document_type_data"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="own_document.own_entity"/> |
|
|
<cfield name="_entity_data.id"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cfield name="_document_type_data.id"/> |
|
|
</eq> |
|
|
<or> |
|
|
<eq> <cfield name="own_document.own_document_type"/> <cconst value="14"/> <!-- 'NCA de Productos' --> </eq> |
|
|
<eq> <cfield name="own_document.own_document_type"/> <cconst value="15"/> <!-- 'NCB de Productos' --> </eq> |
|
|
<eq> <cfield name="own_document.own_document_type"/> <cconst value="16"/> <!-- 'NCB de Productos' --> </eq> |
|
|
</or> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
9 |
|
|
10 |
<datasource name="ownDocumentDataSource" database="papo" table="own_document"> |
<neb:Sub neb:src="void_own_document.nebc" |
11 |
<condition> |
document_name="Nota de Crédito" |
12 |
<or> |
document_type_A="14" |
13 |
<eq> <cfield name="own_document.own_document_type"/> <cconst value="14"/> <!-- 'NCA de Productos' --> </eq> |
document_type_B="15" |
14 |
<eq> <cfield name="own_document.own_document_type"/> <cconst value="15"/> <!-- 'NCB de Productos' --> </eq> |
document_type_C="16" |
15 |
<eq> <cfield name="own_document.own_document_type"/> <cconst value="16"/> <!-- 'NCC de Productos' --> </eq> |
stock_when_void="stockSubstractTrigger" |
16 |
</or> |
stock_when_unvoid="stockAddTrigger" |
17 |
</condition> |
/> |
|
</datasource> |
|
|
|
|
|
<datasource name="clientDataSource" database="papo" table="_entity_data, _alien_entity_data, _persona_data, _client_data"> |
|
|
<condition> |
|
|
<and> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_alien_entity_data.entity"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_alien_entity_data._end_t"/> |
|
|
</null> |
|
|
<eq> |
|
|
<cfield name="_alien_entity_data._table"/> |
|
|
<cfield name="_persona_data.alien_entity"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_persona_data._end_t"/> |
|
|
</null> |
|
|
<eq> |
|
|
<cfield name="_persona_data._table"/> |
|
|
<cfield name="_client_data.persona"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_persona_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="itemDataSource" database="papo" |
|
|
table="_price_data, _product_store_data, own_document, own_item, own_product_item"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="own_product_item.own_item"/> |
|
|
<cfield name="own_item.id"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_product_item.price"/> |
|
|
<cfield name="_price_data.id"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_price_data.product"/> |
|
|
<cfield name="_product_store_data.product"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_item.own_document"/> |
|
|
<cfield name="own_document.id"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_product_store_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="levelDataSource" database="papo" |
|
|
table="_product_store_data, product_store" |
|
|
historytable="_product_store_data"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="product_store.id"/> |
|
|
<cfield name="_product_store_data._table"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_product_store_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<neb:Sub neb:src="wait.nebc"/> |
|
|
|
|
|
<trigger name="startUp" type="On-Startup"> |
|
|
#cargo el own-pos entity id |
|
|
callTrigger('searchOwnPosData') |
|
|
#/cargo el own-pos entity id |
|
|
</trigger> |
|
|
|
|
|
|
|
|
<trigger name="searchTrigger" type="NAMED"> |
|
|
callTrigger ('startWaitingModeTrigger') |
|
|
resultBlock.clear () |
|
|
resultBlock.initQuery () |
|
|
resultBlock.numberSEntry = str(searchBlock.numberEntry)+" %" |
|
|
resultBlock.ownEntityIdEntry = str(ownPosBlock.ownPosEntityTableEntry) |
|
|
resultBlock.processQuery () |
|
|
callTrigger ('endWaitingModeTrigger') |
|
|
</trigger> |
|
|
|
|
|
<trigger name="commitTrigger" type="NAMED"> |
|
|
from __future__ import nested_scopes |
|
|
global hack |
|
|
import hack |
|
|
|
|
|
from gnue.common.GDataObjects import ConnectionError as DBError |
|
|
|
|
|
try: |
|
|
callTrigger ('startWaitingModeTrigger') |
|
|
for document in filter(lambda x: (not hack.is_true(x._fields['own_document.is_void'])) != \ |
|
|
(not hack.is_true(x._initialData['own_document.is_void'])), resultDataSource.getRecords()): |
|
|
#le paso el id del documento a buscar |
|
|
tmpValuesDataSource.documentidEntry= str(document.getField('own_document.id')) |
|
|
callTrigger('searchOwnPosData') |
|
|
# got to fix the stock |
|
|
if str(ownPosBlock.stockByInvoice) == "1": |
|
|
if hack.a2f(document.getField('own_document.is_void')): |
|
|
callTrigger('stockSubstractTrigger') |
|
|
else: |
|
|
callTrigger('stockAddTrigger') |
|
|
|
|
|
updateBlock.clear() |
|
|
updateBlock.initQuery() |
|
|
updateBlock.idEntry = str(document.getField('own_document.id')) |
|
|
updateBlock.processQuery() |
|
|
updateBlock.is_voidEntry = str(document.getField('own_document.is_void')) |
|
|
updateBlock.postChanges() |
|
|
|
|
|
searchBlock.clear() |
|
|
callTrigger ('endWaitingModeTrigger') |
|
|
|
|
|
commitConnection () |
|
|
currRecord = resultBlock.getCurrentRecordNumber() |
|
|
callTrigger('searchTrigger') |
|
|
resultBlock.jumpRecord(currRecord) |
|
|
except DBError, err: |
|
|
rollbackConnection () |
|
|
genericBox("Hay problemas para grabar los datos \n \n"+str(err),['Aceptar']) |
|
|
|
|
|
</trigger> |
|
|
|
|
|
<trigger name="rollbackTrigger" type="NAMED"> |
|
|
import hack |
|
|
resultBlock.clear() |
|
|
</trigger> |
|
|
|
|
|
<!--trigger name="abortTrigger" type="NAMED"> |
|
|
import hack |
|
|
resultBlock.reset() |
|
|
</trigger--> |
|
|
|
|
|
<page name="Selección de Nota de Crédito"> |
|
|
<box label="Búsqueda de factura"> |
|
|
<block name="searchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert=""> |
|
|
<lam:box lam:boxtype="h"> |
|
|
<label text="Número de la nota de crédito a buscar"/> |
|
|
</lam:box> |
|
|
<lam:box lam:boxtype="h"> |
|
|
<entry name="numberEntry"/> |
|
|
<button label="Buscar" trigger="searchTrigger"/> |
|
|
</lam:box> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
</block> |
|
|
</box> |
|
|
<!--busco own pos entityIdEntry--> |
|
|
<neb:Sub neb:src="posDocument.nebc" stockByInvoice="stockByInvoice" |
|
|
ownPosBlock="ownPosBlock" |
|
|
ownPosEntityIdEntry="ownPosEntityIdEntry" |
|
|
searchOwnPosData="searchOwnPosData" |
|
|
ownStorehouseBlock ="ownStorehouseBlock" ownStorehouseIdEntry="ownStorehouseIdEntry" /> |
|
|
|
|
|
<neb:Sub neb:src="setStock.nebc" |
|
|
ownDocumentId="tmpValuesDataSource.documentidEntry" |
|
|
storehouseEntityId="ownStorehouseBlock.ownStorehouseIdEntry" |
|
|
stockAddTrigger="stockAddTrigger" |
|
|
stockSubstractTrigger="stockSubstractTrigger" /> |
|
|
<box label="Anular notas de crédito"> |
|
|
<block name="resultBlock" datasource="resultDataSource" transparentBlock="" restrictInsert=""> |
|
|
<lam:box> |
|
|
<lam:box lam:boxtype="h"> |
|
|
<entry name="idREntry" field="own_document.id" hidden="y"/> |
|
|
<entry name="own_document_typeEntry" field="own_document.own_document_type" hidden="y"/> |
|
|
<entry name="ownEntityIdEntry" field="_entity_data._table" hidden="y"/> |
|
|
<lam:box> |
|
|
<label text="Fecha"/> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
<entry name="dateEntry" field="own_document.date" style="label" readonly="y" |
|
|
width="10" rows="10"/> |
|
|
</lam:box> |
|
|
<lam:box width="1"/> |
|
|
<lam:box> |
|
|
<label text="Tipo"/> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
<entry name="codeEntry" field="_document_type_data.code" style="label" readonly="y" |
|
|
width="3" rows="10"/> |
|
|
</lam:box> |
|
|
<lam:box width="1"/> |
|
|
<lam:box> |
|
|
<label text="Número"/> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
<entry name="numberEntry" field="own_document.number" style="label" readonly="y" |
|
|
width="10" rows="10"/> |
|
|
<entry name="numberSEntry" field="own_document.number" hidden="y" readonly="y" |
|
|
width="10" rows="10"/> |
|
|
</lam:box> |
|
|
<lam:box width="1"/> |
|
|
<lam:box> |
|
|
<label text="Cliente"/> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
<entry name="clientEntry" field="own_document.recipient" style="textlookup" readonly="y" foreign_key="clientDataSource._entity_data.id" foreign_key_description="_entity_data.name" rows="10"/> |
|
|
</lam:box> |
|
|
<lam:box width="1"/> |
|
|
<lam:box> |
|
|
<label text="Anulada"/> |
|
|
<lam:box lam:boxtype="h" height="1"/> |
|
|
<lam:box lam:boxtype="h"> |
|
|
<entry name="is_voidEntry" field="own_document.is_void" |
|
|
width="2" rows="10"/> |
|
|
<lam:box width="7"/> |
|
|
<scrollbar page="10"/> |
|
|
</lam:box> |
|
|
</lam:box> |
|
|
</lam:box> |
|
|
</lam:box> |
|
|
<lam:box height="1"/> |
|
|
<lam:box> |
|
|
<lam:box lam:boxtype="h"> |
|
|
<button label="Aceptar" trigger="commitTrigger"/> |
|
|
<button label="Cancelar" trigger="rollbackTrigger"/> |
|
|
<!--button label="Cancelar" trigger="abortTrigger"/--> |
|
|
</lam:box> |
|
|
</lam:box> |
|
|
<lam:box height="1"/> |
|
|
</block> |
|
|
</box> |
|
|
<block name="updateBlock" datasource="ownDocumentDataSource" transparentBlock="" restrictInsert="y"> |
|
|
<entry x="0" y="0" name="idEntry" field="own_document.id" hidden="y"/> |
|
|
<entry x="0" y="0" name="own_document_typeEntry" field="own_document.own_document_type" hidden="y"/> |
|
|
<entry x="0" y="0" name="is_voidEntry" field="own_document.is_void" width="2" rows="10" hidden="y"/> |
|
|
</block> |
|
|
|
|
|
<block name="itemBlock" datasource="itemDataSource"> |
|
|
<entry x="0" y="0" field="own_document.id" name="documentEntry" hidden="y"/> |
|
|
<entry x="0" y="0" field="_product_store_data.product" name="productEntry" hidden="y"/> |
|
|
<entry x="0" y="0" field="_product_store_data.level" name="levelEntry" hidden="y"/> |
|
|
<entry x="0" y="0" field="own_product_item.qty" name="qtyEntry" hidden="y"/> |
|
|
</block> |
|
|
</page> |
|
18 |
</form> |
</form> |