Pman.Tab.XtupleDashboard.bjs
[Pman.Xtuple] / Pman.Tab.XtupleDashboard.bjs
1 {
2     "id": "roo-file-605",
3     "name": "Pman.Tab.XtupleDashboard",
4     "parent": "Pman",
5     "title": "Pman.Tab.XtupleDashboard",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleDashboard.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n    \n    try {\n       // Pman.Xtuple.DashboardRender.load();    \n    } catch (e) {\n        Roo.log(e);\n    }\n    \n}"
11             },
12             "region": "center",
13             "title": "Management Dashboard",
14             "xtype": "NestedLayoutPanel",
15             "|xns": "Roo",
16             "items": [
17                 {
18                     "|xns": "Roo",
19                     "xtype": "BorderLayout",
20                     "*prop": "layout",
21                     "items": [
22                         {
23                             "*prop": "west",
24                             "hidden": false,
25                             "split": true,
26                             "width": 200,
27                             "xtype": "LayoutRegion",
28                             "|xns": "Roo"
29                         },
30                         {
31                             "*prop": "center",
32                             "xtype": "LayoutRegion",
33                             "|xns": "Roo"
34                         },
35                         {
36                             "listeners": {
37                                 "render": "function (_self)\n{\n    _this.dashpanel = _self;\n    \n    \n    (function() { \n            this.layout.getRegion('center').showPanel(0);\n    }).defer(100,this);\n}"
38                             },
39                             "region": "center",
40                             "xtype": "NestedLayoutPanel",
41                             "|xns": "Roo",
42                             "items": [
43                                 {
44                                     "|xns": "Roo",
45                                     "xtype": "BorderLayout",
46                                     "*prop": "layout",
47                                     "items": [
48                                         {
49                                             "*prop": "center",
50                                             "hideTabs": true,
51                                             "xtype": "LayoutRegion",
52                                             "|xns": "Roo"
53                                         },
54                                         {
55                                             "listeners": {
56                                                 "render": "function (_self)\n{\n    _this.viewPanel = _self;\n    \n  \n    //_this.paper = Raphael(_self.el.dom);\n    \n\n \n    \n    \n    \n}",
57                                                 "resize": "function (_self, width, height)\n{\n    \n   Roo.log(\"RESIZE\");\n   /* _this.svg.attr(\"width\", width)\n        .attr(\"height\", height);\n        */\n   //      _this.paper.setSize(width, 400);\n    try {\nPman.Clipping.DashboardRender.resize(width,height);\n    } catch (e) {\n        Roo.log(e);\n    }\n\n   \n    \n}",
58                                                 "activate": "function (_self)\n{\n    if (!_this.loadonce) {\n        _this.loadonce = true;\n    \n        (function () { Pman.Xtuple.DashboardRender.load(); }).defer(1000); \n    }\n}"
59                                             },
60                                             "autoScroll": true,
61                                             "fitContainer": true,
62                                             "fitToFrame": true,
63                                             "region": "center",
64                                             "xtype": "ContentPanel",
65                                             "|xns": "Roo",
66                                             "items": [
67                                                 {
68                                                     "|xns": "Roo",
69                                                     "xtype": "Toolbar",
70                                                     "*prop": "toolbar",
71                                                     "items": [
72                                                         {
73                                                             "text": "Show : ",
74                                                             "xtype": "TextItem",
75                                                             "|xns": "Roo.Toolbar"
76                                                         },
77                                                         {
78                                                             "listeners": {
79                                                                 "render": "function (_self)\n{\n    _this.countryCombo= _self;\n}"
80                                                             },
81                                                             "allowBlank": true,
82                                                             "displayField": "addr_country",
83                                                             "editable": false,
84                                                             "emptyText": " Country",
85                                                             "forceSelection": true,
86                                                             "listWidth": 400,
87                                                             "loadingText": "Searching...",
88                                                             "minChars": 2,
89                                                             "name": "addr_country",
90                                                             "pageSize": 20,
91                                                             "qtip": "Select addr",
92                                                             "selectOnFocus": true,
93                                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_country}</b> </div>",
94                                                             "triggerAction": "all",
95                                                             "typeAhead": true,
96                                                             "width": 100,
97                                                             "xtype": "ComboBox",
98                                                             "|xns": "Roo.form",
99                                                             "items": [
100                                                                 {
101                                                                     "listeners": {
102                                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params._distinct = 'addr_country';\n    o.params._columns = 'addr_country';    \n    o.params['!addr_country'] = '';\n}\n"
103                                                                     },
104                                                                     "*prop": "store",
105                                                                     "remoteSort": true,
106                                                                     "xtype": "Store",
107                                                                     "|sortInfo": "{ direction : 'ASC', field: 'addr_country' }",
108                                                                     "|xns": "Roo.data",
109                                                                     "items": [
110                                                                         {
111                                                                             "*prop": "proxy",
112                                                                             "xtype": "HttpProxy",
113                                                                             "method": "GET",
114                                                                             "|xns": "Roo.data",
115                                                                             "|url": "baseURL + '/Roo/addr.php'"
116                                                                         },
117                                                                         {
118                                                                             "*prop": "reader",
119                                                                             "xtype": "JsonReader",
120                                                                             "|xns": "Roo.data",
121                                                                             "id": "id",
122                                                                             "root": "data",
123                                                                             "totalProperty": "total",
124                                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"addr_line1\",\"type\":\"string\"}]"
125                                                                         }
126                                                                     ]
127                                                                 }
128                                                             ]
129                                                         },
130                                                         {
131                                                             "listeners": {
132                                                                 "render": "function (_self)\n{\n  _this.viewType = _self;\n   _this.dateRange = function() {\n                return {\n                   date_from : _this.mfrom.getValue(),\n                    date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.YEAR, 1).format('Y-m-d')\n         \n                };\n           \n           };\n}",
133                                                                 "select": "function (combo, record, index)\n{\n    Roo.log('select');\n   // Pman.Clipping.DashboardRender.load();\n    var n = new Date();\n    var ys = n.format('Y' )+ '-05-01';\n    n = Date.parseDate(ys, 'Y-n-d');\n    \n    var ftype = record ? record.data.ftype : this.getValue();\n    \n    switch(ftype) {\n        case 'Y':\n            //Roo.log(Date.parseDate(ys, 'Y-n-d'));\n           _this.mfrom.setValue(Date.parseDate(ys, 'Y-n-d'));\n           _this.mfrom.show();\n           _this.mto.hide(); \n           _this.daypick.hide();\n           \n           _this.dateRange = function() {\n                return {\n                   date_from : _this.mfrom.getValue(),\n                    date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.YEAR, 1).format('Y-m-d')\n         \n                };\n           \n           };\n           \n           \n            break;\n        case 'H':        \n        // ?? latest half\n            var m = (new Date()).format('n')*1  > 6 ? 6 : 0;\n            Roo.log(m);\n            Roo.log( n.add(Date.MONTH,m));\n           _this.mfrom.setValue(n.add(Date.MONTH,m));           \n           _this.mfrom.show();\n           _this.mto.hide(); \n           _this.daypick.hide();\n           _this.dateRange = function() {\n                return {\n                    date_from : _this.mfrom.getValue(),\n                    date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 6).format('Y-m-d')\n                };\n           };\n          break;\n        case 'Q':                \n        \n            var m = Math.floor(((new Date()).format('n') *1 -1) / 4) * 4;\n\n           _this.mfrom.setValue(n.add(Date.MONTH, m));           \n           _this.mfrom.show();\n           _this.mto.hide(); \n           _this.daypick.hide();\n           _this.dateRange = function() {\n                return {\n                    date_from : _this.mfrom.getValue(),\n                    date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 3).format('Y-m-d')\n                };\n            };   \n            break;\n\n        case 'M':        \n            var m = (new Date()).format('n') *1  - 1 ;\n           _this.mfrom.setValue(n.add(Date.MONTH, m ));\n           _this.mfrom.show();\n           _this.mto.hide(); \n           _this.daypick.hide();\n            _this.dateRange = function() {\n                return {\n                    date_from : _this.mfrom.getValue(),\n                    date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 1).format('Y-m-d')\n                };\n            };   \n            break;        \n        \n\n        \n        case 'R':\n            // this month..\n            var m = (new Date()).format('n') * 1;            \n           _this.mfrom.setValue(n.add(Date.MONTH, m-1 )); \n           _this.mto.setValue(n.add(Date.MONTH,m )); \n        \n        \n        \n             _this.mfrom.show();\n            _this.mto.show(); \n            _this.daypick.hide();\n             _this.dateRange = function() {\n                return {\n                    date_from : _this.mfrom.getValue(),\n                    date_to : _this.mto.getValue()\n                };\n            };   \n            \n            \n            break;\n        /*\n         case 'W': // today\n            var d = (new Date()).format('w') * -1;\n            _this.daypick.setValue( (new Date()).add(Date.DAY, d )); \n             _this.mfrom.hide();\n            _this.mto.hide(); \n            _this.daypick.show();\n            break;\n        \n        \n        case 'D': // today\n            _this.daypick.setValue(new Date()); \n             _this.mfrom.hide();\n            _this.mto.hide(); \n            _this.daypick.show();\n            break;\n            */\n        default:\n            alerT(\"oops invalid ftype?\");\n            return;\n    }\n    \n    \n    \n}"
134                                                             },
135                                                             "allowBlank": false,
136                                                             "displayField": "fname",
137                                                             "editable": false,
138                                                             "fieldLabel": "Status",
139                                                             "hiddenName": "cm_status",
140                                                             "listWidth": 200,
141                                                             "mode": "local",
142                                                             "name": "cm_status_name",
143                                                             "triggerAction": "all",
144                                                             "value": "R",
145                                                             "valueField": "ftype",
146                                                             "width": 150,
147                                                             "xtype": "ComboBox",
148                                                             "|xns": "Roo.form",
149                                                             "items": [
150                                                                 {
151                                                                     "*prop": "store",
152                                                                     "xtype": "SimpleStore",
153                                                                     "|data": "[ \n    [ 'Y', \"Show Year From\"],\n    [ 'H' , \"6 Months From\"],\n    [ 'Q', \"3 Months From\"] ,\n    [ 'M', \"Single Month\"],\n   // [ 'W', \"Single Week Starting\"],\n    [ 'R', \"Between these Dates\"] //,\n  //  [ 'D', \"Single Day\"]\n    \n]\n",
154                                                                     "|fields": "[  'ftype', 'fname']",
155                                                                     "|xns": "Roo.data"
156                                                                 }
157                                                             ]
158                                                         },
159                                                         {
160                                                             "listeners": {
161                                                                 "render": "function (_self)\n{\n    _this.mfrom=  _self;\n}"
162                                                             },
163                                                             "format": "d/M/Y",
164                                                             "useIso": true,
165                                                             "xtype": "DateField",
166                                                             "|value": "(function() {\n    var n = new Date();\n    // previous apr.\n    var y = n.format('Y');\n    if (n.format('m') < 5) { \n        y--;\n    }\n    \n    return Date.parseDate(y  + '-05-01', 'Y-m-d');\n})()",
167                                                             "|xns": "Roo.form"
168                                                         },
169                                                         {
170                                                             "listeners": {
171                                                                 "render": "function (_self)\n{\n    _this.mto=  _self;\n    //this.hide();\n}"
172                                                             },
173                                                             "format": "d/M/Y",
174                                                             "useIso": true,
175                                                             "xtype": "DateField",
176                                                             "|value": "(function() {\n    var n = (new Date()).add(Date.YEAR, 1);\n    \n    var n = new Date();\n    // previous apr.\n    var y = n.format('Y');\n    if (n.format('m') >= 5) { \n        y++;\n    }\n    \n    return Date.parseDate(y  + '-05-01', 'Y-m-d');\n    \n    \n\n})()",
177                                                             "|xns": "Roo.form"
178                                                         },
179                                                         {
180                                                             "listeners": {
181                                                                 "render": "function (_self)\n{\n    _this.daypick = _self;\n    this.hide();\n}"
182                                                             },
183                                                             "format": "d/M/Y",
184                                                             "useIso": true,
185                                                             "xtype": "DateField",
186                                                             "|value": "(function() {\n//    var n = new Date();\n    return new Date();\n})()",
187                                                             "|xns": "Roo.form"
188                                                         },
189                                                         {
190                                                             "listeners": {
191                                                                 "click": "function (_self, e)\n{\n    Pman.Xtuple.DashboardRender.load();\n}"
192                                                             },
193                                                             "text": "Run Report",
194                                                             "xtype": "Button",
195                                                             "|xns": "Roo.Toolbar"
196                                                         },
197                                                         {
198                                                             "text": "Other Reports",
199                                                             "xtype": "Button",
200                                                             "|xns": "Roo.Toolbar",
201                                                             "items": [
202                                                                 {
203                                                                     "|xns": "Roo.menu",
204                                                                     "xtype": "Menu",
205                                                                     "*prop": "menu",
206                                                                     "items": [
207                                                                         {
208                                                                             "listeners": {
209                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByCustomer',\n        params : _this.dateRange()\n    \n    });\n}\n"
210                                                                             },
211                                                                             "text": "Sales By Customer",
212                                                                             "xtype": "Item",
213                                                                             "|xns": "Roo.menu"
214                                                                         },
215                                                                         {
216                                                                             "listeners": {
217                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByCountry',\n        params :  _this.dateRange()\n    \n    });\n}\n"
218                                                                             },
219                                                                             "text": "Sales By Country",
220                                                                             "xtype": "Item",
221                                                                             "|xns": "Roo.menu"
222                                                                         },
223                                                                         {
224                                                                             "listeners": {
225                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByProduct',\n        params :  _this.dateRange()\n    \n    });\n}\n"
226                                                                             },
227                                                                             "text": "Sales By Product",
228                                                                             "xtype": "Item",
229                                                                             "|xns": "Roo.menu"
230                                                                         },
231                                                                         {
232                                                                             "|xns": "Roo.menu",
233                                                                             "xtype": "Separator"
234                                                                         },
235                                                                         {
236                                                                             "listeners": {
237                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/PurchasesByVendor',\n        params :  _this.dateRange()\n    \n    });\n}\n"
238                                                                             },
239                                                                             "text": "Purchases By Vendor",
240                                                                             "xtype": "Item",
241                                                                             "|xns": "Roo.menu"
242                                                                         },
243                                                                         {
244                                                                             "listeners": {
245                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/PurchasesByProduct',\n        params :  _this.dateRange()\n    \n    });\n}\n"
246                                                                             },
247                                                                             "text": "Purchases By Product",
248                                                                             "xtype": "Item",
249                                                                             "|xns": "Roo.menu"
250                                                                         },
251                                                                         {
252                                                                             "|xns": "Roo.menu",
253                                                                             "xtype": "Separator"
254                                                                         },
255                                                                         {
256                                                                             "listeners": {
257                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/StockAtLocation',\n         params :  _this.dateRange()\n    \n    });\n    Roo.MessageBox.alert(\"Downloading\", \n        \"The file will start downloading shortly - it may take around 1-2 minutes to calculate\");\n    \n}\n"
258                                                                             },
259                                                                             "text": "Historical Stock Levels (EO HKFY)",
260                                                                             "xtype": "Item",
261                                                                             "|xns": "Roo.menu"
262                                                                         },
263                                                                         {
264                                                                             "|xns": "Roo.menu",
265                                                                             "xtype": "Separator"
266                                                                         },
267                                                                         {
268                                                                             "listeners": {
269                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SGTax',\n         params :  _this.dateRange()\n    \n    });\n    Roo.MessageBox.alert(\"Downloading\", \n        \"The file will start downloading shortly - it may take around 1-2 minutes to calculate\");\n    \n}\n"
270                                                                             },
271                                                                             "text": "SG Tax report",
272                                                                             "xtype": "Item",
273                                                                             "|xns": "Roo.menu"
274                                                                         }
275                                                                     ]
276                                                                 }
277                                                             ]
278                                                         },
279                                                         {
280                                                             "|xns": "Roo.Toolbar",
281                                                             "xtype": "Spacer"
282                                                         },
283                                                         {
284                                                             "|xns": "Roo.Toolbar",
285                                                             "xtype": "Fill"
286                                                         },
287                                                         {
288                                                             "text": "Theme : ",
289                                                             "xtype": "TextItem",
290                                                             "|xns": "Roo.Toolbar"
291                                                         },
292                                                         {
293                                                             "listeners": {
294                                                                 "select": "function (combo, record, index)\n{\n    Pman.Xtuple.DashboardRender.load();\n}",
295                                                                 "render": "function (_self)\n{\n    _this.themeCombo = this;\n}"
296                                                             },
297                                                             "allowBlank": false,
298                                                             "displayField": "name",
299                                                             "editable": false,
300                                                             "hiddenName": "colortheme",
301                                                             "listWidth": 300,
302                                                             "name": "colorTheme_title",
303                                                             "qtip": "Select a Color Theme",
304                                                             "selectOnFocus": true,
305                                                             "triggerAction": "all",
306                                                             "typeAhead": false,
307                                                             "valueField": "themeData",
308                                                             "xtype": "ComboBox",
309                                                             "|value": "(function() {\n     return Pman.Xtuple ? Pman.Xtuple.DashboardRender.colorthemes()[12][1] : ''; \n})() ",
310                                                             "|xns": "Roo.form",
311                                                             "items": [
312                                                                 {
313                                                                     "*prop": "store",
314                                                                     "xtype": "SimpleStore",
315                                                                     "|data": "(function() {\n    return (typeof Pman.Xtuple != 'undefined') ? Pman.Xtuple.DashboardRender.colorthemes() : [];\n    \n})()",
316                                                                     "|fields": "['name','themeData']",
317                                                                     "|xns": "Roo.data"
318                                                                 }
319                                                             ]
320                                                         }
321                                                     ]
322                                                 }
323                                             ]
324                                         },
325                                         {
326                                             "listeners": {
327                                                 "render": "function (_self)\n{\n    _this.reportpanel = _self;\n}"
328                                             },
329                                             "autoScroll": true,
330                                             "fitToFrame": true,
331                                             "region": "center",
332                                             "xtype": "ContentPanel",
333                                             "|showReport": "function(node, isxls) {\n    if (node) {\n        _this.selectedNode = node;\n    }\n    var rc = _this.reportCompany.getValue();\n    var params =  {\n        flhead_name : _this.selectedNode.attributes.text,\n        ts : Math.random(),\n        period : _this.reportDateFrom.getValue(),\n        interval:   _this.reportInterval.getValue(),\n        company : (_this.reportCompany.hidden) ? '' : rc == 'consolidated' ? '' : rc,\n        singleCountry :  rc == 'consolidated' ? 0 : 1\n    };\n    \n    if (isxls) {\n        params._xls = 1;\n        new Pman.Download({\n            url : baseURL + '/Xtuple/Reports/ConsolidatedAccounts',\n            method: 'GET',\n            timeout: 120000,\n            params :  params\n        });\n        Roo.MessageBox.alert(\"Notice\", \"Report is downloading now for the combined report this will take about 50s\");\n        return;\n    }\n    var el = this.region.el;\n\n    var done = false;\n    var v= 0;\n    var f = function(){\n            if (done) {\n                return;\n            }\n            Roo.MessageBox.updateProgress(v/50, 'Loading..  Around ' + (50-v) + ' seconds to go');\n            v++;\n            f.defer(1000)\n       };\n     Roo.MessageBox.show({\n           title: 'Please wait...',\n           msg: 'Loading...',\n           width:240,\n           progress:true,\n           closable:true\n       });\n    \n\n    \n    ///el.mask(\"Loading - Should take around 45 seconds <br/> if it takes longer than 2 minutes, then something is broken<br/> If nothing displays try doing shift-reload or ctrl-reload\");\n    this.load({\n        url : baseURL + '/Xtuple/Reports/ConsolidatedAccounts',\n        method: 'GET',\n        params :  params,\n        timeout: 120,\n        callback: function() {\n            done = true;\n            Roo.MessageBox.hide();\n        }\n        \n    });\n    \n    f();\n    \n}\n",
334                                             "|xns": "Roo",
335                                             "items": [
336                                                 {
337                                                     "|xns": "Roo",
338                                                     "xtype": "Toolbar",
339                                                     "*prop": "toolbar",
340                                                     "items": [
341                                                         {
342                                                             "text": "Report Range :",
343                                                             "xtype": "TextItem",
344                                                             "|xns": "Roo.Toolbar"
345                                                         },
346                                                         {
347                                                             "listeners": {
348                                                                 "render": "function (_self)\n{\n    _this.reportDateFrom = _self;\n}",
349                                                                 "select": "function (combo, date)\n{\n  //_this.grid.footer.onClick('first');\n}"
350                                                             },
351                                                             "format": "d/M/Y",
352                                                             "useIso": 1,
353                                                             "width": 120,
354                                                             "xtype": "DateField",
355                                                             "|value": "(function() { \n    return Date.parseDate( \n        '' + (new Date()).format('Y-m') + '-01'\n        , 'Y-m-d'   ); })()",
356                                                             "|xns": "Roo.form"
357                                                         },
358                                                         {
359                                                             "listeners": {
360                                                                 "render": "function (_self)\n{\n  _this.reportInterval = _self;\n}",
361                                                                 "select": "function (combo, record, index)\n{\n   // Roo.log('select');\n   // _this.grid.footer.onClick('first');\n}"
362                                                             },
363                                                             "allowBlank": false,
364                                                             "displayField": "fname",
365                                                             "editable": false,
366                                                             "fieldLabel": "Status",
367                                                             "hiddenName": "cm_status",
368                                                             "listWidth": 400,
369                                                             "mode": "local",
370                                                             "name": "cm_status_name",
371                                                             "triggerAction": "all",
372                                                             "value": "Y",
373                                                             "valueField": "ftype",
374                                                             "width": 200,
375                                                             "xtype": "ComboBox",
376                                                             "|xns": "Roo.form",
377                                                             "items": [
378                                                                 {
379                                                                     "*prop": "store",
380                                                                     "xtype": "SimpleStore",
381                                                                     "|data": "[ \n    [ 'Y', \"Since Start of Financial Year\"],\n    [ 'YY' , \"Since Start of Financial Year with same range Previous Year\"],            \n    [ 'M' , \"Single Month\"],\n    [ 'MM' , \"Single Month with Previous Month\"],    \n    [ 'MY' , \"Single Month with Previous Year\"],\n    [ 'MF' , \"This Months of Financia Year\"],\n    [ 'ML' , \"Last 12 Months\"]\n]\n",
382                                                                     "|fields": "[  'ftype', 'fname']",
383                                                                     "|xns": "Roo.data"
384                                                                 }
385                                                             ]
386                                                         },
387                                                         {
388                                                             "listeners": {
389                                                                 "render": "function (_self)\n{\n  _this.reportCompany = _self;\n}"
390                                                             },
391                                                             "allowBlank": false,
392                                                             "displayField": "fname",
393                                                             "editable": false,
394                                                             "fieldLabel": "Status",
395                                                             "hiddenName": "report_company",
396                                                             "listWidth": 300,
397                                                             "mode": "local",
398                                                             "name": "report_company_name",
399                                                             "triggerAction": "all",
400                                                             "value": "hk",
401                                                             "valueField": "ftype",
402                                                             "width": 100,
403                                                             "xtype": "ComboBox",
404                                                             "|hidden": "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? false : true;\n})()",
405                                                             "|xns": "Roo.form",
406                                                             "items": [
407                                                                 {
408                                                                     "*prop": "store",
409                                                                     "xtype": "SimpleStore",
410                                                                     "|data": "[ \n    [ 'hk', \"Hong Kong\"],\n    [ 'sg' , \"Singapore\"],            \n    [ 'my' , \"Malaysia\"],\n    [ 'cn' , \"China\"],    \n    [ 'au' , \"Australia\"],\n    [ 'consolidated' , \"Consolidated\"]\n]\n",
411                                                                     "|fields": "[  'ftype', 'fname']",
412                                                                     "|xns": "Roo.data"
413                                                                 }
414                                                             ]
415                                                         },
416                                                         {
417                                                             "listeners": {
418                                                                 "click": "function (_self, e)\n{\n      _this.reportpanel.showReport(); \n}"
419                                                             },
420                                                             "text": "Refresh Report",
421                                                             "xtype": "Button",
422                                                             "|xns": "Roo.Toolbar"
423                                                         },
424                                                         {
425                                                             "|xns": "Roo.Toolbar",
426                                                             "xtype": "Fill"
427                                                         },
428                                                         {
429                                                             "listeners": {
430                                                                 "click": "function (_self, e)\n{\n      _this.reportpanel.showReport(false,'xls'); \n}"
431                                                             },
432                                                             "text": "Download XLS",
433                                                             "xtype": "Button",
434                                                             "|xns": "Roo.Toolbar"
435                                                         }
436                                                     ]
437                                                 }
438                                             ]
439                                         }
440                                     ]
441                                 }
442                             ]
443                         },
444                         {
445                             "listeners": {
446                                 "render": "function (_self)\n{\n    _this.tree = _self;\n}"
447                             },
448                             "fitToFrame": true,
449                             "region": "west",
450                             "xtype": "TreePanel",
451                             "|xns": "Roo",
452                             "items": [
453                                 {
454                                     "|xns": "Roo",
455                                     "xtype": "Toolbar",
456                                     "*prop": "toolbar"
457                                 },
458                                 {
459                                     "*prop": "tree",
460                                     "rootVisible": false,
461                                     "xtype": "TreePanel",
462                                     "|xns": "Roo.tree",
463                                     "items": [
464                                         {
465                                             "*prop": "root",
466                                             "id": "root",
467                                             "xtype": "TreeNode",
468                                             "|xns": "Roo.tree"
469                                         },
470                                         {
471                                             "listeners": {
472                                                 "selectionchange": "function (_self, node)\n{\n    var at = node.attributes.id;\n    if (at > 999) {\n         _this.dashpanel.layout.getRegion('center').showPanel(0);\n          Pman.Xtuple.DashboardRender.load();\n          return;\n         \n    }\n    _this.dashpanel.layout.getRegion('center').showPanel(1);\n    _this.reportpanel.showReport(node); \n   \n    \n}"
473                                             },
474                                             "*prop": "selModel",
475                                             "xtype": "DefaultSelectionModel",
476                                             "|xns": "Roo.tree"
477                                         },
478                                         {
479                                             "*prop": "loader",
480                                             "requestMethod": "GET",
481                                             "xtype": "TreeLoader",
482                                             "|baseParams": "{ _tree : 1, _dragon_only : 1 }",
483                                             "|dataUrl": "baseURL + '/Roo/Flhead'",
484                                             "|xns": "Roo.tree"
485                                         },
486                                         {
487                                             "|xns": "Roo.tree",
488                                             "xtype": "AsyncTreeNode",
489                                             "*prop": "root"
490                                         }
491                                     ]
492                                 }
493                             ]
494                         }
495                     ]
496                 }
497             ]
498         }
499     ],
500     "permname": "",
501     "modOrder": "001"
502 }