88 |
|
|
89 |
<!-- lo mismo que arriba, el anterior es para buscar, este para |
<!-- lo mismo que arriba, el anterior es para buscar, este para |
90 |
ABM de uno en particular (segunda pantaia) --> |
ABM de uno en particular (segunda pantaia) --> |
91 |
<datasource name="productDataSource" database="papo" |
<datasource name="productDataSource" database="papo" |
92 |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
table="product, _product_data, price, _price_data, product_code, _product_code_data, product_tax, _product_tax_data, product_store, _product_store_data" |
93 |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
historytable="_product_data, _price_data, _product_code_data, _product_tax_data, _product_store_data" |
94 |
order_by="_product_data.canonical_name,_product_code_data.code"> |
order_by="_product_data.canonical_name,_product_code_data.code"> |
248 |
import gnue.common.GConditions as GConditions |
import gnue.common.GConditions as GConditions |
249 |
import string |
import string |
250 |
import hack |
import hack |
251 |
|
import printing |
|
def printField (field,size,justif='l'): |
|
|
if str(field).strip() == "None": |
|
|
field = "" |
|
|
if justif.lower() == 'l': |
|
|
return str(field).ljust(size) |
|
|
elif justif.lower() == 'r': |
|
|
return str(field).rjust(size) |
|
|
else: |
|
|
return str(field).center(size) |
|
252 |
|
|
|
def printTitle (field,size): |
|
|
return str(field).center(size) |
|
|
|
|
|
|
|
253 |
table = [] |
table = [] |
254 |
|
table.append (printing.printDate ()) |
255 |
line = "\n\nListado de Productos\n\n\n" |
line = "\n\nListado de Productos\n\n\n" |
256 |
table.append(line) |
table.append(line) |
257 |
|
|
258 |
line = " | "+printTitle("Código",13)+" | " |
line = " | "+printing.printTitle("Código",13)+" | " |
259 |
line += printTitle("Nombre",48)+" | " |
line += printing.printTitle("Nombre",48)+" | " |
260 |
line += printTitle("Stock",8)+" | " |
line += printing.printTitle("Stock",8)+" | " |
261 |
lineLen = len(line) |
lineLen = len(line) |
262 |
table.append(line) |
table.append(line) |
263 |
line = "" |
line = "" |
283 |
more = productResulSet.firstRecord(); |
more = productResulSet.firstRecord(); |
284 |
|
|
285 |
while more: |
while more: |
286 |
line = " | "+printField(productResulSet.current.getField("_product_code_data.code"),13,'l')+" | " |
line = " | "+printing.printField(productResulSet.current.getField("_product_code_data.code"),13,'l')+" | " |
287 |
line += printField(productResulSet.current.getField("_product_data.canonical_name"),48,'l')+" | " |
line += printing.printField(productResulSet.current.getField("_product_data.canonical_name"),48,'l')+" | " |
288 |
line += 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')+" | " |
289 |
table.append(line) |
table.append(line) |
290 |
|
|
291 |
more = productResulSet.nextRecord() |
more = productResulSet.nextRecord() |
292 |
|
|
293 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
294 |
|
|
295 |
hack.previewPrint(table) |
printing.previewPrint(table) |
296 |
|
|
297 |
]]></trigger> |
]]></trigger> |
298 |
|
|