52 |
<datasource name="printProductDataSource" database="papo" |
<datasource name="printProductDataSource" database="papo" |
53 |
table="_product_data, _product_code_data, _product_store_data" |
table="_product_data, _product_code_data, _product_store_data" |
54 |
cache="15" order_by="_product_data.canonical_name"> |
cache="15" order_by="_product_data.canonical_name"> |
55 |
|
<joinconditions> |
56 |
|
<join type="left"> |
57 |
|
<join type="left"> |
58 |
|
<left_table name="_product_data"/> |
59 |
|
<right_table name="_product_code_data"/> |
60 |
|
<condition> |
61 |
|
<eq> |
62 |
|
<cfield name="_product_data._table"/> |
63 |
|
<cfield name="_product_code_data.product"/> |
64 |
|
</eq> |
65 |
|
</condition> |
66 |
|
</join> |
67 |
|
<right_table name="_product_store_data"/> |
68 |
|
<condition> |
69 |
|
<eq> |
70 |
|
<cfield name="_product_data._table"/> |
71 |
|
<cfield name="_product_store_data.product"/> |
72 |
|
</eq> |
73 |
|
</condition> |
74 |
|
</join> |
75 |
|
</joinconditions> |
76 |
<condition> |
<condition> |
77 |
<and> |
<and> |
78 |
<!-- pega product con price --> |
<!-- pega product con price --> |
86 |
<!-- <cconst value="1"/> --> |
<!-- <cconst value="1"/> --> |
87 |
<!-- </eq> --> |
<!-- </eq> --> |
88 |
<!-- pega product con product_code --> |
<!-- pega product con product_code --> |
89 |
<eq> |
<!-- <eq> --> |
90 |
<cfield name="_product_data._table"/> |
<!-- <cfield name="_product_data._table"/> --> |
91 |
<cfield name="_product_code_data.product"/> |
<!-- <cfield name="_product_code_data.product"/> --> |
92 |
</eq> |
<!-- </eq> --> |
93 |
<!-- solamente códigos internos (id 1) --> |
<!-- solamente códigos internos (id 1) --> |
94 |
<eq> |
<eq> |
95 |
<cfield name="_product_code_data.product_code_type"/> |
<cfield name="_product_code_data.product_code_type"/> |
96 |
<cconst value="1"/> |
<cconst value="1"/> |
97 |
</eq> |
</eq> |
98 |
<!-- pega product con product_store --> |
<!-- pega product con product_store --> |
99 |
<eq> |
<!-- <eq> --> |
100 |
<cfield name="_product_data._table"/> |
<!-- <cfield name="_product_data._table"/> --> |
101 |
<cfield name="_product_store_data.product"/> |
<!-- <cfield name="_product_store_data.product"/> --> |
102 |
</eq> |
<!-- </eq> --> |
103 |
<!-- descarta productos muertos --> |
<!-- descarta productos muertos --> |
104 |
<null> |
<null> |
105 |
<cfield name="_product_data._end_t"/> |
<cfield name="_product_data._end_t"/> |
273 |
if str(productSearchBlock.searchCodeEntry) or str(productSearchBlock.searchNameEntry): |
if str(productSearchBlock.searchCodeEntry) or str(productSearchBlock.searchNameEntry): |
274 |
if str(productSearchBlock.searchCodeEntry): |
if str(productSearchBlock.searchCodeEntry): |
275 |
eq1 = GConditions.GClike(tmpAnd) |
eq1 = GConditions.GClike(tmpAnd) |
276 |
GConditions.GCField(eq1,"_entity_uid_data.uid") |
GConditions.GCField(eq1,"_product_code_data.code") |
277 |
GConditions.GCConst(eq1,str(productSearchBlock.searchCodeEntry)+'%') |
GConditions.GCConst(eq1,str(productSearchBlock.searchCodeEntry)+'%') |
278 |
if str(productSearchBlock.searchNameEntry): |
if str(productSearchBlock.searchNameEntry): |
279 |
eq2 = GConditions.GClike(tmpAnd) |
eq2 = GConditions.GClike(tmpAnd) |
280 |
GConditions.GCField(eq2,"_entity_data.name") |
GConditions.GCField(eq2,"_product_data.name") |
281 |
GConditions.GCConst(eq2,str(productSearchBlock.searchNameEntry)+'%') |
GConditions.GCConst(eq2,str(productSearchBlock.searchNameEntry)+'%') |
282 |
|
|
283 |
eq3 = GConditions.GClike(tmpAnd) |
tmpOr = GConditions.GCor(tmpAnd) |
284 |
|
eq3 = GConditions.GClike(tmpOr) |
285 |
GConditions.GCField(eq3,"_product_store_data.storehouse") |
GConditions.GCField(eq3,"_product_store_data.storehouse") |
286 |
GConditions.GCConst(eq3,str(ownStorehouseBlock.ownStorehouseIdEntry)) |
GConditions.GCConst(eq3,str(ownStorehouseBlock.ownStorehouseIdEntry)) |
287 |
|
tmpNull = GConditions.GCnull(tmpOr) |
288 |
|
GConditions.GCField(tmpNull,"_product_store_data.storehouse") |
289 |
|
|
290 |
productResulSet = printProductDataSource.createResultSet(productCondition) |
productResulSet = printProductDataSource.createResultSet(productCondition) |
291 |
|
|
292 |
more = productResulSet.firstRecord(); |
more = productResulSet.firstRecord(); |
293 |
|
|
294 |
while more: |
while more: |
295 |
line = " | "+printing.printField(productResulSet.current.getField("_product_code_data.code"),13,'l')+" | " |
line = " | "+printing.printField(productResulSet.current.getField("_product_code_data.code"),13,'l')+" | " |
296 |
line += printing.printField(productResulSet.current.getField("_product_data.canonical_name"),48,'l')+" | " |
line += printing.printField(productResulSet.current.getField("_product_data.canonical_name"),48,'l')+" | " |
297 |
if productResulSet.current.getField("_product_store_data.level"): |
if productResulSet.current.getField("_product_store_data.level"): |
298 |
line += printing.printField("%0.2f" % productResulSet.current.getField("_product_store_data.level"),8,'r')+" | " |
line += printing.printField("%0.2f" % productResulSet.current.getField("_product_store_data.level"),8,'r')+" | " |
299 |
else: |
else: |
300 |
line += "0.00"+" | " |
line += printing.printField("0.00",8,'r')+" | " |
301 |
table.append(line) |
table.append(line) |
302 |
more = productResulSet.nextRecord() |
more = productResulSet.nextRecord() |
303 |
|
|
326 |
except DBError, err: |
except DBError, err: |
327 |
rollbackConnection() |
rollbackConnection() |
328 |
genericBox("Hay problemas para grabar los datos del producto\n"+str(err),['Aceptar']) |
genericBox("Hay problemas para grabar los datos del producto\n"+str(err),['Aceptar']) |
|
#productBlock.jumpRecord(2) |
|
329 |
else: |
else: |
330 |
try: |
try: |
331 |
productBlock.postChanges() |
productBlock.postChanges() |