Pman.Tab.XtupleSalesOrder.bjs
[Pman.Xtuple] / Pman.Tab.XtupleSalesOrder.bjs
1 {
2     "id": "roo-file-65",
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                                                     "text": "Import",
127                                                     "xtype": "Button",
128                                                     "|xns": "Roo.Toolbar",
129                                                     "items": [
130                                                         {
131                                                             "|xns": "Roo.menu",
132                                                             "xtype": "Menu",
133                                                             "*prop": "menu",
134                                                             "items": [
135                                                                 {
136                                                                     "|xns": "Roo.menu",
137                                                                     "xtype": "Item"
138                                                                 }
139                                                             ]
140                                                         }
141                                                     ]
142                                                 },
143                                                 {
144                                                     "listeners": {
145                                                         "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}"
146                                                     },
147                                                     "text": "Magento Upload",
148                                                     "xtype": "Button",
149                                                     "|xns": "Roo.Toolbar"
150                                                 },
151                                                 {
152                                                     "cls": "x-btn-text-icon",
153                                                     "text": "Reports",
154                                                     "xtype": "Button",
155                                                     "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
156                                                     "|xns": "Roo.Toolbar",
157                                                     "items": [
158                                                         {
159                                                             "|xns": "Roo.menu",
160                                                             "xtype": "Menu",
161                                                             "*prop": "menu",
162                                                             "items": [
163                                                                 {
164                                                                     "text": "AR Aging",
165                                                                     "xtype": "Item",
166                                                                     "|xns": "Roo.menu",
167                                                                     "items": [
168                                                                         {
169                                                                             "|xns": "Roo.menu",
170                                                                             "xtype": "Menu",
171                                                                             "*prop": "menu",
172                                                                             "items": [
173                                                                                 {
174                                                                                     "listeners": {
175                                                                                         "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}"
176                                                                                     },
177                                                                                     "text": "as PDF",
178                                                                                     "xtype": "Item",
179                                                                                     "|xns": "Roo.menu"
180                                                                                 },
181                                                                                 {
182                                                                                     "listeners": {
183                                                                                         "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}"
184                                                                                     },
185                                                                                     "text": "as Excel",
186                                                                                     "xtype": "Item",
187                                                                                     "|xns": "Roo.menu"
188                                                                                 },
189                                                                                 {
190                                                                                     "listeners": {
191                                                                                         "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}"
192                                                                                     },
193                                                                                     "text": "Summary Excel",
194                                                                                     "xtype": "Item",
195                                                                                     "|xns": "Roo.menu"
196                                                                                 }
197                                                                             ]
198                                                                         }
199                                                                     ]
200                                                                 },
201                                                                 {
202                                                                     "text": "Customer History",
203                                                                     "xtype": "Item",
204                                                                     "|xns": "Roo.menu",
205                                                                     "items": [
206                                                                         {
207                                                                             "|xns": "Roo.menu",
208                                                                             "xtype": "Menu",
209                                                                             "*prop": "menu",
210                                                                             "items": [
211                                                                                 {
212                                                                                     "listeners": {
213                                                                                         "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}"
214                                                                                     },
215                                                                                     "text": "as PDF",
216                                                                                     "xtype": "Item",
217                                                                                     "|xns": "Roo.menu"
218                                                                                 },
219                                                                                 {
220                                                                                     "listeners": {
221                                                                                         "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}"
222                                                                                     },
223                                                                                     "text": "as Excel",
224                                                                                     "xtype": "Item",
225                                                                                     "|xns": "Roo.menu"
226                                                                                 }
227                                                                             ]
228                                                                         }
229                                                                     ]
230                                                                 },
231                                                                 {
232                                                                     "text": "Customer Statement",
233                                                                     "xtype": "Item",
234                                                                     "|xns": "Roo.menu",
235                                                                     "items": [
236                                                                         {
237                                                                             "|xns": "Roo.menu",
238                                                                             "xtype": "Menu",
239                                                                             "*prop": "menu",
240                                                                             "items": [
241                                                                                 {
242                                                                                     "listeners": {
243                                                                                         "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}"
244                                                                                     },
245                                                                                     "text": "as PDF",
246                                                                                     "xtype": "Item",
247                                                                                     "|xns": "Roo.menu"
248                                                                                 },
249                                                                                 {
250                                                                                     "listeners": {
251                                                                                         "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}"
252                                                                                     },
253                                                                                     "text": "as Excel",
254                                                                                     "xtype": "Item",
255                                                                                     "|xns": "Roo.menu"
256                                                                                 }
257                                                                             ]
258                                                                         }
259                                                                     ]
260                                                                 }
261                                                             ]
262                                                         }
263                                                     ]
264                                                 },
265                                                 {
266                                                     "listeners": {
267                                                         "|click": "function (_self, e)\n{\n    var sels = _this.grid.getSelectionModel().getSelections();\n    \n    if (!sels.length) {\n        Roo.MessageBox.alert(\"Error\", \"Select an order\");\n        return;\n    }\n    var ids = [];\n    for (var i =0; i < sels.length; i++) {\n        var s = sels[i];    \n        \n        if(s.data.cohead_qtyuninvoiced * 1 > 0){\n            Roo.MessageBox.alert(\"Error\", \"Order has not been invoiced! - \" + s.data.cohead_number);\n            return;\n        }\n        \n        if(s.data.aropen_unpaid * 1 > 0){\n            Roo.MessageBox.alert(\"Error\", \"Order has not been paid! - \"  + s.data.cohead_number);\n            return;\n        }\n        ids.push(s.data.cohead_id);\n    }\n    \n    new Pman.Download({\r\n      url : baseURL + '/Xtuple/Reports/SalesOrderBookingDetail',\r\n      params :   {\n            cohead_id : ids.join(',')\n      },\r\n      method : 'GET'\r\n    });\r\n    \n    Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}"
268                                                     },
269                                                     "cls": "x-btn-text-icon",
270                                                     "text": "Email to warehouse",
271                                                     "xtype": "Button",
272                                                     "|icon": "Roo.rootURL + 'images/default/dd/email.gif'",
273                                                     "|xns": "Roo.Toolbar"
274                                                 },
275                                                 {
276                                                     "listeners": {
277                                                         "|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"
278                                                     },
279                                                     "cls": "x-btn-text-icon",
280                                                     "text": "Complete and Close",
281                                                     "xtype": "Button",
282                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
283                                                     "|xns": "Roo.Toolbar"
284                                                 },
285                                                 {
286                                                     "xtype": "Fill",
287                                                     "|xns": "Roo.Toolbar"
288                                                 },
289                                                 {
290                                                     "listeners": {
291                                                         "|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"
292                                                     },
293                                                     "cls": "x-btn-text-icon",
294                                                     "text": "Add",
295                                                     "xtype": "Button",
296                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
297                                                     "|xns": "Roo.Toolbar"
298                                                 },
299                                                 {
300                                                     "listeners": {
301                                                         "|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"
302                                                     },
303                                                     "cls": "x-btn-text-icon",
304                                                     "text": "Copy",
305                                                     "xtype": "Button",
306                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
307                                                     "|xns": "Roo.Toolbar"
308                                                 }
309                                             ]
310                                         },
311                                         {
312                                             "*prop": "colModel[]",
313                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
314                                             "dataIndex": "cohead_orderdate",
315                                             "header": "Ordered",
316                                             "sortable": true,
317                                             "width": 75,
318                                             "xtype": "ColumnModel",
319                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
320                                             "|xns": "Roo.grid"
321                                         },
322                                         {
323                                             "*prop": "colModel[]",
324                                             "dataIndex": "cohead_targetdate",
325                                             "header": "Target Delivery",
326                                             "hidden": true,
327                                             "sortable": true,
328                                             "width": 75,
329                                             "xtype": "ColumnModel",
330                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
331                                             "|xns": "Roo.grid"
332                                         },
333                                         {
334                                             "*prop": "colModel[]",
335                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
336                                             "dataIndex": "cohead_salesrep_id_salesrep_name",
337                                             "header": "Staff IC.",
338                                             "sortable": true,
339                                             "width": 100,
340                                             "xtype": "ColumnModel",
341                                             "|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 }",
342                                             "|xns": "Roo.grid"
343                                         },
344                                         {
345                                             "*prop": "colModel[]",
346                                             "dataIndex": "cohead_number",
347                                             "header": "#order",
348                                             "sortable": true,
349                                             "width": 100,
350                                             "xtype": "ColumnModel",
351                                             "|renderer": "function(v,x,r) {\n\n      \n      // we want to show more detail about status..\n      // like payment status / delivery etc...\n      \n      // I = invoiced\n      // R = Reserved\n      // S = shipped (or partial shipped)\n      // P = paid (or partial paid)\n      // online payment failed? >> on terms?\n      // \n      var tags = {\n        invoiced : '<span class=\"dragon-so-complete\" qtip=\"Invoiced\">I</span>',\n        invoiced_not : '<span class=\"dragon-so-complete-not\"  qtip=\"Not Invoiced\">I</span>',\n        stock_not : '<span class=\"dragon-so-complete-not\" qtip=\"Stock not reserved or shipped\">S</span>',        \n        stock_reserved : '<span class=\"dragon-so-complete-part\" qtip=\"Stock Reserved / Not shipped\">R</span>',\n        stock_shipped : '<span class=\"dragon-so-complete\" qtip=\"Shipped\">S</span>',\n        paid : '<span class=\"dragon-so-complete\" qtip=\"Paid\">P</span>',\n        paid_not : '<span class=\"dragon-so-complete-not\" qtip=\"Not Paid\">P</span>'\n    };        \n     \n     // invoiced\n     var tg = '';\n     \n       // stock status...\n     if (r.data.cohead_qtyunshipped > 0) {\n          \n          tg +=  (r.data.shipitem_qty*1 > 0)  ? tags.stock_reserved :tags.stock_not;\n     }     else {\n     \n         tg +=  tags.stock_shipped;\n    }\n     \n     tg += (r.data.cohead_qtyuninvoiced > 0) ? tags.invoiced_not : tags.invoiced;\n     // ?? partially invoiced??\n     \n     \n     if (r.data.cohead_qtyuninvoiced*1 < 1) {\n          tg += (r.data.aropen_unpaid*1 > 0) ? tags.paid_not : tags.paid;\n      }\n     \n     \n     \n    // payment status??\n\n      if (r.data.cohead_status == 'C') {\n          return tg + ' ' + String.format('<i qtip=\"closed\">{0}</i>', v); \n      }\n      if (r.data.cohead_status == 'X') {\n          return tg + ' ' +  String.format('<s qtip=\"void\">{0}</s>', v)  ; \n      }\n      return tg + ' ' + String.format('{0}', v); \n }",
352                                             "|xns": "Roo.grid"
353                                         },
354                                         {
355                                             "*prop": "colModel[]",
356                                             ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
357                                             "dataIndex": "cohead_cust_id_cust_number",
358                                             "header": "Customer#",
359                                             "sortable": true,
360                                             "width": 100,
361                                             "xtype": "ColumnModel",
362                                             "|renderer": "function(v) { return String.format('{0}', v); }",
363                                             "|xns": "Roo.grid"
364                                         },
365                                         {
366                                             "*prop": "colModel[]",
367                                             ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
368                                             "dataIndex": "cohead_cust_id_cust_name",
369                                             "header": "Customer",
370                                             "sortable": true,
371                                             "width": 200,
372                                             "xtype": "ColumnModel",
373                                             "|renderer": "function(v) { return String.format('{0}', v); }",
374                                             "|xns": "Roo.grid"
375                                         },
376                                         {
377                                             "*prop": "colModel[]",
378                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"}",
379                                             "dataIndex": "cohead_custponumber",
380                                             "header": "Cust. PO#",
381                                             "width": 50,
382                                             "xtype": "ColumnModel",
383                                             "|renderer": "function(v) { return String.format('{0}', v); }",
384                                             "|xns": "Roo.grid"
385                                         },
386                                         {
387                                             "*prop": "colModel[]",
388                                             ".builderCfg": "{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"}",
389                                             "dataIndex": "cohead_type",
390                                             "header": "Type",
391                                             "width": 50,
392                                             "xtype": "ColumnModel",
393                                             "|renderer": "function(v) { return String.format('{0}', v); }",
394                                             "|xns": "Roo.grid"
395                                         },
396                                         {
397                                             "*prop": "colModel[]",
398                                             "dataIndex": "cohead_src_locations",
399                                             "header": "From",
400                                             "width": 100,
401                                             "xtype": "ColumnModel",
402                                             "|renderer": "function(v) { return String.format('{0}', v); }",
403                                             "|xns": "Roo.grid"
404                                         },
405                                         {
406                                             "*prop": "colModel[]",
407                                             ".builderCfg": "{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"}",
408                                             "dataIndex": "cohead_shiptoaddress1",
409                                             "header": "Ship to",
410                                             "width": 200,
411                                             "xtype": "ColumnModel",
412                                             "|renderer": "function(v) { return String.format('{0}', v); }",
413                                             "|xns": "Roo.grid"
414                                         },
415                                         {
416                                             "*prop": "colModel[]",
417                                             ".builderCfg": "{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"}",
418                                             "dataIndex": "cohead_terms_id_terms_descrip",
419                                             "header": "Terms",
420                                             "width": 100,
421                                             "xtype": "ColumnModel",
422                                             "|renderer": "function(v) { return String.format('{0}', v); }",
423                                             "|xns": "Roo.grid"
424                                         },
425                                         {
426                                             "*prop": "colModel[]",
427                                             "align": "right",
428                                             "dataIndex": "cohead_total",
429                                             "header": "Total",
430                                             "width": 100,
431                                             "xtype": "ColumnModel",
432                                             "|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 }",
433                                             "|xns": "Roo.grid"
434                                         }
435                                     ]
436                                 }
437                             ]
438                         },
439                         {
440                             "background": false,
441                             "region": "west",
442                             "xtype": "ContentPanel",
443                             "|xns": "Roo",
444                             "items": [
445                                 {
446                                     "|xns": "Roo",
447                                     "xtype": "Toolbar",
448                                     "*prop": "toolbar",
449                                     "items": [
450                                         {
451                                             "|xns": "Roo.Toolbar",
452                                             "xtype": "Fill"
453                                         },
454                                         {
455                                             "listeners": {
456                                                 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
457                                             },
458                                             "cls": "x-btn-icon",
459                                             "xtype": "Button",
460                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
461                                             "|xns": "Roo.Toolbar"
462                                         },
463                                         {
464                                             "listeners": {
465                                                 "|click": "function (_self, e)\n{\n    _this.form.reset('');\n\n    \n    _this.grid.footer.onClick('first');\n}"
466                                             },
467                                             "cls": "x-btn-icon",
468                                             "xtype": "Button",
469                                             "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
470                                             "|xns": "Roo.Toolbar"
471                                         }
472                                     ]
473                                 },
474                                 {
475                                     "listeners": {
476                                         "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
477                                     },
478                                     "labelAlign": "top",
479                                     "method": "POST",
480                                     "style": "margin:5px;",
481                                     "xtype": "Form",
482                                     "|xns": "Roo.form",
483                                     "items": [
484                                         {
485                                             "listeners": {
486                                                 "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
487                                                 "|render": "function (_self)\n{\n  _this.viewtypeSel = _self;\n}"
488                                             },
489                                             "allowBlank": false,
490                                             "displayField": "value",
491                                             "editable": false,
492                                             "emptyText": "View type",
493                                             "fieldLabel": "View",
494                                             "forceSelection": true,
495                                             "listWidth": 200,
496                                             "loadingText": "Searching...",
497                                             "minChars": 2,
498                                             "name": "viewtype",
499                                             "pageSize": 20,
500                                             "qtip": "Select Action",
501                                             "queryParam": "query[action]",
502                                             "selectOnFocus": true,
503                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>",
504                                             "triggerAction": "all",
505                                             "typeAhead": true,
506                                             "value": "MYOPEN",
507                                             "valueField": "key",
508                                             "width": 150,
509                                             "xtype": "ComboBox",
510                                             "|xns": "Roo.form",
511                                             "items": [
512                                                 {
513                                                     "*prop": "store",
514                                                     "id": 0,
515                                                     "xtype": "SimpleStore",
516                                                     "|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  [ 'NOTSHIPPED', 'All Un-shipped orders' ],\n  [ 'NOTPAID', 'All Un-paid 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]",
517                                                     "|fields": "[ 'key', 'value' ]",
518                                                     "|xns": "Roo.data"
519                                                 }
520                                             ]
521                                         },
522                                         {
523                                             "listeners": {
524                                                 "select": "function (combo, record, index)\n{\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
525                                                 "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}",
526                                                 "beforequery": "function (combo, query, forceAll, cancel, e)\n{\n \n   if( _this.rsearch) {\n        _this.rsearch =false;\n        return false;\n    }\n \n}"
527                                             },
528                                             "allowBlank": true,
529                                             "displayField": "cohead_number",
530                                             "editable": true,
531                                             "emptyText": "Select Order",
532                                             "fieldLabel": "Order #",
533                                             "forceSelection": false,
534                                             "listWidth": 400,
535                                             "loadingText": "Searching...",
536                                             "minChars": 2,
537                                             "name": "query[cohead_number]",
538                                             "pageSize": 20,
539                                             "qtip": "Select Order",
540                                             "queryParam": "query[cohead_number]",
541                                             "selectOnFocus": true,
542                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cohead_number}</b> </div>",
543                                             "triggerAction": "all",
544                                             "typeAhead": false,
545                                             "valueField": "cohead_number",
546                                             "width": 180,
547                                             "xtype": "ComboBox",
548                                             "|xns": "Roo.form",
549                                             "items": [
550                                                 {
551                                                     "listeners": {
552                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params['_columns'] = 'cohead_number';\n    // set more here\n}\n"
553                                                     },
554                                                     "*prop": "store",
555                                                     "remoteSort": true,
556                                                     "xtype": "Store",
557                                                     "|sortInfo": "{ direction : 'ASC', field: 'cohead_number' }",
558                                                     "|xns": "Roo.data",
559                                                     "items": [
560                                                         {
561                                                             "*prop": "proxy",
562                                                             "method": "GET",
563                                                             "xtype": "HttpProxy",
564                                                             "|url": "baseURL + '/Roo/cohead.php'",
565                                                             "|xns": "Roo.data"
566                                                         },
567                                                         {
568                                                             "*prop": "reader",
569                                                             "id": "cohead_number",
570                                                             "root": "data",
571                                                             "totalProperty": "total",
572                                                             "xtype": "JsonReader",
573                                                             "|fields": "[\"cohead_number\"]",
574                                                             "|xns": "Roo.data"
575                                                         }
576                                                     ]
577                                                 }
578                                             ]
579                                         },
580                                         {
581                                             "listeners": {
582                                                 "select": "function (combo, record, index)\n{\n       (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
583                                             },
584                                             "allowBlank": true,
585                                             "displayField": "cust_name",
586                                             "editable": true,
587                                             "emptyText": "Select custinfo",
588                                             "fieldLabel": "Customer",
589                                             "forceSelection": true,
590                                             "hiddenName": "cohead_cust_id",
591                                             "listWidth": 400,
592                                             "loadingText": "Searching...",
593                                             "minChars": 2,
594                                             "name": "cohead_cust_id_cust_name",
595                                             "pageSize": 20,
596                                             "qtip": "Select custinfo",
597                                             "queryParam": "query[cust_name]",
598                                             "selectOnFocus": true,
599                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b>  ({cust_number})</div>",
600                                             "triggerAction": "all",
601                                             "typeAhead": false,
602                                             "valueField": "cust_id",
603                                             "width": 180,
604                                             "xtype": "ComboBox",
605                                             "|xns": "Roo.form",
606                                             "items": [
607                                                 {
608                                                     "*prop": "store",
609                                                     "|xns": "Roo.data",
610                                                     "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
611                                                     "xtype": "Store",
612                                                     "remoteSort": true,
613                                                     "listeners": {
614                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
615                                                     },
616                                                     "items": [
617                                                         {
618                                                             "*prop": "proxy",
619                                                             "xtype": "HttpProxy",
620                                                             "method": "GET",
621                                                             "|xns": "Roo.data",
622                                                             "|url": "baseURL + '/Roo/custinfo.php'"
623                                                         },
624                                                         {
625                                                             "*prop": "reader",
626                                                             "xtype": "JsonReader",
627                                                             "|xns": "Roo.data",
628                                                             "id": "cust_id",
629                                                             "root": "data",
630                                                             "totalProperty": "total",
631                                                             "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
632                                                         }
633                                                     ]
634                                                 }
635                                             ]
636                                         },
637                                         {
638                                             "listeners": {
639                                                 "select": "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
640                                             },
641                                             "fieldLabel": "From",
642                                             "format": "Y-m-d",
643                                             "name": "_fromdate",
644                                             "width": 100,
645                                             "xtype": "DateField",
646                                             "|xns": "Roo.form"
647                                         },
648                                         {
649                                             "listeners": {
650                                                 "select": "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
651                                             },
652                                             "fieldLabel": "To",
653                                             "format": "Y-m-d",
654                                             "name": "_todate",
655                                             "width": 100,
656                                             "xtype": "DateField",
657                                             "|xns": "Roo.form"
658                                         }
659                                     ]
660                                 }
661                             ]
662                         }
663                     ]
664                 }
665             ]
666         }
667     ],
668     "permname": "",
669     "modOrder": "001"
670 }