Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleArAging.bjs
1 {
2     "name" : "Pman.Tab.XtupleArAging",
3     "parent" : "Pman.Tab.XtupleAccountsTab",
4     "title" : "",
5     "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleArAging.bjs",
6     "permname" : "",
7     "modOrder" : "400",
8     "items" : [
9         {
10             "fitToFrame" : true,
11             "background" : true,
12             "region" : "center",
13             "title" : "Accounts Recievable",
14             "xtype" : "NestedLayoutPanel",
15             "fitContainer" : true,
16             "$ xns" : "Roo",
17             "items" : [
18                 {
19                     "xtype" : "BorderLayout",
20                     "$ xns" : "Roo",
21                     "* prop" : "layout",
22                     "items" : [
23                         {
24                             "xtype" : "LayoutRegion",
25                             "$ xns" : "Roo",
26                             "* prop" : "center"
27                         },
28                         {
29                             "listeners" : {
30                                 "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
31                             },
32                             "fitToframe" : true,
33                             "background" : true,
34                             "region" : "center",
35                             "title" : "ArAging",
36                             "xtype" : "GridPanel",
37                             "fitContainer" : true,
38                             "$ xns" : "Roo",
39                             "tableName" : "aropen",
40                             "items" : [
41                                 {
42                                     "listeners" : {
43                                         "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
44                                     },
45                                     "autoExpandColumn" : "araging_cust_name",
46                                     "xtype" : "Grid",
47                                     "loadMask" : true,
48                                     "$ xns" : "Roo.grid",
49                                     "* prop" : "grid",
50                                     "items" : [
51                                         {
52                                             "listeners" : {
53                                                 "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n\n    \n    var dt = _this.relDate.getValue();\n    \n    var params = {\n        _group : 'arAging',\n        _name : 'bydate',\n        'relDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n        'useDocDate:text' : false\n    };\n    \n    var cs = _this.customerSel.getValue();\n    if (cs*1) {\n        params['cust_id:number'] = cs;\n    \n    }\n    \n    \n    Roo.apply(o.params,params);\n}"
54                                             },
55                                             "xtype" : "Store",
56                                             "remoteSort" : true,
57                                             "$ xns" : "Roo.data",
58                                             "* prop" : "dataSource",
59                                             "items" : [
60                                                 {
61                                                     "$ url" : "baseURL + '/Roo/Metasql.php'",
62                                                     "method" : "GET",
63                                                     "xtype" : "HttpProxy",
64                                                     "timeout" : 600000,
65                                                     "$ xns" : "Roo.data",
66                                                     "* prop" : "proxy"
67                                                 },
68                                                 {
69                                                     "id" : "id",
70                                                     "root" : "data",
71                                                     "xtype" : "JsonReader",
72                                                     "$ fields" : "[\n    {\n        'name': 'araging_apopen_id',\n        'type': 'int'\n    },\n    {\n        'name': 'araging_cust_id',\n        'type': 'int'\n    }\n]",
73                                                     "$ xns" : "Roo.data",
74                                                     "* prop" : "reader",
75                                                     "totalProperty" : "total"
76                                                 }
77                                             ]
78                                         },
79                                         {
80                                             "xtype" : "Toolbar",
81                                             "$ xns" : "Roo",
82                                             "* prop" : "toolbar",
83                                             "items" : [
84                                                 {
85                                                     "listeners" : {
86                                                         "render" : "function (_self)\n{\n    _this.customerSel = _self;\n}",
87                                                         "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
88                                                     },
89                                                     "listWidth" : 400,
90                                                     "triggerAction" : "all",
91                                                     "fieldLabel" : "cust_name",
92                                                     "forceSelection" : true,
93                                                     "selectOnFocus" : true,
94                                                     "pageSize" : 20,
95                                                     "displayField" : "cust_name",
96                                                     "emptyText" : "Select customer",
97                                                     "hiddenName" : "cust_id",
98                                                     "minChars" : 2,
99                                                     "valueField" : "cust_id",
100                                                     "xtype" : "ComboBox",
101                                                     "allowBlank" : true,
102                                                     "typeAhead" : true,
103                                                     "editable" : true,
104                                                     "width" : 300,
105                                                     "$ xns" : "Roo.form",
106                                                     "name" : "cust_name",
107                                                     "qtip" : "Select Customer",
108                                                     "queryParam" : "cust_name:text",
109                                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> </div>",
110                                                     "loadingText" : "Searching...",
111                                                     "items" : [
112                                                         {
113                                                             "listeners" : {
114                                                                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    if (!_this.relDate) {\n        return false;\n    }\n    var dt = _this.relDate.getValue();    \n    // set more here\n    o.params['_group'] = 'arAging';\n    o.params['_name'] = 'customers';\n    o.params['relDate:text']  = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');\n    o.params['useDocDate:text'] = false    \n}\n"
115                                                             },
116                                                             "xtype" : "Store",
117                                                             "remoteSort" : true,
118                                                             "$ sortInfo" : "{ direction : 'ASC', field: 'cust_name' }",
119                                                             "$ xns" : "Roo.data",
120                                                             "* prop" : "store",
121                                                             "items" : [
122                                                                 {
123                                                                     "$ url" : "baseURL + '/Roo/metasql.php'",
124                                                                     "xtype" : "HttpProxy",
125                                                                     "method" : "GET",
126                                                                     "$ xns" : "Roo.data",
127                                                                     "* prop" : "proxy"
128                                                                 },
129                                                                 {
130                                                                     "id" : "cust_id",
131                                                                     "root" : "data",
132                                                                     "xtype" : "JsonReader",
133                                                                     "$ xns" : "Roo.data",
134                                                                     "$ fields" : "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]",
135                                                                     "* prop" : "reader",
136                                                                     "totalProperty" : "total"
137                                                                 }
138                                                             ]
139                                                         }
140                                                     ]
141                                                 },
142                                                 {
143                                                     "text" : "as Of:",
144                                                     "xtype" : "TextItem",
145                                                     "$ xns" : "Roo.Toolbar"
146                                                 },
147                                                 {
148                                                     "listeners" : {
149                                                         "render" : "function (_self)\r\n{\r\n    _this.relDate = _self;\r\n   _self.setValue(  new Date() );\r\n}",
150                                                         "select" : "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
151                                                     },
152                                                     "format" : "Y-m-d",
153                                                     "xtype" : "DateField",
154                                                     "allowBlank" : false,
155                                                     "width" : 100,
156                                                     "$ xns" : "Roo.form"
157                                                 }
158                                             ]
159                                         },
160                                         {
161                                             "pageSize" : 25,
162                                             "xtype" : "PagingToolbar",
163                                             "emptyMsg" : "Nothing found",
164                                             "$ xns" : "Roo",
165                                             "displayMsg" : "Displaying araging{0} - {1} of {2}",
166                                             "displayInfo" : true,
167                                             "* prop" : "footer"
168                                         },
169                                         {
170                                             "xtype" : "ColumnModel",
171                                             "header" : "Date",
172                                             "width" : 100,
173                                             "$ renderer" : "function(v) { \n    var d = Date.parseDate(v, 'Y-m-d');\n\n    return String.format('{0}', d.format('d/M/Y')); \n}",
174                                             "$ xns" : "Roo.grid",
175                                             "* prop" : "colModel[]",
176                                             "dataIndex" : "araging_docdate"
177                                         },
178                                         {
179                                             "xtype" : "ColumnModel",
180                                             "header" : "Customer",
181                                             "width" : 200,
182                                             "$ renderer" : "function(v) { return String.format('{0}', v); }",
183                                             "$ xns" : "Roo.grid",
184                                             "* prop" : "colModel[]",
185                                             "dataIndex" : "araging_cust_name"
186                                         },
187                                         {
188                                             "xtype" : "ColumnModel",
189                                             "header" : "Doc Type",
190                                             "width" : 120,
191                                             "$ renderer" : "function(v) {\n    switch(v) {\n        case 'I':\n            return \"Invoice\";\n        case 'C':\n            return \"Credit Memo\";        \n        case 'D':\n            return \"Debit Memo\";                    \n        case 'R':\n            return \"Cash Receipt\";        \n        case 'V':\n            return \"Voucher\";     \n        default:\n             return String.format('{0}', v); \n     }\n }",
192                                             "$ xns" : "Roo.grid",
193                                             "* prop" : "colModel[]",
194                                             "dataIndex" : "araging_doctype"
195                                         },
196                                         {
197                                             "xtype" : "ColumnModel",
198                                             "header" : "Docnumber",
199                                             "width" : 120,
200                                             "$ renderer" : "function(v) {\n    \n             return String.format('{0}', v); \n     \n }",
201                                             "$ xns" : "Roo.grid",
202                                             "* prop" : "colModel[]",
203                                             "dataIndex" : "araging_docnumber"
204                                         },
205                                         {
206                                             "xtype" : "ColumnModel",
207                                             "header" : "Order",
208                                             "width" : 150,
209                                             "$ renderer" : "function(v) { return String.format('{0}', v); }",
210                                             "$ xns" : "Roo.grid",
211                                             "* prop" : "colModel[]",
212                                             "dataIndex" : "araging_ponumber_pretty"
213                                         },
214                                         {
215                                             "xtype" : "ColumnModel",
216                                             "header" : "Currency",
217                                             "width" : 120,
218                                             "$ renderer" : "function(v) {\n    \n             return String.format('{0}', v); \n     \n }",
219                                             "$ xns" : "Roo.grid",
220                                             "* prop" : "colModel[]",
221                                             "dataIndex" : "araging_curr_symbol"
222                                         },
223                                         {
224                                             "align" : "right",
225                                             "xtype" : "ColumnModel",
226                                             "header" : "Value",
227                                             "width" : 100,
228                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
229                                             "$ xns" : "Roo.grid",
230                                             "* prop" : "colModel[]",
231                                             "dataIndex" : "araging_aropen_amount"
232                                         },
233                                         {
234                                             "align" : "right",
235                                             "xtype" : "ColumnModel",
236                                             "header" : "30 Days",
237                                             "width" : 100,
238                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
239                                             "$ xns" : "Roo.grid",
240                                             "* prop" : "colModel[]",
241                                             "dataIndex" : "araging_cur_val"
242                                         },
243                                         {
244                                             "align" : "right",
245                                             "xtype" : "ColumnModel",
246                                             "header" : "60 Days",
247                                             "width" : 100,
248                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
249                                             "$ xns" : "Roo.grid",
250                                             "* prop" : "colModel[]",
251                                             "dataIndex" : "araging_sixty_val"
252                                         },
253                                         {
254                                             "align" : "right",
255                                             "xtype" : "ColumnModel",
256                                             "header" : "90 Days",
257                                             "width" : 100,
258                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
259                                             "$ xns" : "Roo.grid",
260                                             "* prop" : "colModel[]",
261                                             "dataIndex" : "araging_ninety_val"
262                                         },
263                                         {
264                                             "align" : "right",
265                                             "xtype" : "ColumnModel",
266                                             "header" : "Over 90 days",
267                                             "width" : 150,
268                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
269                                             "$ xns" : "Roo.grid",
270                                             "* prop" : "colModel[]",
271                                             "dataIndex" : "araging_plus_val"
272                                         },
273                                         {
274                                             "align" : "right",
275                                             "xtype" : "ColumnModel",
276                                             "header" : "Total",
277                                             "width" : 150,
278                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
279                                             "$ xns" : "Roo.grid",
280                                             "* prop" : "colModel[]",
281                                             "dataIndex" : "araging_total_val"
282                                         },
283                                         {
284                                             "align" : "right",
285                                             "xtype" : "ColumnModel",
286                                             "header" : "Total (BASE)",
287                                             "width" : 150,
288                                             "$ renderer" : "function(v) { \n\n        return String.format(v*1 < 0 ? '<span style=\"color:red\">{0}</span>' : '{0}', \n            Roo.util.Format.usMoney(v)); \n    }",
289                                             "$ xns" : "Roo.grid",
290                                             "* prop" : "colModel[]",
291                                             "dataIndex" : "araging_base_total"
292                                         }
293                                     ]
294                                 }
295                             ]
296                         }
297                     ]
298                 }
299             ]
300         }
301     ]
302 }