Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleSalesHistory.bjs
1 {
2     "id": "roo-file-332",
3     "name": "Pman.Tab.XtupleSalesHistory",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "Pman.Tab.XtupleSalesHistory",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesHistory.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.hpanel = this;\n    if (_this.hgrid) {\n        _this.hgrid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "cohist",
17             "title": "Sales History",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.hgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.hpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "item_descrip1",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, o)\n{\n  \n    Roo.apply(o.params, {\n        _group : 'salesHistory',\n        _name : 'bydate',\n     \n        'credit:text' : 'credit',\n        'return:text' : 'return',\n        'includeFormatted:int' :  1,\n        'startDate:text' : _this.dateFrom.getValue(),\n        'endDate:text' :  _this.dateTo.getValue()\n        \n    });\n    \n    if (_this.custSel.getValue()) {\n       o.params['cust_id:number'] = _this.custSel.getValue();\n    }\n    \n    if (_this.countrySel.getValue()) {\n       o.params['addr_country:text'] = _this.countrySel.getValue();\n    }\n    \n    if (_this.postalCodeSel.getValue()) {\n       o.params['addr_postalcode:text'] = _this.postalCodeSel.getValue();\n    }\n    \n    if (_this.itemSel.getValue()) {\n       o.params['item_id:number'] = _this.itemSel.getValue();\n    }\n    \n    if (_this.orderRep.getValue()) {\n       o.params['cohist_salesrep_id:number'] = _this.orderRep.getValue();\n    }\n    \n    if (_this.custRep.getValue()) {\n       o.params['cust_salesrep_id:number'] = _this.custRep.getValue();\n    }\n    \n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'cohist_shipvia', direction: 'ASC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "method": "GET",
45                                     "xtype": "HttpProxy",
46                                     "|url": "baseURL + '/Roo/metasql.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|fields": "[\n    {\n        'name': 'cohist_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_cust_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_itemsite_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_shipdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cohist_shipvia',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_ordernumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_orderdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cohist_invcnumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_invcdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cohist_qtyshipped',\n        'type': 'float'\n    },\n    {\n        'name': 'cohist_unitprice',\n        'type': 'float'\n    },\n    {\n        'name': 'cohist_shipto_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_salesrep_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_duedate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cohist_imported',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_billtoname',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtoaddress1',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtoaddress2',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtoaddress3',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtocity',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtostate',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_billtozip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptoname',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptoaddress1',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptoaddress2',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptoaddress3',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptocity',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptostate',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_shiptozip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_commission',\n        'type': 'float'\n    },\n    {\n        'name': 'cohist_commissionpaid',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_unitcost',\n        'type': 'float'\n    },\n    {\n        'name': 'cohist_misc_type',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_misc_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_misc_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_doctype',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_promisedate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cohist_ponumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_sequence',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_taxtype_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_taxzone_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_curr_id_curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_curr_id_curr_base',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_curr_id_curr_name',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_curr_id_curr_symbol',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_curr_id_curr_abbr',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_taxzone_id_taxzone_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_taxzone_id_taxzone_code',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_taxzone_id_taxzone_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_taxtype_id_taxtype_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cohist_taxtype_id_taxtype_name',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_taxtype_id_taxtype_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'cohist_taxtype_id_taxtype_sys',\n        'type': 'int'\n    }\n]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "displayInfo": true,
63                             "displayMsg": "Displaying Sales History {0} - {1} of {2}",
64                             "emptyMsg": "No cohist found",
65                             "pageSize": 25,
66                             "xtype": "PagingToolbar",
67                             "|xns": "Roo",
68                             "items": [
69                                 {
70                                     "text": "<span class=\"sales-footer-text\"></span>",
71                                     "xtype": "TextItem",
72                                     "|xns": "Roo.Toolbar"
73                                 }
74                             ]
75                         },
76                         {
77                             "*prop": "toolbar",
78                             "xtype": "Toolbar",
79                             "|xns": "Roo",
80                             "items": [
81                                 {
82                                     "listeners": {
83                                         "render": "function (_self)\n{\n   _this.custSel = _self;\n}"
84                                     },
85                                     "allowBlank": true,
86                                     "displayField": "cust_name",
87                                     "editable": true,
88                                     "emptyText": "Select Customer",
89                                     "fieldLabel": "cust_name",
90                                     "forceSelection": true,
91                                     "hiddenName": "cust_id",
92                                     "listWidth": 400,
93                                     "loadingText": "Searching...",
94                                     "minChars": 2,
95                                     "name": "cust_name",
96                                     "pageSize": 20,
97                                     "qtip": "Select Customer",
98                                     "queryParam": "query[cust_name]",
99                                     "selectOnFocus": true,
100                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> </div>",
101                                     "triggerAction": "all",
102                                     "typeAhead": true,
103                                     "valueField": "cust_id",
104                                     "width": 150,
105                                     "xtype": "ComboBox",
106                                     "|xns": "Roo.form",
107                                     "items": [
108                                         {
109                                             "listeners": {
110                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
111                                             },
112                                             "*prop": "store",
113                                             "remoteSort": true,
114                                             "xtype": "Store",
115                                             "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
116                                             "|xns": "Roo.data",
117                                             "items": [
118                                                 {
119                                                     "*prop": "proxy",
120                                                     "xtype": "HttpProxy",
121                                                     "method": "GET",
122                                                     "|xns": "Roo.data",
123                                                     "|url": "baseURL + '/Roo/custinfo.php'"
124                                                 },
125                                                 {
126                                                     "*prop": "reader",
127                                                     "xtype": "JsonReader",
128                                                     "|xns": "Roo.data",
129                                                     "id": "cust_id",
130                                                     "root": "data",
131                                                     "totalProperty": "total",
132                                                     "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
133                                                 }
134                                             ]
135                                         }
136                                     ]
137                                 },
138                                 {
139                                     "listeners": {
140                                         "render": "function (_self)\n{\n    _this.countrySel = _self;\n}"
141                                     },
142                                     "allowBlank": true,
143                                     "displayField": "addr_country",
144                                     "editable": true,
145                                     "emptyText": "Select Country",
146                                     "fieldLabel": "addr_country",
147                                     "forceSelection": true,
148                                     "hiddenName": "addr_country",
149                                     "listWidth": 400,
150                                     "loadingText": "Searching...",
151                                     "minChars": 2,
152                                     "name": "addr_country",
153                                     "pageSize": 20,
154                                     "qtip": "Select Country",
155                                     "queryParam": "query[addr_country]",
156                                     "selectOnFocus": true,
157                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_country}</b> </div>",
158                                     "triggerAction": "all",
159                                     "typeAhead": true,
160                                     "valueField": "addr_country",
161                                     "width": 100,
162                                     "xtype": "ComboBox",
163                                     "|xns": "Roo.form",
164                                     "items": [
165                                         {
166                                             "listeners": {
167                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params._distinct = 'addr_country';\n    o.params._columns = 'addr_country';   \n    o.params['!addr_country'] = '';        \n    // set more here\n}\n"
168                                             },
169                                             "*prop": "store",
170                                             "remoteSort": true,
171                                             "xtype": "Store",
172                                             "|sortInfo": "{ direction : 'ASC', field: 'addr_country' }",
173                                             "|xns": "Roo.data",
174                                             "items": [
175                                                 {
176                                                     "*prop": "proxy",
177                                                     "method": "GET",
178                                                     "xtype": "HttpProxy",
179                                                     "|url": "baseURL + '/Roo/addr.php'",
180                                                     "|xns": "Roo.data"
181                                                 },
182                                                 {
183                                                     "*prop": "reader",
184                                                     "id": "addr_country",
185                                                     "root": "data",
186                                                     "totalProperty": "total",
187                                                     "xtype": "JsonReader",
188                                                     "|fields": "[{\"name\":\"addr_country\",\"type\":\"string\"}]",
189                                                     "|xns": "Roo.data"
190                                                 }
191                                             ]
192                                         }
193                                     ]
194                                 },
195                                 {
196                                     "listeners": {
197                                         "render": "function (_self)\n{\n    _this.postalCodeSel = _self;\n}"
198                                     },
199                                     "allowBlank": true,
200                                     "displayField": "addr_postalcode",
201                                     "editable": true,
202                                     "emptyText": "Select Postal Code",
203                                     "fieldLabel": "addr_postalcode",
204                                     "forceSelection": true,
205                                     "hiddenName": "addr_postalcode",
206                                     "listWidth": 400,
207                                     "loadingText": "Searching...",
208                                     "minChars": 2,
209                                     "name": "addr_postalcode",
210                                     "pageSize": 20,
211                                     "qtip": "Select Postal Code",
212                                     "queryParam": "query[addr_postalcode]",
213                                     "selectOnFocus": true,
214                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_postalcode}</b> </div>",
215                                     "triggerAction": "all",
216                                     "typeAhead": true,
217                                     "valueField": "addr_postalcode",
218                                     "width": 100,
219                                     "xtype": "ComboBox",
220                                     "|xns": "Roo.form",
221                                     "items": [
222                                         {
223                                             "listeners": {
224                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params._distinct = 'addr_postalcode';\n    o.params._columns = 'addr_postalcode';   \n    o.params['!addr_postalcode'] = '';        \n    // set more here\n}\n"
225                                             },
226                                             "*prop": "store",
227                                             "remoteSort": true,
228                                             "xtype": "Store",
229                                             "|sortInfo": "{ direction : 'ASC', field: 'addr_postalcode' }",
230                                             "|xns": "Roo.data",
231                                             "items": [
232                                                 {
233                                                     "*prop": "proxy",
234                                                     "method": "GET",
235                                                     "xtype": "HttpProxy",
236                                                     "|url": "baseURL + '/Roo/addr.php'",
237                                                     "|xns": "Roo.data"
238                                                 },
239                                                 {
240                                                     "*prop": "reader",
241                                                     "id": "addr_postalcode",
242                                                     "root": "data",
243                                                     "totalProperty": "total",
244                                                     "xtype": "JsonReader",
245                                                     "|fields": "[{\"name\":\"addr_postalcode\",\"type\":\"string\"}]",
246                                                     "|xns": "Roo.data"
247                                                 }
248                                             ]
249                                         }
250                                     ]
251                                 },
252                                 {
253                                     "listeners": {
254                                         "render": "function (_self)\n{\n   _this.itemSel = _self;\n}"
255                                     },
256                                     "allowBlank": true,
257                                     "displayField": "item_number",
258                                     "editable": true,
259                                     "emptyText": "Select Item Number",
260                                     "fieldLabel": "item_number",
261                                     "forceSelection": true,
262                                     "hiddenName": "item_number",
263                                     "listWidth": 400,
264                                     "loadingText": "Searching...",
265                                     "minChars": 2,
266                                     "name": "item_number",
267                                     "pageSize": 20,
268                                     "qtip": "Select Item Number",
269                                     "queryParam": "query[number_or_name]",
270                                     "selectOnFocus": true,
271                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>",
272                                     "triggerAction": "all",
273                                     "typeAhead": true,
274                                     "valueField": "item_id",
275                                     "width": 100,
276                                     "xtype": "ComboBox",
277                                     "|xns": "Roo.form",
278                                     "items": [
279                                         {
280                                             "listeners": {
281                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
282                                             },
283                                             "*prop": "store",
284                                             "remoteSort": true,
285                                             "xtype": "Store",
286                                             "|sortInfo": "{ direction : 'ASC', field: 'item_number' }",
287                                             "|xns": "Roo.data",
288                                             "items": [
289                                                 {
290                                                     "*prop": "proxy",
291                                                     "method": "GET",
292                                                     "xtype": "HttpProxy",
293                                                     "|url": "baseURL + '/Roo/Item.php'",
294                                                     "|xns": "Roo.data"
295                                                 },
296                                                 {
297                                                     "*prop": "reader",
298                                                     "id": "item_id",
299                                                     "root": "data",
300                                                     "totalProperty": "total",
301                                                     "xtype": "JsonReader",
302                                                     "|fields": "[{\"name\":\"item_id\",\"type\":\"int\"},\"item_number\"]",
303                                                     "|xns": "Roo.data"
304                                                 }
305                                             ]
306                                         }
307                                     ]
308                                 },
309                                 {
310                                     "listeners": {
311                                         "render": "function (_self)\n{\n   _this.orderRep = _self;\n}"
312                                     },
313                                     "allowBlank": true,
314                                     "displayField": "salesrep_name",
315                                     "editable": true,
316                                     "emptyText": "Order Sales Rep",
317                                     "fieldLabel": "Order Sales Rep",
318                                     "forceSelection": true,
319                                     "hiddenName": "salesrep_name",
320                                     "listWidth": 400,
321                                     "loadingText": "Searching...",
322                                     "minChars": 2,
323                                     "name": "salesrep_name",
324                                     "pageSize": 20,
325                                     "qtip": "Select Order Sales Rep",
326                                     "queryParam": "query[name]",
327                                     "selectOnFocus": true,
328                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{salesrep_name}</b> </div>",
329                                     "triggerAction": "all",
330                                     "typeAhead": true,
331                                     "valueField": "salesrep_id",
332                                     "width": 120,
333                                     "xtype": "ComboBox",
334                                     "|xns": "Roo.form",
335                                     "items": [
336                                         {
337                                             "listeners": {
338                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params.salesrep_active = 1\n}\n"
339                                             },
340                                             "*prop": "store",
341                                             "remoteSort": true,
342                                             "xtype": "Store",
343                                             "|sortInfo": "{ direction : 'ASC', field: 'salesrep_id' }",
344                                             "|xns": "Roo.data",
345                                             "items": [
346                                                 {
347                                                     "*prop": "proxy",
348                                                     "method": "GET",
349                                                     "xtype": "HttpProxy",
350                                                     "|url": "baseURL + '/Roo/Salesrep.php'",
351                                                     "|xns": "Roo.data"
352                                                 },
353                                                 {
354                                                     "*prop": "reader",
355                                                     "id": "salesrep_id",
356                                                     "root": "data",
357                                                     "totalProperty": "total",
358                                                     "xtype": "JsonReader",
359                                                     "|fields": "[{\"name\":\"salesrep_id\",\"type\":\"int\"}]",
360                                                     "|xns": "Roo.data"
361                                                 }
362                                             ]
363                                         }
364                                     ]
365                                 },
366                                 {
367                                     "listeners": {
368                                         "render": "function (_self)\n{\n   _this.custRep = _self;\n}"
369                                     },
370                                     "allowBlank": true,
371                                     "displayField": "salesrep_name",
372                                     "editable": true,
373                                     "emptyText": "Customer Sales Rep",
374                                     "fieldLabel": "Customer Sales Rep",
375                                     "forceSelection": true,
376                                     "hiddenName": "salesrep_name",
377                                     "listWidth": 400,
378                                     "loadingText": "Searching...",
379                                     "minChars": 2,
380                                     "name": "salesrep_name",
381                                     "pageSize": 20,
382                                     "qtip": "Select Customer Sales Rep",
383                                     "queryParam": "query[name]",
384                                     "selectOnFocus": true,
385                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{salesrep_name}</b> </div>",
386                                     "triggerAction": "all",
387                                     "typeAhead": true,
388                                     "valueField": "salesrep_id",
389                                     "width": 120,
390                                     "xtype": "ComboBox",
391                                     "|xns": "Roo.form",
392                                     "items": [
393                                         {
394                                             "listeners": {
395                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    o.params.salesrep_active = 1\n}\n"
396                                             },
397                                             "*prop": "store",
398                                             "remoteSort": true,
399                                             "xtype": "Store",
400                                             "|sortInfo": "{ direction : 'ASC', field: 'salesrep_id' }",
401                                             "|xns": "Roo.data",
402                                             "items": [
403                                                 {
404                                                     "*prop": "proxy",
405                                                     "method": "GET",
406                                                     "xtype": "HttpProxy",
407                                                     "|url": "baseURL + '/Roo/Salesrep.php'",
408                                                     "|xns": "Roo.data"
409                                                 },
410                                                 {
411                                                     "*prop": "reader",
412                                                     "id": "salesrep_id",
413                                                     "root": "data",
414                                                     "totalProperty": "total",
415                                                     "xtype": "JsonReader",
416                                                     "|fields": "[{\"name\":\"salesrep_id\",\"type\":\"int\"}]",
417                                                     "|xns": "Roo.data"
418                                                 }
419                                             ]
420                                         }
421                                     ]
422                                 },
423                                 {
424                                     "text": "From",
425                                     "xtype": "TextItem",
426                                     "|xns": "Roo.Toolbar"
427                                 },
428                                 {
429                                     "listeners": {
430                                         "render": "function (_self)\n{\n  _this.dateFrom = _self;\n}"
431                                     },
432                                     "format": "d/M/Y",
433                                     "useIso": true,
434                                     "xtype": "DateField",
435                                     "|value": "(function() {return (new Date()).add(Date.MONTH, -3); })()",
436                                     "|xns": "Roo.form"
437                                 },
438                                 {
439                                     "text": "To",
440                                     "xtype": "TextItem",
441                                     "|xns": "Roo.Toolbar"
442                                 },
443                                 {
444                                     "listeners": {
445                                         "render": "function (_self)\n{\n_this.dateTo = _self;\n}"
446                                     },
447                                     "format": "d/M/Y",
448                                     "useIso": true,
449                                     "xtype": "DateField",
450                                     "|value": "(function() {return (new Date()) })()",
451                                     "|xns": "Roo.form"
452                                 },
453                                 {
454                                     "listeners": {
455                                         "click": "function (_self, e)\n{\n    _this.hgrid.footer.onClick('first');\n}"
456                                     },
457                                     "text": "Refresh",
458                                     "xtype": "Button",
459                                     "|xns": "Roo.Toolbar"
460                                 },
461                                 {
462                                     "|xns": "Roo.Toolbar",
463                                     "xtype": "Fill"
464                                 },
465                                 {
466                                     "text": "Download",
467                                     "xtype": "Button",
468                                     "|xns": "Roo.Toolbar",
469                                     "items": [
470                                         {
471                                             "|xns": "Roo.menu",
472                                             "xtype": "Menu",
473                                             "*prop": "menu",
474                                             "items": [
475                                                 {
476                                                     "listeners": {
477                                                         "click": "function (_self, e)\n{\n  var o = { params : {}};\n     Roo.apply(o.params, {\n        _group : 'salesHistory',\n        _name : 'bydate',\n        csvCols : '*', csvTitles : '*',\n        'credit:text' : 'credit',\n        'return:text' : 'return',\n        'includeFormatted:int' :  1,\n        'startDate:text' : _this.dateFrom.getValue(),\n        'endDate:text' :  _this.dateTo.getValue(),\n        limit : 99999\n        \n    });\n    \n    if (_this.custSel.getValue()) {\n       o.params['cust_id:number'] = _this.custSel.getValue();\n    }\n    \n    if (_this.countrySel.getValue()) {\n       o.params['addr_country:text'] = _this.countrySel.getValue();\n    }\n    \n    if (_this.postalCodeSel.getValue()) {\n       o.params['addr_postalcode:text'] = _this.postalCodeSel.getValue();\n    }\n    \n    if (_this.itemSel.getValue()) {\n       o.params['item_id:number'] = _this.itemSel.getValue();\n    }\n    \n    if (_this.orderRep.getValue()) {\n       o.params['cohist_salesrep_id:number'] = _this.orderRep.getValue();\n    }\n    \n    if (_this.custRep.getValue()) {\n       o.params['cust_salesrep_id:number'] = _this.custRep.getValue();\n    }\n    \n    \n    new Pman.Download({\n        url: baseURL + '/Roo/Metasql',\n        params : o.params,\n        limit : 100000,\n        newWindow : true\n    });\n}"
478                                                     },
479                                                     "text": "Sales History",
480                                                     "xtype": "Item",
481                                                     "|xns": "Roo.menu"
482                                                 },
483                                                 {
484                                                     "listeners": {
485                                                         "click": "function (_self, e)\n{\n var o = { params : {}};\n     Roo.apply(o.params, {\n        _group : 'salesHistory',\n        _name : 'stockist',\n      csvCols : '*', csvTitles : '*',\n        'credit:text' : 'credit',\n        'return:text' : 'return',\n        'includeFormatted:int' :  1,\n        'startDate:text' : _this.dateFrom.getValue(),\n        'endDate:text' :  _this.dateTo.getValue(),\n        limit : 99999\n        \n    });\n    \n    if (_this.custSel.getValue()) {\n       o.params['cust_id:number'] = _this.custSel.getValue();\n    }\n    \n    if (_this.countrySel.getValue()) {\n       o.params['addr_country:text'] = _this.countrySel.getValue();\n    }\n    \n    if (_this.postalCodeSel.getValue()) {\n       o.params['addr_postalcode:text'] = _this.postalCodeSel.getValue();\n    }\n    \n    if (_this.itemSel.getValue()) {\n       o.params['item_id:number'] = _this.itemSel.getValue();\n    }\n    \n    if (_this.orderRep.getValue()) {\n       o.params['cohist_salesrep_id:number'] = _this.orderRep.getValue();\n    }\n    \n    if (_this.custRep.getValue()) {\n       o.params['cust_salesrep_id:number'] = _this.custRep.getValue();\n    }\n    \n    \n    new Pman.Download({\n        url: baseURL + '/Roo/Metasql',\n        params : o.params,\n        limit : 100000,\n        newWindow : true\n    });\n}"
486                                                     },
487                                                     "text": "Stockists Summary",
488                                                     "xtype": "Item",
489                                                     "|xns": "Roo.menu"
490                                                 }
491                                             ]
492                                         }
493                                     ]
494                                 }
495                             ]
496                         },
497                         {
498                             "*prop": "colModel[]",
499                             "dataIndex": "cust_id",
500                             "header": "Cust#",
501                             "width": 50,
502                             "xtype": "ColumnModel",
503                             "|renderer": "function(v) { return String.format('{0}', v); }",
504                             "|xns": "Roo.grid"
505                         },
506                         {
507                             "*prop": "colModel[]",
508                             "dataIndex": "cust_name",
509                             "header": "Customer",
510                             "width": 75,
511                             "xtype": "ColumnModel",
512                             "|renderer": "function(v) { return String.format('{0}', v); }",
513                             "|xns": "Roo.grid"
514                         },
515                         {
516                             "*prop": "colModel[]",
517                             "dataIndex": "order_salesrep_name",
518                             "header": "Order Sales Rep",
519                             "width": 100,
520                             "xtype": "ColumnModel",
521                             "|renderer": "function(v) { return String.format('{0}', v); }",
522                             "|xns": "Roo.grid"
523                         },
524                         {
525                             "*prop": "colModel[]",
526                             "dataIndex": "cust_salesrep_name",
527                             "header": "Customer Sales Rep",
528                             "hidden": true,
529                             "width": 100,
530                             "xtype": "ColumnModel",
531                             "|renderer": "function(v) { return String.format('{0}', v); }",
532                             "|xns": "Roo.grid"
533                         },
534                         {
535                             "*prop": "colModel[]",
536                             "dataIndex": "addr_country",
537                             "header": "Country",
538                             "width": 75,
539                             "xtype": "ColumnModel",
540                             "|renderer": "function(v) { return String.format('{0}', v); }",
541                             "|xns": "Roo.grid"
542                         },
543                         {
544                             "*prop": "colModel[]",
545                             "dataIndex": "addr_city",
546                             "header": "City",
547                             "hidden": true,
548                             "width": 75,
549                             "xtype": "ColumnModel",
550                             "|renderer": "function(v) { return String.format('{0}', v); }",
551                             "|xns": "Roo.grid"
552                         },
553                         {
554                             "*prop": "colModel[]",
555                             "dataIndex": "addr_state",
556                             "header": "State",
557                             "hidden": true,
558                             "width": 75,
559                             "xtype": "ColumnModel",
560                             "|renderer": "function(v) { return String.format('{0}', v); }",
561                             "|xns": "Roo.grid"
562                         },
563                         {
564                             "*prop": "colModel[]",
565                             "dataIndex": "addr_postalcode",
566                             "header": "Postal Code",
567                             "width": 75,
568                             "xtype": "ColumnModel",
569                             "|renderer": "function(v) { return String.format('{0}', v); }",
570                             "|xns": "Roo.grid"
571                         },
572                         {
573                             "*prop": "colModel[]",
574                             "dataIndex": "cohist_ordernumber",
575                             "header": "Order",
576                             "width": 75,
577                             "xtype": "ColumnModel",
578                             "|renderer": "function(v) { return String.format('{0}', v); }",
579                             "|xns": "Roo.grid"
580                         },
581                         {
582                             "*prop": "colModel[]",
583                             "dataIndex": "cohead_orderdate",
584                             "header": "Order date",
585                             "width": 75,
586                             "xtype": "ColumnModel",
587                             "|renderer": "function(v) { \n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n }",
588                             "|xns": "Roo.grid"
589                         },
590                         {
591                             "*prop": "colModel[]",
592                             "dataIndex": "invmonth",
593                             "header": "Invoice Month",
594                             "width": 75,
595                             "xtype": "ColumnModel",
596                             "|renderer": "function(v) { \n   \n    return String.format('{0}', v);\n }",
597                             "|xns": "Roo.grid"
598                         },
599                         {
600                             "*prop": "colModel[]",
601                             "dataIndex": "cohist_invcdate",
602                             "header": "Invoice date",
603                             "width": 75,
604                             "xtype": "ColumnModel",
605                             "|renderer": "function(v) { \n    var d = Date.parseDate(v, 'Y-m-d');\n    return String.format('{0}', d ? d.format('d/M/Y') : '');\n }",
606                             "|xns": "Roo.grid"
607                         },
608                         {
609                             "*prop": "colModel[]",
610                             "dataIndex": "cohist_invcnumber",
611                             "header": "Invoice#",
612                             "width": 75,
613                             "xtype": "ColumnModel",
614                             "|renderer": "function(v) { return String.format('{0}', v); }",
615                             "|xns": "Roo.grid"
616                         },
617                         {
618                             "*prop": "colModel[]",
619                             "dataIndex": "item_brand",
620                             "header": "Brand",
621                             "width": 75,
622                             "xtype": "ColumnModel",
623                             "|renderer": "function(v) { return String.format('{0}', v ? v   : ''); }",
624                             "|xns": "Roo.grid"
625                         },
626                         {
627                             "*prop": "colModel[]",
628                             "dataIndex": "item_number",
629                             "header": "Item No.",
630                             "width": 75,
631                             "xtype": "ColumnModel",
632                             "|renderer": "function(v) { return String.format('{0}', v ? v   : ''); }",
633                             "|xns": "Roo.grid"
634                         },
635                         {
636                             "*prop": "colModel[]",
637                             "dataIndex": "item_descrip1",
638                             "header": "Description",
639                             "width": 200,
640                             "xtype": "ColumnModel",
641                             "|renderer": "function(v) { return String.format('{0}', v); }",
642                             "|xns": "Roo.grid"
643                         },
644                         {
645                             "*prop": "colModel[]",
646                             "align": "right",
647                             "dataIndex": "cohist_qtyshipped",
648                             "header": "Shipped",
649                             "width": 70,
650                             "xtype": "ColumnModel",
651                             "|renderer": "function(v) { return parseInt(v); }",
652                             "|xns": "Roo.grid"
653                         },
654                         {
655                             "*prop": "colModel[]",
656                             "dataIndex": "currabbr",
657                             "header": "Currency",
658                             "width": 75,
659                             "xtype": "ColumnModel",
660                             "|renderer": "function(v) { return String.format('{0}', v.split(/\\s+/)[0]); }",
661                             "|xns": "Roo.grid"
662                         },
663                         {
664                             "*prop": "colModel[]",
665                             "align": "right",
666                             "dataIndex": "cohist_unitprice",
667                             "header": "Unit Price",
668                             "width": 75,
669                             "xtype": "ColumnModel",
670                             "|renderer": "function(v) { return Roo.util.Format.number( v, 2); }",
671                             "|xns": "Roo.grid"
672                         },
673                         {
674                             "*prop": "colModel[]",
675                             "align": "right",
676                             "dataIndex": "extprice",
677                             "header": "Ext Cost",
678                             "width": 75,
679                             "xtype": "ColumnModel",
680                             "|renderer": "function(v) { return Roo.util.Format.number( v, 2); }",
681                             "|xns": "Roo.grid"
682                         },
683                         {
684                             "*prop": "colModel[]",
685                             "align": "right",
686                             "dataIndex": "extpricebase",
687                             "header": "Ext Price (Base)",
688                             "width": 75,
689                             "xtype": "ColumnModel",
690                             "|renderer": "function(v) { return Roo.util.Format.number( v, 2); }",
691                             "|xns": "Roo.grid"
692                         },
693                         {
694                             "*prop": "colModel[]",
695                             "align": "right",
696                             "dataIndex": "baseunitprice",
697                             "header": "Unit Price (Base)",
698                             "hidden": true,
699                             "width": 75,
700                             "xtype": "ColumnModel",
701                             "|renderer": "function(v) { return Roo.util.Format.number( v, 2); }",
702                             "|xns": "Roo.grid"
703                         },
704                         {
705                             "*prop": "colModel[]",
706                             "align": "right",
707                             "dataIndex": "basefifovalue",
708                             "header": "Fifo Cost",
709                             "width": 75,
710                             "xtype": "ColumnModel",
711                             "|renderer": "function(v) { return Roo.util.Format.number( v, 2); }",
712                             "|xns": "Roo.grid"
713                         }
714                     ]
715                 }
716             ]
717         }
718     ],
719     "permname": "",
720     "modOrder": "400"
721 }