3 "name": "Pman.Tab.XtupleItem",
4 "parent": "Pman.Tab.XtupleManage",
5 "title": "Pman.Tab.XtupleItem",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
12 "xtype": "NestedLayoutPanel",
17 "xtype": "BorderLayout",
22 "xtype": "LayoutRegion",
29 "xtype": "LayoutRegion",
34 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
47 "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
48 "cellclick": "function (_self, row, col, e)\n{\n var di = _this.grid.colModel.getDataIndex(col);\n \n var rec = _this.grid.ds.getAt(row);\n \n if(di == 'item_image_filename'){\n if(!rec.data.item_image_id){\n return;\n }\n var u = baseURL;\n if(rec.data.item_image_from_hk){\n u = u.split('/');\n u.pop();\n u = u.join('/') + '/hk.php';\n }\n Pman.download( {\n url: u + '/Images/Download/' + rec.data.item_image_id + '/' + rec.data.item_image_filename\n });\n return;\n }\n \n if (di == 'item_active') {\n \n var nv = rec.data.item_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Item',\n params : {\n item_id : rec.data.item_id,\n item_active : nv\n },\n success : function() {\n rec.set('item_active', nv);\n }\n });\n return;\n \n \n }\n \n if(di == 'itemsrc_active'){\n if(!rec.data.itemsrc_active){\n Roo.MessageBox.alert('Error','Please edit it on Xtuple tool');\n return;\n }\n if(rec.data.itemsrc_active){\n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure this product is no longer purchased\",\n function (res) {\n if(res!='yes') {\n return;\n }\n rec.commit();\n });\n }\n }\n \n _this.locgrid.footer.onClick('first');\n \n \n \n \n}",
49 "afteredit": "function (e)\n{\n \n \n Roo.log(e);\n new Pman.Request({\n url : baseURL +'/Roo/Charass',\n params : {\n charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),\n charass_value : e.value,\n charass_target_type : 'I',\n charass_default : 1,\n charass_target_id : e.record.data.item_id\n },\n method : 'POST'\n });\n \n \n e.record.commit();\n \n \n \n}",
50 "celldblclick": "function (_self, rowIndex, columnIndex, e)\n{\n var s = _this.grid.ds.getAt(rowIndex);\n \n Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n}"
53 "autoExpandColumn": "item_descrip1",
56 "xtype": "EditorGrid",
61 "beforeload": "function (_self, o)\n{\n o.params._with_prodcat = 1;\n o.params._with_char = 1;\n o.params._with_itemsrc_active = 1;\n o.params._with_last_purchase_price = 1;\n o.params._with_image = 1;\n var s = _this.search.getValue();\n if (s.length) {\n o.params['query[number_or_name]'] = s;\n }\n if (!_this.active.pressed) {\n o.params.item_active = 1;\n }\n if (_this.brandSel.getValue().length) {\n o.params._with_brand = _this.brandSel.getValue()\n }\n \n o.params._with_stock_balance = 1;\n}",
62 "update": "function (_self, record, operation)\n{\n if(operation != 'commit'){\n return;\n }\n \n var nv = record.data.itemsrc_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Itemsrc',\n params : {\n _update_by_item : 1,\n item_id : record.data.item_id,\n itemsrc_active : nv\n },\n success : function(res) {\n record.set('itemsrc_active', nv);\n }\n });\n}",
63 "load": "function (_self, records, options)\n{\n\n var cm = _this.grid.getColumnModel();\n if(records.length){\n cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);\n }\n}"
65 "*prop": "dataSource",
68 "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
75 "|url": "baseURL + '/Roo/item.php'",
80 "xtype": "JsonReader",
81 "totalProperty": "total",
85 "|fields": "[\n {\n 'name': 'item_id',\n 'type': 'int'\n },\n {\n 'name': 'item_number',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip1',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip2',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_picklist',\n 'type': 'int'\n },\n {\n 'name': 'item_comments',\n 'type': 'string'\n },\n {\n 'name': 'item_sold',\n 'type': 'int'\n },\n {\n 'name': 'item_fractional',\n 'type': 'int'\n },\n {\n 'name': 'item_active',\n 'type': 'int'\n },\n {\n 'name': 'item_type',\n 'type': 'string'\n },\n {\n 'name': 'item_prodweight',\n 'type': 'float'\n },\n {\n 'name': 'item_packweight',\n 'type': 'float'\n },\n {\n 'name': 'item_prodcat_id',\n 'type': 'int'\n },\n {\n 'name': 'item_exclusive',\n 'type': 'int'\n },\n {\n 'name': 'item_listprice',\n 'type': 'float'\n },\n {\n 'name': 'item_config',\n 'type': 'int'\n },\n {\n 'name': 'item_extdescrip',\n 'type': 'string'\n },\n {\n 'name': 'item_upccode',\n 'type': 'string'\n },\n {\n 'name': 'item_maxcost',\n 'type': 'float'\n },\n {\n 'name': 'item_inv_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_warrdays',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_tax_recoverable',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_code',\n 'type': 'string'\n },\n {\n 'name': 'item_freightclass_id_freightclass_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_code',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_mfg',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_creator',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_created',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_modifier',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_modified',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_type',\n 'type': 'string'\n }\n]"
96 "render": "function (_self)\n{\n _this.brandSel = _self;\n}",
97 "select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
101 "displayField": "charass_value",
103 "emptyText": "Select Brand",
104 "forceSelection": true,
106 "loadingText": "Searching...",
109 "qtip": "Select Brand",
110 "queryParam": "query[charass_value]",
111 "selectOnFocus": true,
112 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
113 "triggerAction": "all",
120 "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
125 "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
131 "xtype": "HttpProxy",
132 "|url": "baseURL + '/Roo/Charass.php'",
137 "xtype": "JsonReader",
138 "totalProperty": "total",
142 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]"
150 "render": "function (_self)\n{\n _this.search = _self;\n}",
151 "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
153 "emptyText": "Search Product",
154 "xtype": "TextField",
159 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
163 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
164 "|xns": "Roo.Toolbar"
168 "|click": "function (_self, e)\n{\n _this.search.setValue('');\n \n\n \n _this.grid.footer.onClick('first');\n}"
172 "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
173 "|xns": "Roo.Toolbar"
176 "|xns": "Roo.Toolbar",
181 "toggle": "function (_self, pressed)\n{\n\n this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
182 "render": "function (_self)\n{\n _this.active = _self;\n}"
184 "enableToggle": true,
185 "text": "Show Inactive",
187 "|xns": "Roo.Toolbar"
190 "|xns": "Roo.Toolbar",
195 "|click": "function()\n{\n\n Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
197 "cls": "x-btn-text-icon",
200 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
201 "|xns": "Roo.Toolbar"
205 "|click": "function()\n{\n var s = _this.grid.selModel.getSelectedCell();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select a product\");\n return;\n } \n var rec = _this.grid.ds.getAt(s[0]);\n \n var params = [];\n \n Roo.MessageBox.prompt(\n \"Rename SKU\", \n \"Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok\",\n function(r,v) {\n if (r != 'ok') {\n return;\n \n }\n params = {\n _rename_sku : v,\n item_id : rec.data.item_id,\n _check : 1\n }\n\n change(params);\n \n return;\n \n \n\n }\n );\n \n var change = function(params){\n new Pman.Request({\n url : baseURL + '/Roo/Item',\n mask : \"Renaming\",\n method : 'POST',\n params : params,\n success : function(res) {\n Roo.log(res);\n _this.grid.footer.onClick('refresh');\n if(typeof(res.data) == 'string'){\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed');\n return\n }\n var offices = [];\n Roo.each(res.data, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.alert(\"Notice\", 'SKU has been renamed in ' + offices.join(\", \"));\n \n },\n failure : function(res) {\n Roo.log(res);\n try {\n if (res.errors.confirm.length) {\n var offices = [];\n Roo.each(res.errors.confirm, function(o){\n offices.push(Pman.Xtuple.offices[o]);\n })\n Roo.MessageBox.confirm(\n \"Confirm\", \n \" Do you want to change the name in \" + offices.join(\", \") + \"?\",\n function(x) {\n if (x != 'yes') {\n Roo.MessageBox.alert(\"Notice\", 'SKU was not changed');\n return;\n }\n delete params['_check'];\n params._can_change_sku = 1;\n change(params);\n }\n );\n return;\n }\n } catch(e) { }\n Roo.MessageBox.alert(\"Error\", res.errorMsg);\n \n }\n });\n }\n \n}\n"
207 "text": "Rename SKU",
209 "|xns": "Roo.Toolbar"
212 "|xns": "Roo.Toolbar",
216 "text": "Report start :",
218 "|xns": "Roo.Toolbar"
222 "render": "function (_self)\n{\n _this.dateFrom = _self;\n}"
226 "xtype": "DateField",
227 "|value": "(function() { return (new Date()).format('Y') + '-01-01'; })()",
232 "render": "function (_self)\n{\n _this.datespan = _self;\n}"
235 "displayField": "fname",
237 "fieldLabel": "Status",
238 "hiddenName": "cm_status",
241 "name": "cm_status_name",
242 "triggerAction": "all",
244 "valueField": "ftype",
251 "xtype": "SimpleStore",
252 "|data": "[ \n [ '1', \"Single Month Sales\"],\n [ '3', \"Quarter Sales\"],\n [ '6', \"Half year Sales\"] ,\n [ '12', \"Full Year Sales\"] \n]\n",
253 "|fields": "[ 'ftype', 'fname']",
260 "click": "function (_self, e)\n{\n if (!_this.brandSel.getValue().length) {\n Roo.MessageBox.alert(\"Error\", \"Select a brand to download\");\n return;\n }\n\n new Pman.Download({\n url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',\n params: { \n date_from : _this.dateFrom.getValue(),\n brand : _this.brandSel.getValue(),\n span : _this.datespan.getValue()\n }\n });\n \n\n}"
262 "text": "Download Sales Report",
264 "|xns": "Roo.Toolbar"
270 "xtype": "PagingToolbar",
273 "displayMsg": "Displaying item{0} - {1} of {2}",
274 "emptyMsg": "No item found",
278 "text": "Tools - Upload/Download",
280 "|xns": "Roo.Toolbar",
289 "click": "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/item',\n params : {\n _costgrid : 1\n }\n });\n}"
291 "text": "Download Standard costs",
297 "click": "function (_self, e)\n{\n// Roo.MessageBox.alert(\"Disabled\", \"Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again\");\n // return;\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Products',\n timeout : 60000\n \n },\n function (data) {\n var msg = [];\n \n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Products(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Products(s)\");\n }\n if (data.skipped) {\n msg.push(\"Skipped \" + data.skipped);\n }\n \n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}"
299 "text": "Upload new products and costs",
309 "click": "function (_self, e)\n{\n \n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a row\");\n return;\n }\n \n var rec = _this.grid.ds.getAt(sel[0]);\n if(rec.data.item_id * 1 < 1){\n return;\n }\n \n Pman.Dialog.Image.show({\n id : rec.data.item_image_id ? rec.data.item_image_id : 0,\n onid : rec.data.item_id,\n ontable : 'item'\n }, function(data) {\n if (data) {\n _this.grid.footer.onClick('first');\n \n }\n \n });\n}"
311 "text": "Upload an image",
321 "click": "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n function runSync() {\n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n timeout: 60000,\n params : {\n _syncFromHK : 1,\n offset : offset\n },\n success : function(res) {\n Roo.log(res);\n if (!res.data.total) {\n Roo.MessageBox.hide();\n return;\n }\n offset += res.data.limit;\n Roo.MessageBox.updateProgress ( offset / res.data.total, \"Done \" + offset + '/' + res.data.total);\n runSync();\n }\n \n \n });\n }\n runSync();\n}"
323 "text": "Sync Product Data from HK",
325 "|hidden": "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
330 "click": "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n _new_only : 1\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
332 "text": "Sync Product from HK (New Products Only)",
334 "|hidden": "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
339 "click": "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n \n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n item_number : _this.search.getValue()\n },\n success : function(res) {\n Roo.log(res);\n \n Roo.MessageBox.hide();\n _this.grid.footer.onClick('refresh');\n \n \n }\n \n \n });\n \n}"
341 "text": "Sync Product from HK (Based on Search)",
343 "|hidden": "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
353 "*prop": "colModel[]",
354 "dataIndex": "item_image_filename",
355 "header": "Image ( Click to download )",
357 "xtype": "ColumnModel",
358 "|renderer": "function(v,x,r)\r\n{\n if(!v){\n return '';\n }\n if(r.data.item_image_from_hk){\n var url = baseURL.split('/');\n url.pop();\n url = url.join('/');\n return '<img src=\"' + url + '/hk.php/Images/Thumb/150x150/' + r.data.item_image_id + '/' + v + '\" width=\"150\" height=\"' + Math.ceil(150 / r.data.item_image_size) + '\" />'; \n }\r\n return '<img src=\"' + baseURL + '/Images/Thumb/150x150/' + r.data.item_image_id + '/' + v + '\" width=\"150\" height=\"' + Math.ceil(150 / r.data.item_image_size) + '\" />';\r\n}",
362 "*prop": "colModel[]",
363 "dataIndex": "item_char_brand",
367 "xtype": "ColumnModel",
368 "|renderer": "function(v) { return String.format('{0}', v); }",
373 "xtype": "GridEditor",
380 "displayField": "charass_value",
382 "forceSelection": false,
384 "loadingText": "Searching...",
387 "qtip": "Select Brand",
388 "queryParam": "query[charass_value]",
389 "selectOnFocus": true,
390 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
391 "triggerAction": "all",
398 "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'BRAND';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value';\n\n}"
403 "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
409 "xtype": "HttpProxy",
410 "|url": "baseURL + '/Roo/Charass.php'",
415 "xtype": "JsonReader",
416 "totalProperty": "total",
420 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]"
431 "*prop": "colModel[]",
432 "dataIndex": "item_char_productgroup",
433 "header": "Product Group",
436 "xtype": "ColumnModel",
437 "|renderer": "function(v) { return String.format('{0}', v); }",
442 "xtype": "GridEditor",
449 "displayField": "charass_value",
451 "forceSelection": false,
453 "loadingText": "Searching...",
456 "qtip": "Select Brand",
457 "queryParam": "query[charass_value]",
458 "selectOnFocus": true,
459 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
460 "triggerAction": "all",
467 "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n // look for all of the charass 's with the same type= eg. brand.\n \n o.params.charass_char_id_char_name = 'PRODUCTGROUP';\n o.params.charass_target_type ='I';\n o.params._distinct = 'charass_value';\n o.params._columns = 'charass_value'; \n}"
472 "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
478 "xtype": "HttpProxy",
479 "|url": "baseURL + '/Roo/Charass.php'",
484 "xtype": "JsonReader",
485 "totalProperty": "total",
489 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]"
500 "*prop": "colModel[]",
501 "dataIndex": "item_number",
505 "xtype": "ColumnModel",
506 "|renderer": "function(v) { return String.format('<B>{0}</B>', v); }",
510 "*prop": "colModel[]",
511 "dataIndex": "item_char_pickface_location",
512 "header": "Pickface",
515 "xtype": "ColumnModel",
516 "|renderer": "function(v) { return String.format('{0}', v); }",
521 "xtype": "GridEditor",
526 "xtype": "TextField",
534 "*prop": "colModel[]",
535 "dataIndex": "item_char_pallet_location",
539 "xtype": "ColumnModel",
540 "|renderer": "function(v) { return String.format('{0}', v); }",
545 "xtype": "GridEditor",
550 "xtype": "TextField",
558 "*prop": "colModel[]",
559 "dataIndex": "item_descrip1",
560 "header": "Description",
563 "xtype": "ColumnModel",
564 "|renderer": "function(v) { return String.format('{0}', v); }",
568 "*prop": "colModel[]",
569 "dataIndex": "itemsrc_active",
570 "header": "Purchased",
572 "xtype": "ColumnModel",
573 "|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
577 "*prop": "colModel[]",
578 "dataIndex": "item_sold",
579 "header": "is Sold?",
581 "xtype": "ColumnModel",
582 "|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
586 "*prop": "colModel[]",
587 "dataIndex": "item_active",
588 "header": "is Active?",
590 "xtype": "ColumnModel",
591 "|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
595 "*prop": "colModel[]",
597 "dataIndex": "last_purchase_price",
598 "header": "Last purchase price",
600 "xtype": "ColumnModel",
601 "|renderer": "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
605 "*prop": "colModel[]",
606 "dataIndex": "item_prodcat_id_prodcat_code",
607 "header": "Item prodcat",
609 "xtype": "ColumnModel",
610 "|renderer": "function(v,x,r) { \n return String.format('{0}/{1}', r.data.item_type, v); \n }",
614 "*prop": "colModel[]",
616 "dataIndex": "item_actcost",
619 "xtype": "ColumnModel",
620 "|renderer": "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",
624 "*prop": "colModel[]",
626 "dataIndex": "item_base_cost",
627 "header": "Cost (base)",
629 "xtype": "ColumnModel",
630 "|renderer": "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ; \n \n }",
634 "*prop": "colModel[]",
636 "dataIndex": "item_stock_balance",
639 "xtype": "ColumnModel",
640 "|renderer": "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
649 "|activate": "function() {\n _this.locpanel = this;\n \n}"
652 "fitContainer": true,
655 "tableName": "itemloc",
657 "xtype": "GridPanel",
662 "|render": "function() \n{\n _this.locgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n \n}",
663 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
666 "autoExpandColumn": "location_name",
673 "beforeload": "function (_self, o)\n{\n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel) {\n this.removeAll();\n return false;\n }\n var rec = _this.grid.ds.getAt(sel[0]);\n o.params._stock_for_item_id = rec.data.item_id;\n //o.params['!itemloc_qty'] = 0;\n \n \n}"
675 "*prop": "dataSource",
678 "|sortInfo": "{ field : 'location_name', direction: 'ASC' }",
684 "xtype": "HttpProxy",
685 "|url": "baseURL + '/Roo/location.php'",
690 "xtype": "JsonReader",
691 "totalProperty": "total",
695 "|fields": "[\n {\n 'name': 'itemloc_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_itemsite_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_location_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_qty',\n 'type': 'float'\n },\n {\n 'name': 'itemloc_expiration',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'itemloc_consolflag',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_ls_id',\n 'type': 'int'\n },\n {\n 'name': 'itemloc_warrpurc',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]"
701 "xtype": "PagingToolbar",
704 "displayMsg": "Displaying itemloc{0} - {1} of {2}",
705 "emptyMsg": "No itemloc found",
709 "*prop": "colModel[]",
710 "dataIndex": "location_name",
711 "header": "Location",
713 "xtype": "ColumnModel",
714 "|renderer": "function(v) { return String.format('{0}', v); }",
718 "*prop": "colModel[]",
719 "dataIndex": "itemloc_realqty",
720 "header": "Itemloc qty",
722 "xtype": "ColumnModel",
723 "|renderer": "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",