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