Pman.Tab.XtupleApAging.bjs
[Pman.Xtuple] / Pman.Tab.XtupleApAging.bjs
1 {
2     "id": "roo-file-44",
3     "name": "Pman.Tab.XtupleApAging",
4     "parent": "Pman.Tab.XtupleAccountsTab",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleApAging.bjs",
7     "items": [
8         {
9             "background": true,
10             "fitContainer": true,
11             "fitToFrame": true,
12             "region": "center",
13             "title": "Accounts Payable",
14             "xtype": "NestedLayoutPanel",
15             "|xns": "Roo",
16             "items": [
17                 {
18                     "|xns": "Roo",
19                     "xtype": "BorderLayout",
20                     "*prop": "layout",
21                     "items": [
22                         {
23                             "*prop": "center",
24                             "xtype": "LayoutRegion",
25                             "|xns": "Roo"
26                         },
27                         {
28                             "listeners": {
29                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
30                             },
31                             "background": true,
32                             "fitContainer": true,
33                             "fitToframe": true,
34                             "region": "center",
35                             "tableName": "apopen",
36                             "title": "ApAging",
37                             "xtype": "GridPanel",
38                             "|xns": "Roo",
39                             "items": [
40                                 {
41                                     "listeners": {
42                                         "|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}"
43                                     },
44                                     "*prop": "grid",
45                                     "autoExpandColumn": "araging_cust_name",
46                                     "loadMask": true,
47                                     "xtype": "Grid",
48                                     "|xns": "Roo.grid",
49                                     "items": [
50                                         {
51                                             "*prop": "sm",
52                                             "singleSelect": true,
53                                             "xtype": "RowSelectionModel",
54                                             "|xns": "Roo.grid"
55                                         },
56                                         {
57                                             "listeners": {
58                                                 "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 : 'apAging',\n        _name : 'bydate',\n        'relDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n        'useDocDate:text' : false\n    };\n    \n    var vend = _this.vendSel.getValue();\n    if (vend*1) {\n        params['vend_id:number'] = vend;\n    \n    }\n    \n    \n    Roo.apply(o.params,params);\n}"
59                                             },
60                                             "*prop": "dataSource",
61                                             "remoteSort": true,
62                                             "xtype": "Store",
63                                             "|xns": "Roo.data",
64                                             "items": [
65                                                 {
66                                                     "*prop": "proxy",
67                                                     "method": "GET",
68                                                     "timeout": 600000,
69                                                     "xtype": "HttpProxy",
70                                                     "|url": "baseURL + '/Roo/Metasql.php'",
71                                                     "|xns": "Roo.data"
72                                                 },
73                                                 {
74                                                     "*prop": "reader",
75                                                     "id": "id",
76                                                     "root": "data",
77                                                     "totalProperty": "total",
78                                                     "xtype": "JsonReader",
79                                                     "|fields": "[\n    {\n        'name': 'apaging_doctype',\n        'type': 'string'\n    }\n]",
80                                                     "|xns": "Roo.data"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "|xns": "Roo",
86                                             "xtype": "Toolbar",
87                                             "*prop": "toolbar",
88                                             "items": [
89                                                 {
90                                                     "listeners": {
91                                                         "render": "function (_self)\n{\n    _this.vendSel = _self;\n}",
92                                                         "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
93                                                     },
94                                                     "allowBlank": true,
95                                                     "displayField": "vend_name",
96                                                     "editable": true,
97                                                     "emptyText": "Select Vendor",
98                                                     "fieldLabel": "cust_name",
99                                                     "forceSelection": true,
100                                                     "hiddenName": "vend_id",
101                                                     "listWidth": 400,
102                                                     "loadingText": "Searching...",
103                                                     "minChars": 2,
104                                                     "name": "vend_name",
105                                                     "pageSize": 20,
106                                                     "qtip": "Select Vendor",
107                                                     "queryParam": "vend_name:text",
108                                                     "selectOnFocus": true,
109                                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>",
110                                                     "triggerAction": "all",
111                                                     "typeAhead": true,
112                                                     "valueField": "vend_id",
113                                                     "width": 300,
114                                                     "xtype": "ComboBox",
115                                                     "|xns": "Roo.form",
116                                                     "items": [
117                                                         {
118                                                             "listeners": {
119                                                                 "|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'] = 'apAging';\n    o.params['_name'] = 'vendors';\n    o.params['relDate:text']  = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');\n    o.params['useDocDate:text'] = false    \n}\n"
120                                                             },
121                                                             "*prop": "store",
122                                                             "remoteSort": true,
123                                                             "xtype": "Store",
124                                                             "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
125                                                             "|xns": "Roo.data",
126                                                             "items": [
127                                                                 {
128                                                                     "*prop": "proxy",
129                                                                     "method": "GET",
130                                                                     "xtype": "HttpProxy",
131                                                                     "|url": "baseURL + '/Roo/metasql.php'",
132                                                                     "|xns": "Roo.data"
133                                                                 },
134                                                                 {
135                                                                     "*prop": "reader",
136                                                                     "id": "cust_id",
137                                                                     "root": "data",
138                                                                     "totalProperty": "total",
139                                                                     "xtype": "JsonReader",
140                                                                     "|fields": "[{\"name\":\"vend_id\",\"type\":\"int\"},\"vend_name\"]",
141                                                                     "|xns": "Roo.data"
142                                                                 }
143                                                             ]
144                                                         }
145                                                     ]
146                                                 },
147                                                 {
148                                                     "text": "as Of:",
149                                                     "xtype": "TextItem",
150                                                     "|xns": "Roo.Toolbar"
151                                                 },
152                                                 {
153                                                     "listeners": {
154                                                         "render": "function (_self)\r\n{\r\n    _this.relDate = _self;\r\n   _self.setValue(  new Date() );\r\n}",
155                                                         "select": "function (combo, date)\n{\n    _this.grid.footer.onClick('first');\n}"
156                                                     },
157                                                     "allowBlank": false,
158                                                     "format": "Y-m-d",
159                                                     "width": 100,
160                                                     "xtype": "DateField",
161                                                     "|xns": "Roo.form"
162                                                 },
163                                                 {
164                                                     "|xns": "Roo.Toolbar",
165                                                     "xtype": "Fill"
166                                                 },
167                                                 {
168                                                     "listeners": {
169                                                         "|click": "function ()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    \n    Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to VOID that invoice?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            new Pman.Request({\n                mask : 'Sending',\n                url : baseURL + '/Roo/cobmisc',\n                method : 'POST',\n                params :  params,\n                success : function() {\n                    _this.invgrid.ds.load({});\n                }\n            })\n            \n        }\n    );\n            \n            \n   \n}"
170                                                     },
171                                                     "cls": "x-btn-text-icon",
172                                                     "text": "Void",
173                                                     "xtype": "Button",
174                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
175                                                     "|xns": "Roo.Toolbar"
176                                                 }
177                                             ]
178                                         },
179                                         {
180                                             "*prop": "footer",
181                                             "displayInfo": true,
182                                             "displayMsg": "Displaying araging{0} - {1} of {2}",
183                                             "emptyMsg": "Nothing found",
184                                             "pageSize": 25,
185                                             "xtype": "PagingToolbar",
186                                             "|xns": "Roo"
187                                         },
188                                         {
189                                             "*prop": "colModel[]",
190                                             "dataIndex": "apaging_docdate",
191                                             "header": "Date",
192                                             "width": 100,
193                                             "xtype": "ColumnModel",
194                                             "|renderer": "function(v) { \n    var d = Date.parseDate(v, 'Y-m-d');\n\n    return String.format('{0}', d.format('d/M/Y')); \n}",
195                                             "|xns": "Roo.grid"
196                                         },
197                                         {
198                                             "*prop": "colModel[]",
199                                             "dataIndex": "apaging_vend_name",
200                                             "header": "Vendor",
201                                             "width": 200,
202                                             "xtype": "ColumnModel",
203                                             "|renderer": "function(v) { return String.format('{0}', v); }",
204                                             "|xns": "Roo.grid"
205                                         },
206                                         {
207                                             "*prop": "colModel[]",
208                                             "dataIndex": "apaging_doctype",
209                                             "header": "Doc Type",
210                                             "width": 120,
211                                             "xtype": "ColumnModel",
212                                             "|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 }",
213                                             "|xns": "Roo.grid"
214                                         },
215                                         {
216                                             "*prop": "colModel[]",
217                                             "dataIndex": "apaging_docnumber",
218                                             "header": "Docnumber",
219                                             "width": 120,
220                                             "xtype": "ColumnModel",
221                                             "|renderer": "function(v) {\n    \n             return String.format('{0}', v); \n     \n }",
222                                             "|xns": "Roo.grid"
223                                         },
224                                         {
225                                             "*prop": "colModel[]",
226                                             "dataIndex": "apaging_curr_symbol",
227                                             "header": "Currency",
228                                             "width": 120,
229                                             "xtype": "ColumnModel",
230                                             "|renderer": "function(v) {\n    \n             return String.format('{0}', v); \n     \n }",
231                                             "|xns": "Roo.grid"
232                                         },
233                                         {
234                                             "*prop": "colModel[]",
235                                             "align": "right",
236                                             "dataIndex": "apaging_apopen_amount",
237                                             "header": "Value",
238                                             "width": 100,
239                                             "xtype": "ColumnModel",
240                                             "|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    }",
241                                             "|xns": "Roo.grid"
242                                         },
243                                         {
244                                             "*prop": "colModel[]",
245                                             "align": "right",
246                                             "dataIndex": "apaging_cur_val",
247                                             "header": "30 Days",
248                                             "width": 100,
249                                             "xtype": "ColumnModel",
250                                             "|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    }",
251                                             "|xns": "Roo.grid"
252                                         },
253                                         {
254                                             "*prop": "colModel[]",
255                                             "align": "right",
256                                             "dataIndex": "apaging_sixty_val",
257                                             "header": "60 Days",
258                                             "width": 100,
259                                             "xtype": "ColumnModel",
260                                             "|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    }",
261                                             "|xns": "Roo.grid"
262                                         },
263                                         {
264                                             "*prop": "colModel[]",
265                                             "align": "right",
266                                             "dataIndex": "apaging_ninety_val",
267                                             "header": "90 Days",
268                                             "width": 100,
269                                             "xtype": "ColumnModel",
270                                             "|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    }",
271                                             "|xns": "Roo.grid"
272                                         },
273                                         {
274                                             "*prop": "colModel[]",
275                                             "align": "right",
276                                             "dataIndex": "apaging_plus_val",
277                                             "header": "Over 90 days",
278                                             "width": 150,
279                                             "xtype": "ColumnModel",
280                                             "|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    }",
281                                             "|xns": "Roo.grid"
282                                         },
283                                         {
284                                             "*prop": "colModel[]",
285                                             "align": "right",
286                                             "dataIndex": "apaging_total_val",
287                                             "header": "Total",
288                                             "width": 150,
289                                             "xtype": "ColumnModel",
290                                             "|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    }",
291                                             "|xns": "Roo.grid"
292                                         },
293                                         {
294                                             "*prop": "colModel[]",
295                                             "align": "right",
296                                             "dataIndex": "apaging_base_total",
297                                             "header": "Total (BASE)",
298                                             "width": 150,
299                                             "xtype": "ColumnModel",
300                                             "|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    }",
301                                             "|xns": "Roo.grid"
302                                         }
303                                     ]
304                                 }
305                             ]
306                         }
307                     ]
308                 }
309             ]
310         }
311     ],
312     "permname": "",
313     "modOrder": "400"
314 }