1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleSalesProductList = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 show : function (_self)
36 _this.grid.footer.onClick('first');
44 title : "Products List",
51 activate : function() {
55 // _this.grid.footer.onClick('first');
64 title : "Products List",
72 // if (_this.panel.active) {
73 // this.footer.onClick('first');
77 rowdblclick : function (_self, rowIndex, e)
83 var s = this.ds.getAt(rowIndex);
84 if (s.data.item_id * 1 < 1 ) {
88 _this.callback.call(_this,s.data);
91 autoExpandColumn : 'item_descrip1',
94 xtype: 'RowSelectionModel',
102 beforeload : function (_self, o)
104 o.params._with_prodcat = 1;
105 o.params._with_char = 1;
106 o.params._with_itemsrc_active = 1;
107 o.params._with_last_purchase_price = 1;
108 o.params._with_image = 1;
109 o.params._with_itemsite = 1;
111 if(typeof(_this.data.cohead_cust_id) != 'undefind'){
112 o.params.cohead_cust_id = _this.data.cohead_cust_id;
115 if(typeof(_this.data.cohead_id) != 'undefind'){
116 o.params.cohead_id = _this.data.cohead_id;
119 var s = _this.searchBox.getValue();
123 o.params['query[number_or_name]'] = s;
128 sortInfo : { field : 'item_number', direction: 'ASC' },
133 url : baseURL + '/Roo/item.php'
140 totalProperty : 'total',
147 'name': 'item_number',
151 'name': 'item_descrip1',
155 'name': 'item_descrip2',
159 'name': 'item_classcode_id',
163 'name': 'item_picklist',
167 'name': 'item_comments',
175 'name': 'item_fractional',
179 'name': 'item_active',
187 'name': 'item_prodweight',
191 'name': 'item_packweight',
195 'name': 'item_prodcat_id',
199 'name': 'item_exclusive',
203 'name': 'item_listprice',
207 'name': 'item_config',
211 'name': 'item_extdescrip',
215 'name': 'item_upccode',
219 'name': 'item_maxcost',
223 'name': 'item_inv_uom_id',
227 'name': 'item_price_uom_id',
231 'name': 'item_warrdays',
235 'name': 'item_freightclass_id',
239 'name': 'item_tax_recoverable',
243 'name': 'item_price_uom_id_uom_id',
247 'name': 'item_price_uom_id_uom_name',
251 'name': 'item_price_uom_id_uom_descrip',
255 'name': 'item_price_uom_id_uom_item_weight',
259 'name': 'item_inv_uom_id_uom_id',
263 'name': 'item_inv_uom_id_uom_name',
267 'name': 'item_inv_uom_id_uom_descrip',
271 'name': 'item_inv_uom_id_uom_item_weight',
275 'name': 'item_freightclass_id_freightclass_id',
279 'name': 'item_freightclass_id_freightclass_code',
283 'name': 'item_freightclass_id_freightclass_descrip',
287 'name': 'item_classcode_id_classcode_id',
291 'name': 'item_classcode_id_classcode_code',
295 'name': 'item_classcode_id_classcode_descrip',
299 'name': 'item_classcode_id_classcode_mfg',
303 'name': 'item_classcode_id_classcode_creator',
307 'name': 'item_classcode_id_classcode_created',
311 'name': 'item_classcode_id_classcode_modifier',
315 'name': 'item_classcode_id_classcode_modified',
319 'name': 'item_classcode_id_classcode_type',
326 xtype: 'PagingToolbar',
329 displayMsg : "Double click to select the item",
330 emptyMsg : "No item found",
341 specialkey : function (_self, e)
343 _this.grid.footer.onClick('first');
345 render : function (_self)
347 _this.searchBox = _self;
355 click : function (_self, e)
357 _this.grid.footer.onClick('first');
361 icon : rootURL + '/Pman/templates/images/search.gif'
367 click : function (_self, e)
369 _this.searchBox.setValue('');
\r
370 _this.status_type.setValue('');
\r
371 _this.grid.footer.onClick('first');
\r
375 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
381 xtype: 'ColumnModel',
383 dataIndex : 'item_image_filename',
386 renderer : function(v,x,r)
\r
391 if(r.data.item_image_from_hk){
392 var url = baseURL.split('/');
395 return '<img src="' + url + '/hk.php/Images/Thumb/150x150/' + r.data.item_image_id + '/' + v + '" width="150" height="100" />';
397 return '<img src="' + baseURL + '/Images/Thumb/150x150/' + r.data.item_image_id + '/' + v + '" width="150" height="100" />';
\r
401 xtype: 'ColumnModel',
403 dataIndex : 'item_char_brand',
407 renderer : function(v) { return String.format('{0}', v); }
410 xtype: 'ColumnModel',
412 dataIndex : 'item_char_productgroup',
413 header : 'Product Group',
415 renderer : function(v) { return String.format('{0}', v); }
418 xtype: 'ColumnModel',
420 dataIndex : 'item_number',
423 renderer : function(v) { return String.format('{0}', v); }
426 xtype: 'ColumnModel',
428 dataIndex : 'item_descrip1',
429 header : 'Description',
431 renderer : function(v) { return String.format('{0}', v); }
434 xtype: 'ColumnModel',
436 dataIndex : 'itemsrc_active',
437 header : 'Purchased',
439 renderer : function(v) {
440 var state = v * 1 > 0 ? '-checked' : '';
442 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
447 xtype: 'ColumnModel',
449 dataIndex : 'item_sold',
452 renderer : function(v) {
453 var state = v * 1 > 0 ? '-checked' : '';
455 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
460 xtype: 'ColumnModel',
462 dataIndex : 'item_active',
463 header : 'is Active?',
465 renderer : function(v) {
466 var state = v * 1 > 0 ? '-checked' : '';
468 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
473 xtype: 'ColumnModel',
475 dataIndex : 'item_type',
478 renderer : function(v) { return String.format('{0}', v); }
481 xtype: 'ColumnModel',
483 dataIndex : 'item_prodcat_id_prodcat_code',
484 header : 'Item prodcat',
486 renderer : function(v) { return String.format('{0}', v); }
493 xtype: 'LayoutRegion',
501 click : function (_self, e)
512 click : function (_self, e)