Pman.Tab.XtupleItem.bjs
[Pman.Xtuple] / Pman.Tab.XtupleItem.bjs
1 {
2  "name" : "Pman.Tab.XtupleItem",
3  "parent" : "Pman.Tab.XtupleManage",
4  "title" : "Pman.Tab.XtupleItem",
5  "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
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   "2cfd827c6e37453fe1ddde82a5bd9474" : "No itemloc found",
32   "d8ab3576a67fe0cc175ee77d57d0fd85" : "Pickface",
33   "5bc3fd20294c17c9803942958fd7f26d" : "Show Inactive",
34   "70cd7e06502a63356290711ec3b11223" : "Upload new products and costs",
35   "c6ca371871d835c79c8654b5cd788cc7" : "Product Group",
36   "695dbdb13fad32669a68d8fec8541c7f" : "Download Standard costs",
37   "156567f65fc207d39cadbf045687c521" : "Itemloc qty",
38   "c2f1d503b95bf9f3aa4d775a216c5c73" : "Sync Product Data from HK",
39   "36c454c4130e4444e8410f11d6d998f0" : "Tools - Upload/Download",
40   "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
41   "7fee866379427143414dd7a72e56414b" : "Report start :",
42   "a9e35d03ee7f31f5bb199379a6d3547a" : "Select Brand",
43   "35be52be39d3efcd0cd2b3721fc3c298" : "Cost (base)",
44   "750587d31c68779e7f615c190a9dc23f" : "Last purchase price",
45   "b2ee912b91d69b435159c7c3f6df7f5f" : "Number",
46   "173cf046739c17fd7c97ec3540d58807" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
47   "c20ad4d76fe97759aa27a0c99bff6710" : "12"
48  },
49  "items" : [
50   {
51    "background" : false,
52    "region" : "center",
53    "title" : "Products",
54    "xtype" : "NestedLayoutPanel",
55    "$ xns" : "Roo",
56    "items" : [
57     {
58      "xtype" : "BorderLayout",
59      "$ xns" : "Roo",
60      "* prop" : "layout",
61      "items" : [
62       {
63        "xtype" : "LayoutRegion",
64        "$ xns" : "Roo",
65        "* prop" : "center"
66       },
67       {
68        "xtype" : "LayoutRegion",
69        "$ xns" : "Roo",
70        "width" : 200,
71        "split" : true,
72        "* prop" : "east"
73       },
74       {
75        "listeners" : {
76         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
77        },
78        "region" : "center",
79        "fitToframe" : true,
80        "background" : false,
81        "title" : "Products",
82        "xtype" : "GridPanel",
83        "fitContainer" : true,
84        "$ xns" : "Roo",
85        "tableName" : "item",
86        "items" : [
87         {
88          "listeners" : {
89           "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}",
90           "|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}",
91           "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}",
92           "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}"
93          },
94          "autoExpandColumn" : "item_descrip1",
95          "xtype" : "EditorGrid",
96          "loadMask" : true,
97          "clicksToEdit" : 1,
98          "$ xns" : "Roo.grid",
99          "* prop" : "grid",
100          "items" : [
101           {
102            "listeners" : {
103             "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}",
104             "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}",
105             "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}"
106            },
107            "xtype" : "Store",
108            "remoteSort" : true,
109            "$ sortInfo" : "{ field : 'item_number', direction: 'ASC' }",
110            "$ xns" : "Roo.data",
111            "* prop" : "dataSource",
112            "items" : [
113             {
114              "$ url" : "baseURL + '/Roo/item.php'",
115              "xtype" : "HttpProxy",
116              "method" : "GET",
117              "$ xns" : "Roo.data",
118              "* prop" : "proxy"
119             },
120             {
121              "id" : "id",
122              "root" : "data",
123              "xtype" : "JsonReader",
124              "$ xns" : "Roo.data",
125              "$ 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]",
126              "* prop" : "reader",
127              "totalProperty" : "total"
128             }
129            ]
130           },
131           {
132            "xtype" : "Toolbar",
133            "$ xns" : "Roo",
134            "* prop" : "toolbar",
135            "items" : [
136             {
137              "listeners" : {
138               "render" : "function (_self)\n{\n  _this.brandSel = _self;\n}",
139               "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
140              },
141              "alwaysQuery" : true,
142              "listWidth" : 300,
143              "triggerAction" : "all",
144              "forceSelection" : true,
145              "selectOnFocus" : true,
146              "pageSize" : 20,
147              "displayField" : "charass_value",
148              "emptyText" : "Select Brand",
149              "minChars" : 2,
150              "xtype" : "ComboBox",
151              "allowBlank" : true,
152              "editable" : true,
153              "width" : 150,
154              "$ xns" : "Roo.form",
155              "qtip" : "Select Brand",
156              "queryParam" : "query[charass_value]",
157              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
158              "loadingText" : "Searching...",
159              "items" : [
160               {
161                "listeners" : {
162                 "|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}"
163                },
164                "xtype" : "Store",
165                "remoteSort" : true,
166                "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
167                "$ xns" : "Roo.data",
168                "* prop" : "store",
169                "items" : [
170                 {
171                  "$ url" : "baseURL + '/Roo/Charass.php'",
172                  "method" : "GET",
173                  "xtype" : "HttpProxy",
174                  "$ xns" : "Roo.data",
175                  "* prop" : "proxy"
176                 },
177                 {
178                  "id" : "id",
179                  "root" : "data",
180                  "xtype" : "JsonReader",
181                  "$ xns" : "Roo.data",
182                  "$ 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]",
183                  "* prop" : "reader",
184                  "totalProperty" : "total"
185                 }
186                ]
187               }
188              ]
189             },
190             {
191              "listeners" : {
192               "specialkey" : "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}",
193               "render" : "function (_self)\n{\n  _this.search = _self;\n}"
194              },
195              "emptyText" : "Search Product",
196              "xtype" : "TextField",
197              "$ xns" : "Roo.form"
198             },
199             {
200              "listeners" : {
201               "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
202              },
203              "xtype" : "Button",
204              "cls" : "x-btn-icon",
205              "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
206              "$ xns" : "Roo.Toolbar"
207             },
208             {
209              "listeners" : {
210               "|click" : "function (_self, e)\n{\n    _this.search.setValue('');\n    \n\n    \n    _this.grid.footer.onClick('first');\n}"
211              },
212              "xtype" : "Button",
213              "cls" : "x-btn-icon",
214              "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
215              "$ xns" : "Roo.Toolbar"
216             },
217             {
218              "xtype" : "Separator",
219              "$ xns" : "Roo.Toolbar"
220             },
221             {
222              "listeners" : {
223               "toggle" : "function (_self, pressed)\n{\n\n    this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
224               "render" : "function (_self)\n{\n    _this.active = _self;\n}"
225              },
226              "text" : "Show Inactive",
227              "enableToggle" : true,
228              "xtype" : "Button",
229              "$ xns" : "Roo.Toolbar"
230             },
231             {
232              "xtype" : "Fill",
233              "$ xns" : "Roo.Toolbar"
234             },
235             {
236              "listeners" : {
237               "|click" : "function()\n{\n\n   Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
238              },
239              "text" : "Add",
240              "xtype" : "Button",
241              "cls" : "x-btn-text-icon",
242              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
243              "$ xns" : "Roo.Toolbar"
244             },
245             {
246              "listeners" : {
247               "|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"
248              },
249              "text" : "Rename SKU",
250              "xtype" : "Button",
251              "$ xns" : "Roo.Toolbar"
252             },
253             {
254              "xtype" : "Separator",
255              "$ xns" : "Roo.Toolbar"
256             },
257             {
258              "text" : "Report start :",
259              "xtype" : "TextItem",
260              "$ xns" : "Roo.Toolbar"
261             },
262             {
263              "listeners" : {
264               "render" : "function (_self)\n{\n    _this.dateFrom = _self;\n}"
265              },
266              "format" : "d/M/Y",
267              "useIso" : true,
268              "xtype" : "DateField",
269              "| value" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
270              "$ xns" : "Roo.form"
271             },
272             {
273              "listeners" : {
274               "render" : "function (_self)\n{\n  _this.datespan  = _self;\n}"
275              },
276              "listWidth" : 200,
277              "triggerAction" : "all",
278              "fieldLabel" : "Status",
279              "displayField" : "fname",
280              "hiddenName" : "cm_status",
281              "value" : 12,
282              "valueField" : "ftype",
283              "xtype" : "ComboBox",
284              "allowBlank" : false,
285              "editable" : false,
286              "width" : 150,
287              "$ xns" : "Roo.form",
288              "mode" : "local",
289              "name" : "cm_status_name",
290              "items" : [
291               {
292                "xtype" : "SimpleStore",
293                "$ data" : "[ \n    [ '1', \"Single Month Sales\"],\n    [ '3', \"Quarter Sales\"],\n    [ '6', \"Half year Sales\"] ,\n    [ '12', \"Full Year Sales\"] \n]\n",
294                "$ fields" : "[  'ftype', 'fname']",
295                "$ xns" : "Roo.data",
296                "* prop" : "store"
297               }
298              ]
299             },
300             {
301              "listeners" : {
302               "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}"
303              },
304              "text" : "Download Sales Report",
305              "xtype" : "Button",
306              "$ xns" : "Roo.Toolbar"
307             }
308            ]
309           },
310           {
311            "pageSize" : 25,
312            "xtype" : "PagingToolbar",
313            "emptyMsg" : "No item found",
314            "$ xns" : "Roo",
315            "displayInfo" : true,
316            "displayMsg" : "Displaying item{0} - {1} of {2}",
317            "* prop" : "footer",
318            "items" : [
319             {
320              "text" : "Tools - Upload/Download",
321              "xtype" : "Button",
322              "$ xns" : "Roo.Toolbar",
323              "items" : [
324               {
325                "xtype" : "Menu",
326                "$ xns" : "Roo.menu",
327                "* prop" : "menu",
328                "items" : [
329                 {
330                  "listeners" : {
331                   "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}"
332                  },
333                  "text" : "Download Standard costs",
334                  "xtype" : "Item",
335                  "$ xns" : "Roo.menu"
336                 },
337                 {
338                  "listeners" : {
339                   "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}"
340                  },
341                  "text" : "Upload new products and costs",
342                  "xtype" : "Item",
343                  "$ xns" : "Roo.menu"
344                 },
345                 {
346                  "xtype" : "Separator",
347                  "$ xns" : "Roo.menu"
348                 },
349                 {
350                  "listeners" : {
351                   "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}"
352                  },
353                  "text" : "Sync Product Data from HK",
354                  "xtype" : "Item",
355                  "$ xns" : "Roo.menu",
356                  "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
357                 },
358                 {
359                  "listeners" : {
360                   "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}"
361                  },
362                  "text" : "Sync Product from HK (New Products Only)",
363                  "xtype" : "Item",
364                  "$ xns" : "Roo.menu",
365                  "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
366                 },
367                 {
368                  "listeners" : {
369                   "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}"
370                  },
371                  "text" : "Sync Product from HK (Based on Search)",
372                  "xtype" : "Item",
373                  "$ xns" : "Roo.menu",
374                  "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
375                 }
376                ]
377               }
378              ]
379             }
380            ]
381           },
382           {
383            "xtype" : "ColumnModel",
384            "sortable" : false,
385            "header" : "Image",
386            "width" : 150,
387            "$ 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); }",
388            "$ xns" : "Roo.grid",
389            "* prop" : "colModel[]",
390            "dataIndex" : "item_image_id"
391           },
392           {
393            "xtype" : "ColumnModel",
394            "sortable" : true,
395            "header" : "Brand",
396            "width" : 100,
397            "$ renderer" : "function(v) { return String.format('{0}', v); }",
398            "$ xns" : "Roo.grid",
399            "* prop" : "colModel[]",
400            "dataIndex" : "item_char_brand",
401            "items" : [
402             {
403              "xtype" : "GridEditor",
404              "$ xns" : "Roo.grid",
405              "* prop" : "editor",
406              "items" : [
407               {
408                "alwaysQuery" : true,
409                "listWidth" : 300,
410                "triggerAction" : "all",
411                "forceSelection" : false,
412                "selectOnFocus" : true,
413                "pageSize" : 20,
414                "displayField" : "charass_value",
415                "minChars" : 2,
416                "xtype" : "ComboBox",
417                "allowBlank" : true,
418                "editable" : true,
419                "width" : 150,
420                "$ xns" : "Roo.form",
421                "* prop" : "field",
422                "qtip" : "Select Brand",
423                "queryParam" : "query[charass_value]",
424                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
425                "loadingText" : "Searching...",
426                "items" : [
427                 {
428                  "listeners" : {
429                   "|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}"
430                  },
431                  "xtype" : "Store",
432                  "remoteSort" : true,
433                  "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
434                  "$ xns" : "Roo.data",
435                  "* prop" : "store",
436                  "items" : [
437                   {
438                    "$ url" : "baseURL + '/Roo/Charass.php'",
439                    "method" : "GET",
440                    "xtype" : "HttpProxy",
441                    "$ xns" : "Roo.data",
442                    "* prop" : "proxy"
443                   },
444                   {
445                    "id" : "id",
446                    "root" : "data",
447                    "xtype" : "JsonReader",
448                    "$ xns" : "Roo.data",
449                    "$ 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]",
450                    "* prop" : "reader",
451                    "totalProperty" : "total"
452                   }
453                  ]
454                 }
455                ]
456               }
457              ]
458             }
459            ]
460           },
461           {
462            "xtype" : "ColumnModel",
463            "sortable" : true,
464            "header" : "Product Group",
465            "width" : 100,
466            "$ renderer" : "function(v) { return String.format('{0}', v); }",
467            "$ xns" : "Roo.grid",
468            "* prop" : "colModel[]",
469            "dataIndex" : "item_char_productgroup",
470            "items" : [
471             {
472              "xtype" : "GridEditor",
473              "$ xns" : "Roo.grid",
474              "* prop" : "editor",
475              "items" : [
476               {
477                "alwaysQuery" : true,
478                "listWidth" : 300,
479                "triggerAction" : "all",
480                "forceSelection" : false,
481                "selectOnFocus" : true,
482                "pageSize" : 20,
483                "displayField" : "charass_value",
484                "minChars" : 2,
485                "xtype" : "ComboBox",
486                "allowBlank" : true,
487                "editable" : true,
488                "width" : 150,
489                "$ xns" : "Roo.form",
490                "* prop" : "field",
491                "qtip" : "Select Brand",
492                "queryParam" : "query[charass_value]",
493                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
494                "loadingText" : "Searching...",
495                "items" : [
496                 {
497                  "listeners" : {
498                   "|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}"
499                  },
500                  "xtype" : "Store",
501                  "remoteSort" : true,
502                  "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
503                  "$ xns" : "Roo.data",
504                  "* prop" : "store",
505                  "items" : [
506                   {
507                    "$ url" : "baseURL + '/Roo/Charass.php'",
508                    "method" : "GET",
509                    "xtype" : "HttpProxy",
510                    "$ xns" : "Roo.data",
511                    "* prop" : "proxy"
512                   },
513                   {
514                    "id" : "id",
515                    "root" : "data",
516                    "xtype" : "JsonReader",
517                    "$ xns" : "Roo.data",
518                    "$ 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]",
519                    "* prop" : "reader",
520                    "totalProperty" : "total"
521                   }
522                  ]
523                 }
524                ]
525               }
526              ]
527             }
528            ]
529           },
530           {
531            "xtype" : "ColumnModel",
532            "sortable" : true,
533            "header" : "Number",
534            "width" : 100,
535            "$ renderer" : "function(v) { return String.format('<B>{0}</B>', v); }",
536            "$ xns" : "Roo.grid",
537            "* prop" : "colModel[]",
538            "dataIndex" : "item_number"
539           },
540           {
541            "xtype" : "ColumnModel",
542            "sortable" : true,
543            "header" : "Pickface",
544            "width" : 100,
545            "$ renderer" : "function(v) { return String.format('{0}', v); }",
546            "$ xns" : "Roo.grid",
547            "* prop" : "colModel[]",
548            "dataIndex" : "item_char_pickface_location",
549            "items" : [
550             {
551              "xtype" : "GridEditor",
552              "$ xns" : "Roo.grid",
553              "* prop" : "editor",
554              "items" : [
555               {
556                "xtype" : "TextField",
557                "$ xns" : "Roo.form",
558                "* prop" : "field"
559               }
560              ]
561             }
562            ]
563           },
564           {
565            "xtype" : "ColumnModel",
566            "sortable" : true,
567            "header" : "Pallet",
568            "width" : 100,
569            "$ renderer" : "function(v) { return String.format('{0}', v); }",
570            "$ xns" : "Roo.grid",
571            "* prop" : "colModel[]",
572            "dataIndex" : "item_char_pallet_location",
573            "items" : [
574             {
575              "xtype" : "GridEditor",
576              "$ xns" : "Roo.grid",
577              "* prop" : "editor",
578              "items" : [
579               {
580                "xtype" : "TextField",
581                "$ xns" : "Roo.form",
582                "* prop" : "field"
583               }
584              ]
585             }
586            ]
587           },
588           {
589            "xtype" : "ColumnModel",
590            "sortable" : true,
591            "header" : "Description",
592            "width" : 200,
593            "$ renderer" : "function(v) { return String.format('{0}', v); }",
594            "$ xns" : "Roo.grid",
595            "* prop" : "colModel[]",
596            "dataIndex" : "item_descrip1"
597           },
598           {
599            "xtype" : "ColumnModel",
600            "sortable" : true,
601            "header" : "Purchased",
602            "width" : 55,
603            "$ 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 }",
604            "$ xns" : "Roo.grid",
605            "* prop" : "colModel[]",
606            "dataIndex" : "itemsrc_active"
607           },
608           {
609            "xtype" : "ColumnModel",
610            "sortable" : true,
611            "header" : "is Sold?",
612            "width" : 50,
613            "$ 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 }",
614            "$ xns" : "Roo.grid",
615            "* prop" : "colModel[]",
616            "dataIndex" : "item_sold"
617           },
618           {
619            "xtype" : "ColumnModel",
620            "sortable" : true,
621            "header" : "is Active?",
622            "width" : 50,
623            "$ 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 }",
624            "$ xns" : "Roo.grid",
625            "* prop" : "colModel[]",
626            "dataIndex" : "item_active"
627           },
628           {
629            "align" : "right",
630            "xtype" : "ColumnModel",
631            "header" : "Last purchase price",
632            "width" : 120,
633            "$ 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 }",
634            "$ xns" : "Roo.grid",
635            "* prop" : "colModel[]",
636            "dataIndex" : "last_purchase_price"
637           },
638           {
639            "xtype" : "ColumnModel",
640            "width" : 100,
641            "header" : "Item prodcat",
642            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}/{1}', r.data.item_type, v); \n    }",
643            "$ xns" : "Roo.grid",
644            "* prop" : "colModel[]",
645            "dataIndex" : "item_prodcat_id_prodcat_code"
646           },
647           {
648            "align" : "right",
649            "xtype" : "ColumnModel",
650            "header" : "Cost",
651            "width" : 75,
652            "$ 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 }",
653            "$ xns" : "Roo.grid",
654            "* prop" : "colModel[]",
655            "dataIndex" : "item_actcost"
656           },
657           {
658            "align" : "right",
659            "xtype" : "ColumnModel",
660            "header" : "Cost (base)",
661            "width" : 75,
662            "$ 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 }",
663            "$ xns" : "Roo.grid",
664            "* prop" : "colModel[]",
665            "dataIndex" : "item_base_cost"
666           },
667           {
668            "align" : "right",
669            "xtype" : "ColumnModel",
670            "header" : "Balance",
671            "width" : 100,
672            "$ renderer" : "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
673            "$ xns" : "Roo.grid",
674            "* prop" : "colModel[]",
675            "dataIndex" : "item_stock_balance"
676           }
677          ]
678         }
679        ]
680       },
681       {
682        "listeners" : {
683         "|activate" : "function() {\n    _this.locpanel = this;\n \n}"
684        },
685        "region" : "east",
686        "fitToframe" : true,
687        "background" : true,
688        "title" : "itemloc",
689        "xtype" : "GridPanel",
690        "fitContainer" : true,
691        "$ xns" : "Roo",
692        "tableName" : "itemloc",
693        "items" : [
694         {
695          "listeners" : {
696           "|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",
697           "|render" : "function() \n{\n    _this.locgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n}"
698          },
699          "autoExpandColumn" : "location_name",
700          "xtype" : "Grid",
701          "loadMask" : true,
702          "$ xns" : "Roo.grid",
703          "* prop" : "grid",
704          "items" : [
705           {
706            "listeners" : {
707             "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}"
708            },
709            "xtype" : "Store",
710            "remoteSort" : true,
711            "$ sortInfo" : "{ field : 'location_name', direction: 'ASC' }",
712            "$ xns" : "Roo.data",
713            "* prop" : "dataSource",
714            "items" : [
715             {
716              "$ url" : "baseURL + '/Roo/location.php'",
717              "method" : "GET",
718              "xtype" : "HttpProxy",
719              "$ xns" : "Roo.data",
720              "* prop" : "proxy"
721             },
722             {
723              "id" : "id",
724              "root" : "data",
725              "xtype" : "JsonReader",
726              "$ xns" : "Roo.data",
727              "$ 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]",
728              "* prop" : "reader",
729              "totalProperty" : "total"
730             }
731            ]
732           },
733           {
734            "pageSize" : 25,
735            "xtype" : "PagingToolbar",
736            "emptyMsg" : "No itemloc found",
737            "$ xns" : "Roo",
738            "displayInfo" : true,
739            "displayMsg" : "Displaying itemloc{0} - {1} of {2}",
740            "* prop" : "footer"
741           },
742           {
743            "xtype" : "ColumnModel",
744            "width" : 75,
745            "header" : "Location",
746            "$ renderer" : "function(v) { return String.format('{0}', v); }",
747            "$ xns" : "Roo.grid",
748            "* prop" : "colModel[]",
749            "dataIndex" : "location_name"
750           },
751           {
752            "xtype" : "ColumnModel",
753            "width" : 75,
754            "header" : "Itemloc qty",
755            "$ renderer" : "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
756            "$ xns" : "Roo.grid",
757            "* prop" : "colModel[]",
758            "dataIndex" : "itemloc_realqty"
759           }
760          ]
761         }
762        ]
763       }
764      ]
765     }
766    ]
767   }
768  ]
769 }