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