2 "name" : "Pman.Tab.XtupleItem",
3 "parent" : "Pman.Tab.XtupleManage",
4 "title" : "Pman.Tab.XtupleItem",
5 "path" : "/home/edward/gitlive/Pman.Xtuple/Pman.Tab.XtupleItem.bjs",
9 "be53a0541a6d36f6ecb879fa2c584b08" : "Image",
10 "41e902bb1b2db625736ede3bacc41fe0" : "is Sold?",
11 "ce4ee01637f4279d02d0f232459dc9a4" : "Purchased",
12 "1be6f9eb563f3bf85c78b4219bf09de9" : "Brand",
13 "aa554e9e2270df2127bfe9096f1bd9ce" : "Displaying item{0} - {1} of {2}",
14 "ce5bf551379459c1c61d2a204061c455" : "Location",
15 "44ca8ce0e02dee5d520525ac21bcbee9" : "Sync Product from HK (Based on Search)",
16 "068f80c7519d0528fb08e82137a72131" : "Products",
17 "68f43fdcf074903d65da764642a4b968" : "is Active?",
18 "759d259249621c817551c5fe726d5c57" : "itemloc",
19 "89217b1527e14cced20e78111a8f5027" : "Item prodcat",
20 "e924991fc4c883bc237e69efe884d674" : "Download Sales Report",
21 "ee3585dbcb1e8f8826f3403c1e9d898c" : "Rename SKU",
22 "20b4f77bd00b4f63a49ec8e08f3bf6a6" : "Cost",
23 "fe78f3efbfa84d8485d589031596c5b8" : "Pallet",
24 "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
25 "19029645d5286771ac708d1bcd118bf4" : "Displaying itemloc{0} - {1} of {2}",
26 "1243daf593fa297e07ab03bf06d925af" : "Searching...",
27 "99a808d8d16122d70e44bd7f709d30fb" : "Balance",
28 "9a8faafb674c03474827bcb6fcde43a3" : "Search Product",
29 "f1c3ca6cadc4a9f57a08d5f7482a3f83" : "No item found",
30 "d6ea9efa48916e9563d76ddc233ebe2a" : "Sync Product from HK (New Products Only)",
31 "ec53a8c4f07baed5d8825072c89799be" : "Status",
32 "2cfd827c6e37453fe1ddde82a5bd9474" : "No itemloc found",
33 "d8ab3576a67fe0cc175ee77d57d0fd85" : "Pickface",
34 "5bc3fd20294c17c9803942958fd7f26d" : "Show Inactive",
35 "70cd7e06502a63356290711ec3b11223" : "Upload new products and costs",
36 "c6ca371871d835c79c8654b5cd788cc7" : "Product Group",
37 "695dbdb13fad32669a68d8fec8541c7f" : "Download Standard costs",
38 "156567f65fc207d39cadbf045687c521" : "Itemloc qty",
39 "c2f1d503b95bf9f3aa4d775a216c5c73" : "Sync Product Data from HK",
40 "36c454c4130e4444e8410f11d6d998f0" : "Tools - Upload/Download",
41 "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
42 "7fee866379427143414dd7a72e56414b" : "Report start :",
43 "a9e35d03ee7f31f5bb199379a6d3547a" : "Select Brand",
44 "35be52be39d3efcd0cd2b3721fc3c298" : "Cost (base)",
45 "750587d31c68779e7f615c190a9dc23f" : "Last purchase price",
46 "b2ee912b91d69b435159c7c3f6df7f5f" : "Number",
47 "173cf046739c17fd7c97ec3540d58807" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
48 "c20ad4d76fe97759aa27a0c99bff6710" : "12"
55 "xtype" : "NestedLayoutPanel",
59 "xtype" : "BorderLayout",
64 "xtype" : "LayoutRegion",
69 "xtype" : "LayoutRegion",
77 "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
83 "xtype" : "GridPanel",
84 "fitContainer" : true,
90 "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 \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 \n \n \n\n if(rec.data.itemsrc_active * 1){\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.set('itemsrc_active', 0);\n rec.commit();\n });\n return;\n }\n \n Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {\n _this.grid.footer.onClick('first');\n }); \n return;\n \n }\n \n _this.locgrid.footer.onClick('first');\n \n \n \n \n}",
91 "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}",
92 "|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}",
93 "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}"
95 "autoExpandColumn" : "item_descrip1",
96 "xtype" : "EditorGrid",
104 "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}",
105 "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}",
106 "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}"
110 "$ sortInfo" : "{ field : 'item_number', direction: 'ASC' }",
111 "$ xns" : "Roo.data",
112 "* prop" : "dataSource",
115 "$ url" : "baseURL + '/Roo/item.php'",
117 "xtype" : "HttpProxy",
118 "$ xns" : "Roo.data",
124 "xtype" : "JsonReader",
125 "$ xns" : "Roo.data",
126 "$ 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]",
128 "totalProperty" : "total"
135 "* prop" : "toolbar",
139 "render" : "function (_self)\n{\n _this.brandSel = _self;\n}",
140 "select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
142 "alwaysQuery" : true,
144 "triggerAction" : "all",
145 "forceSelection" : true,
146 "selectOnFocus" : true,
148 "displayField" : "charass_value",
149 "emptyText" : "Select Brand",
151 "xtype" : "ComboBox",
155 "$ xns" : "Roo.form",
156 "qtip" : "Select Brand",
157 "queryParam" : "query[charass_value]",
158 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
159 "loadingText" : "Searching...",
163 "|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}"
167 "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
168 "$ xns" : "Roo.data",
172 "$ url" : "baseURL + '/Roo/Charass.php'",
173 "xtype" : "HttpProxy",
175 "$ xns" : "Roo.data",
181 "xtype" : "JsonReader",
182 "$ xns" : "Roo.data",
183 "$ 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]",
185 "totalProperty" : "total"
193 "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}",
194 "render" : "function (_self)\n{\n _this.search = _self;\n}"
196 "emptyText" : "Search Product",
197 "xtype" : "TextField",
202 "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
205 "cls" : "x-btn-icon",
206 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
207 "$ xns" : "Roo.Toolbar"
211 "|click" : "function (_self, e)\n{\n _this.search.setValue('');\n \n\n \n _this.grid.footer.onClick('first');\n}"
214 "cls" : "x-btn-icon",
215 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
216 "$ xns" : "Roo.Toolbar"
219 "xtype" : "Separator",
220 "$ xns" : "Roo.Toolbar"
224 "toggle" : "function (_self, pressed)\n{\n\n this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
225 "render" : "function (_self)\n{\n _this.active = _self;\n}"
227 "text" : "Show Inactive",
228 "enableToggle" : true,
230 "$ xns" : "Roo.Toolbar"
234 "$ xns" : "Roo.Toolbar"
238 "|click" : "function()\n{\n\n Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
242 "cls" : "x-btn-text-icon",
243 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
244 "$ xns" : "Roo.Toolbar"
248 "|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"
250 "text" : "Rename SKU",
252 "$ xns" : "Roo.Toolbar"
255 "xtype" : "Separator",
256 "$ xns" : "Roo.Toolbar"
259 "text" : "Report start :",
260 "xtype" : "TextItem",
261 "$ xns" : "Roo.Toolbar"
265 "render" : "function (_self)\n{\n _this.dateFrom = _self;\n}"
268 "xtype" : "DateField",
270 "| value" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
275 "render" : "function (_self)\n{\n _this.datespan = _self;\n}"
278 "triggerAction" : "all",
279 "fieldLabel" : "Status",
280 "displayField" : "fname",
281 "hiddenName" : "cm_status",
283 "valueField" : "ftype",
284 "xtype" : "ComboBox",
285 "allowBlank" : false,
288 "$ xns" : "Roo.form",
290 "name" : "cm_status_name",
293 "xtype" : "SimpleStore",
294 "$ data" : "[ \n [ '1', \"Single Month Sales\"],\n [ '3', \"Quarter Sales\"],\n [ '6', \"Half year Sales\"] ,\n [ '12', \"Full Year Sales\"] \n]\n",
295 "$ fields" : "[ 'ftype', 'fname']",
296 "$ xns" : "Roo.data",
303 "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}"
305 "text" : "Download Sales Report",
307 "$ xns" : "Roo.Toolbar"
313 "xtype" : "PagingToolbar",
314 "emptyMsg" : "No item found",
316 "displayInfo" : true,
317 "displayMsg" : "Displaying item{0} - {1} of {2}",
321 "text" : "Tools - Upload/Download",
323 "$ xns" : "Roo.Toolbar",
327 "$ xns" : "Roo.menu",
332 "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}"
334 "text" : "Download Standard costs",
340 "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}"
342 "text" : "Upload new products and costs",
347 "xtype" : "Separator",
352 "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}"
354 "text" : "Sync Product Data from HK",
356 "$ xns" : "Roo.menu",
357 "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
361 "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}"
363 "text" : "Sync Product from HK (New Products Only)",
365 "$ xns" : "Roo.menu",
366 "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
370 "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}"
372 "text" : "Sync Product from HK (Based on Search)",
374 "$ xns" : "Roo.menu",
375 "| hidden" : "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
384 "xtype" : "ColumnModel",
388 "$ 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); }",
389 "$ xns" : "Roo.grid",
390 "* prop" : "colModel[]",
391 "dataIndex" : "item_image_id"
394 "xtype" : "ColumnModel",
398 "$ renderer" : "function(v) { return String.format('{0}', v); }",
399 "$ xns" : "Roo.grid",
400 "* prop" : "colModel[]",
401 "dataIndex" : "item_char_brand",
404 "xtype" : "GridEditor",
405 "$ xns" : "Roo.grid",
409 "alwaysQuery" : true,
411 "triggerAction" : "all",
412 "forceSelection" : false,
413 "selectOnFocus" : true,
415 "displayField" : "charass_value",
417 "xtype" : "ComboBox",
421 "$ xns" : "Roo.form",
423 "qtip" : "Select Brand",
424 "queryParam" : "query[charass_value]",
425 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
426 "loadingText" : "Searching...",
430 "|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}"
434 "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
435 "$ xns" : "Roo.data",
439 "$ url" : "baseURL + '/Roo/Charass.php'",
440 "xtype" : "HttpProxy",
442 "$ xns" : "Roo.data",
448 "xtype" : "JsonReader",
449 "$ xns" : "Roo.data",
450 "$ 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]",
452 "totalProperty" : "total"
463 "xtype" : "ColumnModel",
465 "header" : "Product Group",
467 "$ renderer" : "function(v) { return String.format('{0}', v); }",
468 "$ xns" : "Roo.grid",
469 "* prop" : "colModel[]",
470 "dataIndex" : "item_char_productgroup",
473 "xtype" : "GridEditor",
474 "$ xns" : "Roo.grid",
478 "alwaysQuery" : true,
480 "triggerAction" : "all",
481 "forceSelection" : false,
482 "selectOnFocus" : true,
484 "displayField" : "charass_value",
486 "xtype" : "ComboBox",
490 "$ xns" : "Roo.form",
492 "qtip" : "Select Brand",
493 "queryParam" : "query[charass_value]",
494 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
495 "loadingText" : "Searching...",
499 "|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}"
503 "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
504 "$ xns" : "Roo.data",
508 "$ url" : "baseURL + '/Roo/Charass.php'",
509 "xtype" : "HttpProxy",
511 "$ xns" : "Roo.data",
517 "xtype" : "JsonReader",
518 "$ xns" : "Roo.data",
519 "$ 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]",
521 "totalProperty" : "total"
532 "xtype" : "ColumnModel",
536 "$ renderer" : "function(v) { return String.format('<B>{0}</B>', v); }",
537 "$ xns" : "Roo.grid",
538 "* prop" : "colModel[]",
539 "dataIndex" : "item_number"
542 "xtype" : "ColumnModel",
544 "header" : "Pickface",
546 "$ renderer" : "function(v) { return String.format('{0}', v); }",
547 "$ xns" : "Roo.grid",
548 "* prop" : "colModel[]",
549 "dataIndex" : "item_char_pickface_location",
552 "xtype" : "GridEditor",
553 "$ xns" : "Roo.grid",
557 "xtype" : "TextField",
558 "$ xns" : "Roo.form",
566 "xtype" : "ColumnModel",
570 "$ renderer" : "function(v) { return String.format('{0}', v); }",
571 "$ xns" : "Roo.grid",
572 "* prop" : "colModel[]",
573 "dataIndex" : "item_char_pallet_location",
576 "xtype" : "GridEditor",
577 "$ xns" : "Roo.grid",
581 "xtype" : "TextField",
582 "$ xns" : "Roo.form",
590 "xtype" : "ColumnModel",
592 "header" : "Description",
594 "$ renderer" : "function(v) { return String.format('{0}', v); }",
595 "$ xns" : "Roo.grid",
596 "* prop" : "colModel[]",
597 "dataIndex" : "item_descrip1"
600 "xtype" : "ColumnModel",
602 "header" : "Purchased",
604 "$ 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 }",
605 "$ xns" : "Roo.grid",
606 "* prop" : "colModel[]",
607 "dataIndex" : "itemsrc_active"
610 "xtype" : "ColumnModel",
612 "header" : "is Sold?",
614 "$ 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 }",
615 "$ xns" : "Roo.grid",
616 "* prop" : "colModel[]",
617 "dataIndex" : "item_sold"
620 "xtype" : "ColumnModel",
622 "header" : "is Active?",
624 "$ 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 }",
625 "$ xns" : "Roo.grid",
626 "* prop" : "colModel[]",
627 "dataIndex" : "item_active"
631 "xtype" : "ColumnModel",
632 "header" : "Last purchase price",
634 "$ 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 }",
635 "$ xns" : "Roo.grid",
636 "* prop" : "colModel[]",
637 "dataIndex" : "last_purchase_price"
640 "xtype" : "ColumnModel",
641 "header" : "Item prodcat",
643 "$ renderer" : "function(v,x,r) { \n return String.format('{0}/{1}', r.data.item_type, v); \n }",
644 "$ xns" : "Roo.grid",
645 "* prop" : "colModel[]",
646 "dataIndex" : "item_prodcat_id_prodcat_code"
650 "xtype" : "ColumnModel",
653 "$ 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 }",
654 "$ xns" : "Roo.grid",
655 "* prop" : "colModel[]",
656 "dataIndex" : "item_actcost"
660 "xtype" : "ColumnModel",
661 "header" : "Cost (base)",
663 "$ 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 }",
664 "$ xns" : "Roo.grid",
665 "* prop" : "colModel[]",
666 "dataIndex" : "item_base_cost"
670 "xtype" : "ColumnModel",
671 "header" : "Balance",
673 "$ renderer" : "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
674 "$ xns" : "Roo.grid",
675 "* prop" : "colModel[]",
676 "dataIndex" : "item_stock_balance"
684 "|activate" : "function() {\n _this.locpanel = this;\n \n}"
690 "xtype" : "GridPanel",
691 "fitContainer" : true,
693 "tableName" : "itemloc",
697 "|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",
698 "|render" : "function() \n{\n _this.locgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n \n}"
700 "autoExpandColumn" : "location_name",
703 "$ xns" : "Roo.grid",
708 "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}"
712 "$ sortInfo" : "{ field : 'location_name', direction: 'ASC' }",
713 "$ xns" : "Roo.data",
714 "* prop" : "dataSource",
717 "$ url" : "baseURL + '/Roo/location.php'",
718 "xtype" : "HttpProxy",
720 "$ xns" : "Roo.data",
726 "xtype" : "JsonReader",
727 "$ xns" : "Roo.data",
728 "$ 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]",
730 "totalProperty" : "total"
736 "xtype" : "PagingToolbar",
737 "emptyMsg" : "No itemloc found",
739 "displayInfo" : true,
740 "displayMsg" : "Displaying itemloc{0} - {1} of {2}",
744 "xtype" : "ColumnModel",
745 "header" : "Location",
747 "$ renderer" : "function(v) { return String.format('{0}', v); }",
748 "$ xns" : "Roo.grid",
749 "* prop" : "colModel[]",
750 "dataIndex" : "location_name"
753 "xtype" : "ColumnModel",
754 "header" : "Itemloc qty",
756 "$ renderer" : "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
757 "$ xns" : "Roo.grid",
758 "* prop" : "colModel[]",
759 "dataIndex" : "itemloc_realqty"