Pman.Tab.XtupleItem.bjs
authorEdward <edward@roojs.com>
Fri, 10 Oct 2014 03:57:11 +0000 (11:57 +0800)
committerEdward <edward@roojs.com>
Fri, 10 Oct 2014 03:57:11 +0000 (11:57 +0800)
Pman.Tab.XtupleItem.js

Pman.Tab.XtupleItem.bjs
Pman.Tab.XtupleItem.js

index 48f2128..6482b28 100644 (file)
 {
-    "id": "roo-file-53",
-    "name": "Pman.Tab.XtupleItem",
-    "parent": "Pman.Tab.XtupleManage",
-    "title": "Pman.Tab.XtupleItem",
-    "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
-    "items": [
+    "name" : "Pman.Tab.XtupleItem",
+    "parent" : "Pman.Tab.XtupleManage",
+    "title" : "Pman.Tab.XtupleItem",
+    "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleItem.bjs",
+    "permname" : "",
+    "modOrder" : "001",
+    "items" : [
         {
-            "background": true,
-            "region": "center",
-            "title": "Products",
-            "xtype": "NestedLayoutPanel",
-            "|xns": "Roo",
-            "items": [
+            "background" : false,
+            "region" : "center",
+            "title" : "Products",
+            "xtype" : "NestedLayoutPanel",
+            "$ xns" : "Roo",
+            "items" : [
                 {
-                    "|xns": "Roo",
-                    "xtype": "BorderLayout",
-                    "*prop": "layout",
-                    "items": [
+                    "xtype" : "BorderLayout",
+                    "$ xns" : "Roo",
+                    "* prop" : "layout",
+                    "items" : [
                         {
-                            "|xns": "Roo",
-                            "xtype": "LayoutRegion",
-                            "*prop": "center"
+                            "xtype" : "LayoutRegion",
+                            "$ xns" : "Roo",
+                            "* prop" : "center"
                         },
                         {
-                            "*prop": "east",
-                            "split": true,
-                            "width": 200,
-                            "xtype": "LayoutRegion",
-                            "|xns": "Roo"
+                            "xtype" : "LayoutRegion",
+                            "width" : 200,
+                            "$ xns" : "Roo",
+                            "split" : true,
+                            "* prop" : "east"
                         },
                         {
-                            "listeners": {
-                                "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+                            "listeners" : {
+                                "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
                             },
-                            "background": true,
-                            "fitContainer": true,
-                            "fitToframe": true,
-                            "region": "center",
-                            "tableName": "item",
-                            "title": "Products",
-                            "xtype": "GridPanel",
-                            "|xns": "Roo",
-                            "items": [
+                            "fitToframe" : true,
+                            "background" : false,
+                            "region" : "center",
+                            "title" : "Products",
+                            "xtype" : "GridPanel",
+                            "fitContainer" : true,
+                            "$ xns" : "Roo",
+                            "tableName" : "item",
+                            "items" : [
                                 {
-                                    "listeners": {
-                                        "|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}",
-                                        "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}",
-                                        "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}",
-                                        "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}"
+                                    "listeners" : {
+                                        "|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}",
+                                        "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}",
+                                        "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}",
+                                        "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}"
                                     },
-                                    "*prop": "grid",
-                                    "autoExpandColumn": "item_descrip1",
-                                    "clicksToEdit": 1,
-                                    "loadMask": true,
-                                    "xtype": "EditorGrid",
-                                    "|xns": "Roo.grid",
-                                    "items": [
+                                    "autoExpandColumn" : "item_descrip1",
+                                    "xtype" : "EditorGrid",
+                                    "loadMask" : true,
+                                    "clicksToEdit" : 1,
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "grid",
+                                    "items" : [
                                         {
-                                            "listeners": {
-                                                "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}",
-                                                "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}",
-                                                "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}"
+                                            "listeners" : {
+                                                "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}",
+                                                "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}",
+                                                "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}"
                                             },
-                                            "*prop": "dataSource",
-                                            "remoteSort": true,
-                                            "xtype": "Store",
-                                            "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
-                                            "|xns": "Roo.data",
-                                            "items": [
+                                            "xtype" : "Store",
+                                            "remoteSort" : true,
+                                            "$ sortInfo" : "{ field : 'item_number', direction: 'ASC' }",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "dataSource",
+                                            "items" : [
                                                 {
-                                                    "*prop": "proxy",
-                                                    "xtype": "HttpProxy",
-                                                    "method": "GET",
-                                                    "|url": "baseURL + '/Roo/item.php'",
-                                                    "|xns": "Roo.data"
+                                                    "$ url" : "baseURL + '/Roo/item.php'",
+                                                    "method" : "GET",
+                                                    "xtype" : "HttpProxy",
+                                                    "$ xns" : "Roo.data",
+                                                    "* prop" : "proxy"
                                                 },
                                                 {
-                                                    "|xns": "Roo.data",
-                                                    "xtype": "JsonReader",
-                                                    "totalProperty": "total",
-                                                    "root": "data",
-                                                    "*prop": "reader",
-                                                    "id": "id",
-                                                    "|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]"
+                                                    "id" : "id",
+                                                    "root" : "data",
+                                                    "xtype" : "JsonReader",
+                                                    "$ xns" : "Roo.data",
+                                                    "$ 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]",
+                                                    "* prop" : "reader",
+                                                    "totalProperty" : "total"
                                                 }
                                             ]
                                         },
                                         {
-                                            "|xns": "Roo",
-                                            "xtype": "Toolbar",
-                                            "*prop": "toolbar",
-                                            "items": [
+                                            "xtype" : "Toolbar",
+                                            "$ xns" : "Roo",
+                                            "* prop" : "toolbar",
+                                            "items" : [
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n  _this.brandSel = _self;\n}",
-                                                        "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "render" : "function (_self)\n{\n  _this.brandSel = _self;\n}",
+                                                        "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
                                                     },
-                                                    "allowBlank": true,
-                                                    "alwaysQuery": true,
-                                                    "displayField": "charass_value",
-                                                    "editable": true,
-                                                    "emptyText": "Select Brand",
-                                                    "forceSelection": true,
-                                                    "listWidth": 300,
-                                                    "loadingText": "Searching...",
-                                                    "minChars": 2,
-                                                    "pageSize": 20,
-                                                    "qtip": "Select Brand",
-                                                    "queryParam": "query[charass_value]",
-                                                    "selectOnFocus": true,
-                                                    "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
-                                                    "triggerAction": "all",
-                                                    "width": 150,
-                                                    "xtype": "ComboBox",
-                                                    "|xns": "Roo.form",
-                                                    "items": [
+                                                    "alwaysQuery" : true,
+                                                    "listWidth" : 300,
+                                                    "triggerAction" : "all",
+                                                    "forceSelection" : true,
+                                                    "selectOnFocus" : true,
+                                                    "pageSize" : 20,
+                                                    "displayField" : "charass_value",
+                                                    "emptyText" : "Select Brand",
+                                                    "minChars" : 2,
+                                                    "xtype" : "ComboBox",
+                                                    "allowBlank" : true,
+                                                    "editable" : true,
+                                                    "width" : 150,
+                                                    "$ xns" : "Roo.form",
+                                                    "qtip" : "Select Brand",
+                                                    "queryParam" : "query[charass_value]",
+                                                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+                                                    "loadingText" : "Searching...",
+                                                    "items" : [
                                                         {
-                                                            "listeners": {
-                                                                "|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}"
+                                                            "listeners" : {
+                                                                "|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}"
                                                             },
-                                                            "*prop": "store",
-                                                            "remoteSort": true,
-                                                            "xtype": "Store",
-                                                            "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
-                                                            "|xns": "Roo.data",
-                                                            "items": [
+                                                            "xtype" : "Store",
+                                                            "remoteSort" : true,
+                                                            "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+                                                            "$ xns" : "Roo.data",
+                                                            "* prop" : "store",
+                                                            "items" : [
                                                                 {
-                                                                    "*prop": "proxy",
-                                                                    "method": "GET",
-                                                                    "xtype": "HttpProxy",
-                                                                    "|url": "baseURL + '/Roo/Charass.php'",
-                                                                    "|xns": "Roo.data"
+                                                                    "$ url" : "baseURL + '/Roo/Charass.php'",
+                                                                    "xtype" : "HttpProxy",
+                                                                    "method" : "GET",
+                                                                    "$ xns" : "Roo.data",
+                                                                    "* prop" : "proxy"
                                                                 },
                                                                 {
-                                                                    "|xns": "Roo.data",
-                                                                    "xtype": "JsonReader",
-                                                                    "totalProperty": "total",
-                                                                    "root": "data",
-                                                                    "*prop": "reader",
-                                                                    "id": "id",
-                                                                    "|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]"
+                                                                    "id" : "id",
+                                                                    "root" : "data",
+                                                                    "xtype" : "JsonReader",
+                                                                    "$ xns" : "Roo.data",
+                                                                    "$ 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]",
+                                                                    "* prop" : "reader",
+                                                                    "totalProperty" : "total"
                                                                 }
                                                             ]
                                                         }
                                                     ]
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n  _this.search = _self;\n}",
-                                                        "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "specialkey" : "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}",
+                                                        "render" : "function (_self)\n{\n  _this.search = _self;\n}"
                                                     },
-                                                    "emptyText": "Search Product",
-                                                    "xtype": "TextField",
-                                                    "|xns": "Roo.form"
+                                                    "emptyText" : "Search Product",
+                                                    "xtype" : "TextField",
+                                                    "$ xns" : "Roo.form"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
                                                     },
-                                                    "cls": "x-btn-icon",
-                                                    "xtype": "Button",
-                                                    "|icon": "rootURL + '/Pman/templates/images/search.gif'",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "xtype" : "Button",
+                                                    "cls" : "x-btn-icon",
+                                                    "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "|click": "function (_self, e)\n{\n    _this.search.setValue('');\n    \n\n    \n    _this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "|click" : "function (_self, e)\n{\n    _this.search.setValue('');\n    \n\n    \n    _this.grid.footer.onClick('first');\n}"
                                                     },
-                                                    "cls": "x-btn-icon",
-                                                    "xtype": "Button",
-                                                    "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "xtype" : "Button",
+                                                    "cls" : "x-btn-icon",
+                                                    "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Separator"
+                                                    "xtype" : "Separator",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "toggle": "function (_self, pressed)\n{\n\n    this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
-                                                        "render": "function (_self)\n{\n    _this.active = _self;\n}"
+                                                    "listeners" : {
+                                                        "toggle" : "function (_self, pressed)\n{\n\n    this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
+                                                        "render" : "function (_self)\n{\n    _this.active = _self;\n}"
                                                     },
-                                                    "enableToggle": true,
-                                                    "text": "Show Inactive",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Show Inactive",
+                                                    "enableToggle" : true,
+                                                    "xtype" : "Button",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Fill"
+                                                    "xtype" : "Fill",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "|click": "function()\n{\n\n   Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
+                                                    "listeners" : {
+                                                        "|click" : "function()\n{\n\n   Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
                                                     },
-                                                    "cls": "x-btn-text-icon",
-                                                    "text": "Add",
-                                                    "xtype": "Button",
-                                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Add",
+                                                    "xtype" : "Button",
+                                                    "cls" : "x-btn-text-icon",
+                                                    "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "|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"
+                                                    "listeners" : {
+                                                        "|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"
                                                     },
-                                                    "text": "Rename SKU",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Rename SKU",
+                                                    "xtype" : "Button",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Separator"
+                                                    "xtype" : "Separator",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "text": "Report start :",
-                                                    "xtype": "TextItem",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Report start :",
+                                                    "xtype" : "TextItem",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n    _this.dateFrom = _self;\n}"
+                                                    "listeners" : {
+                                                        "render" : "function (_self)\n{\n    _this.dateFrom = _self;\n}"
                                                     },
-                                                    "format": "d/M/Y",
-                                                    "useIso": true,
-                                                    "xtype": "DateField",
-                                                    "|value": "(function() { return (new Date()).format('Y') + '-01-01'; })()",
-                                                    "|xns": "Roo.form"
+                                                    "format" : "d/M/Y",
+                                                    "xtype" : "DateField",
+                                                    "useIso" : true,
+                                                    "| value" : "(function() { return (new Date()).format('Y') + '-01-01'; })()",
+                                                    "$ xns" : "Roo.form"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n  _this.datespan  = _self;\n}"
+                                                    "listeners" : {
+                                                        "render" : "function (_self)\n{\n  _this.datespan  = _self;\n}"
                                                     },
-                                                    "allowBlank": false,
-                                                    "displayField": "fname",
-                                                    "editable": false,
-                                                    "fieldLabel": "Status",
-                                                    "hiddenName": "cm_status",
-                                                    "listWidth": 200,
-                                                    "mode": "local",
-                                                    "name": "cm_status_name",
-                                                    "triggerAction": "all",
-                                                    "value": 12,
-                                                    "valueField": "ftype",
-                                                    "width": 150,
-                                                    "xtype": "ComboBox",
-                                                    "|xns": "Roo.form",
-                                                    "items": [
+                                                    "listWidth" : 200,
+                                                    "triggerAction" : "all",
+                                                    "fieldLabel" : "Status",
+                                                    "displayField" : "fname",
+                                                    "hiddenName" : "cm_status",
+                                                    "value" : 12,
+                                                    "valueField" : "ftype",
+                                                    "xtype" : "ComboBox",
+                                                    "allowBlank" : false,
+                                                    "editable" : false,
+                                                    "width" : 150,
+                                                    "$ xns" : "Roo.form",
+                                                    "mode" : "local",
+                                                    "name" : "cm_status_name",
+                                                    "items" : [
                                                         {
-                                                            "*prop": "store",
-                                                            "xtype": "SimpleStore",
-                                                            "|data": "[ \n    [ '1', \"Single Month Sales\"],\n    [ '3', \"Quarter Sales\"],\n    [ '6', \"Half year Sales\"] ,\n    [ '12', \"Full Year Sales\"] \n]\n",
-                                                            "|fields": "[  'ftype', 'fname']",
-                                                            "|xns": "Roo.data"
+                                                            "xtype" : "SimpleStore",
+                                                            "$ data" : "[ \n    [ '1', \"Single Month Sales\"],\n    [ '3', \"Quarter Sales\"],\n    [ '6', \"Half year Sales\"] ,\n    [ '12', \"Full Year Sales\"] \n]\n",
+                                                            "$ fields" : "[  'ftype', 'fname']",
+                                                            "$ xns" : "Roo.data",
+                                                            "* prop" : "store"
                                                         }
                                                     ]
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "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}"
+                                                    "listeners" : {
+                                                        "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}"
                                                     },
-                                                    "text": "Download Sales Report",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Download Sales Report",
+                                                    "xtype" : "Button",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "footer",
-                                            "xtype": "PagingToolbar",
-                                            "pageSize": 25,
-                                            "displayInfo": true,
-                                            "displayMsg": "Displaying item{0} - {1} of {2}",
-                                            "emptyMsg": "No item found",
-                                            "|xns": "Roo",
-                                            "items": [
+                                            "pageSize" : 25,
+                                            "xtype" : "PagingToolbar",
+                                            "emptyMsg" : "No item found",
+                                            "$ xns" : "Roo",
+                                            "displayInfo" : true,
+                                            "displayMsg" : "Displaying item{0} - {1} of {2}",
+                                            "* prop" : "footer",
+                                            "items" : [
                                                 {
-                                                    "text": "Tools - Upload/Download",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar",
-                                                    "items": [
+                                                    "text" : "Tools - Upload/Download",
+                                                    "xtype" : "Button",
+                                                    "$ xns" : "Roo.Toolbar",
+                                                    "items" : [
                                                         {
-                                                            "|xns": "Roo.menu",
-                                                            "xtype": "Menu",
-                                                            "*prop": "menu",
-                                                            "items": [
+                                                            "xtype" : "Menu",
+                                                            "$ xns" : "Roo.menu",
+                                                            "* prop" : "menu",
+                                                            "items" : [
                                                                 {
-                                                                    "listeners": {
-                                                                        "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}"
+                                                                    "listeners" : {
+                                                                        "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}"
                                                                     },
-                                                                    "text": "Download Standard costs",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Download Standard costs",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "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}"
+                                                                    "listeners" : {
+                                                                        "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}"
                                                                     },
-                                                                    "text": "Upload new products and costs",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Upload new products and costs",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "|xns": "Roo.menu",
-                                                                    "xtype": "Separator"
+                                                                    "xtype" : "Separator",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "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}"
+                                                                    "listeners" : {
+                                                                        "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}"
                                                                     },
-                                                                    "text": "Sync Product Data from HK",
-                                                                    "xtype": "Item",
-                                                                    "|hidden": "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Sync Product Data from HK",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu",
+                                                                    "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "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}"
+                                                                    "listeners" : {
+                                                                        "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}"
                                                                     },
-                                                                    "text": "Sync Product from HK (New Products Only)",
-                                                                    "xtype": "Item",
-                                                                    "|hidden": "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Sync Product from HK (New Products Only)",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu",
+                                                                    "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "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}"
+                                                                    "listeners" : {
+                                                                        "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}"
                                                                     },
-                                                                    "text": "Sync Product from HK (Based on Search)",
-                                                                    "xtype": "Item",
-                                                                    "|hidden": "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Sync Product from HK (Based on Search)",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu",
+                                                                    "| hidden" : "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? true : false;\n})()"
                                                                 }
                                                             ]
                                                         }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_image_id",
-                                            "header": "Image",
-                                            "sortable": false,
-                                            "width": 150,
-                                            "xtype": "ColumnModel",
-                                            "|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); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : false,
+                                            "header" : "Image",
+                                            "width" : 150,
+                                            "$ 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); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_image_id"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_char_brand",
-                                            "header": "Brand",
-                                            "sortable": true,
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid",
-                                            "items": [
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Brand",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_char_brand",
+                                            "items" : [
                                                 {
-                                                    "|xns": "Roo.grid",
-                                                    "xtype": "GridEditor",
-                                                    "*prop": "editor",
-                                                    "items": [
+                                                    "xtype" : "GridEditor",
+                                                    "$ xns" : "Roo.grid",
+                                                    "* prop" : "editor",
+                                                    "items" : [
                                                         {
-                                                            "*prop": "field",
-                                                            "allowBlank": true,
-                                                            "alwaysQuery": true,
-                                                            "displayField": "charass_value",
-                                                            "editable": true,
-                                                            "forceSelection": false,
-                                                            "listWidth": 300,
-                                                            "loadingText": "Searching...",
-                                                            "minChars": 2,
-                                                            "pageSize": 20,
-                                                            "qtip": "Select Brand",
-                                                            "queryParam": "query[charass_value]",
-                                                            "selectOnFocus": true,
-                                                            "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
-                                                            "triggerAction": "all",
-                                                            "width": 150,
-                                                            "xtype": "ComboBox",
-                                                            "|xns": "Roo.form",
-                                                            "items": [
+                                                            "alwaysQuery" : true,
+                                                            "listWidth" : 300,
+                                                            "triggerAction" : "all",
+                                                            "forceSelection" : false,
+                                                            "selectOnFocus" : true,
+                                                            "pageSize" : 20,
+                                                            "displayField" : "charass_value",
+                                                            "minChars" : 2,
+                                                            "xtype" : "ComboBox",
+                                                            "allowBlank" : true,
+                                                            "editable" : true,
+                                                            "width" : 150,
+                                                            "$ xns" : "Roo.form",
+                                                            "* prop" : "field",
+                                                            "qtip" : "Select Brand",
+                                                            "queryParam" : "query[charass_value]",
+                                                            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+                                                            "loadingText" : "Searching...",
+                                                            "items" : [
                                                                 {
-                                                                    "listeners": {
-                                                                        "|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}"
+                                                                    "listeners" : {
+                                                                        "|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}"
                                                                     },
-                                                                    "*prop": "store",
-                                                                    "remoteSort": true,
-                                                                    "xtype": "Store",
-                                                                    "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
-                                                                    "|xns": "Roo.data",
-                                                                    "items": [
+                                                                    "xtype" : "Store",
+                                                                    "remoteSort" : true,
+                                                                    "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+                                                                    "$ xns" : "Roo.data",
+                                                                    "* prop" : "store",
+                                                                    "items" : [
                                                                         {
-                                                                            "*prop": "proxy",
-                                                                            "method": "GET",
-                                                                            "xtype": "HttpProxy",
-                                                                            "|url": "baseURL + '/Roo/Charass.php'",
-                                                                            "|xns": "Roo.data"
+                                                                            "$ url" : "baseURL + '/Roo/Charass.php'",
+                                                                            "xtype" : "HttpProxy",
+                                                                            "method" : "GET",
+                                                                            "$ xns" : "Roo.data",
+                                                                            "* prop" : "proxy"
                                                                         },
                                                                         {
-                                                                            "|xns": "Roo.data",
-                                                                            "xtype": "JsonReader",
-                                                                            "totalProperty": "total",
-                                                                            "root": "data",
-                                                                            "*prop": "reader",
-                                                                            "id": "id",
-                                                                            "|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]"
+                                                                            "id" : "id",
+                                                                            "root" : "data",
+                                                                            "xtype" : "JsonReader",
+                                                                            "$ xns" : "Roo.data",
+                                                                            "$ 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]",
+                                                                            "* prop" : "reader",
+                                                                            "totalProperty" : "total"
                                                                         }
                                                                     ]
                                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_char_productgroup",
-                                            "header": "Product Group",
-                                            "sortable": true,
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid",
-                                            "items": [
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Product Group",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_char_productgroup",
+                                            "items" : [
                                                 {
-                                                    "|xns": "Roo.grid",
-                                                    "xtype": "GridEditor",
-                                                    "*prop": "editor",
-                                                    "items": [
+                                                    "xtype" : "GridEditor",
+                                                    "$ xns" : "Roo.grid",
+                                                    "* prop" : "editor",
+                                                    "items" : [
                                                         {
-                                                            "*prop": "field",
-                                                            "allowBlank": true,
-                                                            "alwaysQuery": true,
-                                                            "displayField": "charass_value",
-                                                            "editable": true,
-                                                            "forceSelection": false,
-                                                            "listWidth": 300,
-                                                            "loadingText": "Searching...",
-                                                            "minChars": 2,
-                                                            "pageSize": 20,
-                                                            "qtip": "Select Brand",
-                                                            "queryParam": "query[charass_value]",
-                                                            "selectOnFocus": true,
-                                                            "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
-                                                            "triggerAction": "all",
-                                                            "width": 150,
-                                                            "xtype": "ComboBox",
-                                                            "|xns": "Roo.form",
-                                                            "items": [
+                                                            "alwaysQuery" : true,
+                                                            "listWidth" : 300,
+                                                            "triggerAction" : "all",
+                                                            "forceSelection" : false,
+                                                            "selectOnFocus" : true,
+                                                            "pageSize" : 20,
+                                                            "displayField" : "charass_value",
+                                                            "minChars" : 2,
+                                                            "xtype" : "ComboBox",
+                                                            "allowBlank" : true,
+                                                            "editable" : true,
+                                                            "width" : 150,
+                                                            "$ xns" : "Roo.form",
+                                                            "* prop" : "field",
+                                                            "qtip" : "Select Brand",
+                                                            "queryParam" : "query[charass_value]",
+                                                            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
+                                                            "loadingText" : "Searching...",
+                                                            "items" : [
                                                                 {
-                                                                    "listeners": {
-                                                                        "|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}"
+                                                                    "listeners" : {
+                                                                        "|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}"
                                                                     },
-                                                                    "*prop": "store",
-                                                                    "remoteSort": true,
-                                                                    "xtype": "Store",
-                                                                    "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
-                                                                    "|xns": "Roo.data",
-                                                                    "items": [
+                                                                    "xtype" : "Store",
+                                                                    "remoteSort" : true,
+                                                                    "$ sortInfo" : "{ field : 'charass_value' , direction : 'ASC' }",
+                                                                    "$ xns" : "Roo.data",
+                                                                    "* prop" : "store",
+                                                                    "items" : [
                                                                         {
-                                                                            "*prop": "proxy",
-                                                                            "method": "GET",
-                                                                            "xtype": "HttpProxy",
-                                                                            "|url": "baseURL + '/Roo/Charass.php'",
-                                                                            "|xns": "Roo.data"
+                                                                            "$ url" : "baseURL + '/Roo/Charass.php'",
+                                                                            "xtype" : "HttpProxy",
+                                                                            "method" : "GET",
+                                                                            "$ xns" : "Roo.data",
+                                                                            "* prop" : "proxy"
                                                                         },
                                                                         {
-                                                                            "|xns": "Roo.data",
-                                                                            "xtype": "JsonReader",
-                                                                            "totalProperty": "total",
-                                                                            "root": "data",
-                                                                            "*prop": "reader",
-                                                                            "id": "id",
-                                                                            "|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]"
+                                                                            "id" : "id",
+                                                                            "root" : "data",
+                                                                            "xtype" : "JsonReader",
+                                                                            "$ xns" : "Roo.data",
+                                                                            "$ 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]",
+                                                                            "* prop" : "reader",
+                                                                            "totalProperty" : "total"
                                                                         }
                                                                     ]
                                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_number",
-                                            "header": "Number",
-                                            "sortable": true,
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('<B>{0}</B>', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Number",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('<B>{0}</B>', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_number"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_char_pickface_location",
-                                            "header": "Pickface",
-                                            "sortable": true,
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid",
-                                            "items": [
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Pickface",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_char_pickface_location",
+                                            "items" : [
                                                 {
-                                                    "|xns": "Roo.grid",
-                                                    "xtype": "GridEditor",
-                                                    "*prop": "editor",
-                                                    "items": [
+                                                    "xtype" : "GridEditor",
+                                                    "$ xns" : "Roo.grid",
+                                                    "* prop" : "editor",
+                                                    "items" : [
                                                         {
-                                                            "|xns": "Roo.form",
-                                                            "xtype": "TextField",
-                                                            "*prop": "field"
+                                                            "xtype" : "TextField",
+                                                            "$ xns" : "Roo.form",
+                                                            "* prop" : "field"
                                                         }
                                                     ]
                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_char_pallet_location",
-                                            "header": "Pallet",
-                                            "sortable": true,
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid",
-                                            "items": [
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Pallet",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_char_pallet_location",
+                                            "items" : [
                                                 {
-                                                    "|xns": "Roo.grid",
-                                                    "xtype": "GridEditor",
-                                                    "*prop": "editor",
-                                                    "items": [
+                                                    "xtype" : "GridEditor",
+                                                    "$ xns" : "Roo.grid",
+                                                    "* prop" : "editor",
+                                                    "items" : [
                                                         {
-                                                            "|xns": "Roo.form",
-                                                            "xtype": "TextField",
-                                                            "*prop": "field"
+                                                            "xtype" : "TextField",
+                                                            "$ xns" : "Roo.form",
+                                                            "* prop" : "field"
                                                         }
                                                     ]
                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_descrip1",
-                                            "header": "Description",
-                                            "sortable": true,
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Description",
+                                            "width" : 200,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_descrip1"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "itemsrc_active",
-                                            "header": "Purchased",
-                                            "sortable": true,
-                                            "width": 55,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "Purchased",
+                                            "width" : 55,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "itemsrc_active"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_sold",
-                                            "header": "is Sold?",
-                                            "sortable": true,
-                                            "width": 50,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "is Sold?",
+                                            "width" : 50,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_sold"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_active",
-                                            "header": "is Active?",
-                                            "sortable": true,
-                                            "width": 50,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "sortable" : true,
+                                            "header" : "is Active?",
+                                            "width" : 50,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_active"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "last_purchase_price",
-                                            "header": "Last purchase price",
-                                            "width": 120,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Last purchase price",
+                                            "width" : 120,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "last_purchase_price"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "item_prodcat_id_prodcat_code",
-                                            "header": "Item prodcat",
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { \n    return String.format('{0}/{1}', r.data.item_type, v); \n    }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Item prodcat",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}/{1}', r.data.item_type, v); \n    }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_prodcat_id_prodcat_code"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "item_actcost",
-                                            "header": "Cost",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Cost",
+                                            "width" : 75,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_actcost"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "item_base_cost",
-                                            "header": "Cost (base)",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|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 }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Cost (base)",
+                                            "width" : 75,
+                                            "$ 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 }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_base_cost"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "item_stock_balance",
-                                            "header": "Balance",
-                                            "width": 100,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Balance",
+                                            "width" : 100,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v ? parseInt( v) : ''); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "item_stock_balance"
                                         }
                                     ]
                                 }
                             ]
                         },
                         {
-                            "listeners": {
-                                "|activate": "function() {\n    _this.locpanel = this;\n \n}"
+                            "listeners" : {
+                                "|activate" : "function() {\n    _this.locpanel = this;\n \n}"
                             },
-                            "background": true,
-                            "fitContainer": true,
-                            "fitToframe": true,
-                            "region": "east",
-                            "tableName": "itemloc",
-                            "title": "itemloc",
-                            "xtype": "GridPanel",
-                            "|xns": "Roo",
-                            "items": [
+                            "fitToframe" : true,
+                            "background" : true,
+                            "region" : "east",
+                            "title" : "itemloc",
+                            "xtype" : "GridPanel",
+                            "fitContainer" : true,
+                            "$ xns" : "Roo",
+                            "tableName" : "itemloc",
+                            "items" : [
                                 {
-                                    "listeners": {
-                                        "|render": "function() \n{\n    _this.locgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n}",
-                                        "|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"
+                                    "listeners" : {
+                                        "|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",
+                                        "|render" : "function() \n{\n    _this.locgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n}"
                                     },
-                                    "*prop": "grid",
-                                    "autoExpandColumn": "location_name",
-                                    "loadMask": true,
-                                    "xtype": "Grid",
-                                    "|xns": "Roo.grid",
-                                    "items": [
+                                    "autoExpandColumn" : "location_name",
+                                    "xtype" : "Grid",
+                                    "loadMask" : true,
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "grid",
+                                    "items" : [
                                         {
-                                            "listeners": {
-                                                "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}"
+                                            "listeners" : {
+                                                "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}"
                                             },
-                                            "*prop": "dataSource",
-                                            "remoteSort": true,
-                                            "xtype": "Store",
-                                            "|sortInfo": "{ field : 'location_name', direction: 'ASC' }",
-                                            "|xns": "Roo.data",
-                                            "items": [
+                                            "xtype" : "Store",
+                                            "remoteSort" : true,
+                                            "$ sortInfo" : "{ field : 'location_name', direction: 'ASC' }",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "dataSource",
+                                            "items" : [
                                                 {
-                                                    "*prop": "proxy",
-                                                    "method": "GET",
-                                                    "xtype": "HttpProxy",
-                                                    "|url": "baseURL + '/Roo/location.php'",
-                                                    "|xns": "Roo.data"
+                                                    "$ url" : "baseURL + '/Roo/location.php'",
+                                                    "xtype" : "HttpProxy",
+                                                    "method" : "GET",
+                                                    "$ xns" : "Roo.data",
+                                                    "* prop" : "proxy"
                                                 },
                                                 {
-                                                    "|xns": "Roo.data",
-                                                    "xtype": "JsonReader",
-                                                    "totalProperty": "total",
-                                                    "root": "data",
-                                                    "*prop": "reader",
-                                                    "id": "id",
-                                                    "|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]"
+                                                    "id" : "id",
+                                                    "root" : "data",
+                                                    "xtype" : "JsonReader",
+                                                    "$ xns" : "Roo.data",
+                                                    "$ 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]",
+                                                    "* prop" : "reader",
+                                                    "totalProperty" : "total"
                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "footer",
-                                            "xtype": "PagingToolbar",
-                                            "pageSize": 25,
-                                            "displayInfo": true,
-                                            "displayMsg": "Displaying itemloc{0} - {1} of {2}",
-                                            "emptyMsg": "No itemloc found",
-                                            "|xns": "Roo"
+                                            "pageSize" : 25,
+                                            "xtype" : "PagingToolbar",
+                                            "emptyMsg" : "No itemloc found",
+                                            "$ xns" : "Roo",
+                                            "displayInfo" : true,
+                                            "displayMsg" : "Displaying itemloc{0} - {1} of {2}",
+                                            "* prop" : "footer"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "location_name",
-                                            "header": "Location",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Location",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_name"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "itemloc_realqty",
-                                            "header": "Itemloc qty",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Itemloc qty",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "itemloc_realqty"
                                         }
                                     ]
                                 }
                 }
             ]
         }
-    ],
-    "permname": "",
-    "modOrder": "001"
+    ]
 }
\ No newline at end of file
index ed5078d..80d01f7 100644 (file)
@@ -2,8 +2,10 @@
 
 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
 
+Roo.namespace('Pman.Tab');
+
 Pman.Tab.XtupleItem = new Roo.XComponent({
-    part     :  ["Xtuple","Item"],
+    part     :  ["Xtuple", "Item" ],
     order    : '001-Pman.Tab.XtupleItem',
     region   : 'center',
     parent   : 'Pman.Tab.XtupleManage',
@@ -15,202 +17,39 @@ Pman.Tab.XtupleItem = new Roo.XComponent({
         var _this = this;
         var MODULE = this;
         return {
-            xtype: 'NestedLayoutPanel',
-            xns: Roo,
-            background : true,
-            region : 'center',
-            title : "Products",
             layout : {
-                xtype: 'BorderLayout',
-                xns: Roo,
+                center : {
+                    '|xns' : 'Roo',
+                    xtype : 'LayoutRegion',
+                    xns : Roo
+                },
+                east : {
+                    '|xns' : 'Roo',
+                    xtype : 'LayoutRegion',
+                    width : 200,
+                    xns : Roo,
+                    split : true
+                },
+                '|xns' : 'Roo',
+                xtype : 'BorderLayout',
+                xns : Roo,
                 items : [
-                    {
-                        xtype: 'GridPanel',
-                        xns: Roo,
-                        listeners : {
-                            activate : function() {
-                                _this.panel = this;
-                                if (_this.grid) {
-                                    _this.grid.footer.onClick('first');
-                                }
-                            }
-                        },
-                        background : true,
-                        fitContainer : true,
-                        fitToframe : true,
-                        region : 'center',
-                        tableName : 'item',
-                        title : "Products",
+                       {
                         grid : {
-                            xtype: 'EditorGrid',
-                            xns: Roo.grid,
-                            listeners : {
-                                render : function() 
-                                {
-                                    _this.grid = this; 
-                                    //_this.dialog = Pman.Dialog.FILL_IN
-                                    if (_this.panel.active) {
-                                       this.footer.onClick('first');
-                                    }
-                                },
-                                cellclick : function (_self, row, col, e)
-                                {
-                                     var di = _this.grid.colModel.getDataIndex(col);
-                                     
-                                     var rec = _this.grid.ds.getAt(row);
-                                     
-                                     
-                                     if (di == 'item_active') {
-                                     
-                                        var nv = rec.data.item_active ? 0 : 1;
-                                        new Pman.Request({
-                                            mask : 'Saving',
-                                            url : baseURL + '/Roo/Item',
-                                            params : {
-                                                item_id : rec.data.item_id,
-                                                item_active : nv
-                                            },
-                                            success : function() {
-                                                rec.set('item_active', nv);
-                                            }
-                                        });
-                                        return;
-                                        
-                                     
-                                     }
-                                     
-                                     if(di == 'itemsrc_active'){
-                                     
-                                     
-                                     
-                                
-                                        if(rec.data.itemsrc_active * 1){
-                                            Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
-                                                function (res) {
-                                                    if(res!='yes') {
-                                                        return;
-                                                    }
-                                                    rec.set('itemsrc_active', 0);
-                                                    rec.commit();
-                                            });
-                                            return;
-                                        }
-                                        
-                                        Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
-                                            _this.grid.footer.onClick('first');
-                                       }); 
-                                       return;
-                                        
-                                    }
-                                     
-                                     _this.locgrid.footer.onClick('first');
-                                     
-                                     
-                                     
-                                     
-                                },
-                                afteredit : function (e)
-                                {
-                                    
-                                    
-                                    Roo.log(e);
-                                    new Pman.Request({
-                                        url : baseURL +'/Roo/Charass',
-                                        params : {
-                                             charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
-                                             charass_value : e.value,
-                                             charass_target_type : 'I',
-                                             charass_default : 1,
-                                             charass_target_id : e.record.data.item_id
-                                         },
-                                         method : 'POST'
-                                     });
-                                    
-                                    
-                                    e.record.commit();
-                                    
-                                    
-                                    
-                                },
-                                celldblclick : function (_self, rowIndex, columnIndex, e)
-                                {
-                                    var s = _this.grid.ds.getAt(rowIndex);
-                                    
-                                    Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
-                                        _this.grid.footer.onClick('first');
-                                   }); 
-                                }
-                            },
-                            autoExpandColumn : 'item_descrip1',
-                            clicksToEdit : 1,
-                            loadMask : true,
                             dataSource : {
-                                xtype: 'Store',
-                                xns: Roo.data,
-                                listeners : {
-                                    beforeload : function (_self, o)
-                                    {
-                                      o.params._with_prodcat = 1;
-                                      o.params._with_char = 1;
-                                      o.params._with_itemsrc_active = 1;
-                                      o.params._with_last_purchase_price = 1;
-                                      o.params._with_image = 1;
-                                      var s = _this.search.getValue();
-                                      if (s.length) {
-                                        o.params['query[number_or_name]'] = s;
-                                      }
-                                      if (!_this.active.pressed) {
-                                        o.params.item_active = 1;
-                                      }
-                                      if (_this.brandSel.getValue().length) {
-                                        o.params._with_brand = _this.brandSel.getValue()
-                                      }
-                                      
-                                      o.params._with_stock_balance = 1;
-                                    },
-                                    update : function (_self, record, operation)
-                                    {
-                                        if(operation != 'commit'){
-                                            return;
-                                        }
-                                        
-                                        var nv  = record.data.itemsrc_active ? 0 : 1;
-                                        new Pman.Request({
-                                            mask : 'Saving',
-                                            url : baseURL + '/Roo/Itemsrc',
-                                            params : {
-                                                _update_by_item : 1,
-                                                item_id : record.data.item_id,
-                                                itemsrc_active : nv
-                                            },
-                                            success : function(res) {
-                                                record.set('itemsrc_active', nv);
-                                            }
-                                        });
-                                    },
-                                    load : function (_self, records, options)
-                                    {
-                                    
-                                        var cm = _this.grid.getColumnModel();
-                                        if(records.length){
-                                            cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
-                                        }
-                                    }
-                                },
-                                remoteSort : true,
-                                sortInfo : { field : 'item_number', direction: 'ASC' },
                                 proxy : {
-                                    xtype: 'HttpProxy',
-                                    xns: Roo.data,
+                                    '|xns' : 'Roo.data',
+                                    url : baseURL + '/Roo/item.php',
                                     method : 'GET',
-                                    url : baseURL + '/Roo/item.php'
+                                    xtype : 'HttpProxy',
+                                    xns : Roo.data
                                 },
                                 reader : {
-                                    xtype: 'JsonReader',
-                                    xns: Roo.data,
-                                    totalProperty : 'total',
-                                    root : 'data',
+                                    '|xns' : 'Roo.data',
                                     id : 'id',
+                                    root : 'data',
+                                    xtype : 'JsonReader',
+                                    xns : Roo.data,
                                     fields : [
                                         {
                                             'name': 'item_id',
@@ -392,73 +231,89 @@ Pman.Tab.XtupleItem = new Roo.XComponent({
                                             'name': 'item_classcode_id_classcode_type',
                                             'type': 'string'
                                         }
-                                    ]
-                                }
+                                    ],
+                                    totalProperty : 'total'
+                                },
+                                '|xns' : 'Roo.data',
+                                xtype : 'Store',
+                                remoteSort : true,
+                                sortInfo : { field : 'item_number', direction: 'ASC' },
+                                xns : Roo.data,
+                                listeners : {
+                                       update : function (_self, record, operation)
+                                          {
+                                              if(operation != 'commit'){
+                                                  return;
+                                              }
+                                              
+                                              var nv  = record.data.itemsrc_active ? 0 : 1;
+                                              new Pman.Request({
+                                                  mask : 'Saving',
+                                                  url : baseURL + '/Roo/Itemsrc',
+                                                  params : {
+                                                      _update_by_item : 1,
+                                                      item_id : record.data.item_id,
+                                                      itemsrc_active : nv
+                                                  },
+                                                  success : function(res) {
+                                                      record.set('itemsrc_active', nv);
+                                                  }
+                                              });
+                                          },
+                                       beforeload : function (_self, o)
+                                          {
+                                            o.params._with_prodcat = 1;
+                                            o.params._with_char = 1;
+                                            o.params._with_itemsrc_active = 1;
+                                            o.params._with_last_purchase_price = 1;
+                                            o.params._with_image = 1;
+                                            var s = _this.search.getValue();
+                                            if (s.length) {
+                                              o.params['query[number_or_name]'] = s;
+                                            }
+                                            if (!_this.active.pressed) {
+                                              o.params.item_active = 1;
+                                            }
+                                            if (_this.brandSel.getValue().length) {
+                                              o.params._with_brand = _this.brandSel.getValue()
+                                            }
+                                            
+                                            o.params._with_stock_balance = 1;
+                                          },
+                                       load : function (_self, records, options)
+                                          {
+                                          
+                                              var cm = _this.grid.getColumnModel();
+                                              if(records.length){
+                                                  cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
+                                              }
+                                          }
+                                },
+                                items : [
+
+                                ]
+
                             },
                             toolbar : {
-                                xtype: 'Toolbar',
-                                xns: Roo,
+                                '|xns' : 'Roo',
+                                xtype : 'Toolbar',
+                                xns : Roo,
                                 items : [
-                                    {
-                                        xtype: 'ComboBox',
-                                        xns: Roo.form,
-                                        listeners : {
-                                            render : function (_self)
-                                            {
-                                              _this.brandSel = _self;
-                                            },
-                                            select : function (combo, record, index)
-                                            {
-                                                _this.grid.footer.onClick('first');
-                                            }
-                                        },
-                                        allowBlank : true,
-                                        alwaysQuery : true,
-                                        displayField : 'charass_value',
-                                        editable : true,
-                                        emptyText : "Select Brand",
-                                        forceSelection : true,
-                                        listWidth : 300,
-                                        loadingText : "Searching...",
-                                        minChars : 2,
-                                        pageSize : 20,
-                                        qtip : "Select Brand",
-                                        queryParam : 'query[charass_value]',
-                                        selectOnFocus : true,
-                                        tpl : '<div class="x-grid-cell-text x-btn button"><b>{charass_value}</b> </div>',
-                                        triggerAction : 'all',
-                                        width : 150,
+                                       {
                                         store : {
-                                            xtype: 'Store',
-                                            xns: Roo.data,
-                                            listeners : {
-                                                beforeload : function (_self, o)
-                                                {
-                                                    o.params = o.params || {};
-                                                    // staff can see all logs, other companies can only see their own.
-                                                    // look for all of the charass 's with the same type= eg. brand.
-                                                    
-                                                    o.params.charass_char_id_char_name = 'BRAND';
-                                                    o.params.charass_target_type ='I';
-                                                    o.params._distinct = 'charass_value';
-                                                        o.params._columns = 'charass_value';
-                                                
-                                                }
-                                            },
-                                            remoteSort : true,
-                                            sortInfo : { field : 'charass_value' , direction : 'ASC' },
                                             proxy : {
-                                                xtype: 'HttpProxy',
-                                                xns: Roo.data,
+                                                '|xns' : 'Roo.data',
+                                                url : baseURL + '/Roo/Charass.php',
+                                                xtype : 'HttpProxy',
                                                 method : 'GET',
-                                                url : baseURL + '/Roo/Charass.php'
+                                                xns : Roo.data
                                             },
                                             reader : {
-                                                xtype: 'JsonReader',
-                                                xns: Roo.data,
-                                                totalProperty : 'total',
-                                                root : 'data',
+                                                '|xns' : 'Roo.data',
                                                 id : 'id',
+                                                root : 'data',
+                                                xtype : 'JsonReader',
+                                                xns : Roo.data,
                                                 fields : [
                                                     {
                                                         'name': 'id',
@@ -569,1054 +424,1299 @@ Pman.Tab.XtupleItem = new Roo.XComponent({
                                                         'name': 'person_id_deleted_dt',
                                                         'type': 'date'
                                                     }
-                                                ]
-                                            }
-                                        }
-                                    },
-                                    {
-                                        xtype: 'TextField',
-                                        xns: Roo.form,
-                                        listeners : {
-                                            render : function (_self)
-                                            {
-                                              _this.search = _self;
+                                                ],
+                                                totalProperty : 'total'
                                             },
-                                            specialkey : function (_self, e)
-                                            {
-                                                _this.grid.footer.onClick('first');
-                                            }
+                                            '|xns' : 'Roo.data',
+                                            xtype : 'Store',
+                                            remoteSort : true,
+                                            sortInfo : { field : 'charass_value' , direction : 'ASC' },
+                                            xns : Roo.data,
+                                            listeners : {
+                                               beforeload : function (_self, o)
+                                                  {
+                                                      o.params = o.params || {};
+                                                      // staff can see all logs, other companies can only see their own.
+                                                      // look for all of the charass 's with the same type= eg. brand.
+                                                      
+                                                      o.params.charass_char_id_char_name = 'BRAND';
+                                                      o.params.charass_target_type ='I';
+                                                      o.params._distinct = 'charass_value';
+                                                          o.params._columns = 'charass_value';
+                                                  
+                                                  }
+                                            },
+                                            items : [
+
+                                            ]
+
                                         },
-                                        emptyText : "Search Product"
-                                    },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                        '|xns' : 'Roo.form',
+                                        alwaysQuery : true,
+                                        listWidth : 300,
+                                        triggerAction : 'all',
+                                        forceSelection : true,
+                                        selectOnFocus : true,
+                                        pageSize : 20,
+                                        displayField : 'charass_value',
+                                        emptyText : "Select Brand",
+                                        minChars : 2,
+                                        xtype : 'ComboBox',
+                                        allowBlank : true,
+                                        editable : true,
+                                        width : 150,
+                                        xns : Roo.form,
+                                        qtip : "Select Brand",
+                                        queryParam : 'query[charass_value]',
+                                        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+                                        loadingText : "Searching...",
                                         listeners : {
-                                            click : function (_self, e)
-                                            {
-                                            _this.grid.footer.onClick('first');
-                                            }
+                                               render : function (_self)
+                                                  {
+                                                    _this.brandSel = _self;
+                                                  },
+                                               select : function (combo, record, index)
+                                                  {
+                                                      _this.grid.footer.onClick('first');
+                                                  }
                                         },
-                                        cls : 'x-btn-icon',
-                                        icon : rootURL + '/Pman/templates/images/search.gif'
+                                        items : [
+
+                                        ]
+
                                     },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                       {
+                                        '|xns' : 'Roo.form',
+                                        emptyText : "Search Product",
+                                        xtype : 'TextField',
+                                        xns : Roo.form,
                                         listeners : {
-                                            click : function (_self, e)
-                                            {
-                                                _this.search.setValue('');
-                                                
-                                            
-                                                
-                                                _this.grid.footer.onClick('first');
-                                            }
-                                        },
-                                        cls : 'x-btn-icon',
-                                        icon : rootURL + '/Pman/templates/images/edit-clear.gif'
+                                               specialkey : function (_self, e)
+                                                  {
+                                                      _this.grid.footer.onClick('first');
+                                                  },
+                                               render : function (_self)
+                                                  {
+                                                    _this.search = _self;
+                                                  }
+                                        }
                                     },
-                                    {
-                                        xtype: 'Separator',
-                                        xns: Roo.Toolbar
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        xtype : 'Button',
+                                        cls : 'x-btn-icon',
+                                        icon : rootURL + '/Pman/templates/images/search.gif',
+                                        xns : Roo.Toolbar,
+                                        listeners : {
+                                               click : function (_self, e)
+                                                  {
+                                                  _this.grid.footer.onClick('first');
+                                                  }
+                                        }
                                     },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        xtype : 'Button',
+                                        cls : 'x-btn-icon',
+                                        icon : rootURL + '/Pman/templates/images/edit-clear.gif',
+                                        xns : Roo.Toolbar,
                                         listeners : {
-                                            toggle : function (_self, pressed)
-                                            {
-                                            
-                                                this.setText(pressed ? "Hide Inactive" : "Show Inactive");
-                                                (function() { _this.grid.footer.onClick('first'); }).defer(100);
-                                            },
-                                            render : function (_self)
-                                            {
-                                                _this.active = _self;
-                                            }
-                                        },
-                                        enableToggle : true,
-                                        text : "Show Inactive"
+                                               click : function (_self, e)
+                                                  {
+                                                      _this.search.setValue('');
+                                                      
+                                                  
+                                                      
+                                                      _this.grid.footer.onClick('first');
+                                                  }
+                                        }
                                     },
-                                    {
-                                        xtype: 'Fill',
-                                        xns: Roo.Toolbar
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        xtype : 'Separator',
+                                        xns : Roo.Toolbar
                                     },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        text : "Show Inactive",
+                                        enableToggle : true,
+                                        xtype : 'Button',
+                                        xns : Roo.Toolbar,
                                         listeners : {
-                                            click : function()
-                                            {
-                                            
-                                               Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
-                                                    _this.grid.footer.onClick('first');
-                                               }); 
-                                            }
-                                        },
-                                        cls : 'x-btn-text-icon',
+                                               toggle : function (_self, pressed)
+                                                  {
+                                                  
+                                                      this.setText(pressed ? "Hide Inactive" : "Show Inactive");
+                                                      (function() { _this.grid.footer.onClick('first'); }).defer(100);
+                                                  },
+                                               render : function (_self)
+                                                  {
+                                                      _this.active = _self;
+                                                  }
+                                        }
+                                    },
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        xtype : 'Fill',
+                                        xns : Roo.Toolbar
+                                    },
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
                                         text : "Add",
-                                        icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
+                                        xtype : 'Button',
+                                        cls : 'x-btn-text-icon',
+                                        icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+                                        xns : Roo.Toolbar,
+                                        listeners : {
+                                               click : function()
+                                                  {
+                                                  
+                                                     Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
+                                                          _this.grid.footer.onClick('first');
+                                                     }); 
+                                                  }
+                                        }
                                     },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        text : "Rename SKU",
+                                        xtype : 'Button',
+                                        xns : Roo.Toolbar,
                                         listeners : {
-                                            click : function()
-                                            {
-                                                var s = _this.grid.selModel.getSelectedCell();
-                                                if (!s) {
-                                                    Roo.MessageBox.alert("Error", "Select a product");
-                                                    return;
-                                                } 
-                                                var rec = _this.grid.ds.getAt(s[0]);
-                                                
-                                                var params = [];
-                                                
-                                                Roo.MessageBox.prompt(
-                                                    "Rename SKU", 
-                                                    "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
-                                                    function(r,v) {
-                                                        if (r != 'ok') {
-                                                            return;
-                                                            
-                                                        }
-                                                        params = {
-                                                            _rename_sku : v,
-                                                            item_id : rec.data.item_id,
-                                                            _check : 1
-                                                        }
-                                            
-                                                        change(params);
-                                                        
-                                                        return;
-                                                            
-                                                        
-                                            
-                                                    }
-                                                );
-                                                
-                                                var change = function(params){
-                                                    new Pman.Request({
-                                                        url : baseURL + '/Roo/Item',
-                                                        mask : "Renaming",
-                                                        method : 'POST',
-                                                        params : params,
-                                                        success : function(res) {
-                                                            Roo.log(res);
-                                                            _this.grid.footer.onClick('refresh');
-                                                            if(typeof(res.data) == 'string'){
-                                                                Roo.MessageBox.alert("Notice", 'SKU has been renamed');
-                                                                return
-                                                            }
-                                                            var offices = [];
-                                                            Roo.each(res.data, function(o){
-                                                                offices.push(Pman.Xtuple.offices[o]);
-                                                            })
-                                                            Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
-                                                            
-                                                        },
-                                                        failure : function(res) {
-                                                            Roo.log(res);
-                                                            try {
-                                                                if (res.errors.confirm.length) {
-                                                                    var offices = [];
-                                                                    Roo.each(res.errors.confirm, function(o){
-                                                                        offices.push(Pman.Xtuple.offices[o]);
-                                                                    })
-                                                                    Roo.MessageBox.confirm(
-                                                                        "Confirm", 
-                                                                        " Do you want to change the name in " + offices.join(", ") + "?",
-                                                                        function(x) {
-                                                                            if (x != 'yes') {
-                                                                                Roo.MessageBox.alert("Notice", 'SKU was not changed');
-                                                                                return;
-                                                                            }
-                                                                            delete params['_check'];
-                                                                            params._can_change_sku = 1;
-                                                                            change(params);
-                                                                        }
-                                                                    );
-                                                                    return;
-                                                                }
-                                                            } catch(e) { }
-                                                            Roo.MessageBox.alert("Error", res.errorMsg);
-                                                            
-                                                        }
-                                                    });
-                                                }
-                                               
-                                            }
-                                        },
-                                        text : "Rename SKU"
+                                               click : function()
+                                                  {
+                                                      var s = _this.grid.selModel.getSelectedCell();
+                                                      if (!s) {
+                                                          Roo.MessageBox.alert("Error", "Select a product");
+                                                          return;
+                                                      } 
+                                                      var rec = _this.grid.ds.getAt(s[0]);
+                                                      
+                                                      var params = [];
+                                                      
+                                                      Roo.MessageBox.prompt(
+                                                          "Rename SKU", 
+                                                          "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
+                                                          function(r,v) {
+                                                              if (r != 'ok') {
+                                                                  return;
+                                                                  
+                                                              }
+                                                              params = {
+                                                                  _rename_sku : v,
+                                                                  item_id : rec.data.item_id,
+                                                                  _check : 1
+                                                              }
+                                                  
+                                                              change(params);
+                                                              
+                                                              return;
+                                                                  
+                                                              
+                                                  
+                                                          }
+                                                      );
+                                                      
+                                                      var change = function(params){
+                                                          new Pman.Request({
+                                                              url : baseURL + '/Roo/Item',
+                                                              mask : "Renaming",
+                                                              method : 'POST',
+                                                              params : params,
+                                                              success : function(res) {
+                                                                  Roo.log(res);
+                                                                  _this.grid.footer.onClick('refresh');
+                                                                  if(typeof(res.data) == 'string'){
+                                                                      Roo.MessageBox.alert("Notice", 'SKU has been renamed');
+                                                                      return
+                                                                  }
+                                                                  var offices = [];
+                                                                  Roo.each(res.data, function(o){
+                                                                      offices.push(Pman.Xtuple.offices[o]);
+                                                                  })
+                                                                  Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
+                                                                  
+                                                              },
+                                                              failure : function(res) {
+                                                                  Roo.log(res);
+                                                                  try {
+                                                                      if (res.errors.confirm.length) {
+                                                                          var offices = [];
+                                                                          Roo.each(res.errors.confirm, function(o){
+                                                                              offices.push(Pman.Xtuple.offices[o]);
+                                                                          })
+                                                                          Roo.MessageBox.confirm(
+                                                                              "Confirm", 
+                                                                              " Do you want to change the name in " + offices.join(", ") + "?",
+                                                                              function(x) {
+                                                                                  if (x != 'yes') {
+                                                                                      Roo.MessageBox.alert("Notice", 'SKU was not changed');
+                                                                                      return;
+                                                                                  }
+                                                                                  delete params['_check'];
+                                                                                  params._can_change_sku = 1;
+                                                                                  change(params);
+                                                                              }
+                                                                          );
+                                                                          return;
+                                                                      }
+                                                                  } catch(e) { }
+                                                                  Roo.MessageBox.alert("Error", res.errorMsg);
+                                                                  
+                                                              }
+                                                          });
+                                                      }
+                                                     
+                                                  }
+                                        }
                                     },
-                                    {
-                                        xtype: 'Separator',
-                                        xns: Roo.Toolbar
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        xtype : 'Separator',
+                                        xns : Roo.Toolbar
                                     },
-                                    {
-                                        xtype: 'TextItem',
-                                        xns: Roo.Toolbar,
-                                        text : "Report start :"
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        text : "Report start :",
+                                        xtype : 'TextItem',
+                                        xns : Roo.Toolbar
                                     },
-                                    {
-                                        xtype: 'DateField',
-                                        xns: Roo.form,
-                                        listeners : {
-                                            render : function (_self)
-                                            {
-                                                _this.dateFrom = _self;
-                                            }
-                                        },
+                                       {
+                                        '|xns' : 'Roo.form',
                                         format : 'd/M/Y',
+                                        xtype : 'DateField',
                                         useIso : true,
-                                        value : (function() { return (new Date()).format('Y') + '-01-01'; })()
-                                    },
-                                    {
-                                        xtype: 'ComboBox',
-                                        xns: Roo.form,
+                                        value : (function() { return (new Date()).format('Y') + '-01-01'; })(),
+                                        xns : Roo.form,
                                         listeners : {
-                                            render : function (_self)
-                                            {
-                                              _this.datespan  = _self;
-                                            }
-                                        },
-                                        allowBlank : false,
-                                        displayField : 'fname',
-                                        editable : false,
-                                        fieldLabel : 'Status',
-                                        hiddenName : 'cm_status',
-                                        listWidth : 200,
-                                        mode : 'local',
-                                        name : 'cm_status_name',
-                                        triggerAction : 'all',
-                                        value : 12,
-                                        valueField : 'ftype',
-                                        width : 150,
+                                               render : function (_self)
+                                                  {
+                                                      _this.dateFrom = _self;
+                                                  }
+                                        }
+                                    },
+                                       {
                                         store : {
-                                            xtype: 'SimpleStore',
-                                            xns: Roo.data,
+                                            '|xns' : 'Roo.data',
+                                            xtype : 'SimpleStore',
                                             data : [ 
                                                 [ '1', "Single Month Sales"],
                                                 [ '3', "Quarter Sales"],
                                                 [ '6', "Half year Sales"] ,
                                                 [ '12', "Full Year Sales"] 
                                             ],
-                                            fields : [  'ftype', 'fname']
-                                        }
-                                    },
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
+                                            fields : [  'ftype', 'fname'],
+                                            xns : Roo.data
+                                        },
+                                        '|xns' : 'Roo.form',
+                                        listWidth : 200,
+                                        triggerAction : 'all',
+                                        fieldLabel : 'Status',
+                                        displayField : 'fname',
+                                        hiddenName : 'cm_status',
+                                        value : 12,
+                                        valueField : 'ftype',
+                                        xtype : 'ComboBox',
+                                        allowBlank : false,
+                                        editable : false,
+                                        width : 150,
+                                        xns : Roo.form,
+                                        mode : 'local',
+                                        name : 'cm_status_name',
                                         listeners : {
-                                            click : function (_self, e)
-                                            {
-                                                if (!_this.brandSel.getValue().length) {
-                                                    Roo.MessageBox.alert("Error", "Select a brand to download");
-                                                    return;
-                                                }
-                                            
-                                                new Pman.Download({
-                                                    url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
-                                                    params: { 
-                                                        date_from : _this.dateFrom.getValue(),
-                                                        brand : _this.brandSel.getValue(),
-                                                        span : _this.datespan.getValue()
-                                                    }
-                                                });
-                                                    
-                                            
-                                            }
+                                               render : function (_self)
+                                                  {
+                                                    _this.datespan  = _self;
+                                                  }
                                         },
-                                        text : "Download Sales Report"
+                                        items : [
+
+                                        ]
+
+                                    },
+                                       {
+                                        '|xns' : 'Roo.Toolbar',
+                                        text : "Download Sales Report",
+                                        xtype : 'Button',
+                                        xns : Roo.Toolbar,
+                                        listeners : {
+                                               click : function (_self, e)
+                                                  {
+                                                      if (!_this.brandSel.getValue().length) {
+                                                          Roo.MessageBox.alert("Error", "Select a brand to download");
+                                                          return;
+                                                      }
+                                                  
+                                                      new Pman.Download({
+                                                          url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
+                                                          params: { 
+                                                              date_from : _this.dateFrom.getValue(),
+                                                              brand : _this.brandSel.getValue(),
+                                                              span : _this.datespan.getValue()
+                                                          }
+                                                      });
+                                                          
+                                                  
+                                                  }
+                                        }
                                     }
                                 ]
+
                             },
                             footer : {
-                                xtype: 'PagingToolbar',
-                                xns: Roo,
+                                '|xns' : 'Roo',
                                 pageSize : 25,
+                                xtype : 'PagingToolbar',
+                                emptyMsg : "No item found",
+                                xns : Roo,
                                 displayInfo : true,
                                 displayMsg : "Displaying item{0} - {1} of {2}",
-                                emptyMsg : "No item found",
                                 items : [
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
-                                        text : "Tools - Upload/Download",
+                                       {
                                         menu : {
-                                            xtype: 'Menu',
-                                            xns: Roo.menu,
+                                            '|xns' : 'Roo.menu',
+                                            xtype : 'Menu',
+                                            xns : Roo.menu,
                                             items : [
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
+                                               {
+                                                    '|xns' : 'Roo.menu',
+                                                    text : "Download Standard costs",
+                                                    xtype : 'Item',
+                                                    xns : Roo.menu,
                                                     listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                           new Pman.Download({
-                                                                method: 'GET',
-                                                                url : baseURL + '/Roo/item',
-                                                                params : {
-                                                                    _costgrid : 1
-                                                                }
-                                                           });
-                                                        }
-                                                    },
-                                                    text : "Download Standard costs"
+                                                       click : function (_self, e)
+                                                          {
+                                                             new Pman.Download({
+                                                                  method: 'GET',
+                                                                  url : baseURL + '/Roo/item',
+                                                                  params : {
+                                                                      _costgrid : 1
+                                                                  }
+                                                             });
+                                                          }
+                                                    }
                                                 },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
+                                               {
+                                                    '|xns' : 'Roo.menu',
+                                                    text : "Upload new products and costs",
+                                                    xtype : 'Item',
+                                                    xns : Roo.menu,
                                                     listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                        //   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");
-                                                         //  return;
-                                                           
-                                                           Pman.Dialog.Image.show(
-                                                               {
-                                                                    _url : baseURL+'/Xtuple/Import/Products',
-                                                                    timeout : 60000
-                                                                
-                                                               },
-                                                               function (data) {
-                                                                    var msg = [];
-                                                                   
-                                                                    if (data.updated) {
-                                                                        msg.push("Updated " + data.updated + " Products(s)");
-                                                                    }            
-                                                                    if (data.inserted) {
-                                                                        msg.push("Added " + data.inserted + " Products(s)");
-                                                                    }
-                                                                    if (data.skipped) {
-                                                                        msg.push("Skipped " + data.skipped);
-                                                                    }
-                                                                    
-                                                                    if (!msg.length) {
-                                                                        msg.push("No data changed");
-                                                                    }
-                                                                    Roo.MessageBox.alert("Notice", msg.join("\n"));
-                                                        
-                                                               }
-                                                           );
-                                                        }
-                                                    },
-                                                    text : "Upload new products and costs"
+                                                       click : function (_self, e)
+                                                          {
+                                                          //   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");
+                                                           //  return;
+                                                             
+                                                             Pman.Dialog.Image.show(
+                                                                 {
+                                                                      _url : baseURL+'/Xtuple/Import/Products',
+                                                                      timeout : 60000
+                                                                  
+                                                                 },
+                                                                 function (data) {
+                                                                      var msg = [];
+                                                                     
+                                                                      if (data.updated) {
+                                                                          msg.push("Updated " + data.updated + " Products(s)");
+                                                                      }            
+                                                                      if (data.inserted) {
+                                                                          msg.push("Added " + data.inserted + " Products(s)");
+                                                                      }
+                                                                      if (data.skipped) {
+                                                                          msg.push("Skipped " + data.skipped);
+                                                                      }
+                                                                      
+                                                                      if (!msg.length) {
+                                                                          msg.push("No data changed");
+                                                                      }
+                                                                      Roo.MessageBox.alert("Notice", msg.join("\n"));
+                                                          
+                                                                 }
+                                                             );
+                                                          }
+                                                    }
                                                 },
-                                                {
-                                                    xtype: 'Separator',
-                                                    xns: Roo.menu
+                                               {
+                                                    '|xns' : 'Roo.menu',
+                                                    xtype : 'Separator',
+                                                    xns : Roo.menu
                                                 },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
-                                                    listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                          Roo.MessageBox.progress ("Syncing Stock", "Sending");
-                                                          
-                                                          var offset = 0;
-                                                          
-                                                           function runSync() {
-                                                               
-                                                               new Pman.Request( {
-                                                                    url : baseURL+'/Roo/Item',
-                                                                    method : 'GET',
-                                                                    timeout: 60000,
-                                                                    params : {
-                                                                        _syncFromHK : 1,
-                                                                        offset : offset
-                                                                    },
-                                                                    success : function(res) {
-                                                                        Roo.log(res);
-                                                                        if (!res.data.total) {
-                                                                            Roo.MessageBox.hide();
-                                                                            return;
-                                                                        }
-                                                                        offset += res.data.limit;
-                                                                        Roo.MessageBox.updateProgress ( offset  / res.data.total, "Done " + offset + '/' + res.data.total);
-                                                                        runSync();
-                                                                    }
-                                                                    
-                                                                
-                                                               });
-                                                           }
-                                                           runSync();
-                                                        }
-                                                    },
+                                               {
+                                                    '|xns' : 'Roo.menu',
                                                     text : "Sync Product Data from HK",
+                                                    xtype : 'Item',
+                                                    xns : Roo.menu,
                                                     hidden : (function() {
                                                     
                                                         return baseURL.match(/hk\.php$/) ? true : false;
-                                                    })()
-                                                },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
+                                                    })(),
                                                     listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                          Roo.MessageBox.progress ("Syncing Stock", "Sending");
-                                                          
-                                                          var offset = 0;
-                                                          
-                                                           
-                                                               
-                                                           new Pman.Request( {
-                                                                url : baseURL+'/Roo/Item',
-                                                                method : 'GET',
-                                                                params : {
-                                                                    _syncFromHK : 1,
-                                                                    _new_only : 1
-                                                                },
-                                                                success : function(res) {
-                                                                    Roo.log(res);
-                                                                    
-                                                                        Roo.MessageBox.hide();
-                                                                     _this.grid.footer.onClick('refresh');
-                                                                    
-                                                                     
-                                                                }
-                                                                
-                                                            
-                                                           });
-                                                            
-                                                        }
-                                                    },
+                                                       click : function (_self, e)
+                                                          {
+                                                            Roo.MessageBox.progress ("Syncing Stock", "Sending");
+                                                            
+                                                            var offset = 0;
+                                                            
+                                                             function runSync() {
+                                                                 
+                                                                 new Pman.Request( {
+                                                                      url : baseURL+'/Roo/Item',
+                                                                      method : 'GET',
+                                                                      timeout: 60000,
+                                                                      params : {
+                                                                          _syncFromHK : 1,
+                                                                          offset : offset
+                                                                      },
+                                                                      success : function(res) {
+                                                                          Roo.log(res);
+                                                                          if (!res.data.total) {
+                                                                              Roo.MessageBox.hide();
+                                                                              return;
+                                                                          }
+                                                                          offset += res.data.limit;
+                                                                          Roo.MessageBox.updateProgress ( offset  / res.data.total, "Done " + offset + '/' + res.data.total);
+                                                                          runSync();
+                                                                      }
+                                                                      
+                                                                  
+                                                                 });
+                                                             }
+                                                             runSync();
+                                                          }
+                                                    }
+                                                },
+                                               {
+                                                    '|xns' : 'Roo.menu',
                                                     text : "Sync Product from HK (New Products Only)",
+                                                    xtype : 'Item',
+                                                    xns : Roo.menu,
                                                     hidden : (function() {
                                                     
                                                         return baseURL.match(/hk\.php$/) ? true : false;
-                                                    })()
-                                                },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
+                                                    })(),
                                                     listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                          Roo.MessageBox.progress ("Syncing Stock", "Sending");
-                                                          
-                                                          var offset = 0;
-                                                          
-                                                           
-                                                               
-                                                           new Pman.Request( {
-                                                                url : baseURL+'/Roo/Item',
-                                                                method : 'GET',
-                                                                params : {
-                                                                    _syncFromHK : 1,
-                                                                    item_number : _this.search.getValue()
-                                                                },
-                                                                success : function(res) {
-                                                                    Roo.log(res);
-                                                                    
-                                                                        Roo.MessageBox.hide();
-                                                                     _this.grid.footer.onClick('refresh');
-                                                                    
-                                                                     
-                                                                }
-                                                                
-                                                            
-                                                           });
-                                                            
-                                                        }
-                                                    },
+                                                       click : function (_self, e)
+                                                          {
+                                                            Roo.MessageBox.progress ("Syncing Stock", "Sending");
+                                                            
+                                                            var offset = 0;
+                                                            
+                                                             
+                                                                 
+                                                             new Pman.Request( {
+                                                                  url : baseURL+'/Roo/Item',
+                                                                  method : 'GET',
+                                                                  params : {
+                                                                      _syncFromHK : 1,
+                                                                      _new_only : 1
+                                                                  },
+                                                                  success : function(res) {
+                                                                      Roo.log(res);
+                                                                      
+                                                                          Roo.MessageBox.hide();
+                                                                       _this.grid.footer.onClick('refresh');
+                                                                      
+                                                                       
+                                                                  }
+                                                                  
+                                                              
+                                                             });
+                                                              
+                                                          }
+                                                    }
+                                                },
+                                               {
+                                                    '|xns' : 'Roo.menu',
                                                     text : "Sync Product from HK (Based on Search)",
+                                                    xtype : 'Item',
+                                                    xns : Roo.menu,
                                                     hidden : (function() {
                                                     
                                                         return baseURL.match(/hk\.php$/) ? true : false;
-                                                    })()
+                                                    })(),
+                                                    listeners : {
+                                                       click : function (_self, e)
+                                                          {
+                                                            Roo.MessageBox.progress ("Syncing Stock", "Sending");
+                                                            
+                                                            var offset = 0;
+                                                            
+                                                             
+                                                                 
+                                                             new Pman.Request( {
+                                                                  url : baseURL+'/Roo/Item',
+                                                                  method : 'GET',
+                                                                  params : {
+                                                                      _syncFromHK : 1,
+                                                                      item_number : _this.search.getValue()
+                                                                  },
+                                                                  success : function(res) {
+                                                                      Roo.log(res);
+                                                                      
+                                                                          Roo.MessageBox.hide();
+                                                                       _this.grid.footer.onClick('refresh');
+                                                                      
+                                                                       
+                                                                  }
+                                                                  
+                                                              
+                                                             });
+                                                              
+                                                          }
+                                                    }
                                                 }
                                             ]
-                                        }
+
+                                        },
+                                        '|xns' : 'Roo.Toolbar',
+                                        text : "Tools - Upload/Download",
+                                        xtype : 'Button',
+                                        xns : Roo.Toolbar,
+                                        items : [
+
+                                        ]
+
                                     }
                                 ]
+
                             },
+                            '|xns' : 'Roo.grid',
+                            autoExpandColumn : 'item_descrip1',
+                            xtype : 'EditorGrid',
+                            loadMask : true,
+                            clicksToEdit : 1,
+                            xns : Roo.grid,
                             colModel : [
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_image_id',
-                                    header : 'Image',
-                                    sortable : false,
-                                    width : 150,
-                                    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); }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_char_brand',
-                                    header : 'Brand',
-                                    sortable : true,
-                                    width : 100,
-                                    renderer : function(v) { return String.format('{0}', v); },
-                                    editor : {
-                                        xtype: 'GridEditor',
-                                        xns: Roo.grid,
-                                        field : {
-                                            xtype: 'ComboBox',
-                                            xns: Roo.form,
-                                            allowBlank : true,
-                                            alwaysQuery : true,
-                                            displayField : 'charass_value',
-                                            editable : true,
-                                            forceSelection : false,
-                                            listWidth : 300,
-                                            loadingText : "Searching...",
-                                            minChars : 2,
-                                            pageSize : 20,
-                                            qtip : "Select Brand",
-                                            queryParam : 'query[charass_value]',
-                                            selectOnFocus : true,
-                                            tpl : '<div class="x-grid-cell-text x-btn button"><b>{charass_value}</b> </div>',
-                                            triggerAction : 'all',
-                                            width : 150,
-                                            store : {
-                                                xtype: 'Store',
-                                                xns: Roo.data,
-                                                listeners : {
-                                                    beforeload : function (_self, o)
-                                                    {
-                                                        o.params = o.params || {};
-                                                        // staff can see all logs, other companies can only see their own.
-                                                        // look for all of the charass 's with the same type= eg. brand.
-                                                        
-                                                        o.params.charass_char_id_char_name = 'BRAND';
-                                                        o.params.charass_target_type ='I';
-                                                        o.params._distinct = 'charass_value';
-                                                            o.params._columns = 'charass_value';
-                                                    
-                                                    }
-                                                },
-                                                remoteSort : true,
-                                                sortInfo : { field : 'charass_value' , direction : 'ASC' },
-                                                proxy : {
-                                                    xtype: 'HttpProxy',
-                                                    xns: Roo.data,
-                                                    method : 'GET',
-                                                    url : baseURL + '/Roo/Charass.php'
-                                                },
-                                                reader : {
-                                                    xtype: 'JsonReader',
-                                                    xns: Roo.data,
-                                                    totalProperty : 'total',
-                                                    root : 'data',
-                                                    id : 'id',
-                                                    fields : [
-                                                        {
-                                                            'name': 'id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_name',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'event_when',
-                                                            'type': 'date',
-                                                            'dateFormat': 'Y-m-d'
-                                                        },
-                                                        {
-                                                            'name': 'action',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'ipaddr',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'on_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'on_table',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'remarks',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_office_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_name',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_phone',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_fax',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_email',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_company_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_role',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_active',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_remarks',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_passwd',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_owner_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_lang',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_no_reset_sent',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_action_type',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_project_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_deleted_by',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_deleted_dt',
-                                                            'type': 'date'
-                                                        }
-                                                    ]
-                                                }
-                                            }
-                                        }
-                                    }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_char_productgroup',
-                                    header : 'Product Group',
-                                    sortable : true,
-                                    width : 100,
-                                    renderer : function(v) { return String.format('{0}', v); },
-                                    editor : {
-                                        xtype: 'GridEditor',
-                                        xns: Roo.grid,
-                                        field : {
-                                            xtype: 'ComboBox',
-                                            xns: Roo.form,
-                                            allowBlank : true,
-                                            alwaysQuery : true,
-                                            displayField : 'charass_value',
-                                            editable : true,
-                                            forceSelection : false,
-                                            listWidth : 300,
-                                            loadingText : "Searching...",
-                                            minChars : 2,
-                                            pageSize : 20,
-                                            qtip : "Select Brand",
-                                            queryParam : 'query[charass_value]',
-                                            selectOnFocus : true,
-                                            tpl : '<div class="x-grid-cell-text x-btn button"><b>{charass_value}</b> </div>',
-                                            triggerAction : 'all',
-                                            width : 150,
-                                            store : {
-                                                xtype: 'Store',
-                                                xns: Roo.data,
-                                                listeners : {
-                                                    beforeload : function (_self, o)
-                                                    {
-                                                        o.params = o.params || {};
-                                                        // staff can see all logs, other companies can only see their own.
-                                                        // look for all of the charass 's with the same type= eg. brand.
-                                                        
-                                                        o.params.charass_char_id_char_name = 'PRODUCTGROUP';
-                                                        o.params.charass_target_type ='I';
-                                                        o.params._distinct = 'charass_value';
-                                                            o.params._columns = 'charass_value';    
-                                                    }
-                                                },
-                                                remoteSort : true,
-                                                sortInfo : { field : 'charass_value' , direction : 'ASC' },
-                                                proxy : {
-                                                    xtype: 'HttpProxy',
-                                                    xns: Roo.data,
-                                                    method : 'GET',
-                                                    url : baseURL + '/Roo/Charass.php'
-                                                },
-                                                reader : {
-                                                    xtype: 'JsonReader',
-                                                    xns: Roo.data,
-                                                    totalProperty : 'total',
-                                                    root : 'data',
-                                                    id : 'id',
-                                                    fields : [
-                                                        {
-                                                            'name': 'id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_name',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'event_when',
-                                                            'type': 'date',
-                                                            'dateFormat': 'Y-m-d'
-                                                        },
-                                                        {
-                                                            'name': 'action',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'ipaddr',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'on_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'on_table',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'remarks',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_office_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_name',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_phone',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_fax',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_email',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_company_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_role',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_active',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_remarks',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_passwd',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_owner_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_lang',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_no_reset_sent',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_action_type',
-                                                            'type': 'string'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_project_id',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_deleted_by',
-                                                            'type': 'int'
-                                                        },
-                                                        {
-                                                            'name': 'person_id_deleted_dt',
-                                                            'type': 'date'
-                                                        }
-                                                    ]
-                                                }
-                                            }
-                                        }
-                                    }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_number',
-                                    header : 'Number',
-                                    sortable : true,
-                                    width : 100,
-                                    renderer : function(v) { return String.format('<B>{0}</B>', v); }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_char_pickface_location',
-                                    header : 'Pickface',
-                                    sortable : true,
-                                    width : 100,
-                                    renderer : function(v) { return String.format('{0}', v); },
-                                    editor : {
-                                        xtype: 'GridEditor',
-                                        xns: Roo.grid,
-                                        field : {
-                                            xtype: 'TextField',
-                                            xns: Roo.form
-                                        }
-                                    }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_char_pallet_location',
-                                    header : 'Pallet',
-                                    sortable : true,
-                                    width : 100,
-                                    renderer : function(v) { return String.format('{0}', v); },
-                                    editor : {
-                                        xtype: 'GridEditor',
-                                        xns: Roo.grid,
-                                        field : {
-                                            xtype: 'TextField',
-                                            xns: Roo.form
-                                        }
-                                    }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_descrip1',
-                                    header : 'Description',
-                                    sortable : true,
-                                    width : 200,
-                                    renderer : function(v) { return String.format('{0}', v); }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'itemsrc_active',
-                                    header : 'Purchased',
-                                    sortable : true,
-                                    width : 55,
-                                    renderer : function(v) {  
-                                        var state = v * 1 > 0 ?  '-checked' : '';
-                                    
-                                        return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-                                                    
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_sold',
-                                    header : 'is Sold?',
-                                    sortable : true,
-                                    width : 50,
-                                    renderer : function(v) {  
-                                        var state = v * 1 > 0 ?  '-checked' : '';
-                                    
-                                        return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-                                                    
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_active',
-                                    header : 'is Active?',
-                                    sortable : true,
-                                    width : 50,
-                                    renderer : function(v) {  
-                                        var state = v * 1 > 0 ?  '-checked' : '';
-                                    
-                                        return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
-                                                    
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    align : 'right',
-                                    dataIndex : 'last_purchase_price',
-                                    header : 'Last purchase price',
-                                    width : 120,
-                                    renderer : function(v,x,r) {
-                                    
-                                         return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ; 
-                                         
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'item_prodcat_id_prodcat_code',
-                                    header : 'Item prodcat',
-                                    width : 100,
-                                    renderer : function(v,x,r) { 
-                                        return String.format('{0}/{1}', r.data.item_type, v); 
-                                        }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    align : 'right',
-                                    dataIndex : 'item_actcost',
-                                    header : 'Cost',
-                                    width : 75,
-                                    renderer : function(v,x,r) {
-                                    
-                                         return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; 
-                                         
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    align : 'right',
-                                    dataIndex : 'item_base_cost',
-                                    header : 'Cost (base)',
-                                    width : 75,
-                                    renderer : function(v,x,r) {
-                                    
-                                         return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ; 
-                                         
-                                     }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    align : 'right',
-                                    dataIndex : 'item_stock_balance',
-                                    header : 'Balance',
-                                    width : 100,
-                                    renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); }
-                                }
+                                {
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : false,
+                                       header : 'Image',
+                                       width : 150,
+                                       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); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_image_id'
+                                   },
+{
+                                       editor : {
+                                           field : {
+                                               store : {
+                                                   proxy : {
+                                                       '|xns' : 'Roo.data',
+                                                       url : baseURL + '/Roo/Charass.php',
+                                                       xtype : 'HttpProxy',
+                                                       method : 'GET',
+                                                       xns : Roo.data
+                                                   },
+                                                   reader : {
+                                                       '|xns' : 'Roo.data',
+                                                       id : 'id',
+                                                       root : 'data',
+                                                       xtype : 'JsonReader',
+                                                       xns : Roo.data,
+                                                       fields : [
+                                                           {
+                                                               'name': 'id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_name',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'event_when',
+                                                               'type': 'date',
+                                                               'dateFormat': 'Y-m-d'
+                                                           },
+                                                           {
+                                                               'name': 'action',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'ipaddr',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'on_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'on_table',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'remarks',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_office_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_name',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_phone',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_fax',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_email',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_company_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_role',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_active',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_remarks',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_passwd',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_owner_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_lang',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_no_reset_sent',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_action_type',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_project_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_deleted_by',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_deleted_dt',
+                                                               'type': 'date'
+                                                           }
+                                                       ],
+                                                       totalProperty : 'total'
+                                                   },
+                                                   '|xns' : 'Roo.data',
+                                                   xtype : 'Store',
+                                                   remoteSort : true,
+                                                   sortInfo : { field : 'charass_value' , direction : 'ASC' },
+                                                   xns : Roo.data,
+                                                   listeners : {
+                                                       beforeload : function (_self, o)
+                                                          {
+                                                              o.params = o.params || {};
+                                                              // staff can see all logs, other companies can only see their own.
+                                                              // look for all of the charass 's with the same type= eg. brand.
+                                                              
+                                                              o.params.charass_char_id_char_name = 'BRAND';
+                                                              o.params.charass_target_type ='I';
+                                                              o.params._distinct = 'charass_value';
+                                                                  o.params._columns = 'charass_value';
+                                                          
+                                                          }
+                                                   },
+                                                   items : [
+
+                                                   ]
+
+                                               },
+                                               '|xns' : 'Roo.form',
+                                               alwaysQuery : true,
+                                               listWidth : 300,
+                                               triggerAction : 'all',
+                                               forceSelection : false,
+                                               selectOnFocus : true,
+                                               pageSize : 20,
+                                               displayField : 'charass_value',
+                                               minChars : 2,
+                                               xtype : 'ComboBox',
+                                               allowBlank : true,
+                                               editable : true,
+                                               width : 150,
+                                               xns : Roo.form,
+                                               qtip : "Select Brand",
+                                               queryParam : 'query[charass_value]',
+                                               tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+                                               loadingText : "Searching...",
+                                               items : [
+
+                                               ]
+
+                                           },
+                                           '|xns' : 'Roo.grid',
+                                           xtype : 'GridEditor',
+                                           xns : Roo.grid,
+                                           items : [
+
+                                           ]
+
+                                       },
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Brand',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_char_brand',
+                                       items : [
+
+                                       ]
+
+                                   },
+{
+                                       editor : {
+                                           field : {
+                                               store : {
+                                                   proxy : {
+                                                       '|xns' : 'Roo.data',
+                                                       url : baseURL + '/Roo/Charass.php',
+                                                       xtype : 'HttpProxy',
+                                                       method : 'GET',
+                                                       xns : Roo.data
+                                                   },
+                                                   reader : {
+                                                       '|xns' : 'Roo.data',
+                                                       id : 'id',
+                                                       root : 'data',
+                                                       xtype : 'JsonReader',
+                                                       xns : Roo.data,
+                                                       fields : [
+                                                           {
+                                                               'name': 'id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_name',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'event_when',
+                                                               'type': 'date',
+                                                               'dateFormat': 'Y-m-d'
+                                                           },
+                                                           {
+                                                               'name': 'action',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'ipaddr',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'on_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'on_table',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'remarks',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_office_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_name',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_phone',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_fax',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_email',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_company_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_role',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_active',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_remarks',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_passwd',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_owner_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_lang',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_no_reset_sent',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_action_type',
+                                                               'type': 'string'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_project_id',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_deleted_by',
+                                                               'type': 'int'
+                                                           },
+                                                           {
+                                                               'name': 'person_id_deleted_dt',
+                                                               'type': 'date'
+                                                           }
+                                                       ],
+                                                       totalProperty : 'total'
+                                                   },
+                                                   '|xns' : 'Roo.data',
+                                                   xtype : 'Store',
+                                                   remoteSort : true,
+                                                   sortInfo : { field : 'charass_value' , direction : 'ASC' },
+                                                   xns : Roo.data,
+                                                   listeners : {
+                                                       beforeload : function (_self, o)
+                                                          {
+                                                              o.params = o.params || {};
+                                                              // staff can see all logs, other companies can only see their own.
+                                                              // look for all of the charass 's with the same type= eg. brand.
+                                                              
+                                                              o.params.charass_char_id_char_name = 'PRODUCTGROUP';
+                                                              o.params.charass_target_type ='I';
+                                                              o.params._distinct = 'charass_value';
+                                                                  o.params._columns = 'charass_value';    
+                                                          }
+                                                   },
+                                                   items : [
+
+                                                   ]
+
+                                               },
+                                               '|xns' : 'Roo.form',
+                                               alwaysQuery : true,
+                                               listWidth : 300,
+                                               triggerAction : 'all',
+                                               forceSelection : false,
+                                               selectOnFocus : true,
+                                               pageSize : 20,
+                                               displayField : 'charass_value',
+                                               minChars : 2,
+                                               xtype : 'ComboBox',
+                                               allowBlank : true,
+                                               editable : true,
+                                               width : 150,
+                                               xns : Roo.form,
+                                               qtip : "Select Brand",
+                                               queryParam : 'query[charass_value]',
+                                               tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
+                                               loadingText : "Searching...",
+                                               items : [
+
+                                               ]
+
+                                           },
+                                           '|xns' : 'Roo.grid',
+                                           xtype : 'GridEditor',
+                                           xns : Roo.grid,
+                                           items : [
+
+                                           ]
+
+                                       },
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Product Group',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_char_productgroup',
+                                       items : [
+
+                                       ]
+
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Number',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('<B>{0}</B>', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_number'
+                                   },
+{
+                                       editor : {
+                                           field : {
+                                               '|xns' : 'Roo.form',
+                                               xtype : 'TextField',
+                                               xns : Roo.form
+                                           },
+                                           '|xns' : 'Roo.grid',
+                                           xtype : 'GridEditor',
+                                           xns : Roo.grid,
+                                           items : [
+
+                                           ]
+
+                                       },
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Pickface',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_char_pickface_location',
+                                       items : [
+
+                                       ]
+
+                                   },
+{
+                                       editor : {
+                                           field : {
+                                               '|xns' : 'Roo.form',
+                                               xtype : 'TextField',
+                                               xns : Roo.form
+                                           },
+                                           '|xns' : 'Roo.grid',
+                                           xtype : 'GridEditor',
+                                           xns : Roo.grid,
+                                           items : [
+
+                                           ]
+
+                                       },
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Pallet',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_char_pallet_location',
+                                       items : [
+
+                                       ]
+
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Description',
+                                       width : 200,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_descrip1'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'Purchased',
+                                       width : 55,
+                                       renderer : function(v) {  
+                                           var state = v * 1 > 0 ?  '-checked' : '';
+                                       
+                                           return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+                                                       
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'itemsrc_active'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'is Sold?',
+                                       width : 50,
+                                       renderer : function(v) {  
+                                           var state = v * 1 > 0 ?  '-checked' : '';
+                                       
+                                           return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+                                                       
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_sold'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       sortable : true,
+                                       header : 'is Active?',
+                                       width : 50,
+                                       renderer : function(v) {  
+                                           var state = v * 1 > 0 ?  '-checked' : '';
+                                       
+                                           return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+                                                       
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_active'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       align : 'right',
+                                       xtype : 'ColumnModel',
+                                       header : 'Last purchase price',
+                                       width : 120,
+                                       renderer : function(v,x,r) {
+                                       
+                                            return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ; 
+                                            
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'last_purchase_price'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       header : 'Item prodcat',
+                                       width : 100,
+                                       renderer : function(v,x,r) { 
+                                           return String.format('{0}/{1}', r.data.item_type, v); 
+                                           },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_prodcat_id_prodcat_code'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       align : 'right',
+                                       xtype : 'ColumnModel',
+                                       header : 'Cost',
+                                       width : 75,
+                                       renderer : function(v,x,r) {
+                                       
+                                            return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; 
+                                            
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_actcost'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       align : 'right',
+                                       xtype : 'ColumnModel',
+                                       header : 'Cost (base)',
+                                       width : 75,
+                                       renderer : function(v,x,r) {
+                                       
+                                            return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ; 
+                                            
+                                        },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_base_cost'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       align : 'right',
+                                       xtype : 'ColumnModel',
+                                       header : 'Balance',
+                                       width : 100,
+                                       renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'item_stock_balance'
+                                   }
+                            ],
+                            listeners : {
+                               render : function() 
+                                  {
+                                      _this.grid = this; 
+                                      //_this.dialog = Pman.Dialog.FILL_IN
+                                      if (_this.panel.active) {
+                                         this.footer.onClick('first');
+                                      }
+                                  },
+                               cellclick : function (_self, row, col, e)
+                                  {
+                                       var di = _this.grid.colModel.getDataIndex(col);
+                                       
+                                       var rec = _this.grid.ds.getAt(row);
+                                       
+                                       
+                                       if (di == 'item_active') {
+                                       
+                                          var nv = rec.data.item_active ? 0 : 1;
+                                          new Pman.Request({
+                                              mask : 'Saving',
+                                              url : baseURL + '/Roo/Item',
+                                              params : {
+                                                  item_id : rec.data.item_id,
+                                                  item_active : nv
+                                              },
+                                              success : function() {
+                                                  rec.set('item_active', nv);
+                                              }
+                                          });
+                                          return;
+                                          
+                                       
+                                       }
+                                       
+                                       if(di == 'itemsrc_active'){
+                                       
+                                       
+                                       
+                                  
+                                          if(rec.data.itemsrc_active * 1){
+                                              Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
+                                                  function (res) {
+                                                      if(res!='yes') {
+                                                          return;
+                                                      }
+                                                      rec.set('itemsrc_active', 0);
+                                                      rec.commit();
+                                              });
+                                              return;
+                                          }
+                                          
+                                          Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
+                                              _this.grid.footer.onClick('first');
+                                         }); 
+                                         return;
+                                          
+                                      }
+                                       
+                                       _this.locgrid.footer.onClick('first');
+                                       
+                                       
+                                       
+                                       
+                                  },
+                               celldblclick : function (_self, rowIndex, columnIndex, e)
+                                  {
+                                      var s = _this.grid.ds.getAt(rowIndex);
+                                      
+                                      Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
+                                          _this.grid.footer.onClick('first');
+                                     }); 
+                                  },
+                               afteredit : function (e)
+                                  {
+                                      
+                                      
+                                      Roo.log(e);
+                                      new Pman.Request({
+                                          url : baseURL +'/Roo/Charass',
+                                          params : {
+                                               charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
+                                               charass_value : e.value,
+                                               charass_target_type : 'I',
+                                               charass_default : 1,
+                                               charass_target_id : e.record.data.item_id
+                                           },
+                                           method : 'POST'
+                                       });
+                                      
+                                      
+                                      e.record.commit();
+                                      
+                                      
+                                      
+                                  }
+                            },
+                            items : [
+
                             ]
-                        }
-                    },
-                    {
-                        xtype: 'GridPanel',
-                        xns: Roo,
-                        listeners : {
-                            activate : function() {
-                                _this.locpanel = this;
-                             
-                            }
+
                         },
-                        background : true,
-                        fitContainer : true,
+                        '|xns' : 'Roo',
                         fitToframe : true,
-                        region : 'east',
-                        tableName : 'itemloc',
-                        title : "itemloc",
+                        background : false,
+                        region : 'center',
+                        title : "Products",
+                        xtype : 'GridPanel',
+                        fitContainer : true,
+                        xns : Roo,
+                        tableName : 'item',
+                        listeners : {
+                               activate : function() {
+                                      _this.panel = this;
+                                      if (_this.grid) {
+                                          _this.grid.footer.onClick('first');
+                                      }
+                                  }
+                        },
+                        items : [
+
+                        ]
+
+                    },
+                       {
                         grid : {
-                            xtype: 'Grid',
-                            xns: Roo.grid,
-                            listeners : {
-                                render : function() 
-                                {
-                                    _this.locgrid = this; 
-                                    //_this.dialog = Pman.Dialog.FILL_IN
-                                    
-                                },
-                                rowdblclick : function (_self, rowIndex, e)
-                                {
-                                    if (!_this.dialog) return;
-                                    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
-                                        _this.grid.footer.onClick('first');
-                                    }); 
-                                }
-                            },
-                            autoExpandColumn : 'location_name',
-                            loadMask : true,
                             dataSource : {
-                                xtype: 'Store',
-                                xns: Roo.data,
-                                listeners : {
-                                    beforeload : function (_self, o)
-                                    {
-                                        var sel = _this.grid.selModel.getSelectedCell();
-                                        if (!sel) {
-                                            this.removeAll();
-                                            return false;
-                                        }
-                                        var rec = _this.grid.ds.getAt(sel[0]);
-                                        o.params._stock_for_item_id = rec.data.item_id;
-                                        //o.params['!itemloc_qty'] = 0;
-                                        
-                                        
-                                    }
-                                },
-                                remoteSort : true,
-                                sortInfo : { field : 'location_name', direction: 'ASC' },
                                 proxy : {
-                                    xtype: 'HttpProxy',
-                                    xns: Roo.data,
+                                    '|xns' : 'Roo.data',
+                                    url : baseURL + '/Roo/location.php',
+                                    xtype : 'HttpProxy',
                                     method : 'GET',
-                                    url : baseURL + '/Roo/location.php'
+                                    xns : Roo.data
                                 },
                                 reader : {
-                                    xtype: 'JsonReader',
-                                    xns: Roo.data,
-                                    totalProperty : 'total',
-                                    root : 'data',
+                                    '|xns' : 'Roo.data',
                                     id : 'id',
+                                    root : 'data',
+                                    xtype : 'JsonReader',
+                                    xns : Roo.data,
                                     fields : [
                                         {
                                             'name': 'itemloc_id',
@@ -1652,49 +1752,120 @@ Pman.Tab.XtupleItem = new Roo.XComponent({
                                             'type': 'date',
                                             'dateFormat': 'Y-m-d'
                                         }
-                                    ]
-                                }
+                                    ],
+                                    totalProperty : 'total'
+                                },
+                                '|xns' : 'Roo.data',
+                                xtype : 'Store',
+                                remoteSort : true,
+                                sortInfo : { field : 'location_name', direction: 'ASC' },
+                                xns : Roo.data,
+                                listeners : {
+                                       beforeload : function (_self, o)
+                                          {
+                                              var sel = _this.grid.selModel.getSelectedCell();
+                                              if (!sel) {
+                                                  this.removeAll();
+                                                  return false;
+                                              }
+                                              var rec = _this.grid.ds.getAt(sel[0]);
+                                              o.params._stock_for_item_id = rec.data.item_id;
+                                              //o.params['!itemloc_qty'] = 0;
+                                              
+                                              
+                                          }
+                                },
+                                items : [
+
+                                ]
+
                             },
                             footer : {
-                                xtype: 'PagingToolbar',
-                                xns: Roo,
+                                '|xns' : 'Roo',
                                 pageSize : 25,
+                                xtype : 'PagingToolbar',
+                                emptyMsg : "No itemloc found",
+                                xns : Roo,
                                 displayInfo : true,
-                                displayMsg : "Displaying itemloc{0} - {1} of {2}",
-                                emptyMsg : "No itemloc found"
+                                displayMsg : "Displaying itemloc{0} - {1} of {2}"
                             },
+                            '|xns' : 'Roo.grid',
+                            autoExpandColumn : 'location_name',
+                            xtype : 'Grid',
+                            loadMask : true,
+                            xns : Roo.grid,
                             colModel : [
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'location_name',
-                                    header : 'Location',
-                                    width : 75,
-                                    renderer : function(v) { return String.format('{0}', v); }
-                                },
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'itemloc_realqty',
-                                    header : 'Itemloc qty',
-                                    width : 75,
-                                    renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); }
-                                }
+                                {
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       header : 'Location',
+                                       width : 75,
+                                       renderer : function(v) { return String.format('{0}', v); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'location_name'
+                                   },
+{
+                                       '|xns' : 'Roo.grid',
+                                       xtype : 'ColumnModel',
+                                       header : 'Itemloc qty',
+                                       width : 75,
+                                       renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); },
+                                       xns : Roo.grid,
+                                       dataIndex : 'itemloc_realqty'
+                                   }
+                            ],
+                            listeners : {
+                               rowdblclick : function (_self, rowIndex, e)
+                                  {
+                                      if (!_this.dialog) return;
+                                      _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
+                                          _this.grid.footer.onClick('first');
+                                      }); 
+                                  },
+                               render : function() 
+                                  {
+                                      _this.locgrid = this; 
+                                      //_this.dialog = Pman.Dialog.FILL_IN
+                                      
+                                  }
+                            },
+                            items : [
+
                             ]
-                        }
+
+                        },
+                        '|xns' : 'Roo',
+                        fitToframe : true,
+                        background : true,
+                        region : 'east',
+                        title : "itemloc",
+                        xtype : 'GridPanel',
+                        fitContainer : true,
+                        xns : Roo,
+                        tableName : 'itemloc',
+                        listeners : {
+                               activate : function() {
+                                      _this.locpanel = this;
+                                   
+                                  }
+                        },
+                        items : [
+
+                        ]
+
                     }
-                ],
-                center : {
-                    xtype: 'LayoutRegion',
-                    xns: Roo
-                },
-                east : {
-                    xtype: 'LayoutRegion',
-                    xns: Roo,
-                    split : true,
-                    width : 200
-                }
-            }
-        };
-    }
+                ]
+
+            },
+            '|xns' : 'Roo',
+            background : false,
+            region : 'center',
+            title : "Products",
+            xtype : 'NestedLayoutPanel',
+            xns : Roo,
+            items : [
+
+            ]
+
+        };    }
 });