Fix #7123 - getting abra ready to test
[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  \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      \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         \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              \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             \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             \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                                                             "|dateRange": "function() {\n\n  \n    var ftype =  this.getValue();\n    \n    switch(ftype) {\n        case 'Y':\n       \n            \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            break;\n        case 'H':        \n        // \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            \n \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           \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               \n        \n\n        \n        case 'R':\n           \n                return {\n                    date_from : _this.mfrom.getValue(),\n                    date_to : _this.mto.getValue()\n                };\n           \n            \n            break;\n       \n        default:\n            Roo.MessageBox.alert(\"select range\");\n            return;\n    }\n \n}\n",
149                                                             "|xns": "Roo.form",
150                                                             "items": [
151                                                                 {
152                                                                     "*prop": "store",
153                                                                     "xtype": "SimpleStore",
154                                                                     "|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",
155                                                                     "|fields": "[  'ftype', 'fname']",
156                                                                     "|xns": "Roo.data"
157                                                                 }
158                                                             ]
159                                                         },
160                                                         {
161                                                             "listeners": {
162                                                                 "render": "function (_self)\n{\n    _this.mfrom=  _self;\n}"
163                                                             },
164                                                             "format": "d/M/Y",
165                                                             "useIso": true,
166                                                             "xtype": "DateField",
167                                                             "|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})()",
168                                                             "|xns": "Roo.form"
169                                                         },
170                                                         {
171                                                             "listeners": {
172                                                                 "render": "function (_self)\n{\n    _this.mto=  _self;\n    //this.hide();\n}"
173                                                             },
174                                                             "format": "d/M/Y",
175                                                             "useIso": true,
176                                                             "xtype": "DateField",
177                                                             "|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})()",
178                                                             "|xns": "Roo.form"
179                                                         },
180                                                         {
181                                                             "listeners": {
182                                                                 "render": "function (_self)\n{\n    _this.daypick = _self;\n    this.hide();\n}"
183                                                             },
184                                                             "format": "d/M/Y",
185                                                             "useIso": true,
186                                                             "xtype": "DateField",
187                                                             "|value": "(function() {\n//    var n = new Date();\n    return new Date();\n})()",
188                                                             "|xns": "Roo.form"
189                                                         },
190                                                         {
191                                                             "listeners": {
192                                                                 "click": "function (_self, e)\n{\n    Pman.Xtuple.DashboardRender.load();\n}"
193                                                             },
194                                                             "text": "Run Report",
195                                                             "xtype": "Button",
196                                                             "|xns": "Roo.Toolbar"
197                                                         },
198                                                         {
199                                                             "text": "Other Reports",
200                                                             "xtype": "Button",
201                                                             "|xns": "Roo.Toolbar",
202                                                             "items": [
203                                                                 {
204                                                                     "|xns": "Roo.menu",
205                                                                     "xtype": "Menu",
206                                                                     "*prop": "menu",
207                                                                     "items": [
208                                                                         {
209                                                                             "listeners": {
210                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByCustomer',\n        params : _this.viewType.dateRange()\n         \n    \n    });\n}\n"
211                                                                             },
212                                                                             "text": "Sales By Customer",
213                                                                             "xtype": "Item",
214                                                                             "|xns": "Roo.menu"
215                                                                         },
216                                                                         {
217                                                                             "listeners": {
218                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByCountry',\n        params :  _this.viewType.dateRange()\n    \n    });\n}\n"
219                                                                             },
220                                                                             "text": "Sales By Country",
221                                                                             "xtype": "Item",
222                                                                             "|xns": "Roo.menu"
223                                                                         },
224                                                                         {
225                                                                             "listeners": {
226                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SalesByProduct',\n        params :  _this.viewType.dateRange()\n    \n    });\n}\n"
227                                                                             },
228                                                                             "text": "Sales By Product",
229                                                                             "xtype": "Item",
230                                                                             "|xns": "Roo.menu"
231                                                                         },
232                                                                         {
233                                                                             "|xns": "Roo.menu",
234                                                                             "xtype": "Separator"
235                                                                         },
236                                                                         {
237                                                                             "listeners": {
238                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/PurchasesByVendor',\n        params :  _this.viewType.dateRange()\n    \n    });\n}\n"
239                                                                             },
240                                                                             "text": "Purchases By Vendor",
241                                                                             "xtype": "Item",
242                                                                             "|xns": "Roo.menu"
243                                                                         },
244                                                                         {
245                                                                             "listeners": {
246                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/PurchasesByProduct',\n        params :  _this.viewType.dateRange()\n    \n    });\n}\n"
247                                                                             },
248                                                                             "text": "Purchases By Product",
249                                                                             "xtype": "Item",
250                                                                             "|xns": "Roo.menu"
251                                                                         },
252                                                                         {
253                                                                             "|xns": "Roo.menu",
254                                                                             "xtype": "Separator"
255                                                                         },
256                                                                         {
257                                                                             "listeners": {
258                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/StockAtLocation',\n         params :  _this.viewType.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"
259                                                                             },
260                                                                             "text": "Historical Stock Levels (EO HKFY)",
261                                                                             "xtype": "Item",
262                                                                             "|xns": "Roo.menu"
263                                                                         },
264                                                                         {
265                                                                             "|xns": "Roo.menu",
266                                                                             "xtype": "Separator"
267                                                                         },
268                                                                         {
269                                                                             "listeners": {
270                                                                                 "click": "function (_self, e)\n{\n    new Pman.Download({\n        url :baseURL + '/Xtuple/Reports/SGTax',\n         params :  _this.viewType.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"
271                                                                             },
272                                                                             "text": "SG Tax report",
273                                                                             "xtype": "Item",
274                                                                             "|xns": "Roo.menu"
275                                                                         }
276                                                                     ]
277                                                                 }
278                                                             ]
279                                                         },
280                                                         {
281                                                             "|xns": "Roo.Toolbar",
282                                                             "xtype": "Spacer"
283                                                         },
284                                                         {
285                                                             "|xns": "Roo.Toolbar",
286                                                             "xtype": "Fill"
287                                                         },
288                                                         {
289                                                             "text": "Theme : ",
290                                                             "xtype": "TextItem",
291                                                             "|xns": "Roo.Toolbar"
292                                                         },
293                                                         {
294                                                             "listeners": {
295                                                                 "select": "function (combo, record, index)\n{\n    Pman.Xtuple.DashboardRender.load();\n}",
296                                                                 "render": "function (_self)\n{\n    _this.themeCombo = this;\n}"
297                                                             },
298                                                             "allowBlank": false,
299                                                             "displayField": "name",
300                                                             "editable": false,
301                                                             "hiddenName": "colortheme",
302                                                             "listWidth": 300,
303                                                             "name": "colorTheme_title",
304                                                             "qtip": "Select a Color Theme",
305                                                             "selectOnFocus": true,
306                                                             "triggerAction": "all",
307                                                             "typeAhead": false,
308                                                             "valueField": "themeData",
309                                                             "xtype": "ComboBox",
310                                                             "|value": "(function() {\n     return Pman.Xtuple ? Pman.Xtuple.DashboardRender.colorthemes()[12][1] : ''; \n})() ",
311                                                             "|xns": "Roo.form",
312                                                             "items": [
313                                                                 {
314                                                                     "*prop": "store",
315                                                                     "xtype": "SimpleStore",
316                                                                     "|data": "(function() {\n    return (typeof Pman.Xtuple != 'undefined') ? Pman.Xtuple.DashboardRender.colorthemes() : [];\n    \n})()",
317                                                                     "|fields": "['name','themeData']",
318                                                                     "|xns": "Roo.data"
319                                                                 }
320                                                             ]
321                                                         }
322                                                     ]
323                                                 }
324                                             ]
325                                         },
326                                         {
327                                             "listeners": {
328                                                 "render": "function (_self)\n{\n    _this.reportpanel = _self;\n}"
329                                             },
330                                             "autoScroll": true,
331                                             "fitToFrame": true,
332                                             "region": "center",
333                                             "xtype": "ContentPanel",
334                                             "|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",
335                                             "|xns": "Roo",
336                                             "items": [
337                                                 {
338                                                     "|xns": "Roo",
339                                                     "xtype": "Toolbar",
340                                                     "*prop": "toolbar",
341                                                     "items": [
342                                                         {
343                                                             "text": "Report Range :",
344                                                             "xtype": "TextItem",
345                                                             "|xns": "Roo.Toolbar"
346                                                         },
347                                                         {
348                                                             "listeners": {
349                                                                 "render": "function (_self)\n{\n    _this.reportDateFrom = _self;\n}",
350                                                                 "select": "function (combo, date)\n{\n  //_this.grid.footer.onClick('first');\n}"
351                                                             },
352                                                             "format": "d/M/Y",
353                                                             "useIso": 1,
354                                                             "width": 120,
355                                                             "xtype": "DateField",
356                                                             "|value": "(function() { \n    return Date.parseDate( \n        '' + (new Date()).format('Y-m') + '-01'\n        , 'Y-m-d'   ); })()",
357                                                             "|xns": "Roo.form"
358                                                         },
359                                                         {
360                                                             "listeners": {
361                                                                 "render": "function (_self)\n{\n  _this.reportInterval = _self;\n}",
362                                                                 "select": "function (combo, record, index)\n{\n   // Roo.log('select');\n   // _this.grid.footer.onClick('first');\n}"
363                                                             },
364                                                             "allowBlank": false,
365                                                             "displayField": "fname",
366                                                             "editable": false,
367                                                             "fieldLabel": "Status",
368                                                             "hiddenName": "cm_status",
369                                                             "listWidth": 400,
370                                                             "mode": "local",
371                                                             "name": "cm_status_name",
372                                                             "triggerAction": "all",
373                                                             "value": "Y",
374                                                             "valueField": "ftype",
375                                                             "width": 200,
376                                                             "xtype": "ComboBox",
377                                                             "|xns": "Roo.form",
378                                                             "items": [
379                                                                 {
380                                                                     "*prop": "store",
381                                                                     "xtype": "SimpleStore",
382                                                                     "|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",
383                                                                     "|fields": "[  'ftype', 'fname']",
384                                                                     "|xns": "Roo.data"
385                                                                 }
386                                                             ]
387                                                         },
388                                                         {
389                                                             "listeners": {
390                                                                 "render": "function (_self)\n{\n  _this.reportCompany = _self;\n}"
391                                                             },
392                                                             "allowBlank": false,
393                                                             "displayField": "fname",
394                                                             "editable": false,
395                                                             "fieldLabel": "Status",
396                                                             "hiddenName": "report_company",
397                                                             "listWidth": 300,
398                                                             "mode": "local",
399                                                             "name": "report_company_name",
400                                                             "triggerAction": "all",
401                                                             "value": "hk",
402                                                             "valueField": "ftype",
403                                                             "width": 100,
404                                                             "xtype": "ComboBox",
405                                                             "|hidden": "(function() {\n\n    return baseURL.match(/hk\\.php$/) ? false : true;\n})()",
406                                                             "|xns": "Roo.form",
407                                                             "items": [
408                                                                 {
409                                                                     "*prop": "store",
410                                                                     "xtype": "SimpleStore",
411                                                                     "|data": "[ \n    [ 'hk', \"Hong Kong\"],\n    [ 'sg' , \"Singapore\"],            \n    [ 'my' , \"Malaysia\"],\n    [ 'cn' , \"China\"],    \n    [ 'au' , \"Australia\"],\n    [ 'consolidated' , \"Consolidated\"]\n]\n",
412                                                                     "|fields": "[  'ftype', 'fname']",
413                                                                     "|xns": "Roo.data"
414                                                                 }
415                                                             ]
416                                                         },
417                                                         {
418                                                             "listeners": {
419                                                                 "click": "function (_self, e)\n{\n      _this.reportpanel.showReport(); \n}"
420                                                             },
421                                                             "text": "Refresh Report",
422                                                             "xtype": "Button",
423                                                             "|xns": "Roo.Toolbar"
424                                                         },
425                                                         {
426                                                             "|xns": "Roo.Toolbar",
427                                                             "xtype": "Fill"
428                                                         },
429                                                         {
430                                                             "listeners": {
431                                                                 "click": "function (_self, e)\n{\n      _this.reportpanel.showReport(false,'xls'); \n}"
432                                                             },
433                                                             "text": "Download XLS",
434                                                             "xtype": "Button",
435                                                             "|xns": "Roo.Toolbar"
436                                                         }
437                                                     ]
438                                                 }
439                                             ]
440                                         }
441                                     ]
442                                 }
443                             ]
444                         },
445                         {
446                             "listeners": {
447                                 "render": "function (_self)\n{\n    _this.tree = _self;\n}"
448                             },
449                             "fitToFrame": true,
450                             "region": "west",
451                             "xtype": "TreePanel",
452                             "|xns": "Roo",
453                             "items": [
454                                 {
455                                     "|xns": "Roo",
456                                     "xtype": "Toolbar",
457                                     "*prop": "toolbar"
458                                 },
459                                 {
460                                     "*prop": "tree",
461                                     "rootVisible": false,
462                                     "xtype": "TreePanel",
463                                     "|xns": "Roo.tree",
464                                     "items": [
465                                         {
466                                             "*prop": "root",
467                                             "id": "root",
468                                             "xtype": "TreeNode",
469                                             "|xns": "Roo.tree"
470                                         },
471                                         {
472                                             "listeners": {
473                                                 "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}"
474                                             },
475                                             "*prop": "selModel",
476                                             "xtype": "DefaultSelectionModel",
477                                             "|xns": "Roo.tree"
478                                         },
479                                         {
480                                             "*prop": "loader",
481                                             "requestMethod": "GET",
482                                             "xtype": "TreeLoader",
483                                             "|baseParams": "{ _tree : 1, _dragon_only : 1 }",
484                                             "|dataUrl": "baseURL + '/Roo/Flhead'",
485                                             "|xns": "Roo.tree"
486                                         },
487                                         {
488                                             "|xns": "Roo.tree",
489                                             "xtype": "AsyncTreeNode",
490                                             "*prop": "root"
491                                         }
492                                     ]
493                                 }
494                             ]
495                         }
496                     ]
497                 }
498             ]
499         }
500     ],
501     "permname": "",
502     "modOrder": "001"
503 }