Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleStock.bjs
index 84f21b8..720b820 100644 (file)
 {
-    "id": "roo-file-333",
-    "name": "Pman.Tab.XtupleStock",
-    "parent": "Pman.Tab.XtupleManage",
-    "title": "Pman.Tab.XtupleStock",
-    "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleStock.bjs",
-    "items": [
+    "name" : "Pman.Tab.XtupleStock",
+    "parent" : "Pman.Tab.XtupleManage",
+    "title" : "Pman.Tab.XtupleStock",
+    "path" : "/home/alan/gitlive/Pman.Xtuple/Pman.Tab.XtupleStock.bjs",
+    "permname" : "",
+    "modOrder" : "001",
+    "items" : [
         {
-            "listeners": {
-                "render": "function (_self)\n{\n _this.toppanel = _self;\n}"
+            "listeners" : {
+                "render" : "function (_self)\n{\n _this.toppanel = _self;\n}"
             },
-            "background": true,
-            "region": "center",
-            "title": "Locations /Stock ",
-            "xtype": "NestedLayoutPanel",
-            "|xns": "Roo",
-            "items": [
+            "background" : true,
+            "region" : "center",
+            "title" : "Locations /Stock ",
+            "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,
-                            "title": "Stock",
-                            "width": 250,
-                            "xtype": "LayoutRegion",
-                            "|xns": "Roo"
+                            "title" : "Stock",
+                            "xtype" : "LayoutRegion",
+                            "width" : 250,
+                            "$ 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": "location",
-                            "title": "location",
-                            "xtype": "GridPanel",
-                            "|xns": "Roo",
-                            "items": [
+                            "fitToframe" : true,
+                            "background" : true,
+                            "region" : "center",
+                            "title" : "location",
+                            "xtype" : "GridPanel",
+                            "fitContainer" : true,
+                            "$ xns" : "Roo",
+                            "tableName" : "location",
+                            "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}",
-                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    \n    Pman.Dialog.XtupleLocation.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
-                                        "cellclick": "function (_self, rowIndex, col, e)\n{\n   \n    var ix = this.colModel.getDataIndex(col);\n    var rec = _this.grid.ds.getAt(rowIndex);\n  \n  \n     \n     if (ix == 'location_restrict') {\n     \n        var nv = rec.data.location_restrict  ? 0 : 1;\n        new Pman.Request({\n            mask : 'Saving',\n            url : baseURL + '/Roo/Location',\n            params : {\n                location_id : rec.data.location_id,\n                location_restrict : nv\n            },\n            success : function() {\n                rec.set('location_restrict', nv);\n            }\n        });\n        return;\n        \n     \n     }\n  \n  \n  \n  \n     _this.itemgrid.viewtype = 1;\n    \n    \n     if ('location_qty_neg' == ix || 'location_netsuite_stock_neg' == ix ) {\n             _this.itemgrid.viewtype = -1;\n     }\n     if ('location_netsuite_stock' == ix || 'location_netsuite_stock_neg' == ix ) {\n             _this.itemgrid.viewtype *= 2;\n     }\n        \n        (function() { _this.itemgrid.footer.onClick('first'); }).defer(100);\n        \n        \n        \n        \n          \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n}"
+                                    "listeners" : {
+                                        "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    \n    Pman.Dialog.XtupleLocation.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
+                                        "cellclick" : "function (_self, rowIndex, col, e)\n{\n   \n    var ix = this.colModel.getDataIndex(col);\n    var rec = _this.grid.ds.getAt(rowIndex);\n  \n  \n     \n     if (ix == 'location_restrict') {\n     \n        var nv = rec.data.location_restrict  ? 0 : 1;\n        new Pman.Request({\n            mask : 'Saving',\n            url : baseURL + '/Roo/Location',\n            params : {\n                location_id : rec.data.location_id,\n                location_restrict : nv\n            },\n            success : function() {\n                rec.set('location_restrict', nv);\n            }\n        });\n        return;\n        \n     \n     }\n  \n  \n  \n  \n     _this.itemgrid.viewtype = 1;\n    \n    \n     if ('location_qty_neg' == ix || 'location_netsuite_stock_neg' == ix ) {\n             _this.itemgrid.viewtype = -1;\n     }\n     if ('location_netsuite_stock' == ix || 'location_netsuite_stock_neg' == ix ) {\n             _this.itemgrid.viewtype *= 2;\n     }\n        \n        (function() { _this.itemgrid.footer.onClick('first'); }).defer(100);\n        \n        \n        \n        \n          \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n}",
+                                        "|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}"
                                     },
-                                    "*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": {
-                                                "selectionchange": "function (_self)\n{\n   \n   // _this.toppanel.layout.getRegion('east').expand();\n}"
+                                            "listeners" : {
+                                                "selectionchange" : "function (_self)\n{\n   \n   // _this.toppanel.layout.getRegion('east').expand();\n}"
                                             },
-                                            "*prop": "sm",
-                                            "xtype": "RowSelectionModel",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "RowSelectionModel",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "sm"
                                         },
                                         {
-                                            "listeners": {
-                                                "beforeload": "function (_self, o)\n{\n  \n    o.params._as_of = _this.dateTo.getValue();\n    if (!o.params._as_of.length) {\n        return false;\n    }\n    o.params._with_stock_and_value = 1;\n    \n    o.params._viewType = _this.viewType.getValue();\n}",
-                                                "load": "function (_self, records, options)\n{\n    // build index.\n    \n    var dt = Date.parseDate(_this.dateTo.getValue(), 'Y-m-d');\n    var maxd = Date.parseDate('2012-11-01', 'Y-m-d');\n    \n    if (!records.length) {\n        return;\n    }\n    \n    var map = {};\n    \n    Roo.each(records, function(r) {\n        map[r.data.location_id] = r;\n        r.set('location_qty',undefined);\n        r.set('location_qty_neg', undefined);\n        r.set('location_value', undefined);\n    \n    });\n    var pqty = 0;\n    var nqty = 0;\n    var tval = 0.0;\n     var overlaydata  =  function (type, data) {\n            Roo.each(data, function(r) {\n                var rec= map[r.location_id];\n                \n                //switch(type) { \n                    //case 'netsuite':\n                        rec.set('location_netsuite_stock', r.location_netsuite_stock);\n                        rec.set('location_netsuite_stock_neg', r.location_netsuite_stock_neg);                        \n                   //     break;\n                 //   case 'dragon':\n                        rec.set('location_qty', r.location_qty);\n                        pqty += r.location_qty *1;                        \n                        rec.set('location_qty_neg', r.location_qty_neg);\n                        nqty += r.location_qty_neg  *1;\n                        rec.set('location_value', r.location_value);\n                        tval += r.location_value * 1.0;\n                  //      break;\n                    \n                    \n                //}\n            })\n                \n                \n \n     };\n    \n    var i = 0; \n    \n    var loadoverlay = function(type) {\n    \n         \n        new Pman.Request({\n            method : 'GET',\n            //mask : 'Loading ' + type + ' stock levels (takes around 30s)',\n            timeout: 60000,\n            url : baseURL + '/Roo/Location',\n            params  : {\n                _as_of : _this.dateTo.getValue(),\n                _with_stock_and_value : 'both',\n                location_id : records[i++].data.location_id \n            },\n            success : function( res ) {\n                \n                overlaydata(type, res.data);\n            \n                if (i >=  records.length) {\n                     _this.grid.footer.displayEl.update(String.format(\"Total: pos={0} neg={1} eq={2} val={3}\", \n                        Roo.util.Format.number(pqty,0), \n                        Roo.util.Format.number(nqty,0), \n                        Roo.util.Format.number(pqty+nqty,0), \n                        Roo.util.Format.number(tval,0)\n                        ));\n                    return;\n                }                \n               loadoverlay(type);\n                //if (type == 'dragon' && dt < maxd  ) {\n                //    loadoverlay('netsuite');\n               // } else {\n                //\n               // }\n                \n            \n            },\n            failure : function( ) {\n                Roo.MessageBox.alert('Error' , 'Loading data failed, try again');\n            }\n        });\n    \n    };\n    \n     loadoverlay('dragon');\n    \n    \n}"
+                                            "listeners" : {
+                                                "beforeload" : "function (_self, o)\n{\n  \n    o.params._as_of = _this.dateTo.getValue();\n\n    if (!o.params._as_of.length) {\n        return false;\n    }\n    o.params._with_stock_and_value = 1;\n    \n    o.params._viewType = _this.viewType.getValue();\n}",
+                                                "load" : "function (_self, records, options)\n{\n    // build index.\n    \n    var dt = Date.parseDate(_this.dateTo.getValue(), 'Y-m-d');\n    var maxd = Date.parseDate('2012-11-01', 'Y-m-d');\n    \n    if (!records.length) {\n        return;\n    }\n    \n    var map = {};\n    \n    Roo.each(records, function(r) {\n        map[r.data.location_id] = r;\n        r.set('location_qty',undefined);\n        r.set('location_qty_neg', undefined);\n        r.set('location_value', undefined);\n    \n    });\n    var pqty = 0;\n    var nqty = 0;\n    var tval = 0.0;\n     var overlaydata  =  function (type, data) {\n            Roo.each(data, function(r) {\n                var rec= map[r.location_id];\n                \n                //switch(type) { \n                    //case 'netsuite':\n                        rec.set('location_netsuite_stock', r.location_netsuite_stock);\n                        rec.set('location_netsuite_stock_neg', r.location_netsuite_stock_neg);                        \n                   //     break;\n                 //   case 'dragon':\n                        rec.set('location_qty', r.location_qty);\n                        pqty += r.location_qty *1;                        \n                        rec.set('location_qty_neg', r.location_qty_neg);\n                        nqty += r.location_qty_neg  *1;\n                        rec.set('location_value', r.location_value);\n                        tval += r.location_value * 1.0;\n                  //      break;\n                    \n                    \n                //}\n            })\n                \n                \n \n     };\n    \n    var i = 0; \n    \n    var loadoverlay = function(type) {\n    \n         \n        new Pman.Request({\n            method : 'GET',\n            //mask : 'Loading ' + type + ' stock levels (takes around 30s)',\n            timeout: 60000,\n            url : baseURL + '/Roo/Location',\n            params  : {\n                _as_of : _this.dateTo.getValue(),\n                _with_stock_and_value : 'both',\n                location_id : records[i++].data.location_id \n            },\n            success : function( res ) {\n                \n                overlaydata(type, res.data);\n            \n                if (i >=  records.length) {\n                     _this.grid.footer.displayEl.update(String.format(\"Total: pos={0} neg={1} eq={2} val={3}\", \n                        Roo.util.Format.number(pqty,0), \n                        Roo.util.Format.number(nqty,0), \n                        Roo.util.Format.number(pqty+nqty,0), \n                        Roo.util.Format.number(tval,0)\n                        ));\n                    return;\n                }                \n               loadoverlay(type);\n                //if (type == 'dragon' && dt < maxd  ) {\n                //    loadoverlay('netsuite');\n               // } else {\n                //\n               // }\n                \n            \n            },\n            failure : function( ) {\n                Roo.MessageBox.alert('Error' , 'Loading data failed, try again');\n            }\n        });\n    \n    };\n    \n     loadoverlay('dragon');\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': 'location_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_warehous_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_name',\n        'type': 'string'\n    },\n    {\n        'name': 'location_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'location_restrict',\n        'type': 'int'\n    },\n    {\n        'name': 'location_netable',\n        'type': 'int'\n    },\n    {\n        'name': 'location_whsezone_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_aisle',\n        'type': 'string'\n    },\n    {\n        'name': 'location_rack',\n        'type': 'string'\n    },\n    {\n        'name': 'location_bin',\n        'type': 'string'\n    }\n]"
+                                                    "id" : "id",
+                                                    "root" : "data",
+                                                    "xtype" : "JsonReader",
+                                                    "$ xns" : "Roo.data",
+                                                    "$ fields" : "[\n    {\n        'name': 'location_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_warehous_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_name',\n        'type': 'string'\n    },\n    {\n        'name': 'location_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'location_restrict',\n        'type': 'int'\n    },\n    {\n        'name': 'location_netable',\n        'type': 'int'\n    },\n    {\n        'name': 'location_whsezone_id',\n        'type': 'int'\n    },\n    {\n        'name': 'location_aisle',\n        'type': 'string'\n    },\n    {\n        'name': 'location_rack',\n        'type': 'string'\n    },\n    {\n        'name': 'location_bin',\n        'type': 'string'\n    }\n]",
+                                                    "* prop" : "reader",
+                                                    "totalProperty" : "total"
                                                 }
                                             ]
                                         },
                                         {
-                                            "*prop": "footer",
-                                            "displayInfo": true,
-                                            "displayMsg": "Displaying location{0} - {1} of {2}",
-                                            "emptyMsg": "No location found",
-                                            "pageSize": 999,
-                                            "xtype": "PagingToolbar",
-                                            "|xns": "Roo",
-                                            "items": [
+                                            "pageSize" : 999,
+                                            "xtype" : "PagingToolbar",
+                                            "emptyMsg" : "No location found",
+                                            "$ xns" : "Roo",
+                                            "displayMsg" : "Displaying location{0} - {1} of {2}",
+                                            "displayInfo" : true,
+                                            "* prop" : "footer",
+                                            "items" : [
                                                 {
-                                                    "listeners": {
-                                                        "click": "function (_self, e)\n{\n  Roo.MessageBox.progress (\"Syncing Balances\", \"Sending\");\n  \n  var offset = 0;\n  \n   function runSync() {\n       \n       new Pman.Request( {\n            url : baseURL+'/Roo/Locbal',\n            method : 'GET',\n            params : {\n                _sync : 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   runSync();\n}"
+                                                    "listeners" : {
+                                                        "click" : "function (_self, e)\n{\n  Roo.MessageBox.progress (\"Syncing Balances\", \"Sending\");\n  \n  var offset = 0;\n  \n   function runSync() {\n       \n       new Pman.Request( {\n            url : baseURL+'/Roo/Locbal',\n            method : 'GET',\n            params : {\n                _sync : 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   runSync();\n}"
                                                     },
-                                                    "hidden": true,
-                                                    "text": "Sync Stock Balances",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "Sync Stock Balances",
+                                                    "hidden" : true,
+                                                    "xtype" : "Button",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Products'\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   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Products'\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}"
                                                     },
-                                                    "hidden": true,
-                                                    "text": "Upload new products and costs",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar",
-                                                    "items": [
+                                                    "text" : "Upload new products and costs",
+                                                    "hidden" : true,
+                                                    "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    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    \n    Pman.Dialog.XtupleTransfer.show({\n        id : 0,\n        _ns_autofill : 1,\n        invhist_transfer_to : l.data.location_id,\n        invhist_transfer_to_location_descrip : l.data.location_descrip,\n        \n        invhist_transfer_transdate : _this.dateTo.getValue(),\n        invhist_transfer_arrivaldate  : _this.dateTo.getValue()\n    \n        \n    }, function() { _this.grid.ds.load({}); }\n    );\n    \n    \n}"
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    \n    Pman.Dialog.XtupleTransfer.show({\n        id : 0,\n        _ns_autofill : 1,\n        invhist_transfer_to : l.data.location_id,\n        invhist_transfer_to_location_descrip : l.data.location_descrip,\n        \n        invhist_transfer_transdate : _this.dateTo.getValue(),\n        invhist_transfer_arrivaldate  : _this.dateTo.getValue()\n    \n        \n    }, function() { _this.grid.ds.load({}); }\n    );\n    \n    \n}"
                                                                     },
-                                                                    "text": "Transfer to Fix +ve number",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Transfer to Fix +ve number",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "click": "function (_self, e)\n{\n    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    \n    Pman.Dialog.XtupleTransfer.show({\n        id : 0,\n        _ns_autofill : -1,\n        invhist_transfer_from : l.data.location_id,\n        invhist_transfer_from_location_descrip : l.data.location_descrip,\n        \n        invhist_transfer_transdate : _this.dateTo.getValue(),\n        invhist_transfer_arrivaldate  : _this.dateTo.getValue()\n    \n        \n    }, function() { _this.grid.ds.load({}); }\n    );\n    \n    \n}\n "
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    \n    Pman.Dialog.XtupleTransfer.show({\n        id : 0,\n        _ns_autofill : -1,\n        invhist_transfer_from : l.data.location_id,\n        invhist_transfer_from_location_descrip : l.data.location_descrip,\n        \n        invhist_transfer_transdate : _this.dateTo.getValue(),\n        invhist_transfer_arrivaldate  : _this.dateTo.getValue()\n    \n        \n    }, function() { _this.grid.ds.load({}); }\n    );\n    \n    \n}\n "
                                                                     },
-                                                                    "text": "Transfer to Fix -ve number",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Transfer to Fix -ve number",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 }
                                                             ]
                                                         }
                                             ]
                                         },
                                         {
-                                            "*prop": "toolbar",
-                                            "xtype": "Toolbar",
-                                            "|xns": "Roo",
-                                            "items": [
+                                            "xtype" : "Toolbar",
+                                            "$ xns" : "Roo",
+                                            "* prop" : "toolbar",
+                                            "items" : [
                                                 {
-                                                    "text": "As of:",
-                                                    "xtype": "TextItem",
-                                                    "|xns": "Roo.Toolbar"
+                                                    "text" : "As of:",
+                                                    "xtype" : "TextItem",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n    _this.dateTo = _self;\n}",
-                                                        "select": "function (combo, date)\n{\n  _this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "render" : "function (_self)\n{\n    _this.dateTo = _self;\n}",
+                                                        "select" : "function (combo, date)\n{\n  _this.grid.footer.onClick('first');\n}"
                                                     },
-                                                    "format": "d/M/Y",
-                                                    "useIso": 1,
-                                                    "width": 120,
-                                                    "xtype": "DateField",
-                                                    "|xns": "Roo.form"
+                                                    "format" : "d/M/Y",
+                                                    "useIso" : 1,
+                                                    "xtype" : "DateField",
+                                                    "width" : 120,
+                                                    "$ xns" : "Roo.form"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "render": "function (_self)\n{\n    _this.viewType = _self;\n}",
-                                                        "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
+                                                    "listeners" : {
+                                                        "render" : "function (_self)\n{\n    _this.viewType = _self;\n}",
+                                                        "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
                                                     },
-                                                    "allowBlank": false,
-                                                    "displayField": "fname",
-                                                    "editable": false,
-                                                    "fieldLabel": "Status",
-                                                    "hiddenName": "loctype",
-                                                    "listWidth": 200,
-                                                    "mode": "local",
-                                                    "name": "loctype_name",
-                                                    "triggerAction": "all",
-                                                    "value": "local",
-                                                    "valueField": "ftype",
-                                                    "width": 100,
-                                                    "xtype": "ComboBox",
-                                                    "|xns": "Roo.form",
-                                                    "items": [
+                                                    "listWidth" : 200,
+                                                    "triggerAction" : "all",
+                                                    "fieldLabel" : "Status",
+                                                    "displayField" : "fname",
+                                                    "hiddenName" : "loctype",
+                                                    "value" : "local",
+                                                    "valueField" : "ftype",
+                                                    "xtype" : "ComboBox",
+                                                    "allowBlank" : false,
+                                                    "editable" : false,
+                                                    "width" : 100,
+                                                    "$ xns" : "Roo.form",
+                                                    "mode" : "local",
+                                                    "name" : "loctype_name",
+                                                    "items" : [
                                                         {
-                                                            "*prop": "store",
-                                                            "xtype": "SimpleStore",
-                                                            "|data": "[ ['local', \"Local\"],[ 'remote' , \"Remote\"],[ 'disabled', \"Disabled\"] ]\n",
-                                                            "|fields": "[  'ftype', 'fname']",
-                                                            "|xns": "Roo.data"
+                                                            "xtype" : "SimpleStore",
+                                                            "$ data" : "[ ['local', \"Local\"],[ 'remote' , \"Remote\"],[ 'disabled', \"Disabled\"] ]\n",
+                                                            "$ fields" : "[  'ftype', 'fname']",
+                                                            "$ xns" : "Roo.data",
+                                                            "* prop" : "store"
                                                         }
                                                     ]
                                                 },
                                                 {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Fill"
+                                                    "xtype" : "Fill",
+                                                    "$ xns" : "Roo.Toolbar"
                                                 },
                                                 {
-                                                    "listeners": {
-                                                        "|click": "function()\n{\n    // work out last \n    Pman.Dialog.XtupleLocation.show( { }, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
-                                                        "render": "function (_self)\n{\n    _this.addItemBtn = _self;\n}"
+                                                    "listeners" : {
+                                                        "|click" : "function()\n{\n    // work out last \n    Pman.Dialog.XtupleLocation.show( { }, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
+                                                        "render" : "function (_self)\n{\n    _this.addItemBtn = _self;\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"
                                                 },
                                                 {
-                                                    "text": "Download Reports",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar",
-                                                    "items": [
+                                                    "text" : "Download Reports",
+                                                    "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\n    var ret= [];\n    var hr = [];\n    var cols = [];\n    Roo.each( _this.grid.colModel.config, function(h) {\n        hr.push(h.header);\n        cols.push(h.dataIndex);\n    });\n    ret.push(hr);\n    _this.grid.ds.each(function(rec) {\n        hr = [];\n        for(var i =0;i<cols.length;i++) {\n            hr.push(rec.get(cols[i]));\n        }\n        ret.push(hr);\n    });\n   \n       new Pman.Download({\n            url : baseURL + '/Core/JsonToExcel',\n            method : 'POST',\n            params : {\n                _json : Roo.encode(ret) \n            }\n        });\n     \n}"
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n\n    var ret= [];\n    var hr = [];\n    var cols = [];\n    Roo.each( _this.grid.colModel.config, function(h) {\n        hr.push(h.header);\n        cols.push(h.dataIndex);\n    });\n    ret.push(hr);\n    _this.grid.ds.each(function(rec) {\n        hr = [];\n        for(var i =0;i<cols.length;i++) {\n            hr.push(rec.get(cols[i]));\n        }\n        ret.push(hr);\n    });\n   \n       new Pman.Download({\n            url : baseURL + '/Core/JsonToExcel',\n            method : 'POST',\n            params : {\n                _json : Roo.encode(ret) \n            }\n        });\n     \n}"
                                                                     },
-                                                                    "text": "Summary of Stock in all Locatoins",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Summary of Stock in all Locatoins",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "|xns": "Roo.menu",
-                                                                    "xtype": "Separator"
+                                                                    "xtype" : "Separator",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "click": "function (_self, e)\n{\n \n    \n\n       new Pman.Download({\n            url : baseURL + '/Roo/Invdetail',\n            method : 'GET',\n            timeout: 60000,\n            params : {\n                _summary_at_date : _this.dateTo.getValue(),\n                'csvCols[0]' : 'location_name',               \n                'csvCols[1]' :  'item_number',\n                'csvCols[2]' :  'item_descrip1',                \n                'csvCols[3]' : 'stock_qty',\n                'csvCols[4]' : 'stdcost_value',\n                'csvCols[5]' : 'fifo_value',                                \n                'csvTitles[0]' :'Location',                \n                'csvTitles[1]' :  'Item Number',\n                'csvTitles[2]' :  'Item Description',                \n                'csvTitles[3]' : 'Qty', \n                'csvTitles[4]' : 'Std Cost Valued',\n                'csvTitles[5]' : 'FIFO Value',                                \n                'sort' : 'location_name,item_number',\n                'dir' : 'ASC',  \n                _with_empty_stock : 1,      \n                limit : 99999\n                           \n            }\n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly (around 30s)\");\n     \n}\n"
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n \n    \n\n       new Pman.Download({\n            url : baseURL + '/Roo/Invdetail',\n            method : 'GET',\n            timeout: 60000,\n            params : {\n                _summary_at_date : _this.dateTo.getValue(),\n                'csvCols[0]' : 'location_name',               \n                'csvCols[1]' :  'item_number',\n                'csvCols[2]' :  'item_descrip1',                \n                'csvCols[3]' : 'stock_qty',\n                'csvCols[4]' : 'stdcost_value',\n                'csvCols[5]' : 'fifo_value',                                \n                'csvTitles[0]' :'Location',                \n                'csvTitles[1]' :  'Item Number',\n                'csvTitles[2]' :  'Item Description',                \n                'csvTitles[3]' : 'Qty', \n                'csvTitles[4]' : 'Std Cost Valued',\n                'csvTitles[5]' : 'FIFO Value',                                \n                'sort' : 'location_name,item_number',\n                'dir' : 'ASC',  \n                _with_empty_stock : 1,      \n                limit : 99999\n                           \n            }\n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly (around 30s)\");\n     \n}\n"
                                                                     },
-                                                                    "text": "All Stock in all locations (active)",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "All Stock in all locations (active)",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "click": "function (_self, e)\n{\n    var p = {\n            'csvCols[0]' : 'itemsite_item_id_item_number',\n            'csvCols[1]' : 'item_brand_name',\n            'csvCols[2]' : 'itemsite_item_id_item_descrip1',\n            'csvCols[3]' : 'itemsite_qty_before',\n            'csvCols[4]' : 'itemsite_sold_atdate'  ,\n            'csvCols[5]' : 'itemsite_qty',          \n            'csvCols[6]' : 'itemsite_sold_after',   \n            'csvCols[7]' : 'last_transaction',\n            'csvCols[8]' : 'customer_price_each',                           \n            'csvCols[9]' : 'customer_total_value',                                    \n            'csvCols[10]' : 'itemsite_value',\n            'csvCols[11]' : 'item_last_purchase_price',\n            \n            'csvTitles[0]' : 'SKU',\n            'csvTitles[1]' : 'Brand'  ,\n            'csvTitles[2]' : 'Description',            \n            'csvTitles[3]' : 'Qty Before'  , \n            'csvTitles[4]' : 'Total Sold'  , \n            'csvTitles[5]' : 'Qty'  , \n            'csvTitles[6]' : 'Sold After'  , \n            'csvTitles[7]' : 'Last Transaction'  ,\n            'csvTitles[8]' : 'Customer unit price'  ,\n            'csvTitles[9]' : 'Customer Total Value'  ,\n            'csvTitles[10]' : 'FIFO value'  ,\n            'csvTitles[11]' : 'Last Purchase Price'  ,       \n\n\n            \n            \n            'sort' : 'itemsite_item_id_item_number',\n            'dir' : 'ASC',        \n            limit : 9999\n    };\n     var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    p.location_id = l.data.location_id;\n    p._as_of = _this.dateTo.getValue();\n    p._with_stock_and_value = 1;\n    p._viewtype = 1;\n    p._with_brand = 1;\n    p._with_last_purchase_price = 1;\n    p._with_qty_detail = 1;\n    \n        new Pman.Download({\n            url : baseURL + '/Roo/itemsite',\n            timeout : 60000,\n            \n            method : 'GET',\n            params : p\n\n        \n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n    var p = {\n            'csvCols[0]' : 'itemsite_item_id_item_number',\n            'csvCols[1]' : 'item_brand_name',\n            'csvCols[2]' : 'itemsite_item_id_item_descrip1',\n            'csvCols[3]' : 'itemsite_qty_before',\n            'csvCols[4]' : 'itemsite_sold_atdate'  ,\n            'csvCols[5]' : 'itemsite_qty',          \n            'csvCols[6]' : 'itemsite_sold_after',   \n            'csvCols[7]' : 'last_transaction',\n            'csvCols[8]' : 'customer_price_each',                           \n            'csvCols[9]' : 'customer_total_value',                                    \n            'csvCols[10]' : 'itemsite_value',\n            'csvCols[11]' : 'item_last_purchase_price',\n            \n            'csvTitles[0]' : 'SKU',\n            'csvTitles[1]' : 'Brand'  ,\n            'csvTitles[2]' : 'Description',            \n            'csvTitles[3]' : 'Qty Before'  , \n            'csvTitles[4]' : 'Total Sold'  , \n            'csvTitles[5]' : 'Qty'  , \n            'csvTitles[6]' : 'Sold After'  , \n            'csvTitles[7]' : 'Last Transaction'  ,\n            'csvTitles[8]' : 'Customer unit price'  ,\n            'csvTitles[9]' : 'Customer Total Value'  ,\n            'csvTitles[10]' : 'FIFO value'  ,\n            'csvTitles[11]' : 'Last Purchase Price'  ,       \n\n\n            \n            \n            'sort' : 'itemsite_item_id_item_number',\n            'dir' : 'ASC',        \n            limit : 9999\n    };\n     var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    p.location_id = l.data.location_id;\n    p._as_of = _this.dateTo.getValue();\n    p._with_stock_and_value = 1;\n    p._viewtype = 1;\n    p._with_brand = 1;\n    p._with_last_purchase_price = 1;\n    p._with_qty_detail = 1;\n    \n        new Pman.Download({\n            url : baseURL + '/Roo/itemsite',\n            timeout : 60000,\n            \n            method : 'GET',\n            params : p\n\n        \n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
                                                                     },
-                                                                    "text": "Stock at Selected Location (inc. empty)",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Stock at Selected Location (inc. empty)",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "|xns": "Roo.menu",
-                                                                    "xtype": "Separator"
+                                                                    "xtype" : "Separator",
+                                                                    "$ xns" : "Roo.menu"
                                                                 },
                                                                 {
-                                                                    "listeners": {
-                                                                        "click": "function (_self, e)\n{\n     \n     var p = {\n        _group : 'itemsite',\n        _name : 'stockatlocation',\n        csvCols : '*',\n        limit : 99999\n     };\n     var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    p['location_id:number'] = l.data.location_id;\n    p['as_of:text'] = _this.dateTo.getValue();\n    \n        new Pman.Download({\n            url : baseURL + '/Roo/Metasql',\n            newWindow : 1,\n            timeout : 60000,\n            \n            method : 'GET',\n            params : p\n\n        \n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
+                                                                    "listeners" : {
+                                                                        "click" : "function (_self, e)\n{\n     \n     var p = {\n        _group : 'itemsite',\n        _name : 'stockatlocation',\n        csvCols : '*',\n        limit : 99999\n     };\n     var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        Roo.MessageBox.alert(\"Error\", \"Select location\");\n        return;\n    }\n    p['location_id:number'] = l.data.location_id;\n    p['as_of:text'] = _this.dateTo.getValue();\n    \n        new Pman.Download({\n            url : baseURL + '/Roo/Metasql',\n            newWindow : 1,\n            timeout : 60000,\n            \n            method : 'GET',\n            params : p\n\n        \n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
                                                                     },
-                                                                    "text": "Stock at Selected Location (inc. empty) with Adjustment details",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
+                                                                    "text" : "Stock at Selected Location (inc. empty) with Adjustment details",
+                                                                    "xtype" : "Item",
+                                                                    "$ xns" : "Roo.menu"
                                                                 }
                                                             ]
                                                         }
                                             ]
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "location_restrict",
-                                            "header": "Active",
-                                            "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",
+                                            "header" : "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" : "location_restrict"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "location_name",
-                                            "header": "Name",
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Name",
+                                            "width" : 200,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_name"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "location_descrip",
-                                            "header": "Description",
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Description",
+                                            "width" : 200,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_descrip"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "location_cust_id_cust_name",
-                                            "header": "Customer",
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { \n\n    if (!r.data.location_cust_id_char_internalcompany.length) {\n       return String.format('{0}', v); \n    }\n   return String.format('<span style=\"color:red\">[Internal Company : {0}] {1} </span>', \n        r.data.location_cust_id_char_internalcompany,        v); \n    \n}\n",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Customer",
+                                            "width" : 200,
+                                            "$ renderer" : "function(v,x,r) { \n\n    if (!r.data.location_cust_id_char_internalcompany.length) {\n       return String.format('{0}', v); \n    }\n   return String.format('<span style=\"color:red\">[Internal Company : {0}] {1} </span>', \n        r.data.location_cust_id_char_internalcompany,        v); \n    \n}\n",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_cust_id_cust_name"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_qty",
-                                            "header": "Qty",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { return  typeof(v) == 'undefined' ? '...' : String.format('{0} ', (v*1).toFixed(0) ); }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Qty",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v,x,r) { return  typeof(v) == 'undefined' ? '...' : String.format('{0} ', (v*1).toFixed(0) ); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_qty"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_qty_neg",
-                                            "header": "Missing TX",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { \n    if ( typeof(v) == 'undefined') {\n        return '';\n    }\n    if (v == 0) {\n        return '';\n    }\n    \n    return String.format('<span style=\"color:red;\">{0}</span>', (v*1).toFixed(0) ); \n}",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Missing TX",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v,x,r) { \n    if ( typeof(v) == 'undefined') {\n        return '';\n    }\n    if (v == 0) {\n        return '';\n    }\n    \n    return String.format('<span style=\"color:red;\">{0}</span>', (v*1).toFixed(0) ); \n}",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_qty_neg"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_qty",
-                                            "header": "Est. Net Qty",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { \n    \n    return typeof(v) == 'undefined' ? '...' : \n        String.format('{0}', ((v*1) + (r.data.location_qty_neg*1)).toFixed(0) ); \n}",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Est. Net Qty",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v,x,r) { \n    \n    return typeof(v) == 'undefined' ? '...' : \n        String.format('{0}', ((v*1) + (r.data.location_qty_neg*1)).toFixed(0) ); \n}",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_qty"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_netsuite_stock",
-                                            "header": "NS Qty",
-                                            "hidden": true,
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) {\n    var f= '{0}';\n    if ((r.data.location_qty) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold\">{0}</span>';\n    }\n     return typeof(v) == 'undefined' ? '...' : String.format(f, (v*1).toFixed(0) );\n     \n  }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "hidden" : true,
+                                            "xtype" : "ColumnModel",
+                                            "header" : "NS Qty",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v,x,r) {\n    var f= '{0}';\n    if ((r.data.location_qty) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold\">{0}</span>';\n    }\n     return typeof(v) == 'undefined' ? '...' : String.format(f, (v*1).toFixed(0) );\n     \n  }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_netsuite_stock"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_netsuite_stock_neg",
-                                            "header": "NS -ve Qty",
-                                            "hidden": true,
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) {     \n    var f= '{0}';\n    if ((r.data.location_qty_neg) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold\">{0}</span>';\n    }\n     return typeof(v) == 'undefined' ? '...' : String.format(f, (v*1).toFixed(0) ); \n }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "hidden" : true,
+                                            "xtype" : "ColumnModel",
+                                            "header" : "NS -ve Qty",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v,x,r) {     \n    var f= '{0}';\n    if ((r.data.location_qty_neg) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold\">{0}</span>';\n    }\n     return typeof(v) == 'undefined' ? '...' : String.format(f, (v*1).toFixed(0) ); \n }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_netsuite_stock_neg"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "location_value",
-                                            "header": "Value",
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return typeof(v) == 'undefined' ? '...' :  Roo.util.Format.usMoney(  v); }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Value",
+                                            "width" : 200,
+                                            "$ renderer" : "function(v) { return typeof(v) == 'undefined' ? '...' :  Roo.util.Format.usMoney(  v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "location_value"
                                         }
                                     ]
                                 }
                             ]
                         },
                         {
-                            "listeners": {
-                                "|activate": "function() {\n    _this.itempanel = this;\n    if (_this.itemgrid) {\n       // _this.itemgrid.footer.onClick('first');\n    }\n}"
+                            "listeners" : {
+                                "|activate" : "function() {\n    _this.itempanel = this;\n    if (_this.itemgrid) {\n       // _this.itemgrid.footer.onClick('first');\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.itemgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.itempanel.active) {\n      // this.footer.onClick('first');\n    }\n}",
-                                        "|rowdblclick": "function (_self, rowIndex, e)\n{  \n    var rec =this.getDataSource().getAt(rowIndex);\n\n    var loc = _this.grid.selModel.getSelected();\n  \n    var dt = _this.dateTo.getValue();\n    \n  Pman.Dialog.XtupleInvHistory.show({\n        itemsite_item_id_item_number   : rec.data.itemsite_item_id_item_number,\n  \n        location_name : loc.data.location_name,\n        location_descrip : loc.data.location_descrip,\n        \n        invhist_transdate :  typeof(dt) == 'string' ? dt : dt.format('Y-m-d')\n    }); \n    \n   \n\n}\n",
-                                        "cellclick": "function (_self, row, col, e)\n{\n\n   if ('netsuite_qty' == this.colModel.getDataIndex(col)) {\n        var d = this.ds.getAt(row); \n        var loc = _this.grid.selModel.getSelected();\n \n       new Pman.Download({\n            url: baseURL + '/Xtuple/NetsuiteFix/StockCheck',\n            params : {\n                item_id : d.data.itemsite_item_id,\n                location_id : loc.data.location_id\n            }\n           \n        \n        });\n    }\n}"
+                                    "listeners" : {
+                                        "|rowdblclick" : "function (_self, rowIndex, e)\n{  \n    var rec =this.getDataSource().getAt(rowIndex);\n\n    var loc = _this.grid.selModel.getSelected();\n  \n    var dt = _this.dateTo.getValue();\n    \n  Pman.Dialog.XtupleInvHistory.show({\n        itemsite_item_id_item_number   : rec.data.itemsite_item_id_item_number,\n  \n        location_name : loc.data.location_name,\n        location_descrip : loc.data.location_descrip,\n        \n        invhist_transdate :  typeof(dt) == 'string' ? dt : dt.format('Y-m-d')\n    }); \n    \n   \n\n}\n",
+                                        "cellclick" : "function (_self, row, col, e)\n{\n\n   if ('netsuite_qty' == this.colModel.getDataIndex(col)) {\n        var d = this.ds.getAt(row); \n        var loc = _this.grid.selModel.getSelected();\n \n       new Pman.Download({\n            url: baseURL + '/Xtuple/NetsuiteFix/StockCheck',\n            params : {\n                item_id : d.data.itemsite_item_id,\n                location_id : loc.data.location_id\n            }\n           \n        \n        });\n    }\n}",
+                                        "|render" : "function() \n{\n    _this.itemgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.itempanel.active) {\n      // this.footer.onClick('first');\n    }\n}"
                                     },
-                                    "*prop": "grid",
-                                    "autoExpandColumn": "itemsite_item_id_item_number",
-                                    "loadMask": true,
-                                    "xtype": "Grid",
-                                    "|xns": "Roo.grid",
-                                    "items": [
+                                    "autoExpandColumn" : "itemsite_item_id_item_number",
+                                    "xtype" : "Grid",
+                                    "loadMask" : true,
+                                    "$ xns" : "Roo.grid",
+                                    "* prop" : "grid",
+                                    "items" : [
                                         {
-                                            "listeners": {
-                                                "beforeload": "function (_self, o)\n{\n    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        return false;\n    }\n    o.params.location_id = l.data.location_id;\n    o.params._as_of = _this.dateTo.getValue();\n    o.params._with_stock_and_value = 1;\n    o.params._viewtype =  _this.itemgrid.viewtype;\n}"
+                                            "listeners" : {
+                                                "beforeload" : "function (_self, o)\n{\n    var l = _this.grid.selModel ? _this.grid.selModel.getSelected() : false;\n    if (!l) {\n        return false;\n    }\n    o.params.location_id = l.data.location_id;\n    o.params._as_of = _this.dateTo.getValue();\n    o.params._with_stock_and_value = 1;\n    o.params._viewtype =  _this.itemgrid.viewtype;\n}"
                                             },
-                                            "*prop": "dataSource",
-                                            "remoteSort": true,
-                                            "xtype": "Store",
-                                            "|sortInfo": "{ field : 'itemsite_item_id_item_number', direction: 'ASC' }",
-                                            "|xns": "Roo.data",
-                                            "items": [
+                                            "xtype" : "Store",
+                                            "remoteSort" : true,
+                                            "$ sortInfo" : "{ field : 'itemsite_item_id_item_number', direction: 'ASC' }",
+                                            "$ xns" : "Roo.data",
+                                            "* prop" : "dataSource",
+                                            "items" : [
                                                 {
-                                                    "*prop": "proxy",
-                                                    "method": "GET",
-                                                    "timeout": 120000,
-                                                    "xtype": "HttpProxy",
-                                                    "|url": "baseURL + '/Roo/itemsite.php'",
-                                                    "|xns": "Roo.data"
+                                                    "$ url" : "baseURL + '/Roo/itemsite.php'",
+                                                    "method" : "GET",
+                                                    "xtype" : "HttpProxy",
+                                                    "timeout" : 120000,
+                                                    "$ 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",
-                                            "displayInfo": true,
-                                            "displayMsg": "{0} - {1} of {2}",
-                                            "emptyMsg": "No itemloc found",
-                                            "pageSize": 25,
-                                            "xtype": "PagingToolbar",
-                                            "|xns": "Roo"
+                                            "pageSize" : 25,
+                                            "xtype" : "PagingToolbar",
+                                            "emptyMsg" : "No itemloc found",
+                                            "$ xns" : "Roo",
+                                            "displayMsg" : "{0} - {1} of {2}",
+                                            "displayInfo" : true,
+                                            "* prop" : "footer"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "itemsite_item_id_item_number",
-                                            "header": "Item",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid"
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Item",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v) { return String.format('{0}', v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "itemsite_item_id_item_number"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "itemsite_qty",
-                                            "header": "Qty",
-                                            "width": 55,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return String.format('{0}', (v*1).toFixed(0)); }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Qty",
+                                            "width" : 55,
+                                            "$ renderer" : "function(v) { return String.format('{0}', (v*1).toFixed(0)); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "itemsite_qty"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "netsuite_qty",
-                                            "header": "NS Qty",
-                                            "hidden": true,
-                                            "width": 50,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) {     \n    var f= '<span style=\"color:blue;text-decoration:underline;cursor:pointer;\">{0}</span>';\n    if ((r.data.itemsite_qty) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold;text-decoration:underline;cursor:pointer;\">{0}</span>';\n    }\n    return String.format(f, (v*1).toFixed(0) ); \n}",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "hidden" : true,
+                                            "xtype" : "ColumnModel",
+                                            "header" : "NS Qty",
+                                            "width" : 50,
+                                            "$ renderer" : "function(v,x,r) {     \n    var f= '<span style=\"color:blue;text-decoration:underline;cursor:pointer;\">{0}</span>';\n    if ((r.data.itemsite_qty) *1 != (v*1)) {\n        f = '<span style=\"color:red;font-weight:bold;text-decoration:underline;cursor:pointer;\">{0}</span>';\n    }\n    return String.format(f, (v*1).toFixed(0) ); \n}",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "netsuite_qty"
                                         },
                                         {
-                                            "*prop": "colModel[]",
-                                            "align": "right",
-                                            "dataIndex": "itemsite_value",
-                                            "header": "Value",
-                                            "width": 75,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v) { return Roo.util.Format.usMoney(v); }",
-                                            "|xns": "Roo.grid"
+                                            "align" : "right",
+                                            "xtype" : "ColumnModel",
+                                            "header" : "Value",
+                                            "width" : 75,
+                                            "$ renderer" : "function(v) { return Roo.util.Format.usMoney(v); }",
+                                            "$ xns" : "Roo.grid",
+                                            "* prop" : "colModel[]",
+                                            "dataIndex" : "itemsite_value"
                                         }
                                     ]
                                 }
                 }
             ]
         }
-    ],
-    "permname": "",
-    "modOrder": "001"
+    ]
 }
\ No newline at end of file