3 |
<form title="Ajuste de Stock" |
<form title="Ajuste de Stock" |
4 |
height="20" width="80" tabbed="top"> |
height="20" width="80" tabbed="top"> |
5 |
<!-- I think this one's not used yet --> |
<!-- I think this one's not used yet --> |
6 |
|
<neb:Block> |
7 |
|
use PAPO; |
8 |
|
my $uniqed=0; |
9 |
|
</neb:Block> |
10 |
|
<datasource name="tmpValuesDataSource" cache="1"/> |
11 |
<datasource name="storehouseDataSource" database="papo" |
<datasource name="storehouseDataSource" database="papo" |
12 |
table="entity, _entity_data, own_entity, _own_entity_data, own_storehouse, _own_storehouse_data"> |
table="entity, _entity_data, own_entity, _own_entity_data, own_storehouse, _own_storehouse_data"> |
13 |
<condition> |
<condition> |
14 |
<and> |
<and> |
15 |
<!-- glue historics --> |
<!-- glue historics --> |
16 |
|
|
17 |
<eq> <cfield name="entity.id"/> <cfield name="_entity_data._table"/> </eq> |
<eq> <cfield name="entity.id"/> <cfield name="_entity_data._table"/> </eq> |
18 |
<null> <cfield name="_entity_data._end_t"/> </null> |
<null> <cfield name="_entity_data._end_t"/> </null> |
19 |
|
|
20 |
<eq> <cfield name="own_entity.id"/> <cfield name="_own_entity_data._table"/> </eq> |
<eq> <cfield name="own_entity.id"/> <cfield name="_own_entity_data._table"/> </eq> |
21 |
<null> <cfield name="_own_entity_data._end_t"/> </null> |
<null> <cfield name="_own_entity_data._end_t"/> </null> |
22 |
|
|
23 |
<eq> <cfield name="own_storehouse.id"/> <cfield name="_own_storehouse_data._table"/> </eq> |
<eq> <cfield name="own_storehouse.id"/> <cfield name="_own_storehouse_data._table"/> </eq> |
24 |
<null> <cfield name="_own_storehouse_data._end_t"/> </null> |
<null> <cfield name="_own_storehouse_data._end_t"/> </null> |
25 |
|
|
26 |
<!-- join them --> |
<!-- join them --> |
27 |
<eq> <cfield name="_own_entity_data.entity"/> <cfield name="entity.id"/> </eq> |
<eq> <cfield name="_own_entity_data.entity"/> <cfield name="entity.id"/> </eq> |
28 |
<eq> <cfield name="_own_storehouse_data.own_entity"/> <cfield name="own_entity.id"/> </eq> |
<eq> <cfield name="_own_storehouse_data.own_entity"/> <cfield name="own_entity.id"/> </eq> |
29 |
|
|
30 |
<!-- no filters --> |
<!-- no filters --> |
31 |
</and> |
</and> |
32 |
</condition> |
</condition> |
33 |
</datasource> |
</datasource> |
34 |
|
|
35 |
<!-- the main data source --> |
<!-- the main data source --> |
36 |
<datasource name="storeProductLevelDataSource" database="papo" |
<datasource name="storeProductLevelDataSource" database="papo" |
37 |
table="product_store, _product_store_data, product, _product_data, product_code, _product_code_data" |
table="product_store, _product_store_data, product, _product_data, product_code, _product_code_data" |
66 |
<!-- this one will hold the resultSet --> |
<!-- this one will hold the resultSet --> |
67 |
<datasource name="searchDataSource"/> |
<datasource name="searchDataSource"/> |
68 |
|
|
69 |
<!-- Origen de datos que contiene el numero del próximo doc --> |
|
|
<datasource name="branchDocumentDataSource" database="papo" |
|
|
table="branch_document, _branch_document_data" historytable="_branch_document_data" prequery="y"> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> <cfield name="branch_document.id"/> <cfield name="_branch_document_data._table"/> </eq> |
|
|
|
|
|
<!-- numero para los ajustes de stock --> |
|
|
<eq> <cfield name="_branch_document_data.document_type"/> <cconst value="7"/> </eq> |
|
|
|
|
|
<!-- que este activo --> |
|
|
<null> <cfield name="_branch_document_data._end_t"/> </null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
70 |
<!-- Origen de datos que contiene el encabezado del documento --> |
<!-- Origen de datos que contiene el encabezado del documento --> |
71 |
<datasource name="ownDocumentDataSource" database="papo" table="own_document" |
<datasource name="ownDocumentDataSource" database="papo" table="own_document" |
72 |
order_by="date" /> |
order_by="date" /> |
108 |
</datasource> |
</datasource> |
109 |
|
|
110 |
<!-- Triggers --> |
<!-- Triggers --> |
111 |
|
<trigger name="startUp" type="On-Startup"> |
112 |
|
callTrigger('startTrigger') |
113 |
|
</trigger> |
114 |
|
<trigger name="startTrigger" type="NAMED"> |
115 |
|
ownDocumentBlock.typeEntry = "7" |
116 |
|
callTrigger('searchNextStockMaintenanceNumber') |
117 |
|
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
118 |
|
</trigger> |
119 |
|
|
120 |
<trigger name="searchTrigger" type="NAMED"><![CDATA[ |
<trigger name="searchTrigger" type="NAMED"><![CDATA[ |
121 |
|
callTrigger('startTrigger') |
122 |
storeProductLevelBlock.clear() |
storeProductLevelBlock.clear() |
123 |
storeProductLevelBlock.initQuery () |
storeProductLevelBlock.initQuery () |
124 |
storeProductLevelBlock.productCodeEntry= str(searchBlock.productCodeFilterEntry)+'%' |
storeProductLevelBlock.productCodeEntry= str(searchBlock.productCodeFilterEntry)+'%' |
129 |
<trigger name="rollbackTrigger" type="NAMED"> |
<trigger name="rollbackTrigger" type="NAMED"> |
130 |
for block in form._object._blockList: |
for block in form._object._blockList: |
131 |
block.clear() |
block.clear() |
132 |
|
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
133 |
</trigger> |
</trigger> |
134 |
|
|
135 |
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
159 |
printing.printField (printingDocBlock.diffEntry, 6, 'r')+'|'+ |
printing.printField (printingDocBlock.diffEntry, 6, 'r')+'|'+ |
160 |
printing.printField (printingDocBlock.obsEntry, 19)+'|') |
printing.printField (printingDocBlock.obsEntry, 19)+'|') |
161 |
printingDocBlock.nextRecord () |
printingDocBlock.nextRecord () |
162 |
|
print str(ownPosDocumentBlock.documentPrintCommand) |
163 |
printing.previewPrint (lines) |
while form.genericBox ('Verifique que se haya impreso bien', ['Listo', 'Reintentar'])==2: |
164 |
|
printing.previewPrint (lines,ownPosDocumentBlock.documentPrintCommand) |
165 |
]]></trigger> |
]]></trigger> |
166 |
|
|
167 |
<trigger name="commitTrigger" type="NAMED"><![CDATA[ |
<trigger name="commitTrigger" type="NAMED"><![CDATA[ |
175 |
ownDocumentBlock.newRecord () |
ownDocumentBlock.newRecord () |
176 |
ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq') |
ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq') |
177 |
# increase the doc number |
# increase the doc number |
178 |
ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry) |
ownDocumentBlock.numberEntry= str(ownPosDocumentBlock.documentNumberEntry) |
179 |
branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1) |
ownPosDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1) |
|
|
|
180 |
# set the date, id and type |
# set the date, id and type |
181 |
ownDocumentBlock.dateEntry = ownDocumentDataSource.getTimeStamp() |
ownDocumentBlock.dateEntry = str(tmpBlock.tmpDateEntry) |
182 |
ownDocumentBlock.typeEntry = "7" |
#ownDocumentDataSource.getTimeStamp() |
183 |
|
#ownDocumentBlock.typeEntry = "7" |
184 |
# nice try to curryfy ;) |
# nice try to curryfy ;) |
185 |
changeValueFunction= lambda diff: lambda actual_value: actual_value+diff |
changeValueFunction= lambda diff: lambda actual_value: actual_value+diff |
186 |
|
|
201 |
ownItemBlock.diffEntry= str(diff) |
ownItemBlock.diffEntry= str(diff) |
202 |
ownItemBlock.obsEntry= str(storeProductLevelBlock.obsEntry) |
ownItemBlock.obsEntry= str(storeProductLevelBlock.obsEntry) |
203 |
storeProductLevelBlock.nextRecord () |
storeProductLevelBlock.nextRecord () |
|
|
|
204 |
searchBlock.clear() |
searchBlock.clear() |
205 |
# uncomment if you want an empty |
# uncomment if you want an empty |
206 |
# storeProductLevelBlock.clear() |
# storeProductLevelBlock.clear() |
207 |
ownDocumentBlock.commit() |
#ownDocumentBlock.commit() |
208 |
|
try: |
209 |
|
ownDocumentBlock.postChanges() |
210 |
|
commitConnection() |
211 |
|
except DBError, err: |
212 |
|
rollbackConnection() |
213 |
|
genericBox("Hay problemas para grabar los datos \n \n"+str(err),['Aceptar']) |
214 |
callTrigger('printTrigger') |
callTrigger('printTrigger') |
215 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
216 |
]]></trigger> |
callTrigger('rollbackTrigger') |
217 |
|
callTrigger('startTrigger') |
218 |
|
]]></trigger> |
219 |
|
|
220 |
<neb:Sub neb:src="wait.nebc"/> |
<neb:Sub neb:src="wait.nebc"/> |
221 |
|
|
222 |
<page name="Ajuste de Stock"> |
<page name="Ajuste de Stock"> |
223 |
|
<box height="4" label="número" name="dateRecipientBox" width="80" x="0" y="0"> |
224 |
|
<block name="tmpBlock" datasource="tmpValuesDataSource" transparentBlock=""> |
225 |
|
<label text="Fecha" x="1" y="1" /> |
226 |
|
<label text="Número de Auste de Stock:" x="32" y="1"/> |
227 |
|
<entry name="tmpDateEntry" typecast="date" width="14" x="7" y="1"/> |
228 |
|
</block> |
229 |
|
<neb:Sub neb:src="posDocument.nebc" documentType="ownDocumentBlock.typeEntry" |
230 |
|
ownPosDocumentBlock="ownPosDocumentBlock" documentNumberEntry="documentNumberEntry" |
231 |
|
documentNumberEntryX="65" documentNumberEntryY="1" |
232 |
|
searchNextDocumentNumber="searchNextStockMaintenanceNumber" > |
233 |
|
</neb:Sub> |
234 |
|
</box> |
235 |
|
<box height="18" label="ajuste stock" name="stockMaintenanceRecipientBox" width="80" x="0" y="3"> |
236 |
<block name="searchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert=""> |
<block name="searchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert=""> |
237 |
<label text="Código" |
<label text="Código" |
238 |
x="1" y="1"/> |
x="1" y="1"/> |
261 |
<label text="Cant. en stock" |
<label text="Cant. en stock" |
262 |
x="41" y="3"/> |
x="41" y="3"/> |
263 |
<entry name="levelEntry" field="_product_store_data.level" |
<entry name="levelEntry" field="_product_store_data.level" |
264 |
x="50" y="4" width="5" rows="10" |
x="48" y="4" width="8" rows="10" |
265 |
displaymask="%.3f"/> |
displaymask="%.3f"/> |
266 |
<label text="Observaciones" |
<label text="Observaciones" |
267 |
x="56" y="3"/> |
x="56" y="3"/> |
289 |
<entry name="obsEntry" field="own_product_stock_item.observations" hidden="y" x="1" y="1"/> |
<entry name="obsEntry" field="own_product_stock_item.observations" hidden="y" x="1" y="1"/> |
290 |
</block> |
</block> |
291 |
|
|
292 |
<block name="branchDocumentBlock" datasource="branchDocumentdataSource"> |
<!-- <block name="ownPosDocumentBlock" datasource="ownPosDocumentdataSource"> --> |
293 |
<entry name="documentNumberEntry" field="_branch_document_data.number" hidden="y" x="1" y="1"/> |
<!-- <entry name="documentNumberEntry" field="_branch_document_data.number" hidden="y" x="1" y="1"/> --> |
294 |
</block> |
<!-- </block> --> |
295 |
|
|
296 |
<block name="printingDocBlock" datasource="printingDocDataSource"> |
<block name="printingDocBlock" datasource="printingDocDataSource"> |
297 |
<entry name="docIdEntry" field="own_document.id" hidden="y" x="1" y="1"/> |
<entry name="docIdEntry" field="own_document.id" hidden="y" x="1" y="1"/> |
298 |
<entry name="dateEntry" field="own_document.date" hidden="y" x="1" y="1"/> |
<entry name="dateEntry" field="own_document.date" hidden="y" x="1" y="1"/> |
299 |
<entry name="productCodeEntry" field="_product_code_data.code" hidden="y" x="1" y="1"/> |
<entry name="productCodeEntry" field="_product_code_data.code" hidden="y" x="1" y="1"/> |
300 |
<entry name="productNameEntry" field="_product_data.canonical_name" hidden="y" x="1" y="1"/> |
<entry name="productNameEntry" field="_product_data.canonical_name" hidden="y" x="1" y="1"/> |
301 |
<entry name="diffEntry" field="own_product_stock_item.difference" hidden="y" x="1" y="1"/> |
<entry name="diffEntry" field="own_product_stock_item.difference" hidden="y" x="1" y="1"/> |
302 |
<entry name="obsEntry" field="own_product_stock_item.observations" hidden="y" x="1" y="1"/> |
<entry name="obsEntry" field="own_product_stock_item.observations" hidden="y" x="1" y="1"/> |
303 |
</block> |
</block> |
304 |
|
</box> |
305 |
</page> |
</page> |
306 |
</form> |
</form> |