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_itemsite = 1;
109 o.params._with_image = 1;
111 if(typeof(_this.data.cohead_cust_id) != 'undefined'){
112 o.params.cohead_cust_id = _this.data.cohead_cust_id;
115 if(typeof(_this.data.cohead_id) != 'undefined'){
116 o.params.cohead_id = _this.data.cohead_id;
119 var s = _this.searchBox.getValue();
121 o.params['query[number_or_name]'] = s;
123 if (_this.data.exclude_itemsrc_vendor) {
124 o.params._exclude_itemsrc_vendor = _this.data.exclude_itemsrc_vendor;
127 _this.addSelected.show();
128 if (!_this.data.multi_select) {
129 _this.addSelected.hide();
135 sortInfo : { field : 'item_number', direction: 'ASC' },
140 url : baseURL + '/Roo/item.php'
147 totalProperty : 'total',
154 'name': 'item_number',
158 'name': 'item_descrip1',
162 'name': 'item_descrip2',
166 'name': 'item_classcode_id',
170 'name': 'item_picklist',
174 'name': 'item_comments',
182 'name': 'item_fractional',
186 'name': 'item_active',
194 'name': 'item_prodweight',
198 'name': 'item_packweight',
202 'name': 'item_prodcat_id',
206 'name': 'item_exclusive',
210 'name': 'item_listprice',
214 'name': 'item_config',
218 'name': 'item_extdescrip',
222 'name': 'item_upccode',
226 'name': 'item_maxcost',
230 'name': 'item_inv_uom_id',
234 'name': 'item_price_uom_id',
238 'name': 'item_warrdays',
242 'name': 'item_freightclass_id',
246 'name': 'item_tax_recoverable',
250 'name': 'item_price_uom_id_uom_id',
254 'name': 'item_price_uom_id_uom_name',
258 'name': 'item_price_uom_id_uom_descrip',
262 'name': 'item_price_uom_id_uom_item_weight',
266 'name': 'item_inv_uom_id_uom_id',
270 'name': 'item_inv_uom_id_uom_name',
274 'name': 'item_inv_uom_id_uom_descrip',
278 'name': 'item_inv_uom_id_uom_item_weight',
282 'name': 'item_freightclass_id_freightclass_id',
286 'name': 'item_freightclass_id_freightclass_code',
290 'name': 'item_freightclass_id_freightclass_descrip',
294 'name': 'item_classcode_id_classcode_id',
298 'name': 'item_classcode_id_classcode_code',
302 'name': 'item_classcode_id_classcode_descrip',
306 'name': 'item_classcode_id_classcode_mfg',
310 'name': 'item_classcode_id_classcode_creator',
314 'name': 'item_classcode_id_classcode_created',
318 'name': 'item_classcode_id_classcode_modifier',
322 'name': 'item_classcode_id_classcode_modified',
326 'name': 'item_classcode_id_classcode_type',
333 xtype: 'PagingToolbar',
336 displayMsg : "Double click to select the item",
337 emptyMsg : "No item found",
348 specialkey : function (_self, e)
350 _this.grid.footer.onClick('first');
352 render : function (_self)
354 _this.searchBox = _self;
362 click : function (_self, e)
364 _this.grid.footer.onClick('first');
368 icon : rootURL + '/Pman/templates/images/search.gif'
374 click : function (_self, e)
376 _this.searchBox.setValue('');
\r
377 _this.status_type.setValue('');
\r
378 _this.grid.footer.onClick('first');
\r
382 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
388 xtype: 'ColumnModel',
390 dataIndex : 'item_image_id',
393 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); }
396 xtype: 'ColumnModel',
398 dataIndex : 'item_char_brand',
402 renderer : function(v) { return String.format('{0}', v); }
405 xtype: 'ColumnModel',
407 dataIndex : 'item_char_productgroup',
408 header : 'Product Group',
410 renderer : function(v) { return String.format('{0}', v); }
413 xtype: 'ColumnModel',
415 dataIndex : 'item_number',
418 renderer : function(v) { return String.format('{0}', v); }
421 xtype: 'ColumnModel',
423 dataIndex : 'item_descrip1',
424 header : 'Description',
426 renderer : function(v) { return String.format('{0}', v); }
429 xtype: 'ColumnModel',
431 dataIndex : 'itemsrc_active',
432 header : 'Purchased',
434 renderer : function(v) {
435 var state = v * 1 > 0 ? '-checked' : '';
437 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
442 xtype: 'ColumnModel',
444 dataIndex : 'item_sold',
447 renderer : function(v) {
448 var state = v * 1 > 0 ? '-checked' : '';
450 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
455 xtype: 'ColumnModel',
457 dataIndex : 'item_active',
458 header : 'is Active?',
460 renderer : function(v) {
461 var state = v * 1 > 0 ? '-checked' : '';
463 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
468 xtype: 'ColumnModel',
470 dataIndex : 'item_type',
473 renderer : function(v) { return String.format('{0}', v); }
476 xtype: 'ColumnModel',
478 dataIndex : 'item_prodcat_id_prodcat_code',
479 header : 'Item prodcat',
481 renderer : function(v) { return String.format('{0}', v); }
488 xtype: 'LayoutRegion',
496 click : function (_self, e)
503 var sels = _this.grid.selModel.getSelections();
505 Roo.MessageBox.alert("Error", "Select some items");
508 _this.callback.call(_this,sels);
510 render : function (_self)
512 _this.addSelected = _self;
515 text : "Add Selected"
521 click : function (_self, e)
523 Pman.Dialog.XtupleItem.show({item_id : 0}, function(){
524 _this.grid.footer.onClick('first');
534 click : function (_self, e)