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