Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleSalesPlanning.bjs
1 {
2     "id": "roo-file-78",
3     "name": "Pman.Tab.XtupleSalesPlanning",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "Pman.Tab.XtupleSalesPlanning",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesPlanning.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n   // Roo.log(Pman.hasPerm('Xtuple.SalesPlanner', 'S'));\n   // Roo.log(Pman.Login.authUser);\n}"
11             },
12             "background": false,
13             "fitContainer": true,
14             "fitToFrame": true,
15             "title": "Sales Planning",
16             "xtype": "NestedLayoutPanel",
17             "|xns": "Roo",
18             "items": [
19                 {
20                     "|xns": "Roo",
21                     "xtype": "BorderLayout",
22                     "*prop": "layout",
23                     "items": [
24                         {
25                             "|xns": "Roo",
26                             "xtype": "LayoutRegion",
27                             "*prop": "center"
28                         },
29                         {
30                             "*prop": "south",
31                             "height": 400,
32                             "split": true,
33                             "xtype": "LayoutRegion",
34                             "|xns": "Roo"
35                         },
36                         {
37                             "listeners": {
38                                 "activate": "function (_self)\n{\n    _self.layout.getRegion('center').showPanel(0);\n}"
39                             },
40                             "background": false,
41                             "fitContainer": true,
42                             "fitToFrame": true,
43                             "region": "center",
44                             "xtype": "NestedLayoutPanel",
45                             "|xns": "Roo",
46                             "items": [
47                                 {
48                                     "|xns": "Roo",
49                                     "xtype": "BorderLayout",
50                                     "*prop": "layout",
51                                     "items": [
52                                         {
53                                             "|xns": "Roo",
54                                             "xtype": "LayoutRegion",
55                                             "*prop": "center"
56                                         },
57                                         {
58                                             "*prop": "west",
59                                             "split": true,
60                                             "tabPosition": "top",
61                                             "width": 300,
62                                             "xtype": "LayoutRegion",
63                                             "|xns": "Roo"
64                                         },
65                                         {
66                                             "listeners": {
67                                                 "|activate": "function() {\n    _this.panel = this;\n    \n  //  if (_this.grid) {\n  //      _this.grid.footer.onClick('first');\n  //  }\n}"
68                                             },
69                                             "background": false,
70                                             "fitContainer": true,
71                                             "fitToframe": true,
72                                             "region": "center",
73                                             "tableName": "item",
74                                             "title": "Item",
75                                             "xtype": "GridPanel",
76                                             "|xns": "Roo",
77                                             "items": [
78                                                 {
79                                                     "listeners": {
80                                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n  //  if (_this.panel.active) {\n   //    this.footer.onClick('first');\n  //  }\n}"
81                                                     },
82                                                     "*prop": "grid",
83                                                     "autoExpandColumn": "item_descrip1",
84                                                     "loadMask": true,
85                                                     "xtype": "Grid",
86                                                     "|xns": "Roo.grid",
87                                                     "items": [
88                                                         {
89                                                             "listeners": {
90                                                                 "afterselectionchange": "function (_self)\n{\n    if (_this.sgrid) {\n        _this.sgrid.footer.onClick('first');\n    }\n}"
91                                                             },
92                                                             "*prop": "sm",
93                                                             "singleSelect": true,
94                                                             "xtype": "RowSelectionModel",
95                                                             "|xns": "Roo.grid"
96                                                         },
97                                                         {
98                                                             "listeners": {
99                                                                 "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var s = _this.wgrid.getSelectionModel().getSelected();\n    if(!s.data.cust_id){\n        _this.grid.ds.removeAll();\n        return false;\n    }\n    _this.sgrid.ds.removeAll();\n    \n    o.params._with_year_total = 1;\n    \n    o.params._charass_brand_value = _this.brandSel.getValue();\n    o.params._charass_group_value = _this.groupSel.getValue();\n    \n    o.params._with_itemsrc_active = 1;\n    o.params._in_cust_id = s.data.cust_id;\n    \n    var date = new Date();\n    var year = date.getFullYear(); // four digits\n    var month = date.getMonth(); // 0-11\n    \n    var cm = _this.grid.getColumnModel();\n    function cid(str) {\r\n        return cm.getIndexByDataIndex(str);\r\n    }\r    \n    \n    cm.setColumnHeader(cid('total_before_last_year'),'Total ' + (year - 2));\n    cm.setColumnHeader(cid('total_last_year'),'Total ' + (year - 1));\n    cm.setColumnHeader(cid('forecast_this_year'),'Forecast ' + year);\n    cm.setColumnHeader(cid('total_this_year'),'Total ' + year);\n    \n    if(month > 5){\n        cm.setColumnHeader(cid('forecast_next_year'),'Total ' + (year + 1));\n        cm.setHidden(cid('forecast_next_year'),false);\n    }\n    // it make the grid slow, change it later!\n    if(s.data.cust_name == 'All Companies'){\n        cm.setHidden(cid('forecast_this_year'),true);\n        cm.setHidden(cid('company_estimates'),false);\n    }else{\n        cm.setHidden(cid('forecast_this_year'),false);\n        cm.setHidden(cid('company_estimates'),true);\n    }\n    \n\n}",
100                                                                 "load": "function (_self, records, options)\n{\n    var sm = _this.grid.getSelectionModel();\n    Roo.each(records, function(record){\n        if(record.data.item_id == _this.grid.lastSelectedId){\n            sm.selectRow(_this.grid.ds.indexOf(record));\n            if (_this.sgrid) {\n                _this.sgrid.footer.onClick('first');\n            }\n        }\n    })\n}"
101                                                             },
102                                                             "*prop": "dataSource",
103                                                             "remoteSort": true,
104                                                             "xtype": "Store",
105                                                             "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
106                                                             "|xns": "Roo.data",
107                                                             "items": [
108                                                                 {
109                                                                     "*prop": "proxy",
110                                                                     "method": "GET",
111                                                                     "xtype": "HttpProxy",
112                                                                     "|url": "baseURL + '/Roo/Item.php'",
113                                                                     "|xns": "Roo.data"
114                                                                 },
115                                                                 {
116                                                                     "*prop": "reader",
117                                                                     "id": "id",
118                                                                     "root": "data",
119                                                                     "totalProperty": "total",
120                                                                     "xtype": "JsonReader",
121                                                                     "|fields": "[\n    {\n        'name': 'item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'item_descrip1',\n        'type': 'string'\n    },\n    {\n        'name': 'total_before_last_year',\n        'type': 'int'\n    },\n    {\n        'name': 'total_last_year',\n        'type': 'int'\n    },\n    {\n        'name': 'forecast_this_year',\n        'type': 'int'\n    },\n    {\n        'name': 'total_this_year',\n        'type': 'int'\n    },\n    {\n        'name': 'total_next_year',\n        'type': 'int'\n    },\n    {\n        'name': 'forecast_next_year',\n        'type': 'int'\n    },\n    {\n        'name': 'last_forecast_entered',\n        'type': 'string'\n    }\n]",
122                                                                     "|xns": "Roo.data"
123                                                                 }
124                                                             ]
125                                                         },
126                                                         {
127                                                             "*prop": "footer",
128                                                             "displayInfo": true,
129                                                             "displayMsg": "Displaying Item{0} - {1} of {2}",
130                                                             "emptyMsg": "No Item found",
131                                                             "pageSize": 25,
132                                                             "xtype": "PagingToolbar",
133                                                             "|xns": "Roo"
134                                                         },
135                                                         {
136                                                             "|xns": "Roo",
137                                                             "xtype": "Toolbar",
138                                                             "*prop": "toolbar",
139                                                             "items": [
140                                                                 {
141                                                                     "listeners": {
142                                                                         "render": "function (_self)\n{\n  _this.brandSel = _self;\n  \n}",
143                                                                         "select": "function (combo, record, index)\n{\n    _this.wgrid.ds.load({});}"
144                                                                     },
145                                                                     "allowBlank": true,
146                                                                     "alwaysQuery": true,
147                                                                     "displayField": "charass_value",
148                                                                     "editable": true,
149                                                                     "emptyText": "Select Brand",
150                                                                     "forceSelection": true,
151                                                                     "listWidth": 300,
152                                                                     "loadingText": "Searching...",
153                                                                     "minChars": 2,
154                                                                     "pageSize": 20,
155                                                                     "qtip": "Select Brand",
156                                                                     "queryParam": "query[charass_value]",
157                                                                     "selectOnFocus": true,
158                                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
159                                                                     "triggerAction": "all",
160                                                                     "width": 200,
161                                                                     "xtype": "ComboBox",
162                                                                     "|xns": "Roo.form",
163                                                                     "items": [
164                                                                         {
165                                                                             "listeners": {
166                                                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    // look for all of the charass 's with the same type= eg. brand.\n    \n    o.params.charass_char_id_char_name = 'BRAND';\n    o.params.charass_target_type ='I';\n    o.params._distinct = 'charass_value';\n    o.params._columns = 'charass_value';\n\n}"
167                                                                             },
168                                                                             "*prop": "store",
169                                                                             "remoteSort": true,
170                                                                             "xtype": "Store",
171                                                                             "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
172                                                                             "|xns": "Roo.data",
173                                                                             "items": [
174                                                                                 {
175                                                                                     "*prop": "proxy",
176                                                                                     "method": "GET",
177                                                                                     "xtype": "HttpProxy",
178                                                                                     "|url": "baseURL + '/Roo/Charass.php'",
179                                                                                     "|xns": "Roo.data"
180                                                                                 },
181                                                                                 {
182                                                                                     "*prop": "reader",
183                                                                                     "id": "id",
184                                                                                     "root": "data",
185                                                                                     "totalProperty": "total",
186                                                                                     "xtype": "JsonReader",
187                                                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]",
188                                                                                     "|xns": "Roo.data"
189                                                                                 }
190                                                                             ]
191                                                                         }
192                                                                     ]
193                                                                 },
194                                                                 {
195                                                                     "listeners": {
196                                                                         "render": "function (_self)\n{\n  _this.groupSel = _self;\n}",
197                                                                         "select": "function (combo, record, index)\n{\n    _this.wgrid.ds.load({});\n}"
198                                                                     },
199                                                                     "allowBlank": true,
200                                                                     "alwaysQuery": true,
201                                                                     "displayField": "charass_value",
202                                                                     "editable": true,
203                                                                     "emptyText": "Select Product Group",
204                                                                     "forceSelection": true,
205                                                                     "listWidth": 300,
206                                                                     "loadingText": "Searching...",
207                                                                     "minChars": 2,
208                                                                     "pageSize": 20,
209                                                                     "qtip": "Select Product Group",
210                                                                     "queryParam": "query[charass_value]",
211                                                                     "selectOnFocus": true,
212                                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>",
213                                                                     "triggerAction": "all",
214                                                                     "width": 200,
215                                                                     "xtype": "ComboBox",
216                                                                     "|xns": "Roo.form",
217                                                                     "items": [
218                                                                         {
219                                                                             "listeners": {
220                                                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    // look for all of the charass 's with the same type= eg. brand.\n    \n    o.params.charass_char_id_char_name = 'PRODUCTGROUP';\n    o.params.charass_target_type ='I';\n    o.params._distinct = 'charass_value';\n        o.params._columns = 'charass_value';\n\n}"
221                                                                             },
222                                                                             "*prop": "store",
223                                                                             "remoteSort": true,
224                                                                             "xtype": "Store",
225                                                                             "|sortInfo": "{ field : 'charass_value' , direction : 'ASC' }",
226                                                                             "|xns": "Roo.data",
227                                                                             "items": [
228                                                                                 {
229                                                                                     "*prop": "proxy",
230                                                                                     "method": "GET",
231                                                                                     "xtype": "HttpProxy",
232                                                                                     "|url": "baseURL + '/Roo/Charass.php'",
233                                                                                     "|xns": "Roo.data"
234                                                                                 },
235                                                                                 {
236                                                                                     "*prop": "reader",
237                                                                                     "id": "id",
238                                                                                     "root": "data",
239                                                                                     "totalProperty": "total",
240                                                                                     "xtype": "JsonReader",
241                                                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]",
242                                                                                     "|xns": "Roo.data"
243                                                                                 }
244                                                                             ]
245                                                                         }
246                                                                     ]
247                                                                 },
248                                                                 {
249                                                                     "|xns": "Roo.Toolbar",
250                                                                     "xtype": "Fill"
251                                                                 },
252                                                                 {
253                                                                     "listeners": {
254                                                                         "click": "function ()\n{\n    var brand = _this.brandSel.getValue();\n    var group = _this.groupSel.getValue();\n    \n    if(!brand && !group){\n        Roo.MessageBox.alert('Error','Please select the brand or group');\n        return;\n    }\n    \n    Roo.MessageBox.alert(\"Notice\",\"Your report should be downloading now\");\n    \n    new Pman.download({\n        url : baseURL + '/Roo/Salesforecast',\n        method : 'GET',\n        timeout: 900000,\n        params : {\n            '_download' : 1,\n            'brand' : brand,\n            'group' : group\n        }\n    });  \n   \n}"
255                                                                     },
256                                                                     "cls": "x-btn-text-icon",
257                                                                     "text": "Download Report",
258                                                                     "xtype": "Button",
259                                                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
260                                                                     "|xns": "Roo.Toolbar"
261                                                                 }
262                                                             ]
263                                                         },
264                                                         {
265                                                             "*prop": "colModel[]",
266                                                             "dataIndex": "itemsrc_active",
267                                                             "header": "is Active?",
268                                                             "width": 50,
269                                                             "xtype": "ColumnModel",
270                                                             "|renderer": "function(v) {  \n    var state = v * 1 > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
271                                                             "|xns": "Roo.grid"
272                                                         },
273                                                         {
274                                                             "*prop": "colModel[]",
275                                                             "dataIndex": "item_number",
276                                                             "header": "Item code",
277                                                             "width": 200,
278                                                             "xtype": "ColumnModel",
279                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
280                                                             "|xns": "Roo.grid"
281                                                         },
282                                                         {
283                                                             "*prop": "colModel[]",
284                                                             "dataIndex": "item_descrip1",
285                                                             "header": "Item name",
286                                                             "width": 200,
287                                                             "xtype": "ColumnModel",
288                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
289                                                             "|xns": "Roo.grid"
290                                                         },
291                                                         {
292                                                             "*prop": "colModel[]",
293                                                             "dataIndex": "total_before_last_year",
294                                                             "header": "Total",
295                                                             "width": 150,
296                                                             "xtype": "ColumnModel",
297                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
298                                                             "|xns": "Roo.grid"
299                                                         },
300                                                         {
301                                                             "*prop": "colModel[]",
302                                                             "dataIndex": "total_last_year",
303                                                             "header": "Total",
304                                                             "width": 150,
305                                                             "xtype": "ColumnModel",
306                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
307                                                             "|xns": "Roo.grid"
308                                                         },
309                                                         {
310                                                             "*prop": "colModel[]",
311                                                             "dataIndex": "forecast_this_year",
312                                                             "header": "Forecast",
313                                                             "width": 150,
314                                                             "xtype": "ColumnModel",
315                                                             "|renderer": "function(v,x,r) { \n    \n    if (v*1 == 0) {\n    \n        return '<span style=\"color:red\">' + v + '</span>';\n    }\n    \n    return String.format('{0}', v);\n    \n    \n}",
316                                                             "|xns": "Roo.grid"
317                                                         },
318                                                         {
319                                                             "*prop": "colModel[]",
320                                                             "dataIndex": "total_this_year",
321                                                             "header": "Total",
322                                                             "width": 150,
323                                                             "xtype": "ColumnModel",
324                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
325                                                             "|xns": "Roo.grid"
326                                                         },
327                                                         {
328                                                             "*prop": "colModel[]",
329                                                             "dataIndex": "forecast_next_year",
330                                                             "header": "Forecast",
331                                                             "hidden": true,
332                                                             "width": 150,
333                                                             "xtype": "ColumnModel",
334                                                             "|renderer": "function(v,x,r) { \n    \n    if (v*1 == 0) {\n    \n        return '<span style=\"color:red\">' + v + '</span>';\n    }\n    \n    return String.format('{0}', v);\n    \n    \n}",
335                                                             "|xns": "Roo.grid"
336                                                         },
337                                                         {
338                                                             "*prop": "colModel[]",
339                                                             "dataIndex": "last_forecast_entered",
340                                                             "header": "Last forcast entered",
341                                                             "width": 150,
342                                                             "xtype": "ColumnModel",
343                                                             "|renderer": "function(v,x,r) {\n    if(!v){\n        return;\n    }\n    var last_forecast = new Date(v);\n    \n    var date = new Date();\n    var y = date.getFullYear();\n    var m = date.getMonth() + 3;\n    var d = date.getDate();\n    if(m >= 11){\n        y = y + 1;\n        m = m - 11;\n    }\n    var c = new Date(y,m,d);\n    if (last_forecast < c) {\n        return '<span style=\"color:red\">' + last_forecast.format('M Y') + '</span>';\n    }\n    \n    return String.format('{0}', last_forecast.format('M Y'));\n    \n    \n}",
344                                                             "|xns": "Roo.grid"
345                                                         },
346                                                         {
347                                                             "*prop": "colModel[]",
348                                                             "dataIndex": "company_estimates",
349                                                             "header": "Estimates",
350                                                             "hidden": true,
351                                                             "width": 150,
352                                                             "xtype": "ColumnModel",
353                                                             "|renderer": "function(v,x,r) {\n    return String.format('{0}', v);\n    \n    \n}",
354                                                             "|xns": "Roo.grid"
355                                                         }
356                                                     ]
357                                                 }
358                                             ]
359                                         },
360                                         {
361                                             "listeners": {
362                                                 "|activate": "function() {\n    _this.wpanel = this;\n    if (_this.wgrid) {\n        _this.wgrid.ds.load({});\n    }\n}"
363                                             },
364                                             "background": true,
365                                             "fitContainer": true,
366                                             "fitToframe": true,
367                                             "region": "west",
368                                             "tableName": "custinfo",
369                                             "title": "Customer",
370                                             "xtype": "GridPanel",
371                                             "|xns": "Roo",
372                                             "items": [
373                                                 {
374                                                     "listeners": {
375                                                         "|render": "function() \n{\n    _this.wgrid = this; \n    if (_this.wpanel.active) {\n        _this.wgrid.ds.load({});\n    }\n}",
376                                                         "rowclick": "function (_self, rowIndex, e)\n{\n    var sm = _this.grid.getSelectionModel();\n   if(sm.getSelections().length){\n         _this.grid.lastSelectedId = sm.getSelections()[0].data.item_id;\n     }\n    _this.grid.footer.onClick('refresh');\n}"
377                                                     },
378                                                     "*prop": "grid",
379                                                     "autoExpandColumn": "cust_name_with_pcs",
380                                                     "loadMask": true,
381                                                     "xtype": "Grid",
382                                                     "|xns": "Roo.grid",
383                                                     "items": [
384                                                         {
385                                                             "listeners": {
386                                                                 "beforeload": "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._with_lastyear_total = 1;\n    o.params._columns = 'cust_id,cust_name,lastyear_total';\n    \n    var brand = _this.brandSel.getValue();\n    if(!brand.length){\n        _this.wgrid.ds.removeAll();\n        _this.grid.ds.removeAll();\n        return false;\n    }\n    \n    o.params._charass_brand_value = _this.brandSel.getValue();\n    o.params._charass_group_value = _this.groupSel.getValue();\n    \n    o.params.limit = 9999;\n    \n}\n",
387                                                                 "load": "function (_self, records, options)\n{\n    var sm = _this.wgrid.getSelectionModel();\n    if (!sm.getSelections().length) {\n        sm.selectFirstRow();\n    }\n    \n    _this.grid.footer.onClick('first');\n}"
388                                                             },
389                                                             "*prop": "dataSource",
390                                                             "remoteSort": true,
391                                                             "xtype": "Store",
392                                                             "|sortInfo": "{ field : 'lastyear_total', direction: 'DESC' }",
393                                                             "|xns": "Roo.data",
394                                                             "items": [
395                                                                 {
396                                                                     "*prop": "proxy",
397                                                                     "method": "GET",
398                                                                     "xtype": "HttpProxy",
399                                                                     "|url": "baseURL + '/Roo/Custinfo.php'",
400                                                                     "|xns": "Roo.data"
401                                                                 },
402                                                                 {
403                                                                     "*prop": "reader",
404                                                                     "id": "id",
405                                                                     "root": "data",
406                                                                     "totalProperty": "total",
407                                                                     "xtype": "JsonReader",
408                                                                     "|fields": "[\n    {\n        'name': 'cust_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cust_name_with_pcs',\n        'type': 'string'\n    },\n    {\n        'name': 'lastyear_total',\n        'type': 'int'\n    }\n]",
409                                                                     "|xns": "Roo.data"
410                                                                 }
411                                                             ]
412                                                         },
413                                                         {
414                                                             "*prop": "colModel[]",
415                                                             "dataIndex": "cust_name",
416                                                             "header": "Company Name",
417                                                             "width": 200,
418                                                             "xtype": "ColumnModel",
419                                                             "|renderer": "function(v) { return String.format('{0}', v); }",
420                                                             "|xns": "Roo.grid"
421                                                         },
422                                                         {
423                                                             "*prop": "colModel[]",
424                                                             "dataIndex": "lastyear_total",
425                                                             "header": "",
426                                                             "width": 75,
427                                                             "xtype": "ColumnModel",
428                                                             "|renderer": "function(v,x,r) \n{\n    return String.format('{0}', v + ' pcs'); \n}",
429                                                             "|xns": "Roo.grid"
430                                                         }
431                                                     ]
432                                                 }
433                                             ]
434                                         }
435                                     ]
436                                 }
437                             ]
438                         },
439                         {
440                             "listeners": {
441                                 "|activate": "function() {\n    _this.spanel = this;\n  /*  if (_this.sgrid) {\n        _this.sgrid.footer.onClick('first');\n    } */\n}"
442                             },
443                             "background": false,
444                             "fitContainer": true,
445                             "fitToframe": true,
446                             "region": "south",
447                             "tableName": "Groups",
448                             "title": "Details",
449                             "xtype": "GridPanel",
450                             "|xns": "Roo",
451                             "items": [
452                                 {
453                                     "listeners": {
454                                         "|render": "function() \n{\n    _this.sgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n   /* if (_this.spanel.active) {\n       this.footer.onClick('first');\n    } */\n}",
455                                         "afteredit": "function (e)\n{\n    _this.grid.loadMask.el.unmask();\n    _this.wgrid.loadMask.el.unmask();\n    if(e.value == e.originalValue){\n        return;\n    }\n    var field = e.field;\n    var salesforecast_id = e.record.json[field + '_salesforecast_id'];\n    var rec = _this.grid.getSelectionModel().getSelected();\n    var s = _this.wgrid.getSelectionModel().getSelected();\n    \n    if(!rec || !s){\n        Roo.Msg.alert(\"Error\",\"Please select a item\");\n        return;\n    }\n    \n    var params = {\n            salesforecast_id : (salesforecast_id * 1 > 0) ? salesforecast_id : 0,\n            salesforecast_cust_id : (s.data.cust_id < 0) ? 0 : s.data.cust_id,\n            salesforecast_is_all_buyers : (s.data.view_type) == 'All' ? 1 : 0,\n            _item_id : rec.data.item_id,\n            month : e.column,\n            year : e.record.data['year']\n        }\n    \n    if(s.data.cust_id > 0){ // company level confirm and request editable!\n        if(e.record.data['type'] == 'confirm'){\n            params.salesforecast_qty = e.value;\n        }\n        if(e.record.data['type'] == 'request'){\n            params.salesforecast_requests = e.value;\n        }\n    } else { // item level estimated and total forecast editable!\n        if(e.record.data['type'] == 'estimated'){\n            params.salesforecast_qty = e.value;\n        }\n        if(e.record.data['type'] == 'forecast'){\n            params.salesforecast_sum = e.value;\n        }\n    }\n    \n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Salesforecast.php',\n        method :'POST',\n        params : params,\n        success : function() {\n           \n            _this.sgrid.footer.onClick('first');\n            \n        }\n    });\n    \n}",
456                                         "beforeedit": "function (e)\n{   \n    var rec = e.record;\n    var y = new Date().getFullYear();\n    var m = new Date().getMonth(); // 0-11\n    var s = _this.grid.getSelectionModel().getSelected();\n    var ss = _this.wgrid.getSelectionModel().getSelected();\n   \n   /*\r\n    if(rec.data.type != 'forecast' || rec.data.year != y || !s.data.itemsrc_active || e.column < m + 3){\r\n        return false;\r\n    }\n    */\n\n    if(s.data.itemsrc_active * 1 < 1 || (rec.data.year == y && e.column < m + 3) || (rec.data.year != y && e.column + 12 < m + 3)){\n        return false;\n    }\n    if(ss.data.cust_id > 0){ // companies level, confirm and request editable!\n        if(rec.data.type != 'confirm' && rec.data.type != 'request'){\n            return false;\n        }\n    }else{ // item level, estimated and total forecast  editable!\n        if(rec.data.type != 'estimated' && rec.data.type != 'forecast'){\n            return false;\n        }\n    }\n    \n    _this.grid.loadMask.el.mask('Cancel edit forecast first!');\n    _this.wgrid.loadMask.el.mask('Cancel edit forecast first!');\r\n}"
457                                     },
458                                     "*prop": "grid",
459                                     "autoExpandColumn": "year_text",
460                                     "clicksToEdit": 1,
461                                     "loadMask": true,
462                                     "xtype": "EditorGrid",
463                                     "|calcest": "function(colname) \n{\n\n    var before = _this.sgrid.ds.getAt(0).data[colname];\n    var last = _this.sgrid.ds.getAt(1).data[colname];\n    var est = last * 2;\n    if(before < last * 2){\n       est = last * 2 - before;\n    }\n    return est;\n}\n",
464                                     "|formatcol": "function(v,r,n) \n{\n   var d = new Date();\n   var y = d.getFullYear();\n   var m = d.getMonth();\n   var month = n.split(\"_\");\n //  var est =  _this.sgrid.calcest(n);\n /*  if(r.data.type == 'forecast' && r.data.year == y && r.json.is_all_buyers == 0){\n        if(month[1] < m + 3)\n        { // fill in blank if the month less than next month\n            return String.format('{0}',''); \n        }\n        if(est > v || v > est * 2 || v * 1 == 0)\n        { //red if forcast is less than estimate or double estimate\n            return '<span style=\"color:red\">' + v + ' ( ' + est + ' )</span>';\n        }\n        return String.format('{0}',v + ' ( ' + est + ' )'); \n    }\n    if(r.data.type == 'forecast' && r.data.year == y && r.json.is_all_buyers == 1){\n        var t = '';\n        if((typeof(v) != undefined && v > 0)){\n            t += v + ' ';\n        }\n        if(typeof(r.json[n + '_sum']) != undefined && r.json[n + '_sum'] > 0){\n            t += 'sum( ' + r.json[n + '_sum'] + ' )';\n        }\n        if(month[1] > m + 2 && month[1] < m + 7 && !t){\n            return '<span style=\"color:red\">MUST FILL IN (' + est + ')</span>';\n        }\n        return String.format('{0}',t); \n    }\n    */\n    \n    var s = _this.wgrid.getSelectionModel().getSelected();\n    \n    // forecast - item level \n    \n    \n    if(r.data.type == 'confirm' && s.data.cust_id < 0 && v){\n        return String.format('SUM ( {0} )',v); \n    } \n    \n    if(r.data.type == 'percentage' && v){\n        return  String.format('<span style=\"color:green\">{0}%</span>', Roo.util.Format.number(v,2));\n    } \n    \n    if(r.data.type == 'predicted' && v < 0){\n        return  String.format('<span style=\"color:red\">{0}</span>', 'BAD GUESS');\n    }\n    \n    \n    return String.format('{0}',v); \n\n}\n",
465                                     "|xns": "Roo.grid",
466                                     "items": [
467                                         {
468                                             "listeners": {
469                                                 "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var rec = _this.grid.getSelectionModel().getSelected();\n    var s = _this.wgrid.getSelectionModel().getSelected();\n    \n    if(!_this.grid || !rec || !s){\n        this.removeAll();\n        return;\n    }\n    \n    o.params._detailView = 1;\n    o.params._item_id = rec.data.item_id;\n    o.params._in_cust_id = (s.data.cust_id < 0) ? 0 : s.data.cust_id;\r\n    o.params._is_all_buyers = (s.data.view_type) == 'All' ? 1 : 0;\n    \r\n}"
470                                             },
471                                             "*prop": "dataSource",
472                                             "remoteSort": true,
473                                             "xtype": "Store",
474                                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
475                                             "|xns": "Roo.data",
476                                             "items": [
477                                                 {
478                                                     "*prop": "proxy",
479                                                     "method": "GET",
480                                                     "xtype": "HttpProxy",
481                                                     "|url": "baseURL + '/Roo/Salesforecast.php'",
482                                                     "|xns": "Roo.data"
483                                                 },
484                                                 {
485                                                     "*prop": "reader",
486                                                     "id": "id",
487                                                     "root": "data",
488                                                     "totalProperty": "total",
489                                                     "xtype": "JsonReader",
490                                                     "|fields": "[\n    {\n        'name': 'total_1',\n        'type': 'int'\n    },\n    {\n        'name': 'total_2',\n        'type': 'int'\n    },\n    {\n        'name': 'total_3',\n        'type': 'int'\n    },\n    {\n        'name': 'total_4',\n        'type': 'int'\n    },\n    {\n        'name': 'total_5',\n        'type': 'int'\n    },\n    {\n        'name': 'total_6',\n        'type': 'int'\n    },\n    {\n        'name': 'total_7',\n        'type': 'int'\n    },\n    {\n        'name': 'total_8',\n        'type': 'int'\n    },\n    {\n        'name': 'total_9',\n        'type': 'int'\n    },\n    {\n        'name': 'total_10',\n        'type': 'int'\n    },\n    {\n        'name': 'total_11',\n        'type': 'int'\n    },\n    {\n        'name': 'total_12',\n        'type': 'int'\n    },\n    {\n        'name': 'type',\n        'type': 'string'\n    },\n    {\n        'name': 'year_text',\n        'type': 'string'\n    },\n    {\n        'name': 'year',\n        'type': 'int'\n    }\n]",
491                                                     "|xns": "Roo.data"
492                                                 }
493                                             ]
494                                         },
495                                         {
496                                             "|xns": "Roo",
497                                             "xtype": "Toolbar",
498                                             "*prop": "toolbar",
499                                             "items": [
500                                                 {
501                                                     "|xns": "Roo.Toolbar",
502                                                     "xtype": "Fill"
503                                                 },
504                                                 {
505                                                     "listeners": {
506                                                         "click": "function (_self, e)\n{\n    var d = new Date();\n    var m = d.getMonth(); // getMonth -> 0-11\n    var y = new Date().getFullYear();\n    \n    var salesforecasts = [];\n    var est = 0;\n    var salesforecast_id = 0;\n    var qty = 0;\n    var rec = _this.grid.getSelectionModel().getSelected();\r\n    var s = _this.wgrid.getSelectionModel().getSelected();\n    if(!rec || !s){\n        Roo.Msg.alert(\"Error\",\"Please select a item\");\n        return;\n    }\n    if(rec.data.itemsrc_active * 1 < 1 ){\n        Roo.Msg.alert(\"Error\",\"The itemsrc is not active!\");\n        return;\n    }\n    if(s.data.cust_id < 0){\n        Roo.Msg.alert(\"Error\",\"Auto Fill Just happen on company level, please select a company!\");\n        return;\n    }\n\n    for(var i = 3; i < 13 - m; i++){ //  current month and the next month are not able to edit.\n    \n        var salesforecast = {};\n        \n        salesforecast_id = _this.sgrid.ds.getAt(3).json['total_' + (m + i) + '_salesforecast_id']; // check existing or not ???\n        est = _this.sgrid.ds.getAt(2).json['total_' + (m + i)]; // estimated qty!\n        qty = _this.sgrid.ds.getAt(3).json['total_' + (m + i)]; // existing qty!\n        \n        salesforecast['month'] = m + i; // period month\n        salesforecast['year'] = y; // period year\n        \n        salesforecast['salesforecast_id'] = (salesforecast_id * 1 > 0) ? salesforecast_id : 0; // update or insert ???\n        salesforecast['salesforecast_qty'] = (qty != 0) ? qty : est; // if we have entried in this period. do not use the estimated\n        \n        salesforecast['_item_id'] = rec.data.item_id;\n        \n        salesforecast['salesforecast_cust_id'] = s.data.cust_id;\n        \n        salesforecast['salesforecast_is_all_buyers'] = 0;\n        \n        salesforecasts.push((salesforecast)); \n    }\n    \n    if(!salesforecasts.length){\n        return;\n    }\n    new Pman.Request({\n        url : baseURL + '/Roo/Salesforecast.php',\n        method :'POST',\n        params : {\n            _group_data : Roo.encode(salesforecasts)\n            \n        },\n        success : function() {\n           \n            _this.sgrid.footer.onClick('first');\n            \n        }\n    });\n    \n \n}"
507                                                     },
508                                                     "text": "Auto Fill  (This Year)",
509                                                     "xtype": "Button",
510                                                     "|xns": "Roo.Toolbar"
511                                                 }
512                                             ]
513                                         },
514                                         {
515                                             "*prop": "footer",
516                                             "xtype": "PagingToolbar",
517                                             "pageSize": 25,
518                                             "displayInfo": true,
519                                             "displayMsg": "Displaying Groups{0} - {1} of {2}",
520                                             "emptyMsg": "No Groups found",
521                                             "|xns": "Roo"
522                                         },
523                                         {
524                                             "*prop": "colModel[]",
525                                             "dataIndex": "year_text",
526                                             "header": "Scenario / Month",
527                                             "width": 200,
528                                             "xtype": "ColumnModel",
529                                             "|renderer": "function(v) { return String.format('{0}', v); }",
530                                             "|xns": "Roo.grid"
531                                         },
532                                         {
533                                             "*prop": "colModel[]",
534                                             "dataIndex": "total_1",
535                                             "header": "Jan",
536                                             "width": 100,
537                                             "xtype": "ColumnModel",
538                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
539                                             "|xns": "Roo.grid",
540                                             "items": [
541                                                 {
542                                                     "|xns": "Roo.grid",
543                                                     "xtype": "GridEditor",
544                                                     "*prop": "editor",
545                                                     "items": [
546                                                         {
547                                                             "*prop": "field",
548                                                             "allowDecimals": false,
549                                                             "xtype": "NumberField",
550                                                             "|xns": "Roo.form"
551                                                         }
552                                                     ]
553                                                 }
554                                             ]
555                                         },
556                                         {
557                                             "*prop": "colModel[]",
558                                             "dataIndex": "total_2",
559                                             "header": "Feb",
560                                             "width": 100,
561                                             "xtype": "ColumnModel",
562                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
563                                             "|xns": "Roo.grid",
564                                             "items": [
565                                                 {
566                                                     "|xns": "Roo.grid",
567                                                     "xtype": "GridEditor",
568                                                     "*prop": "editor",
569                                                     "items": [
570                                                         {
571                                                             "*prop": "field",
572                                                             "allowDecimals": false,
573                                                             "xtype": "NumberField",
574                                                             "|xns": "Roo.form"
575                                                         }
576                                                     ]
577                                                 }
578                                             ]
579                                         },
580                                         {
581                                             "*prop": "colModel[]",
582                                             "dataIndex": "total_3",
583                                             "header": "Mar",
584                                             "width": 100,
585                                             "xtype": "ColumnModel",
586                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
587                                             "|xns": "Roo.grid",
588                                             "items": [
589                                                 {
590                                                     "|xns": "Roo.grid",
591                                                     "xtype": "GridEditor",
592                                                     "*prop": "editor",
593                                                     "items": [
594                                                         {
595                                                             "*prop": "field",
596                                                             "allowDecimals": false,
597                                                             "xtype": "NumberField",
598                                                             "|xns": "Roo.form"
599                                                         }
600                                                     ]
601                                                 }
602                                             ]
603                                         },
604                                         {
605                                             "*prop": "colModel[]",
606                                             "dataIndex": "total_4",
607                                             "header": "Apr",
608                                             "width": 100,
609                                             "xtype": "ColumnModel",
610                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
611                                             "|xns": "Roo.grid",
612                                             "items": [
613                                                 {
614                                                     "|xns": "Roo.grid",
615                                                     "xtype": "GridEditor",
616                                                     "*prop": "editor",
617                                                     "items": [
618                                                         {
619                                                             "*prop": "field",
620                                                             "allowDecimals": false,
621                                                             "xtype": "NumberField",
622                                                             "|xns": "Roo.form"
623                                                         }
624                                                     ]
625                                                 }
626                                             ]
627                                         },
628                                         {
629                                             "*prop": "colModel[]",
630                                             "dataIndex": "total_5",
631                                             "header": "May",
632                                             "width": 100,
633                                             "xtype": "ColumnModel",
634                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
635                                             "|xns": "Roo.grid",
636                                             "items": [
637                                                 {
638                                                     "|xns": "Roo.grid",
639                                                     "xtype": "GridEditor",
640                                                     "*prop": "editor",
641                                                     "items": [
642                                                         {
643                                                             "*prop": "field",
644                                                             "allowDecimals": false,
645                                                             "xtype": "NumberField",
646                                                             "|xns": "Roo.form"
647                                                         }
648                                                     ]
649                                                 }
650                                             ]
651                                         },
652                                         {
653                                             "*prop": "colModel[]",
654                                             "dataIndex": "total_6",
655                                             "header": "Jun",
656                                             "width": 100,
657                                             "xtype": "ColumnModel",
658                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
659                                             "|xns": "Roo.grid",
660                                             "items": [
661                                                 {
662                                                     "|xns": "Roo.grid",
663                                                     "xtype": "GridEditor",
664                                                     "*prop": "editor",
665                                                     "items": [
666                                                         {
667                                                             "*prop": "field",
668                                                             "allowDecimals": false,
669                                                             "xtype": "NumberField",
670                                                             "|xns": "Roo.form"
671                                                         }
672                                                     ]
673                                                 }
674                                             ]
675                                         },
676                                         {
677                                             "*prop": "colModel[]",
678                                             "dataIndex": "total_7",
679                                             "header": "Jul",
680                                             "width": 100,
681                                             "xtype": "ColumnModel",
682                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
683                                             "|xns": "Roo.grid",
684                                             "items": [
685                                                 {
686                                                     "|xns": "Roo.grid",
687                                                     "xtype": "GridEditor",
688                                                     "*prop": "editor",
689                                                     "items": [
690                                                         {
691                                                             "*prop": "field",
692                                                             "allowDecimals": false,
693                                                             "xtype": "NumberField",
694                                                             "|xns": "Roo.form"
695                                                         }
696                                                     ]
697                                                 }
698                                             ]
699                                         },
700                                         {
701                                             "*prop": "colModel[]",
702                                             "dataIndex": "total_8",
703                                             "header": "Aug",
704                                             "width": 100,
705                                             "xtype": "ColumnModel",
706                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
707                                             "|xns": "Roo.grid",
708                                             "items": [
709                                                 {
710                                                     "|xns": "Roo.grid",
711                                                     "xtype": "GridEditor",
712                                                     "*prop": "editor",
713                                                     "items": [
714                                                         {
715                                                             "*prop": "field",
716                                                             "allowDecimals": false,
717                                                             "xtype": "NumberField",
718                                                             "|xns": "Roo.form"
719                                                         }
720                                                     ]
721                                                 }
722                                             ]
723                                         },
724                                         {
725                                             "*prop": "colModel[]",
726                                             "dataIndex": "total_9",
727                                             "header": "Sep",
728                                             "width": 100,
729                                             "xtype": "ColumnModel",
730                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
731                                             "|xns": "Roo.grid",
732                                             "items": [
733                                                 {
734                                                     "|xns": "Roo.grid",
735                                                     "xtype": "GridEditor",
736                                                     "*prop": "editor",
737                                                     "items": [
738                                                         {
739                                                             "*prop": "field",
740                                                             "allowDecimals": false,
741                                                             "xtype": "NumberField",
742                                                             "|xns": "Roo.form"
743                                                         }
744                                                     ]
745                                                 }
746                                             ]
747                                         },
748                                         {
749                                             "*prop": "colModel[]",
750                                             "dataIndex": "total_10",
751                                             "header": "Oct",
752                                             "width": 100,
753                                             "xtype": "ColumnModel",
754                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
755                                             "|xns": "Roo.grid",
756                                             "items": [
757                                                 {
758                                                     "|xns": "Roo.grid",
759                                                     "xtype": "GridEditor",
760                                                     "*prop": "editor",
761                                                     "items": [
762                                                         {
763                                                             "*prop": "field",
764                                                             "allowDecimals": false,
765                                                             "xtype": "NumberField",
766                                                             "|xns": "Roo.form"
767                                                         }
768                                                     ]
769                                                 }
770                                             ]
771                                         },
772                                         {
773                                             "*prop": "colModel[]",
774                                             "dataIndex": "total_11",
775                                             "header": "Nov",
776                                             "width": 100,
777                                             "xtype": "ColumnModel",
778                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
779                                             "|xns": "Roo.grid",
780                                             "items": [
781                                                 {
782                                                     "|xns": "Roo.grid",
783                                                     "xtype": "GridEditor",
784                                                     "*prop": "editor",
785                                                     "items": [
786                                                         {
787                                                             "*prop": "field",
788                                                             "allowDecimals": false,
789                                                             "xtype": "NumberField",
790                                                             "|xns": "Roo.form"
791                                                         }
792                                                     ]
793                                                 }
794                                             ]
795                                         },
796                                         {
797                                             "*prop": "colModel[]",
798                                             "dataIndex": "total_12",
799                                             "header": "Dec",
800                                             "width": 100,
801                                             "xtype": "ColumnModel",
802                                             "|renderer": "function(v,x,r) \n{\n   return _this.sgrid.formatcol(v,r,this.name);\n}",
803                                             "|xns": "Roo.grid",
804                                             "items": [
805                                                 {
806                                                     "|xns": "Roo.grid",
807                                                     "xtype": "GridEditor",
808                                                     "*prop": "editor",
809                                                     "items": [
810                                                         {
811                                                             "*prop": "field",
812                                                             "allowDecimals": false,
813                                                             "xtype": "NumberField",
814                                                             "|xns": "Roo.form"
815                                                         }
816                                                     ]
817                                                 }
818                                             ]
819                                         },
820                                         {
821                                             "*prop": "colModel[]",
822                                             "dataIndex": "total_year",
823                                             "header": "Total",
824                                             "width": 100,
825                                             "xtype": "ColumnModel",
826                                             "|renderer": "function(v) { return String.format('{0}', v); }",
827                                             "|xns": "Roo.grid"
828                                         }
829                                     ]
830                                 }
831                             ]
832                         }
833                     ]
834                 }
835             ]
836         }
837     ],
838     "permname": "",
839     "modOrder": "600"
840 }