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