1 |
<!-- POS DOCUMENT COMPONENT --> |
<!-- POS DOCUMENT COMPONENT --> |
2 |
|
<!-- este componente genera el datasouce, triggers y forms para --> |
3 |
|
<!-- determinar el pos en el que se está. esto es mediante la lectura --> |
4 |
|
<!-- de una variable de sistema en el trigger "$searchOwnPosData" . --> |
5 |
|
<!-- si se define $ownPosDocumentBlock, genera datasouce, triggers y forms --> |
6 |
|
<!-- para buscar el numero de own document. para ello hay que pasarle la --> |
7 |
|
<!-- referencia al entry donde se define el tipo de documento a buscar --> |
8 |
|
<!-- en $documentType y la busqueda se realiza mediante el trigger --> |
9 |
|
<!-- $searchNextDocumentNumber --> |
10 |
|
|
11 |
<neb:Vars> |
<neb:Vars> |
12 |
$ownPosBlock => "ownPosBlock" |
$ownPosBlock => "ownPosBlock" |
13 |
$stockByInvoice => "" |
$stockByInvoice => "" |
14 |
$ownPosEntityIdEntry => "ownPosEntityIdEntry" |
$ownPosEntityIdEntry => "ownPosEntityIdEntry" |
15 |
$ownPosDocumentBlock |
$ownPosDocumentBlock => "" |
16 |
$documentType |
$documentType =>"" |
17 |
$documentNumberEntry |
$documentNumberEntry =>"" |
18 |
$documentNumberEntryX |
$documentNumberEntryX =>"" |
19 |
$documentNumberEntryY |
$documentNumberEntryY =>"" |
20 |
$searchNextDocumentNumber |
$searchNextDocumentNumber =>"" |
21 |
|
$searchOwnPosData => "searchOwnPosData" |
22 |
</neb:Vars> |
</neb:Vars> |
23 |
<!-- Origen de datos que contiene el numero de la proxima factura --> |
|
|
<datasource name="ownPosDocumentDataSource" database="papo" |
|
|
table="own_pos_document, _own_pos_document_data" historytable="_own_pos_document_data"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="own_pos_document.id"/> |
|
|
<cfield name="_own_pos_document_data._table"/> |
|
|
</eq> |
|
|
<!-- numero para las facturas de servicios --> |
|
|
<!-- <eq> --> |
|
|
<!-- <cfield name="_own_pos_document_data.document_type"/> --> |
|
|
<!-- <cconst value="4"/> --> |
|
|
<!-- </eq> --> |
|
|
<!-- que este activo --> |
|
|
<null> |
|
|
<cfield name="_own_pos_document_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
24 |
|
|
25 |
<!--pos--> |
<!--pos--> |
26 |
<datasource name="ownPosDataSource" database="papo" table="_own_pos_data,_own_entity_data,_entity_data" > |
<datasource name="ownPosDataSource" database="papo" table="_own_pos_data,_own_entity_data,_entity_data" > |
47 |
</condition> |
</condition> |
48 |
</datasource> |
</datasource> |
49 |
|
|
50 |
<!--pos--> |
<neb:Block>if ($ownPosDocumentBlock ne ""){</neb:Block> |
51 |
<trigger name="searchOwnPosData" type="NAMED"> |
<!-- Origen de datos que contiene el numero de la proxima factura --> |
52 |
import os |
|
53 |
try: |
<datasource name="ownPosDocumentDataSource" database="papo" |
54 |
pos = os.environ['PAPO_POS'] |
table="own_pos_document, _own_pos_document_data" historytable="_own_pos_document_data"> |
55 |
except KeyError: |
<condition> |
56 |
pos = 1 |
<and> |
57 |
print pos |
<eq> |
58 |
ownPosBlock.initQuery() |
<cfield name="own_pos_document.id"/> |
59 |
ownPosBlock.ownPosIdEntry = str(pos) |
<cfield name="_own_pos_document_data._table"/> |
60 |
ownPosBlock.processQuery() |
</eq> |
61 |
</trigger> |
<!-- numero para las facturas de servicios --> |
62 |
<!--/pos--> |
<!-- <eq> --> |
63 |
|
<!-- <cfield name="_own_pos_document_data.document_type"/> --> |
64 |
|
<!-- <cconst value="4"/> --> |
65 |
|
<!-- </eq> --> |
66 |
|
<!-- que este activo --> |
67 |
|
<null> |
68 |
|
<cfield name="_own_pos_document_data._end_t"/> |
69 |
|
</null> |
70 |
|
</and> |
71 |
|
</condition> |
72 |
|
</datasource> |
73 |
|
|
74 |
<trigger name="neb:$searchNextDocumentNumber" type="NAMED"> |
<trigger name="neb:$searchNextDocumentNumber" type="NAMED"> |
75 |
import gnue.common.GConditions as GConditions |
import gnue.common.GConditions as GConditions |
76 |
callTrigger('searchOwnPosData') |
callTrigger('searchOwnPosData') |
77 |
condDocumentNumber = GConditions.GCondition() |
condDocumentNumber = GConditions.GCondition() |
87 |
ownPosDocumentDataSource.createResultSet(condDocumentNumber) |
ownPosDocumentDataSource.createResultSet(condDocumentNumber) |
88 |
|
|
89 |
</trigger> |
</trigger> |
90 |
|
<neb:Block>}</neb:Block> |
91 |
|
|
92 |
|
<!--pos--> |
93 |
|
<trigger name="neb:$searchOwnPosData" type="NAMED"> |
94 |
|
import os |
95 |
|
try: |
96 |
|
pos = os.environ['PAPO_POS'] |
97 |
|
except KeyError: |
98 |
|
pos = 1 |
99 |
|
print pos |
100 |
|
ownPosBlock.initQuery() |
101 |
|
ownPosBlock.ownPosIdEntry = str(pos) |
102 |
|
ownPosBlock.processQuery() |
103 |
|
</trigger> |
104 |
|
<!--/pos--> |
105 |
|
|
106 |
|
|
107 |
<block name="neb:$ownPosBlock" datasource="ownPosDataSource"> |
<block name="neb:$ownPosBlock" datasource="ownPosDataSource"> |
108 |
<neb:Block>if (defined($stockByInvoice)){</neb:Block> |
<neb:Block>if ($stockByInvoice ne ""){</neb:Block> |
109 |
<entry name="neb:$stockByInvoice" field="_own_pos_data.stock_by_invoice" x="65" y="1" hidden="" /> |
<entry name="neb:$stockByInvoice" field="_own_pos_data.stock_by_invoice" x="65" y="1" hidden="" /> |
110 |
<neb:Block>}</neb:Block> |
<neb:Block>}</neb:Block> |
111 |
<entry name="neb:$ownPosEntityIdEntry" field="_entity_data._table" |
<entry name="neb:$ownPosEntityIdEntry" field="_entity_data._table" |
115 |
</block> |
</block> |
116 |
|
|
117 |
<!-- # de factura --> |
<!-- # de factura --> |
118 |
|
|
119 |
|
<neb:Block>if ($ownPosDocumentBlock ne ""){</neb:Block> |
120 |
<block name="neb:$ownPosDocumentBlock" datasource="ownPosDocumentDataSource"> |
<block name="neb:$ownPosDocumentBlock" datasource="ownPosDocumentDataSource"> |
121 |
|
|
122 |
<entry name="neb:$documentNumberEntry" field="_own_pos_document_data.number" style="label" |
<entry name="neb:$documentNumberEntry" field="_own_pos_document_data.number" style="label" |
128 |
<entry name="documentPrintCommand" field="_own_pos_document_data.print_command" hidden="" |
<entry name="documentPrintCommand" field="_own_pos_document_data.print_command" hidden="" |
129 |
x="50" y="1" width="15"/> |
x="50" y="1" width="15"/> |
130 |
</block> |
</block> |
131 |
|
<neb:Block>}</neb:Block> |
132 |
<!--/POS DOCUMENT COMPONENT --> |
<!--/POS DOCUMENT COMPONENT --> |
133 |
|
|
134 |
|
|