Pman.Tab.XtupleSalesOrder.bjs
[Pman.Xtuple] / Pman.Tab.XtupleSalesOrder.bjs
1 {
2     "id": "roo-file-57",
3     "name": "Pman.Tab.XtupleSalesOrder",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesOrder.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n    this.setTitle('Sales Orders (' + Pman.Login.authUser.dbname +')');\n}"
11             },
12             "region": "center",
13             "title": "Sales Orders",
14             "xtype": "NestedLayoutPanel",
15             "|xns": "Roo",
16             "items": [
17                 {
18                     "xtype": "BorderLayout",
19                     "|xns": "Roo",
20                     "*prop": "layout",
21                     "items": [
22                         {
23                             "xtype": "LayoutRegion",
24                             "|xns": "Roo",
25                             "*prop": "west",
26                             "width": "200",
27                             "split": true,
28                             "title": "Search"
29                         },
30                         {
31                             "xtype": "LayoutRegion",
32                             "|xns": "Roo",
33                             "*prop": "center"
34                         },
35                         {
36                             "listeners": {
37                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
38                             },
39                             ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
40                             "background": true,
41                             "fitContainer": true,
42                             "fitToframe": true,
43                             "region": "center",
44                             "tableName": "cohead",
45                             "title": "cohead",
46                             "xtype": "GridPanel",
47                             "|xns": "Roo",
48                             "items": [
49                                 {
50                                     "listeners": {
51                                         "|render": "function() \n{\n    _this.grid = this; \n    try { \n        _this.dialog = Pman.Dialog.XtupleSalesOrder;\n    } catch(e) {}\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
52                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('refresh');\n        Pman.Tab.XtupleSales.grid.footer.onClick('first');\n    }); \n}\n"
53                                     },
54                                     "*prop": "grid",
55                                     "autoExpandColumn": "cohead_cust_id_cust_name",
56                                     "loadMask": true,
57                                     "xtype": "Grid",
58                                     "|xns": "Roo.grid",
59                                     "items": [
60                                         {
61                                             "listeners": {
62                                                 "beforeload": "function (_self, options)\n{\n    var vl;\n    try { \n         vl = _this.form.getFieldValues();\n     } catch (e) {\n        vl = {};\n     }\n\n     \n     \n    for(var x in vl) {\n        if (!(new String(vl[x])).length) {\n            continue;\n        }\n        options.params[x] = vl[x];\n        \n    }\n    try {\n        if (options.params['query[cohead_number]'].length) {\n            options.params.viewtype = 'REALALL';\n        }\n    } catch (e) {}\n}"
63                                             },
64                                             "*prop": "dataSource",
65                                             ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
66                                             "remoteSort": true,
67                                             "xtype": "Store",
68                                             "|sortInfo": "{ field : 'cohead_orderdate', direction: 'DESC' }",
69                                             "|xns": "Roo.data",
70                                             "items": [
71                                                 {
72                                                     "*prop": "proxy",
73                                                     "method": "GET",
74                                                     "timeout": 60000,
75                                                     "xtype": "HttpProxy",
76                                                     "|url": "baseURL + '/Roo/cohead.php'",
77                                                     "|xns": "Roo.data"
78                                                 },
79                                                 {
80                                                     "|xns": "Roo.data",
81                                                     "xtype": "JsonReader",
82                                                     "totalProperty": "total",
83                                                     "root": "data",
84                                                     ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
85                                                     "*prop": "reader",
86                                                     "id": "id",
87                                                     "|fields": "[\n    {\n        'name': 'cohead_number',\n        'type': 'string'\n    },\n    {\n        'name': 'cohead_cust_id_cust_name',\n        'type': 'string'\n    },\n    {\n        'name': 'cohead_custponumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cohead_type'\n    },\n    {\n        'name': 'cohead_orderdate',\n        'type': 'date'\n    },\n    {\n        'name': 'cohead_shipto_id_shipto_name',\n        'type': 'string'\n    },\n    {\n        'name': 'cohead_terms_id_terms_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohead_curr_id_curr_name',\n        'type': 'string'\n    }\n]"
88                                                 }
89                                             ]
90                                         },
91                                         {
92                                             "*prop": "footer",
93                                             "xtype": "PagingToolbar",
94                                             "pageSize": 25,
95                                             "displayInfo": true,
96                                             "displayMsg": "Displaying cohead{0} - {1} of {2}",
97                                             "emptyMsg": "No cohead found",
98                                             "|xns": "Roo",
99                                             "items": [
100                                                 {
101                                                     "listeners": {
102                                                         "click": "function ()\n{\n    new Pman.Download({\n        grid : _this.grid\n    });     \n   \n}"
103                                                     },
104                                                     "cls": "x-btn-text-icon",
105                                                     "text": "Download Results",
106                                                     "xtype": "Button",
107                                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
108                                                     "|xns": "Roo.Toolbar"
109                                                 }
110                                             ]
111                                         },
112                                         {
113                                             "*prop": "toolbar",
114                                             "xtype": "Toolbar",
115                                             "|xns": "Roo",
116                                             "items": [
117                                                 {
118                                                     "listeners": {
119                                                         "click": "function (_self, e)\n{\n Pman.Dialog.XtupleInvHistory.show({\n \n \n    });\n}"
120                                                     },
121                                                     "text": "Quick Stock Check",
122                                                     "xtype": "Button",
123                                                     "|xns": "Roo.Toolbar"
124                                                 },
125                                                 {
126                                                     "listeners": {
127                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Magento',\n            timeout : 90000\n        \n       },\n       function (data) {\n            Roo.MessageBox.alert(\"Notice\", data); \n            _this.grid.footer.onClick('first');\n\n       }\n   );\n}"
128                                                     },
129                                                     "text": "Magento Upload",
130                                                     "xtype": "Button",
131                                                     "|xns": "Roo.Toolbar"
132                                                 },
133                                                 {
134                                                     "hidden": true,
135                                                     "text": "Magento Upload",
136                                                     "xtype": "Button",
137                                                     "|xns": "Roo.Toolbar",
138                                                     "items": [
139                                                         {
140                                                             "|xns": "Roo.menu",
141                                                             "xtype": "Menu",
142                                                             "*prop": "menu",
143                                                             "items": [
144                                                                 {
145                                                                     "listeners": {
146                                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/MagentoOld',\n            timeout : 90000\n            \n        \n       },\n       function (data) {\n            Roo.MessageBox.alert(\"Notice\", data); \n            _this.grid.footer.onClick('first');\n          /*  var msg = [];\n           \n            if (data.updated) {\n                msg.push(\"Updated \" + data.updated + \" Products(s)\");\n            }            \n            if (data.inserted) {\n                msg.push(\"Added \" + data.inserted + \" Products(s)\");\n            }\n            if (data.skipped) {\n                msg.push(\"Skipped \" + data.skipped);\n            }\n            \n            if (!msg.length) {\n                msg.push(\"No data changed\");\n            }\n            Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\")); */\n\n       }\n   );\n}"
147                                                                     },
148                                                                     "text": "Upload Magento File (Old Format)",
149                                                                     "xtype": "Item",
150                                                                     "|xns": "Roo.menu"
151                                                                 },
152                                                                 {
153                                                                     "listeners": {
154                                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Magento',\n            timeout : 90000\n        \n       },\n       function (data) {\n            Roo.MessageBox.alert(\"Notice\", data); \n            _this.grid.footer.onClick('first');\n\n       }\n   );\n}"
155                                                                     },
156                                                                     "text": "Upload Magento File (New Format)",
157                                                                     "xtype": "Item",
158                                                                     "|xns": "Roo.menu"
159                                                                 }
160                                                             ]
161                                                         }
162                                                     ]
163                                                 },
164                                                 {
165                                                     "cls": "x-btn-text-icon",
166                                                     "text": "Reports",
167                                                     "xtype": "Button",
168                                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
169                                                     "|xns": "Roo.Toolbar",
170                                                     "items": [
171                                                         {
172                                                             "|xns": "Roo.menu",
173                                                             "xtype": "Menu",
174                                                             "*prop": "menu",
175                                                             "items": [
176                                                                 {
177                                                                     "text": "AR Aging",
178                                                                     "xtype": "Item",
179                                                                     "|xns": "Roo.menu",
180                                                                     "items": [
181                                                                         {
182                                                                             "|xns": "Roo.menu",
183                                                                             "xtype": "Menu",
184                                                                             "*prop": "menu",
185                                                                             "items": [
186                                                                                 {
187                                                                                     "listeners": {
188                                                                                         "click": "function (_self, e)\n{\n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n    if(!from || !to){\n        Roo.Msg.alert('Error', 'Please select a date range for the report');\n        return;\n    }\n    \n    var params  =   {\n        template: 'ARAging',\n        filename : 'ARAging-' + to.format('Y-m-d'),\n        'param[0]':   \"startDate:string='\" + from.format('Y-m-d') + \"'\",\n        'param[1]':   \"relDate:string='\" + to.format('Y-m-d') + \"'\",\n        'param[2]':   \"useDocDate:number=1\"\n    };\n    var cust_id =     _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 > 0) {\n        params['param[3]'] = 'cust_id:number=' + cust_id;\n    }\n \n    new Pman.Download({\n      url : baseURL + '/Xtuple/Print',\n      params :   params,\n      method : 'GET'\n    });\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
189                                                                                     },
190                                                                                     "text": "as PDF",
191                                                                                     "xtype": "Item",
192                                                                                     "|xns": "Roo.menu"
193                                                                                 },
194                                                                                 {
195                                                                                     "listeners": {
196                                                                                         "click": "function (_self, e)\n{\n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n   \n    \n    var params = {\n        '_group' : 'arAging',\n        '_name' : 'bydate',\n        'limit' : 99999,\n        \n          'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n        'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n     \n        \n        \n        'useDocDate:text' : 'TRUE',\n        'csvTitles' : '*',\n        'csvCols' : '*'\n    };\n    \n    \n    var cust_id =     _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 > 0) {\n        params['cust_id:number'] = cust_id;\n    }\n    \n    new Pman.Download({\r\n      url : baseURL + '/Roo/Metasql',\r\n      params :   params,\r\n      method : 'GET'\r\n    });\r\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\r\n    \r\n}"
197                                                                                     },
198                                                                                     "text": "as Excel",
199                                                                                     "xtype": "Item",
200                                                                                     "|xns": "Roo.menu"
201                                                                                 },
202                                                                                 {
203                                                                                     "listeners": {
204                                                                                         "click": "function (_self, e)\n{\n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n   \n    \n    var params = {\n        '_group' : 'arAging',\n        '_name' : 'summary',\n        'limit' : 99999,\n        \n        \n      \n        'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n        'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n     \n        \n        'useDocDate:text' : 'TRUE',\n        'csvTitles' : '*',\n        'csvCols' : '*'\n    };\n    \n    var cust_id =     _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 > 0) {\n        params['cust_id:number'] = cust_id;\n    }\n    \n    new Pman.Download({\r\n      url : baseURL + '/Roo/Metasql',\r\n      params :   params,\r\n      method : 'GET'\r\n    });\r\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\r\n    \r\n}"
205                                                                                     },
206                                                                                     "text": "Summary Excel",
207                                                                                     "xtype": "Item",
208                                                                                     "|xns": "Roo.menu"
209                                                                                 }
210                                                                             ]
211                                                                         }
212                                                                     ]
213                                                                 },
214                                                                 {
215                                                                     "text": "Customer History",
216                                                                     "xtype": "Item",
217                                                                     "|xns": "Roo.menu",
218                                                                     "items": [
219                                                                         {
220                                                                             "|xns": "Roo.menu",
221                                                                             "xtype": "Menu",
222                                                                             "*prop": "menu",
223                                                                             "items": [
224                                                                                 {
225                                                                                     "listeners": {
226                                                                                         "click": "function (_self, e)\n{\n    var cust_id = _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 < 1) {\n        Roo.Msg.alert('Error', 'Please select a customer');\n        return;\n    }\n    \n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n    if(!from || !to){\n        Roo.Msg.alert('Error', 'Please select a date range for the report');\n        return;\n    }\n    \n    var params  =   {\n        template: 'customer_ar_history',\n        filename : 'customer_ar_history-' + to.format('Y-m-d'),\n        'param[0]':   \"startDate:string='\" + from.format('Y-m-d') + \"'\",\n        'param[1]':   \"endDate:string='\" + to.format('Y-m-d') + \"'\",\n        'param[2]':   \"cust_id:number=\" + cust_id\n    };\n         \n    new Pman.Download({\n        url : baseURL + '/Xtuple/Print',\n        params :   params,\n        method : 'GET'\n    });\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
227                                                                                     },
228                                                                                     "text": "as PDF",
229                                                                                     "xtype": "Item",
230                                                                                     "|xns": "Roo.menu"
231                                                                                 },
232                                                                                 {
233                                                                                     "listeners": {
234                                                                                         "click": "function (_self, e)\n{\n    var cust_id = _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 < 1) {\n        Roo.Msg.alert('Error', 'Please select a customer');\n        return;\n    }\n    \n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n  \n    \n    var params = {\n        '_group' : 'customerHistory',\n        '_name' : 'detail',\n        'limit' : 99999,\n        \n        'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n        'endDate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n       \n        'cust_id:number' : cust_id,\n        'csvTitles' : '*',\n        'csvCols' : '*'\n    };\n    \n    \n    new Pman.Download({\r\n      url : baseURL + '/Roo/Metasql',\r\n      params :   params,\r\n      method : 'GET'\r\n    });\r\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
235                                                                                     },
236                                                                                     "text": "as Excel",
237                                                                                     "xtype": "Item",
238                                                                                     "|xns": "Roo.menu"
239                                                                                 }
240                                                                             ]
241                                                                         }
242                                                                     ]
243                                                                 },
244                                                                 {
245                                                                     "text": "Customer Statement",
246                                                                     "xtype": "Item",
247                                                                     "|xns": "Roo.menu",
248                                                                     "items": [
249                                                                         {
250                                                                             "|xns": "Roo.menu",
251                                                                             "xtype": "Menu",
252                                                                             "*prop": "menu",
253                                                                             "items": [
254                                                                                 {
255                                                                                     "listeners": {
256                                                                                         "click": "function (_self, e)\n{\n    var cust_id = _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 < 1) {\n        Roo.Msg.alert('Error', 'Please select a customer');\n        return;\n    }\n    \n    var from = _this.form.findField('_fromdate').getValue();\n    var to = _this.form.findField('_todate').getValue();\n    \n \n     \n    var params  =   {\n        template: 'customer_ar_statement',\n        filename : 'customer_ar_statement-' +(to ? to.format('Y-m-d') : '2100-01-01'),\n        'param[0]':   \"startDate:string='\" + (from ? from.format('Y-m-d') : '2000-01-01') + \"'\",\n        'param[1]':   \"asofdate:string='\" + (to ? to.format('Y-m-d') : '2100-01-01')+ \"'\",\n        'param[2]':   \"cust_id:number=\" + cust_id\n    };\n    \n    new Pman.Download({\n        url : baseURL + '/Xtuple/Print',\n        params :   params,\n        method : 'GET'\n    });\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
257                                                                                     },
258                                                                                     "text": "as PDF",
259                                                                                     "xtype": "Item",
260                                                                                     "|xns": "Roo.menu"
261                                                                                 },
262                                                                                 {
263                                                                                     "listeners": {
264                                                                                         "click": "function (_self, e)\n{\n    var cust_id = _this.form.findField('cohead_cust_id').getValue();\n    if (cust_id * 1 < 1) {\n        Roo.Msg.alert('Error', 'Please select a customer');\n        return;\n    }\n    \n   var from = _this.form.findField('_fromdate').getValue();\n   var to = _this.form.findField('_todate').getValue();\n\n    //if(!from || !to){\n    //    Roo.Msg.alert('Error', 'Please select a date range for the report');\n    //    return;\n    //}\n    \n    var params = {\n        '_group' : 'customerStatement',\n        '_name' : 'detail',\n        'limit' : 99999,\n        'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,\n        'asofdate:text' : to ? to.format('Y-m-d') : '2100-01-01',\n        'cust_id:number' : cust_id,\n        'csvTitles' : '*',\n        'csvCols' : '*'\n    };\n\n    \n    new Pman.Download({\r\n      url : baseURL + '/Roo/Metasql',\r\n      params :   params,\r\n      method : 'GET'\r\n    });\r\n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
265                                                                                     },
266                                                                                     "text": "as Excel",
267                                                                                     "xtype": "Item",
268                                                                                     "|xns": "Roo.menu"
269                                                                                 }
270                                                                             ]
271                                                                         }
272                                                                     ]
273                                                                 },
274                                                                 {
275                                                                     "listeners": {
276                                                                         "click": "function (_self, e)\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select an order\");\n        return;\n    }\n    \n    new Pman.Download({\r\n      url : baseURL + '/Xtuple/Reports/SalesOrderBookingDetail',\r\n      params :   {\n        cohead_id : s.data.cohead_id\n      },\r\n      method : 'GET'\r\n    });\r\n    \n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
277                                                                     },
278                                                                     "text": "Order Booking Detail (Send by Email)",
279                                                                     "xtype": "Item",
280                                                                     "|xns": "Roo.menu"
281                                                                 }
282                                                             ]
283                                                         }
284                                                     ]
285                                                 },
286                                                 {
287                                                     "listeners": {
288                                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select an order to close\");\n        return;\n    }\n    \n    if(s.data.cohead_status == 'C'){\n        Roo.MessageBox.alert(\"Error\", \"This order has been closed\");\n        return;\n    }\n    \n    new Pman.Request({\n        url: baseURL + '/Roo/cohead',\n        method : 'POST',\n        params :  {\n            cohead_id : s.data.cohead_id,\n            _close : 1\n        },\n        mask : 'Sending',\n        success : function()\n        {\n            Roo.MessageBox.alert(\"Notice\", \"DONE\");\n            _this.grid.footer.onClick('first');\n        }\n   });\n    \n}\n"
289                                                     },
290                                                     "cls": "x-btn-text-icon",
291                                                     "text": "Complete and Close",
292                                                     "xtype": "Button",
293                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
294                                                     "|xns": "Roo.Toolbar"
295                                                 },
296                                                 {
297                                                     "listeners": {
298                                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
299                                                     },
300                                                     "cls": "x-btn-text-icon",
301                                                     "text": "Email to warehouse",
302                                                     "xtype": "Button",
303                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
304                                                     "|xns": "Roo.Toolbar"
305                                                 },
306                                                 {
307                                                     "xtype": "Fill",
308                                                     "|xns": "Roo.Toolbar"
309                                                 },
310                                                 {
311                                                     "listeners": {
312                                                         "|click": "function()\n{\n   // check if the login in user have more than 25 open orders..\n   // if yes, warning...\n   new Pman.Request({\n        url : baseURL + '/Roo/cohead.php',\n        method :'GET',\n        params : {\n            viewtype : 'MYOPEN',\n            _count_order : 1 // make the search faster!\n        },\n        success : function(res) {\n            if(res.data[0].order_totals * 1 > 25){\n                Roo.MessageBox.alert(\"Warning\", \"Can you please close old orders before creating new ones\");\n            }\n        }\n    });\n   \n   Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
313                                                     },
314                                                     "cls": "x-btn-text-icon",
315                                                     "text": "Add",
316                                                     "xtype": "Button",
317                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
318                                                     "|xns": "Roo.Toolbar"
319                                                 },
320                                                 {
321                                                     "listeners": {
322                                                         "|click": "function()\n{\n   var s = _this.grid.getSelectionModel().getSelected();\n   if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select an order to copy\");\n        return;\n   }\n   \n   \n   Pman.Dialog.XtupleSalesOrderCopy.show( { _copy_cohead_id : s.data.cohead_id } , function(data) {\n   \n        // get the id from the data, then \n   \n        _this.grid.footer.onClick('first');\n        Pman.Tab.XtupleSales.grid.footer.onClick('first');\n        // get the id from the data, then start editing it..\n        Roo.log(data);\n            _this.dialog.show(data,  function() {\n            _this.grid.footer.onClick('refresh');\n            Pman.Tab.XtupleSales.grid.footer.onClick('first');\n        }); \n        \n   }); \n}\n"
323                                                     },
324                                                     "cls": "x-btn-text-icon",
325                                                     "text": "Copy",
326                                                     "xtype": "Button",
327                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
328                                                     "|xns": "Roo.Toolbar"
329                                                 }
330                                             ]
331                                         },
332                                         {
333                                             "*prop": "colModel[]",
334                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
335                                             "dataIndex": "cohead_orderdate",
336                                             "header": "Ordered",
337                                             "sortable": true,
338                                             "width": 75,
339                                             "xtype": "ColumnModel",
340                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
341                                             "|xns": "Roo.grid"
342                                         },
343                                         {
344                                             "*prop": "colModel[]",
345                                             "dataIndex": "cohead_targetdate",
346                                             "header": "Target Delivery",
347                                             "hidden": true,
348                                             "sortable": true,
349                                             "width": 75,
350                                             "xtype": "ColumnModel",
351                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
352                                             "|xns": "Roo.grid"
353                                         },
354                                         {
355                                             "*prop": "colModel[]",
356                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
357                                             "dataIndex": "cohead_salesrep_id_salesrep_name",
358                                             "header": "Staff IC.",
359                                             "sortable": true,
360                                             "width": 100,
361                                             "xtype": "ColumnModel",
362                                             "|renderer": "function(v,x,r) { \n\n    if (r.data.cohead_display_salesrep_id) {\n        return String.format('{0} ({1})', v, r.data.cohead_display_salesrep_id_salesrep_name);\n    }\n    return String.format('{0}', v );\n    \n    \n }",
363                                             "|xns": "Roo.grid"
364                                         },
365                                         {
366                                             "*prop": "colModel[]",
367                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"}",
368                                             "dataIndex": "cohead_number",
369                                             "header": "#order",
370                                             "sortable": true,
371                                             "width": 100,
372                                             "xtype": "ColumnModel",
373                                             "|renderer": "function(v,x,r) {\n\n     if (r.data.cohead_status == 'C') {\n          return String.format('<i qtip=\"closed\">{0}</i>', v); \n      }\n       if (r.data.cohead_status == 'X') {\n          return String.format('<s qtip=\"void\">{0}</s>', v); \n      }\n     return String.format('{0}', v); \n }",
374                                             "|xns": "Roo.grid"
375                                         },
376                                         {
377                                             "*prop": "colModel[]",
378                                             ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
379                                             "dataIndex": "cohead_cust_id_cust_number",
380                                             "header": "Customer#",
381                                             "sortable": true,
382                                             "width": 100,
383                                             "xtype": "ColumnModel",
384                                             "|renderer": "function(v) { return String.format('{0}', v); }",
385                                             "|xns": "Roo.grid"
386                                         },
387                                         {
388                                             "*prop": "colModel[]",
389                                             ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
390                                             "dataIndex": "cohead_cust_id_cust_name",
391                                             "header": "Customer",
392                                             "sortable": true,
393                                             "width": 200,
394                                             "xtype": "ColumnModel",
395                                             "|renderer": "function(v) { return String.format('{0}', v); }",
396                                             "|xns": "Roo.grid"
397                                         },
398                                         {
399                                             "*prop": "colModel[]",
400                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"}",
401                                             "dataIndex": "cohead_custponumber",
402                                             "header": "Cust. PO#",
403                                             "width": 50,
404                                             "xtype": "ColumnModel",
405                                             "|renderer": "function(v) { return String.format('{0}', v); }",
406                                             "|xns": "Roo.grid"
407                                         },
408                                         {
409                                             "*prop": "colModel[]",
410                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"}",
411                                             "dataIndex": "cohead_type",
412                                             "header": "Type",
413                                             "width": 50,
414                                             "xtype": "ColumnModel",
415                                             "|renderer": "function(v) { return String.format('{0}', v); }",
416                                             "|xns": "Roo.grid"
417                                         },
418                                         {
419                                             "*prop": "colModel[]",
420                                             "dataIndex": "cohead_src_locations",
421                                             "header": "From",
422                                             "width": 100,
423                                             "xtype": "ColumnModel",
424                                             "|renderer": "function(v) { return String.format('{0}', v); }",
425                                             "|xns": "Roo.grid"
426                                         },
427                                         {
428                                             "*prop": "colModel[]",
429                                             ".builderCfg": "{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"}",
430                                             "dataIndex": "cohead_shiptoaddress1",
431                                             "header": "Ship to",
432                                             "width": 200,
433                                             "xtype": "ColumnModel",
434                                             "|renderer": "function(v) { return String.format('{0}', v); }",
435                                             "|xns": "Roo.grid"
436                                         },
437                                         {
438                                             "*prop": "colModel[]",
439                                             ".builderCfg": "{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"}",
440                                             "dataIndex": "cohead_terms_id_terms_descrip",
441                                             "header": "Terms",
442                                             "width": 100,
443                                             "xtype": "ColumnModel",
444                                             "|renderer": "function(v) { return String.format('{0}', v); }",
445                                             "|xns": "Roo.grid"
446                                         },
447                                         {
448                                             "*prop": "colModel[]",
449                                             "align": "right",
450                                             "dataIndex": "cohead_total",
451                                             "header": "Total",
452                                             "width": 100,
453                                             "xtype": "ColumnModel",
454                                             "|renderer": "function(v,x,r) { \n    var ret =  String.format('{0} {1}',\n         r.data.cohead_curr_id_curr_name, v ?   parseFloat(v).toFixed(3) : '---'\n     ); \n     \n     if (parseInt(r.data.cohead_qtyordered)  != 0 && \n        parseInt(r.data.cohead_unshipped) == 0 && \n         parseInt(r.data.cohead_qtyunshipped) == 0 &&\n         parseInt(r.data.cohead_qtyuninvoiced) == 0 &&         \n          parseInt(r.data.cohead_unshipped) == 0 &&\n         parseInt(r.data.cohead_uninvoiced) == 0 \n     ) {\n        return ret;\n    }\n     \n     return String.format('<b style=\"color:red\" ' + \n            'qtip=\"Products: {3} ({4}) &lt;BR/&gt;Unshipped: {1} ({5})&lt;BR&gt;Uninvoiced: {2} ({6})\">{0}</b>',\n         ret, \n            r.data.cohead_unshipped, r.data.cohead_uninvoiced, r.data.cohead_subtotal,\n            r.data.cohead_qtyordered, r.data.cohead_qtyunshipped, r.data.cohead_qtyuninvoiced\n         );\n     \n }",
455                                             "|xns": "Roo.grid"
456                                         }
457                                     ]
458                                 }
459                             ]
460                         },
461                         {
462                             "background": false,
463                             "region": "west",
464                             "xtype": "ContentPanel",
465                             "|xns": "Roo",
466                             "items": [
467                                 {
468                                     "|xns": "Roo",
469                                     "xtype": "Toolbar",
470                                     "*prop": "toolbar",
471                                     "items": [
472                                         {
473                                             "|xns": "Roo.Toolbar",
474                                             "xtype": "Fill"
475                                         },
476                                         {
477                                             "listeners": {
478                                                 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
479                                             },
480                                             "cls": "x-btn-icon",
481                                             "xtype": "Button",
482                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
483                                             "|xns": "Roo.Toolbar"
484                                         },
485                                         {
486                                             "listeners": {
487                                                 "|click": "function (_self, e)\n{\n    _this.form.reset('');\n\n    \n    _this.grid.footer.onClick('first');\n}"
488                                             },
489                                             "cls": "x-btn-icon",
490                                             "xtype": "Button",
491                                             "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
492                                             "|xns": "Roo.Toolbar"
493                                         }
494                                     ]
495                                 },
496                                 {
497                                     "listeners": {
498                                         "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
499                                     },
500                                     "labelAlign": "top",
501                                     "method": "POST",
502                                     "style": "margin:5px;",
503                                     "xtype": "Form",
504                                     "|xns": "Roo.form",
505                                     "items": [
506                                         {
507                                             "listeners": {
508                                                 "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
509                                                 "|render": "function (_self)\n{\n  _this.viewtypeSel = _self;\n}"
510                                             },
511                                             "allowBlank": false,
512                                             "displayField": "value",
513                                             "editable": false,
514                                             "emptyText": "View type",
515                                             "fieldLabel": "View",
516                                             "forceSelection": true,
517                                             "listWidth": 200,
518                                             "loadingText": "Searching...",
519                                             "minChars": 2,
520                                             "name": "viewtype",
521                                             "pageSize": 20,
522                                             "qtip": "Select Action",
523                                             "queryParam": "query[action]",
524                                             "selectOnFocus": true,
525                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>",
526                                             "triggerAction": "all",
527                                             "typeAhead": true,
528                                             "value": "MYOPEN",
529                                             "valueField": "key",
530                                             "width": 150,
531                                             "xtype": "ComboBox",
532                                             "|xns": "Roo.form",
533                                             "items": [
534                                                 {
535                                                     "*prop": "store",
536                                                     "id": 0,
537                                                     "xtype": "SimpleStore",
538                                                     "|data": "[\n  [ 'MYOPEN', 'My Open orders' ],\n  [ 'MYCLOSED', 'My Closed orders' ],\n  [ 'MYALL', 'My orders (all)' ],    \n  [ 'MYVOID', 'My Voided orders' ],      \n  [ 'OPEN', 'All Open orders' ],\n  [ 'CLOSED', 'All Closed orders' ],\n  [ 'ALL', 'All orders' ],\n  [ 'VOID', 'Voided orders' ],\n  [ 'INCOMPLETE', 'Incomplete orders' ],  \n  [ 'DRAFTSHIP', 'Have Un-confirmed Shipments' ],\n//  [ 'SHIPPOSTBUG', 'Bugs with Posted transactions' ],  \n//  [ 'SHIPQTYBUG', 'Bugs with Shipment Qty' ] ,\n  [ 'FIFOBUG', 'Problems with FIFO' ] \n    \n]",
539                                                     "|fields": "[ 'key', 'value' ]",
540                                                     "|xns": "Roo.data"
541                                                 }
542                                             ]
543                                         },
544                                         {
545                                             "listeners": {
546                                                 "select": "function (combo, record, index)\n{\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
547                                                 "specialkey": "function (_self, e)\n{\n    //Roo.log(e.getKey());\n    if (e.getKey() == 13) {\n        (function() { _this.grid.footer.onClick('first'); }).defer(100);\n        e.stopEvent();\n        _this.rsearch = true;\n    }\n    \n}",
548                                                 "beforequery": "function (combo, query, forceAll, cancel, e)\n{\n \n   if( _this.rsearch) {\n        _this.rsearch =false;\n        return false;\n    }\n \n}"
549                                             },
550                                             "allowBlank": true,
551                                             "displayField": "cohead_number",
552                                             "editable": true,
553                                             "emptyText": "Select Order",
554                                             "fieldLabel": "Order #",
555                                             "forceSelection": false,
556                                             "listWidth": 400,
557                                             "loadingText": "Searching...",
558                                             "minChars": 2,
559                                             "name": "query[cohead_number]",
560                                             "pageSize": 20,
561                                             "qtip": "Select Order",
562                                             "queryParam": "query[cohead_number]",
563                                             "selectOnFocus": true,
564                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cohead_number}</b> </div>",
565                                             "triggerAction": "all",
566                                             "typeAhead": false,
567                                             "valueField": "cohead_number",
568                                             "width": 180,
569                                             "xtype": "ComboBox",
570                                             "|xns": "Roo.form",
571                                             "items": [
572                                                 {
573                                                     "listeners": {
574                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params['_columns'] = 'cohead_number';\n    // set more here\n}\n"
575                                                     },
576                                                     "*prop": "store",
577                                                     "remoteSort": true,
578                                                     "xtype": "Store",
579                                                     "|sortInfo": "{ direction : 'ASC', field: 'cohead_number' }",
580                                                     "|xns": "Roo.data",
581                                                     "items": [
582                                                         {
583                                                             "*prop": "proxy",
584                                                             "method": "GET",
585                                                             "xtype": "HttpProxy",
586                                                             "|url": "baseURL + '/Roo/cohead.php'",
587                                                             "|xns": "Roo.data"
588                                                         },
589                                                         {
590                                                             "*prop": "reader",
591                                                             "id": "cohead_number",
592                                                             "root": "data",
593                                                             "totalProperty": "total",
594                                                             "xtype": "JsonReader",
595                                                             "|fields": "[\"cohead_number\"]",
596                                                             "|xns": "Roo.data"
597                                                         }
598                                                     ]
599                                                 }
600                                             ]
601                                         },
602                                         {
603                                             "listeners": {
604                                                 "select": "function (combo, record, index)\n{\n       (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
605                                             },
606                                             "allowBlank": true,
607                                             "displayField": "cust_name",
608                                             "editable": true,
609                                             "emptyText": "Select custinfo",
610                                             "fieldLabel": "Customer",
611                                             "forceSelection": true,
612                                             "hiddenName": "cohead_cust_id",
613                                             "listWidth": 400,
614                                             "loadingText": "Searching...",
615                                             "minChars": 2,
616                                             "name": "cohead_cust_id_cust_name",
617                                             "pageSize": 20,
618                                             "qtip": "Select custinfo",
619                                             "queryParam": "query[cust_name]",
620                                             "selectOnFocus": true,
621                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b>  ({cust_number})</div>",
622                                             "triggerAction": "all",
623                                             "typeAhead": false,
624                                             "valueField": "cust_id",
625                                             "width": 180,
626                                             "xtype": "ComboBox",
627                                             "|xns": "Roo.form",
628                                             "items": [
629                                                 {
630                                                     "*prop": "store",
631                                                     "|xns": "Roo.data",
632                                                     "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
633                                                     "xtype": "Store",
634                                                     "remoteSort": true,
635                                                     "listeners": {
636                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
637                                                     },
638                                                     "items": [
639                                                         {
640                                                             "*prop": "proxy",
641                                                             "xtype": "HttpProxy",
642                                                             "method": "GET",
643                                                             "|xns": "Roo.data",
644                                                             "|url": "baseURL + '/Roo/custinfo.php'"
645                                                         },
646                                                         {
647                                                             "*prop": "reader",
648                                                             "xtype": "JsonReader",
649                                                             "|xns": "Roo.data",
650                                                             "id": "cust_id",
651                                                             "root": "data",
652                                                             "totalProperty": "total",
653                                                             "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
654                                                         }
655                                                     ]
656                                                 }
657                                             ]
658                                         },
659                                         {
660                                             "listeners": {
661                                                 "select": "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
662                                             },
663                                             "fieldLabel": "From",
664                                             "format": "Y-m-d",
665                                             "name": "_fromdate",
666                                             "width": 100,
667                                             "xtype": "DateField",
668                                             "|xns": "Roo.form"
669                                         },
670                                         {
671                                             "listeners": {
672                                                 "select": "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
673                                             },
674                                             "fieldLabel": "To",
675                                             "format": "Y-m-d",
676                                             "name": "_todate",
677                                             "width": 100,
678                                             "xtype": "DateField",
679                                             "|xns": "Roo.form"
680                                         }
681                                     ]
682                                 }
683                             ]
684                         }
685                     ]
686                 }
687             ]
688         }
689     ],
690     "permname": "",
691     "modOrder": "001"
692 }