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 if (!_this.data.exclude_itemsrc_vendor) {
108 o.params._with_itemsrc_active = 1;
110 o.params._with_last_purchase_price = 1;
111 o.params._with_itemsite = 1;
112 o.params._with_image = 1;
114 if(typeof(_this.data.cohead_cust_id) != 'undefined'){
115 o.params.cohead_cust_id = _this.data.cohead_cust_id;
118 if(typeof(_this.data.cohead_id) != 'undefined'){
119 o.params.cohead_id = _this.data.cohead_id;
122 var s = _this.searchBox.getValue();
124 o.params['query[number_or_name]'] = s;
126 if (_this.data.exclude_itemsrc_vendor) {
127 o.params._exclude_itemsrc_vendor = _this.data.exclude_itemsrc_vendor;
130 _this.addSelected.show();
131 if (!_this.data.multi_select) {
132 _this.addSelected.hide();
138 sortInfo : { field : 'item_number', direction: 'ASC' },
143 url : baseURL + '/Roo/item.php'
150 totalProperty : 'total',
157 'name': 'item_number',
161 'name': 'item_descrip1',
165 'name': 'item_descrip2',
169 'name': 'item_classcode_id',
173 'name': 'item_picklist',
177 'name': 'item_comments',
185 'name': 'item_fractional',
189 'name': 'item_active',
197 'name': 'item_prodweight',
201 'name': 'item_packweight',
205 'name': 'item_prodcat_id',
209 'name': 'item_exclusive',
213 'name': 'item_listprice',
217 'name': 'item_config',
221 'name': 'item_extdescrip',
225 'name': 'item_upccode',
229 'name': 'item_maxcost',
233 'name': 'item_inv_uom_id',
237 'name': 'item_price_uom_id',
241 'name': 'item_warrdays',
245 'name': 'item_freightclass_id',
249 'name': 'item_tax_recoverable',
253 'name': 'item_price_uom_id_uom_id',
257 'name': 'item_price_uom_id_uom_name',
261 'name': 'item_price_uom_id_uom_descrip',
265 'name': 'item_price_uom_id_uom_item_weight',
269 'name': 'item_inv_uom_id_uom_id',
273 'name': 'item_inv_uom_id_uom_name',
277 'name': 'item_inv_uom_id_uom_descrip',
281 'name': 'item_inv_uom_id_uom_item_weight',
285 'name': 'item_freightclass_id_freightclass_id',
289 'name': 'item_freightclass_id_freightclass_code',
293 'name': 'item_freightclass_id_freightclass_descrip',
297 'name': 'item_classcode_id_classcode_id',
301 'name': 'item_classcode_id_classcode_code',
305 'name': 'item_classcode_id_classcode_descrip',
309 'name': 'item_classcode_id_classcode_mfg',
313 'name': 'item_classcode_id_classcode_creator',
317 'name': 'item_classcode_id_classcode_created',
321 'name': 'item_classcode_id_classcode_modifier',
325 'name': 'item_classcode_id_classcode_modified',
329 'name': 'item_classcode_id_classcode_type',
336 xtype: 'PagingToolbar',
339 displayMsg : "Double click to select the item",
340 emptyMsg : "No item found",
351 specialkey : function (_self, e)
353 _this.grid.footer.onClick('first');
355 render : function (_self)
357 _this.searchBox = _self;
365 click : function (_self, e)
367 _this.grid.footer.onClick('first');
371 icon : rootURL + '/Pman/templates/images/search.gif'
377 click : function (_self, e)
379 _this.searchBox.setValue('');
\r
380 _this.status_type.setValue('');
\r
381 _this.grid.footer.onClick('first');
\r
385 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
391 xtype: 'ColumnModel',
393 dataIndex : 'item_image_id',
396 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/50/{1}/{2}" height="50">', baseURL, v, r.data.item_image_filename); }
399 xtype: 'ColumnModel',
401 dataIndex : 'item_char_brand',
405 renderer : function(v) { return String.format('{0}', v); }
408 xtype: 'ColumnModel',
410 dataIndex : 'item_char_productgroup',
411 header : 'Product Group',
413 renderer : function(v) { return String.format('{0}', v); }
416 xtype: 'ColumnModel',
418 dataIndex : 'item_number',
421 renderer : function(v) { return String.format('{0}', v); }
424 xtype: 'ColumnModel',
426 dataIndex : 'item_descrip1',
427 header : 'Description',
429 renderer : function(v) { return String.format('{0}', v); }
432 xtype: 'ColumnModel',
434 dataIndex : 'itemsrc_active',
435 header : 'Purchased',
437 renderer : function(v) {
438 var state = v * 1 > 0 ? '-checked' : '';
440 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
445 xtype: 'ColumnModel',
447 dataIndex : 'item_sold',
450 renderer : function(v) {
451 var state = v * 1 > 0 ? '-checked' : '';
453 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
458 xtype: 'ColumnModel',
460 dataIndex : 'item_active',
461 header : 'is Active?',
463 renderer : function(v) {
464 var state = v * 1 > 0 ? '-checked' : '';
466 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
471 xtype: 'ColumnModel',
473 dataIndex : 'item_type',
476 renderer : function(v) { return String.format('{0}', v); }
479 xtype: 'ColumnModel',
481 dataIndex : 'item_prodcat_id_prodcat_code',
482 header : 'Item prodcat',
484 renderer : function(v) { return String.format('{0}', v); }
491 xtype: 'LayoutRegion',
499 click : function (_self, e)
506 var sels = _this.grid.selModel.getSelections();
508 Roo.MessageBox.alert("Error", "Select some items");
511 _this.callback.call(_this,sels);
513 render : function (_self)
515 _this.addSelected = _self;
518 text : "Add Selected"
524 click : function (_self, e)
526 Pman.Dialog.XtupleItem.show({item_id : 0}, function(){
527 _this.grid.footer.onClick('first');
537 click : function (_self, e)