10 |
my $uniqed=0; |
my $uniqed=0; |
11 |
</neb:Block> |
</neb:Block> |
12 |
|
|
13 |
<datasource name="nil" cache="1"/> |
<neb:Sub neb:src="queryDeleteOwnDocument.nebc" |
14 |
<datasource name="tmpValuesDataSource" cache="1"/> |
document_name="Nota de crédito" |
15 |
<datasource name="tmpSearchDataSource" cache="1"/> |
document_type_A="14" |
16 |
<datasource name="currentSearchIdDataSource" cache="1"/> |
document_type_B="15" |
17 |
<datasource name="tmpAmountDataSource" cache="1"/> |
document_type_C="16" |
18 |
|
stock_borrado="stockSubstractTrigger" |
19 |
<!-- Origen de datos que sirve para dar de alta procedimientos de pago (en este caso de la nota de crédito) --> |
/> |
|
<datasource name="proceedingDataSource" database="papo" table="proceeding"/> |
|
|
|
|
|
<!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency --> |
|
|
<datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/> |
|
|
|
|
|
<!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency --> |
|
|
<datasource name="ownDocumentProceedingShowDataSource" database="papo" table="own_document_proceeding"/> |
|
|
|
|
|
<!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency --> |
|
|
<datasource name="currencyMovementDataSource" database="papo" |
|
|
table="movement, currency_movement"> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="movement.id"/> |
|
|
<cfield name="currency_movement.movement"/> |
|
|
</eq> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="contactDataSource" database="papo" |
|
|
table="entity, _entity_data, alien_entity, _alien_entity_data,contact, _contact_data" |
|
|
order_by="_entity_data.name"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="entity.id"/> |
|
|
<cfield name="_entity_data._table"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="alien_entity.id"/> |
|
|
<cfield name="_alien_entity_data._table"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="contact.id"/> |
|
|
<cfield name="_contact_data._table"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="entity.id"/> |
|
|
<cfield name="_alien_entity_data.entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="alien_entity.id"/> |
|
|
<cfield name="_contact_data.alien_entity"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_alien_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_contact_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="clientSearchDataSource" database="papo" |
|
|
table="_entity_data, _alien_entity_data, _persona_data, _client_data, |
|
|
_persona_tax_profile_data, _tax_profile_data, entity_type_uid_conf, |
|
|
_entity_uid_data" order_by="_entity_data.name"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_alien_entity_data.entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_alien_entity_data._table"/> |
|
|
<cfield name="_persona_data.alien_entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_persona_data._table"/> |
|
|
<cfield name="_client_data.persona"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_entity_uid_data.entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_persona_tax_profile_data.persona"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_tax_profile_data._table"/> |
|
|
<cfield name="_persona_tax_profile_data.tax_profile"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cconst value="1"/> <!-- Corresponde al tipo de impuesto IVA --> |
|
|
<cfield name="_tax_profile_data.tax"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cconst value="8"/> |
|
|
<cfield name="entity_type_uid_conf.entity_type"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_entity_uid_data.entity_uid_type"/> |
|
|
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_alien_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_persona_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_client_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_entity_uid_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_tax_profile_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_persona_tax_profile_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="clientUIDDataSource" database="papo" |
|
|
table="_entity_data, entity_type_uid_conf, _entity_uid_data" cache="1"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_entity_uid_data.entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cconst value="8"/> |
|
|
<cfield name="entity_type_uid_conf.entity_type"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_entity_uid_data.entity_uid_type"/> |
|
|
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_entity_uid_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="clientNameDataSource" database="papo" |
|
|
table="_entity_data"> |
|
|
<conditions> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
</conditions> |
|
|
</datasource> |
|
|
|
|
|
|
|
|
<!-- |
|
|
datasource usado para la búsqueda |
|
|
--> |
|
|
<datasource name="productSearchDataSource" database="papo" |
|
|
table=" _product_data, _product_code_data, _product_tax_data" |
|
|
cache="15" order_by="_product_data.canonical_name"> |
|
|
<condition> |
|
|
<and> |
|
|
<null> |
|
|
<cfield name="_product_data._end_t"/> |
|
|
</null> |
|
|
<!-- pega product con product_code --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_code_data.product"/> |
|
|
</eq> |
|
|
<!-- solamente códigos internos (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_code_data.product_code_type"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
<!-- descarta códigos de producto muertos --> |
|
|
<null> |
|
|
<cfield name="_product_code_data._end_t"/> |
|
|
</null> |
|
|
<!-- pega product con product_tax --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_tax_data.product"/> |
|
|
</eq> |
|
|
<!-- descarta product_taxes muertos --> |
|
|
<null> |
|
|
<cfield name="_product_tax_data._end_t"/> |
|
|
</null> |
|
|
<!-- solamente 'IVA' (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.tax"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="productUIDDataSource" database="papo" |
|
|
table=" _product_data, _product_code_data, _product_tax_data" |
|
|
cache="15" order_by="_product_data.canonical_name"> |
|
|
<condition> |
|
|
<and> |
|
|
<!-- pega product con product_code --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_code_data.product"/> |
|
|
</eq> |
|
|
<!-- solamente códigos internos (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_code_data.product_code_type"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
<!-- pega product con product_tax --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_tax_data.product"/> |
|
|
</eq> |
|
|
<!-- descarta product_taxes muertos --> |
|
|
<!-- <null> --> |
|
|
<!-- <cfield name="_product_tax_data._end_t"/> --> |
|
|
<!-- </null> --> |
|
|
<!-- Revisar porque tiene que paremetrizar por fecha --> |
|
|
<!-- solamente 'IVA' (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.tax"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="productNameDataSource" database="papo" |
|
|
table="_price_data, _price_data as pricetmp, _product_data, _product_code_data, _product_tax_data" |
|
|
cache="15" order_by="_product_data.canonical_name"> |
|
|
<condition> |
|
|
<and> |
|
|
<!-- pega product con product_code --> |
|
|
<eq> |
|
|
<cfield name="_price_data._table"/> |
|
|
<cfield name="pricetmp._table"/> |
|
|
</eq> |
|
|
<!-- pega price con product --> |
|
|
<eq> |
|
|
<cfield name="_price_data.product"/> |
|
|
<cfield name="_product_data._table"/> |
|
|
</eq> |
|
|
<!-- pega product con product_code --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_code_data.product"/> |
|
|
</eq> |
|
|
<!-- solamente códigos internos (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_code_data.product_code_type"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
<!-- pega product con product_tax --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_tax_data.product"/> |
|
|
</eq> |
|
|
<!-- Revisar porque tiene que paremetrizar por fecha --> |
|
|
<!-- solamente 'IVA' (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.tax"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="pricetmp._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_product_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_product_tax_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_product_code_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="productTaxDataSource" database="papo" |
|
|
table=" _product_data, _product_tax_data" |
|
|
order_by="_product_data.canonical_name"> |
|
|
<condition> |
|
|
<and> |
|
|
<!-- pega product con product_tax --> |
|
|
<eq> |
|
|
<cfield name="_product_data._table"/> |
|
|
<cfield name="_product_tax_data.product"/> |
|
|
</eq> |
|
|
<!-- <or> --> |
|
|
<!-- find the client state in that time --> |
|
|
<!-- <between> --> |
|
|
<!-- <cparam name="invoiceDate"/> --> |
|
|
<!-- <cfield name="_product_tax_data._start_t"/> --> |
|
|
<!-- <cfield name="_product_tax_data._end_t"/> --> |
|
|
<!-- </between> --> |
|
|
<!-- or is it the current one? --> |
|
|
<!-- <and> --> |
|
|
<!-- <ge> --> |
|
|
<!-- <cparam name="invoiceDate"/> --> |
|
|
<!-- <cfield name="_product_tax_data._start_t"/> --> |
|
|
<!-- </ge> --> |
|
|
<!-- <null> --> |
|
|
<!-- <cfield name="_product_tax_data._end_t"/> --> |
|
|
<!-- </null> --> |
|
|
<!-- </and> --> |
|
|
<!-- </or> --> |
|
|
<!-- solamente 'IVA' (id 1) --> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.tax"/> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="productDataSource" database="papo" table="_product_data" |
|
|
order_by="canonical_name"> |
|
|
<condition> |
|
|
<null> |
|
|
<cfield name="_product_data._end_t"/> |
|
|
</null> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="resultOwnDocumentDataSource" table="own_document" |
|
|
order_by="date"> |
|
|
<condition> |
|
|
<or> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="14"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="15"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="16"/> |
|
|
</eq> |
|
|
</or> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownDocumentDataSource" table="own_document" |
|
|
order_by="date"> |
|
|
<condition> |
|
|
<or> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="14"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="15"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="16"/> |
|
|
</eq> |
|
|
</or> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownDocumentShowDataSource" |
|
|
table="own_document" |
|
|
order_by="date"> |
|
|
<condition> |
|
|
<or> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="14"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="15"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="own_document.own_document_type"/> |
|
|
<cconst value="16"/> |
|
|
</eq> |
|
|
</or> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownDocumentTaxShowDataSource" |
|
|
table="own_document_tax"/> |
|
|
|
|
|
<datasource database="papo" name="ownDocumentClientShowDataSource" |
|
|
table="own_document, _entity_data as client" detaillink="own_document.id" |
|
|
master="ownDocumentShowDataSource" masterlink="id" |
|
|
order_by="date"> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="own_document.recipient"/> |
|
|
<cfield name="client.id"/> |
|
|
</eq> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownItemShowDataSource" |
|
|
table="own_item, own_product_item, own_item_tax"> |
|
|
<joinconditions> |
|
|
<join type="left"> |
|
|
<join type="left"> |
|
|
<left_table name="own_item"/> |
|
|
<right_table name="own_product_item"/> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="own_item.id"/> |
|
|
<cfield name="own_product_item.own_item"/> |
|
|
</eq> |
|
|
</condition> |
|
|
</join> |
|
|
<right_table name="own_item_tax"/> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="own_item.id"/> |
|
|
<cfield name="own_item_tax.own_item"/> |
|
|
</eq> |
|
|
</condition> |
|
|
</join> |
|
|
</joinconditions> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownItemDeleteDataSource" |
|
|
table="own_item, own_product_item"> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="own_item.id"/> |
|
|
<cfield name="own_product_item.own_item"/> |
|
|
</eq> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="ownItemTaxShowDataSource" |
|
|
table="own_item_tax"> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="lookUpTaxDataSource" database="papo" |
|
|
table="product,_product_data,product_tax,_product_tax_data,tax,_tax_data"> |
|
|
<condition> |
|
|
<and> |
|
|
<!-- unify historic --> |
|
|
<eq> |
|
|
<cfield name="product.id"/> |
|
|
<cfield name="_product_data._table"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_product_data._end_t"/> |
|
|
</null> |
|
|
<eq> |
|
|
<cfield name="product_tax.id"/> |
|
|
<cfield name="_product_tax_data._table"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_product_tax_data._end_t"/> |
|
|
</null> |
|
|
<eq> |
|
|
<cfield name="tax.id"/> |
|
|
<cfield name="_tax_data._table"/> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_tax_data._end_t"/> |
|
|
</null> |
|
|
<!-- do the join-man --> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.product"/> |
|
|
<cfield name="product.id"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_product_tax_data.tax"/> |
|
|
<cfield name="tax.id"/> |
|
|
</eq> |
|
|
<!-- filter out the wanted ones --> |
|
|
<eq> |
|
|
<cfield name="tax.id"/> |
|
|
<!-- IVA --> |
|
|
<cconst value="1"/> |
|
|
</eq> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<trigger name="startUp" type="On-Startup"> |
|
|
#cargo el own-pos entity id |
|
|
callTrigger('searchOwnPosData') |
|
|
#/cargo el own-pos entity id |
|
|
</trigger> |
|
|
|
|
|
<trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[ |
|
|
setStatusText("Procesando ...") |
|
|
try: |
|
|
# gnue version <= 0.4 |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
# gnue version >= 0.5 |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
# busy clock |
|
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
|
|
]]></trigger> |
|
|
|
|
|
<trigger name="endWaitingModeTrigger" type="NAMED"><![CDATA[ |
|
|
try: |
|
|
# gnue version <= 0.4 |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
# gnue version >= 0.5 |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
|
|
setStatusText("Listo") |
|
|
]]></trigger> |
|
|
|
|
|
|
|
|
<trigger name="rollbackTrigger" type="NAMED"> |
|
|
clear() |
|
|
callTrigger('searchOwnPosData') |
|
|
</trigger> |
|
|
|
|
|
<trigger name="deleteTrigger" type="NAMED"> |
|
|
if genericBox("¿ Está seguro que desea borrar ?",['Sí','No']) == 1 and ownDocumentShowBlock.idEntry \ |
|
|
and len(str(ownDocumentShowBlock.idEntry).strip()): |
|
|
from gnue.common.GDataObjects import ConnectionError as DBError |
|
|
try: |
|
|
lOwnDocId = str(ownDocumentShowBlock.idEntry) |
|
|
ownDocumentProceedingShowBlock.initQuery() |
|
|
ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId |
|
|
ownDocumentProceedingShowBlock.processQuery() |
|
|
proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry) |
|
|
ownDocumentProceedingShowBlock.deleteRecord() |
|
|
postChangeAdvance = 0 |
|
|
ownDocumentProceedingShowBlock.postChanges() |
|
|
|
|
|
if proceedingId: |
|
|
currencyMovementBlock.initQuery() |
|
|
currencyMovementBlock.proceedingEntry = proceedingId |
|
|
currencyMovementBlock.processQuery() |
|
|
postChangeAdvance = 1 |
|
|
rc = currencyMovementBlock.getRecordCount() |
|
|
for recNum in range(rc): |
|
|
currencyMovementBlock.jumpRecord(recNum) |
|
|
currencyMovementBlock.deleteRecord() |
|
|
currencyMovementBlock.postChanges() |
|
|
|
|
|
proceedingBlock.initQuery() |
|
|
proceedingBlock.idEntry = proceedingId |
|
|
proceedingBlock.processQuery() |
|
|
postChangeAdvance = 2 |
|
|
proceedingBlock.deleteRecord() |
|
|
proceedingBlock.postChanges() |
|
|
|
|
|
postChangeAdvance = 3 |
|
|
tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry) |
|
|
if str(ownPosBlock.stockByInvoice) == "1": |
|
|
print "llamado al trigger" |
|
|
callTrigger('stockSubstractTrigger') |
|
|
|
|
|
lRecordCount = ownItemShowBlock.getRecordCount() |
|
|
for recNum in range(lRecordCount): |
|
|
ownItemShowBlock.jumpRecord(recNum) |
|
|
ownItemTaxShowBlock.initQuery() |
|
|
ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry) |
|
|
ownItemTaxShowBlock.processQuery() |
|
|
lTaxRecordCount = ownItemTaxShowBlock.getRecordCount() |
|
|
for taxRecNum in range(lTaxRecordCount): |
|
|
ownItemTaxShowBlock.jumpRecord(taxRecNum) |
|
|
ownItemTaxShowBlock.deleteRecord() |
|
|
ownItemTaxShowBlock.postChanges() |
|
|
ownItemDeleteBlock.initQuery() |
|
|
ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry) |
|
|
ownItemDeleteBlock.processQuery() |
|
|
ownItemDeleteBlock.deleteRecord() |
|
|
ownItemDeleteBlock.postChanges() |
|
|
|
|
|
ownItemShowBlock.clear() |
|
|
|
|
|
|
|
|
postChangeAdvance = 4 |
|
|
|
|
|
ownDocumentTaxShowBlock.initQuery() |
|
|
ownDocumentTaxShowBlock.ownDocumentEntry = tmpValuesDataSource.idEntry |
|
|
ownDocumentTaxShowBlock.processQuery() |
|
|
|
|
|
lRecordCount = ownDocumentTaxShowBlock.getRecordCount() |
|
|
for recNum in range(lRecordCount): |
|
|
ownDocumentTaxShowBlock.jumpRecord(recNum) |
|
|
ownDocumentTaxShowBlock.deleteRecord() |
|
|
ownDocumentTaxShowBlock.postChanges() |
|
|
|
|
|
postChangeAdvance = 5 |
|
|
|
|
|
ownDocumentShowBlock.deleteRecord() |
|
|
ownDocumentShowBlock.postChanges() |
|
|
|
|
|
commitConnection() |
|
|
except DBError, err: |
|
|
rollbackConnection() |
|
|
callTrigger('rollbackTrigger') |
|
|
message = ["el procedimiento de la Nota de Crédito", "Los Montos de la nota de crédito", |
|
|
"el procedimiento","los Items de la Nota de Crédito", "los impuestos de la Nota de Crédito", |
|
|
"la Nota de Crédito"] |
|
|
genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar']) |
|
|
|
|
|
|
|
|
totalShowBlock.ivaEntry = "0.00" |
|
|
totalShowBlock.netoEntry = "0.00" |
|
|
totalShowBlock.totalEntry = "0.00" |
|
|
totalShowBlock.clear() |
|
|
</trigger> |
|
|
|
|
|
|
|
|
<trigger name="bringInvoiceTypeShowTrigger" type="NAMED"> |
|
|
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
|
|
typeInvoice = int(str(ownDocumentShowBlock.typeEntry)) |
|
|
result = "" |
|
|
if typeInvoice == 14: |
|
|
result = "A" |
|
|
elif typeInvoice == 15: |
|
|
result = "B" |
|
|
elif typeInvoice == 16: |
|
|
result = "C" |
|
|
ownDocumentShowBlock.invoiceTypeEntry = result |
|
|
|
|
|
</trigger> |
|
|
|
|
|
<trigger name="totalCalcShowTrigger" type="NAMED"> |
|
|
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
|
|
import hack |
|
|
|
|
|
recordCount = ownItemShowBlock.getRecordCount() |
|
|
ownItemShowBlock.firstRecord() |
|
|
for index in range(recordCount): |
|
|
ownItemShowBlock.jumpRecord(index) |
|
|
try: |
|
|
ownItemShowBlock.taxPercentEntry = round(hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \ |
|
|
hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \ |
|
|
hack.a2f(ownItemShowBlock.qtyEntry,2) * 100,0) |
|
|
except: |
|
|
pass |
|
|
|
|
|
ownItemShowBlock.firstRecord() |
|
|
|
|
|
totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2)) |
|
|
else: |
|
|
totalShowBlock.clear() |
|
|
</trigger> |
|
|
|
|
|
<trigger name="newSearchTrigger" type="NAMED"> |
|
|
clear() |
|
|
</trigger> |
|
|
|
|
|
<trigger name="searchTrigger" type="NAMED"> |
|
|
resultBlock.clear() |
|
|
resultBlock.initQuery() |
|
|
#resultBlock.typeREntry = "2" |
|
|
resultBlock.clientREntry = str(ownDocumentSearchBlock.clientSEntry) |
|
|
resultBlock.numberREntry = str(ownDocumentSearchBlock.numberSEntry)+"%" |
|
|
resultBlock.dateREntry = str(ownDocumentSearchBlock.dateSEntry) |
|
|
resultBlock.processQuery() |
|
|
</trigger> |
|
|
|
|
|
<trigger name="notImplementedSearchTrigger" type="NAMED"> |
|
|
genericBox("No implementado",["Aceptar"]) |
|
|
</trigger> |
|
|
|
|
|
<trigger name="clientSearchTrigger" type="NAMED"> |
|
|
codeToSearch = str(ownDocumentSearchBlock.clientCodeSEntry) |
|
|
nameToSearch = str(ownDocumentSearchBlock.clientNameSEntry) |
|
|
|
|
|
callTrigger('startWaitingModeTrigger') |
|
|
clientResultBlock.reset() |
|
|
clientResultBlock.initQuery() |
|
|
if codeToSearch: |
|
|
clientResultBlock.uidEntry = codeToSearch+"%" |
|
|
if nameToSearch: |
|
|
clientResultBlock.nameEntry = nameToSearch+"%" |
|
|
clientResultBlock.processQuery() |
|
|
callTrigger('endWaitingModeTrigger') |
|
|
|
|
|
recordCount = clientResultBlock.getRecordCount() |
|
|
if recordCount > 1: |
|
|
def callback (returnValue): |
|
|
global block |
|
|
if returnValue >= 0: |
|
|
clientResultBlock.jumpRecord(returnValue) |
|
|
callTrigger('afterClientSearchTrigger') |
|
|
|
|
|
runForm ('clientSelect.gfd', {'data': clientResultBlock, 'callback': callback}) |
|
|
elif recordCount == 1: |
|
|
clientResultBlock.jumpRecord(0) |
|
|
callTrigger('afterClientSearchTrigger') |
|
|
|
|
|
</trigger> |
|
|
|
|
|
<trigger name="afterClientSearchTrigger" type="NAMED"> |
|
|
ownDocumentSearchBlock.clientCodeSEntry = str(clientResultBlock.uidEntry) |
|
|
ownDocumentSearchBlock.clientNameSEntry = str(clientResultBlock.nameEntry) |
|
|
ownDocumentSearchBlock.clientSEntry = str(clientResultBlock.idEntry) |
|
|
</trigger> |
|
|
|
|
|
<trigger name="resultFocusOutTrigger" type="NAMED"> |
|
|
import hack |
|
|
ownDocumentShowBlock.clear() |
|
|
ownItemShowBlock.clear() |
|
|
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
|
|
ownDocumentShowBlock.initQuery() |
|
|
ownDocumentShowBlock.idEntry = ("%s" % resultBlock.idREntry) |
|
|
ownDocumentShowBlock.processQuery() |
|
|
|
|
|
ownItemShowBlock.initQuery() |
|
|
ownItemShowBlock.ownDocumentEntry = ("%s" % ownDocumentShowBlock.idEntry) |
|
|
ownItemShowBlock.processQuery() |
|
|
|
|
|
recordCount = ownItemShowBlock.getRecordCount() |
|
|
ownItemShowBlock.firstRecord() |
|
|
|
|
|
if str(ownDocumentShowBlock.isVoidEntry): |
|
|
ownDocumentShowBlock.stateEntry = "ANULADA" |
|
|
else: |
|
|
ownDocumentShowBlock.stateEntry = "Vigente" |
|
|
|
|
|
</trigger> |
|
|
|
|
|
<trigger name="clientTrigger" type="NAMED"> |
|
|
runForm('client.gfd') |
|
|
</trigger> |
|
|
|
|
|
<trigger name="productTrigger" type="NAMED"> |
|
|
runForm('product.gfd') |
|
|
</trigger> |
|
|
|
|
|
<trigger name="lookUpTax" type="NAMED"><![CDATA[ |
|
|
from hack import search |
|
|
|
|
|
# do the bartman |
|
|
search (lookUpTaxBlock, lookUpTaxBlock.searchThisProductEntry, ownItemBlock.productEntry) |
|
|
ownItemBlock.taxPercentEntry= lookUpTaxBlock.foundTaxEntry |
|
|
# back to normal broadcasting |
|
|
]]></trigger> |
|
|
|
|
|
|
|
|
<page name="Búsqueda de Notas de Crédito de Clientes"> |
|
|
<!-- <trigger type="Pre-Focusout" src="resultFocusOutTrigger"/> --> |
|
|
<box height="12" label="Nota De Crédito de Productos de Cliente" |
|
|
name="invoiceSearchBox" width="107" x="0" y="0"> |
|
|
|
|
|
<block datasource="tmpSearchDataSource" name="ownDocumentSearchBlock" restrictInsert=""> |
|
|
|
|
|
<entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
|
|
|
|
|
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
|
|
<entry x="1" y="2" name="clientCodeSEntry" width="20"> |
|
|
<options> |
|
|
<option name="tip" value="Insertar el Código"/> |
|
|
</options> |
|
|
</entry> |
|
|
<entry x="1" y="3" name="clientNameSEntry" width="35"> |
|
|
<options> |
|
|
<option name="tip" value="Insertar el nombre o descripción"/> |
|
|
</options> |
|
|
</entry> |
|
|
<entry x="1" y="2" field="own_document.recipient" name="clientSEntry" width="25" hidden=""/> |
|
|
<button x="36" y="3" trigger="clientSearchTrigger" width="7" label="Buscar" |
|
|
name="clientSearchPage1Btn" height="1"/> |
|
|
|
|
|
<label name="numberLbl" text="Número" x="1" y="8" /> |
|
|
<entry field="number" name="numberSEntry" width="20" x="1" y="9" /> |
|
|
|
|
|
<label name="dateLbl" text="Fecha" x="22" y="8" /> |
|
|
<entry field="date" name="dateSEntry" typecast="date" |
|
|
rows="1" width="22" x="22" y="9"/> |
|
|
|
|
|
<button x="77" y="9" trigger="searchTrigger" width="10" label="Buscar" |
|
|
name="searchBtn" height="1"/> |
|
|
<button x="88" y="9" trigger="newSearchTrigger" width="10" label="Cancelar" |
|
|
name="newSearchBtn" height="1"/> |
|
|
</block> |
|
|
</box> |
|
|
|
|
|
<box height="14" label="Notas de Crédito encontradas" name="searchResultBox" |
|
|
width="107" x="0" y="11"> |
|
|
<block datasource="resultOwnDocumentDataSource" name="resultBlock"> |
|
|
|
|
|
<entry field="id" hidden="" name="idREntry" x="1" y="1"/> |
|
|
|
|
|
<entry field="own_document_type" hidden="" name="typeREntry" x="1" y="1"/> |
|
|
|
|
|
<entry x="1" y="1" field="recipient" name="clientREntry" |
|
|
width="25" hidden=""/> |
|
|
|
|
|
<entry field="number" name="numberREntry" hidden="" width="20" x="1" y="7"/> |
|
|
|
|
|
<entry field="date" name="dateREntry" typecast="date" hidden="" |
|
|
width="22" x="22" y="7"/> |
|
|
|
|
|
<entry field="bundles" name="bundlesREntry" width="10" x="66" y="7" hidden="" /> |
|
|
|
|
|
|
|
|
|
|
|
<label name="resNumberLbl" text="Número" x="1" y="1" /> |
|
|
<entry field="number" name="resNumberEntry" width="20" x="1" y="2" rows="9"/> |
|
|
<label name="resDateLbl" text="Fecha" x="22" y="1" /> |
|
|
<entry field="date" name="resDateEntry" typecast="date" width="22" x="22" y="2" rows="9"/> |
|
|
<scrollbar page="5" |
|
|
x="45" y="2" width="1" height="9"/> |
|
|
|
|
|
</block> |
|
|
</box> |
|
|
</page> |
|
|
|
|
|
<!-- Página de Consulta/borrado de notas de crédito --> |
|
|
<page name="Nota de Crédito de Cliente (Consulta/borrado)"> |
|
|
<trigger type="PRE-FOCUSIN" src="resultFocusOutTrigger" /> |
|
|
<trigger type="PRE-FOCUSIN" src="bringInvoiceTypeShowTrigger" /> |
|
|
<trigger type="PRE-FOCUSIN" src="totalCalcShowTrigger" /> |
|
|
<box height="12" label="Nota de Crédito de Productos de Cliente" |
|
|
name="invoiceHeaderBox" width="107" x="0" y="0"> |
|
|
|
|
|
<!-- Estos bloques son para la gestion del pago de la nota de crédito --> |
|
|
<block name="proceedingBlock" datasource="proceedingDataSource" transparentBlock=""> |
|
|
<entry name="idEntry" field="id" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="dateEntry" field="date" hidden="" x="1" y="1" width="12"/> |
|
|
</block> |
|
|
|
|
|
<!-- Este bloque esta repetido, pero con otro nombre, porque para borrar debe hacer commit en este primero --> |
|
|
<block name="ownDocumentProceedingShowBlock" datasource="ownDocumentProceedingShowDataSource" transparentBlock=""> |
|
|
<entry name="proceedingEntry" field="proceeding" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="ownDocumentEntry" field="own_document" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/> |
|
|
</block> |
|
|
|
|
|
<block name="ownDocumentTaxShowBlock" datasource="ownDocumentTaxShowDataSource" transparentBlock=""> |
|
|
<entry name="ownDocumentEntry" field="own_document" hidden="" x="1" y="1" width="12"/> |
|
|
</block> |
|
|
|
|
|
<block datasource="ownDocumentShowDataSource" name="ownDocumentShowBlock" restrictInsert="t"> |
|
|
|
|
|
<entry field="own_document.id" hidden="" name="idEntry" x="1" y="1"/> |
|
|
<entry field="own_document.own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
|
|
|
|
|
<entry x="1" y="2" field="own_document.recipient" name="clientEntry" width="25" hidden="" /> |
|
|
|
|
|
<label name="numberLbl" text="Número" x="1" y="8" /> |
|
|
<entry field="own_document.number" name="numberEntry" width="20" x="1" y="9" style="label"/> |
|
|
|
|
|
<label name="dateLbl" text="Fecha" x="22" y="8" /> |
|
|
<entry field="own_document.date" name="dateEntry" typecast="date" |
|
|
rows="1" width="22" x="22" y="9" style="label"/> |
|
|
|
|
|
<label name="invoiceTypeLbl" text="Tipo" x="48" y="8" /> |
|
|
<entry name="invoiceTypeEntry" width="4" x="48" y="9" readonly="t" style="label"/> |
|
|
|
|
|
<label name="stateLbl" text="Estado" x="56" y="8" /> |
|
|
<entry name="stateEntry" style="label" default="Vigente" rows="1" width="22" x="56" y="9"/> |
|
|
<entry name="isVoidEntry" field="own_document.is_void" style="label" rows="1" width="22" x="56" y="9" hidden=""/> |
|
|
</block> |
|
|
|
|
|
<block datasource="ownDocumentClientShowDataSource" name="ownDocumentClientShowBlock" restrictInsert="t"> |
|
|
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
|
|
<entry x="1" y="2" field="client._table" name="clientCodeSEntry" readonly="" |
|
|
width="20" style="textlookup" foreign_key="clientUIDDataSource._entity_data._table" |
|
|
foreign_key_description="_entity_uid_data.uid" > |
|
|
</entry> |
|
|
<entry x="1" y="3" field="client._table" name="clientNameSEntry" readonly="" |
|
|
width="35" style="textlookup" foreign_key="clientNameDataSource._table" |
|
|
foreign_key_description="name" > |
|
|
</entry> |
|
|
|
|
|
</block> |
|
|
</box> |
|
|
<block datasource="ownItemTaxShowDataSource" name="ownItemTaxShowBlock" restrictInsert="t"> |
|
|
<entry field="own_item_tax.own_item" name="ownItemEntry" hidden="" x="1" y="1"/> |
|
|
</block> |
|
|
<block datasource="ownItemDeleteDataSource" name="ownItemDeleteBlock" restrictInsert="t"> |
|
|
<entry field="own_item.id" name="idEntry" hidden="" x="1" y="1"/> |
|
|
</block> |
|
|
|
|
|
<block datasource="ownItemShowDataSource" name="ownItemShowBlock" restrictInsert="t"> |
|
|
|
|
|
<entry field="own_item.id" name="idEntry" hidden="" x="1" y="1"/> |
|
|
<entry field="own_item.own_document" name="ownDocumentEntry" hidden="" x="1" y="1"/> |
|
|
|
|
|
<label text="Productos de la a nota de crédito" x="1" y="12"/> |
|
|
<label text="Código" x="1" y="13"/> |
|
|
|
|
|
<entry x="1" y="14" field="own_product_item.price" name="productCodeEntry" readonly="" |
|
|
width="14" style="textlookup" foreign_key="productNameDataSource._price_data.id" |
|
|
foreign_key_description="_product_code_data.code" rows="7"> |
|
|
</entry> |
|
|
|
|
|
<label text="Nombre" x="15" y="13"/> |
|
|
<entry x="15" y="14" field="own_product_item.price" name="productNameEntry" readonly="" |
|
|
width="20" style="textlookup" foreign_key="productNameDataSource._price_data.id" |
|
|
foreign_key_description="_product_data.canonical_name" rows="7"> |
|
|
</entry> |
|
|
|
|
|
<!-- <entry x="15" y="4" field="own_product_item.product" name="productEntry" width="20" rows="7" hidden=""/> --> |
|
|
|
|
|
<label name="qtyLbl" text="Cantidad" x="43" y="13"/> |
|
|
<entry field="own_product_item.qty" name="qtyEntry" rows="7" typecast="number" displaymask="%0.3f" width="12" x="43" y="14" style="label" readonly=""> |
|
|
</entry> |
|
|
|
|
|
<label name="priceLbl" text="Precio" x="55" y="13"/> |
|
|
<entry x="55" y="14" field="own_product_item.unit_price" name="unitPriceEntry" typecast="number" displaymask="%0.2f" |
|
|
width="10" rows="7" style="label" readonly=""> |
|
|
</entry> |
|
|
<label name="taxLbl" text="IVA" x="65" y="13" /> |
|
|
<entry x="65" y="14" name="taxPercentEntry" width="5" rows="7" style="label" typecast="number" displaymask="%0.2f"/> |
|
|
|
|
|
<entry x="65" y="14" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="5" rows="5" hidden=""/> |
|
|
<!-- <entry x="47" y="4" readonly="" field="own_item_tax.tax" name="taxTypeEntry" width="5" rows="5" default="1" hidden=""/> --> |
|
|
|
|
|
<label name="discountLbl" text="Descuento" x="71" y="13"/> |
|
|
<entry field="own_item.discount" name="discountEntry" typecast="number" displaymask="%0.2f" |
|
|
rows="7" width="10" x="71" y="14" default="0" style="label" readonly=""> |
|
|
</entry> |
|
|
<entry field="own_item.bonus" name="bonusEntry" value="0" typecast="number" displaymask="%0.2f" |
|
|
rows="7" width="12" x="66" y="4" default="0" hidden=""> |
|
|
</entry> |
|
|
<scrollbar page="5" |
|
|
x="103" y="14" width="1" height="7"/> |
|
|
|
|
|
</block> |
|
|
<block datasource="ownDocumentShowDataSource" name="totalShowBlock"> |
|
|
<label name="totalLbl" text="Neto" x="55" y="21"/> |
|
|
<entry name="netoEntry" field="own_document.net_total" readonly="" style="label" x="55" y="22" width="12" default="0.00"/> |
|
|
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
|
|
<entry name="ivaEntry" field="own_document.tax_total" readonly="" style="label" x="65" y="22" width="12" default="0.00"/> |
|
|
<label name="totalLbl" text="Total" x="82" y="21"/> |
|
|
<entry name="totalEntry" readonly="" style="label" x="82" y="22" width="12" default="0.00"/> |
|
|
</block> |
|
|
|
|
|
<block datasource="nil" name="tmpBlock"> |
|
|
<button x="51" y="24" trigger="deleteTrigger" width="10" label="Borrar" |
|
|
name="deleteBtn" height="1"/> |
|
|
|
|
|
</block> |
|
|
<block name="clientResultBlock" datasource="clientSearchDataSource"> |
|
|
<entry name="idEntry" field="_entity_data.id" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="uidEntry" field="_entity_uid_data.uid" x="1" y="1" width="12" hidden=""/> |
|
|
<entry name="nameEntry" field="_entity_data.name" x="1" y="1" width="12" hidden=""/> |
|
|
<entry name="clientIvaTaxProfileEntry" field="_persona_tax_profile_data.tax_profile" x="1" y="1" width="12" hidden=""/> |
|
|
</block> |
|
|
<block name="currencyMovementBlock" datasource="currencyMovementDataSource" transparentBlock=""> |
|
|
<entry name="proceedingEntry" field="movement.proceeding" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="movementTypeEntry" field="movement.movement_type" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="amountEntry" field="movement.amount" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden="" x="1" y="1" width="12"/> |
|
|
</block> |
|
|
|
|
|
<neb:Sub neb:src="setStock.nebc" ownDocumentId="ownDocumentShowBlock.idEntry" |
|
|
storehouseEntityId="ownStorehouseBlock.ownStorehouseIdEntry" |
|
|
stockAddTrigger="stockAddTrigger" stockSubstractTrigger="stockSubstractTrigger"/> |
|
|
<neb:Sub neb:src="posDocument.nebc" |
|
|
ownPosBlock="ownPosBlock" stockByInvoice="stockByInvoice" |
|
|
ownPosEntityIdEntry="ownPosEntityIdEntry" |
|
|
searchOwnPosData="searchOwnPosData" |
|
|
ownStorehouseBlock ="ownStorehouseBlock" ownStorehouseIdEntry="ownStorehouseIdEntry" /> |
|
|
</page> |
|
20 |
</form> |
</form> |