Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleInvHistoryOld.bjs
1 {
2     "id": "roo-file-272",
3     "name": "Pman.Dialog.XtupleInvHistoryOld",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleInvHistoryOld.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 500,
12             "modal": true,
13             "resizable": false,
14             "title": "View inventory history - Hong Kong",
15             "width": 1000,
16             "xtype": "LayoutDialog",
17             "|xns": "Roo",
18             "items": [
19                 {
20                     "*prop": "north",
21                     "height": 50,
22                     "xtype": "LayoutRegion",
23                     "|xns": "Roo"
24                 },
25                 {
26                     "|xns": "Roo",
27                     "xtype": "LayoutRegion",
28                     "*prop": "center"
29                 },
30                 {
31                     "region": "north",
32                     "xtype": "ContentPanel",
33                     "|xns": "Roo",
34                     "items": [
35                         {
36                             "listeners": {
37                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       _this.grid.footer.onClick('first');\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
38                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
39                             },
40                             "method": "POST",
41                             "style": "margin:10px;",
42                             "xtype": "Form",
43                             "|url": "baseURL + '/Roo/invhist.php'",
44                             "|xns": "Roo.form",
45                             "items": [
46                                 {
47                                     "width": 1000,
48                                     "xtype": "Row",
49                                     "|xns": "Roo.form",
50                                     "items": [
51                                         {
52                                             "listeners": {
53                                                 "select": "function (combo, record, index)\n{\n  \n \n   (function() { \n     if (_this.grid) {\n        _this.grid.footer.onClick('first'); \n    }\n     }).defer(100);\n}"
54                                             },
55                                             "allowBlank": true,
56                                             "displayField": "itemsite_item_id_item_number",
57                                             "editable": true,
58                                             "emptyText": "Select itemsite",
59                                             "fieldLabel": "Item",
60                                             "forceSelection": true,
61                                             "listWidth": 400,
62                                             "loadingText": "Searching...",
63                                             "minChars": 2,
64                                             "name": "itemsite_item_id_item_number",
65                                             "pageSize": 20,
66                                             "qtip": "Select itemsite",
67                                             "queryParam": "query[number]",
68                                             "selectOnFocus": true,
69                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> {itemsite_item_id_item_descrip1}</div>",
70                                             "triggerAction": "all",
71                                             "typeAhead": true,
72                                             "valueField": "itemsite_item_id_item_number",
73                                             "width": 200,
74                                             "xtype": "ComboBox",
75                                             "|xns": "Roo.form",
76                                             "items": [
77                                                 {
78                                                     "listeners": {
79                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
80                                                     },
81                                                     "*prop": "store",
82                                                     "remoteSort": true,
83                                                     "xtype": "Store",
84                                                     "|sortInfo": "{ direction : 'ASC', field: 'id' }",
85                                                     "|xns": "Roo.data",
86                                                     "items": [
87                                                         {
88                                                             "*prop": "proxy",
89                                                             "method": "GET",
90                                                             "xtype": "HttpProxy",
91                                                             "|url": "baseURL + '/Xtuple/Roo/itemsite.php'",
92                                                             "|xns": "Roo.data"
93                                                         },
94                                                         {
95                                                             "*prop": "reader",
96                                                             "xtype": "JsonReader",
97                                                             "|xns": "Roo.data",
98                                                             "id": "id",
99                                                             "root": "data",
100                                                             "totalProperty": "total",
101                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]"
102                                                         }
103                                                     ]
104                                                 }
105                                             ]
106                                         },
107                                         {
108                                             "listeners": {
109                                                 "select": "function (combo, record, index)\n{\n  \n \n   (function() { \n     if (_this.grid) {\n        _this.grid.footer.onClick('first'); \n    }\n     }).defer(100);\n}"
110                                             },
111                                             "allowBlank": true,
112                                             "displayField": "location_descrip",
113                                             "editable": true,
114                                             "emptyText": "Select location",
115                                             "fieldLabel": "location",
116                                             "forceSelection": true,
117                                             "hiddenName": "location_name",
118                                             "listWidth": 400,
119                                             "loadingText": "Searching...",
120                                             "minChars": 2,
121                                             "name": "location_descrip",
122                                             "pageSize": 40,
123                                             "qtip": "Select location",
124                                             "queryParam": "query[location_name]",
125                                             "selectOnFocus": true,
126                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_descrip}</b> </div>",
127                                             "triggerAction": "all",
128                                             "typeAhead": true,
129                                             "valueField": "location_name",
130                                             "width": 200,
131                                             "xtype": "ComboBox",
132                                             "|xns": "Roo.form",
133                                             "items": [
134                                                 {
135                                                     "listeners": {
136                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
137                                                     },
138                                                     "*prop": "store",
139                                                     "remoteSort": true,
140                                                     "xtype": "Store",
141                                                     "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
142                                                     "|xns": "Roo.data",
143                                                     "items": [
144                                                         {
145                                                             "*prop": "proxy",
146                                                             "method": "GET",
147                                                             "xtype": "HttpProxy",
148                                                             "|url": "baseURL + '/Xtuple/Roo/location.php'",
149                                                             "|xns": "Roo.data"
150                                                         },
151                                                         {
152                                                             "*prop": "reader",
153                                                             "xtype": "JsonReader",
154                                                             "|xns": "Roo.data",
155                                                             "id": "id",
156                                                             "root": "data",
157                                                             "totalProperty": "total",
158                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
159                                                         }
160                                                     ]
161                                                 }
162                                             ]
163                                         }
164                                     ]
165                                 }
166                             ]
167                         }
168                     ]
169                 },
170                 {
171                     "listeners": {
172                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
173                     },
174                     "background": false,
175                     "fitContainer": true,
176                     "fitToframe": true,
177                     "region": "center",
178                     "tableName": "invhist",
179                     "title": "invhist",
180                     "xtype": "GridPanel",
181                     "|xns": "Roo",
182                     "items": [
183                         {
184                             "listeners": {
185                                 "|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}",
186                                 "|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"
187                             },
188                             "*prop": "grid",
189                             "autoExpandColumn": "invhist_comments",
190                             "loadMask": true,
191                             "xtype": "Grid",
192                             "|xns": "Roo.grid",
193                             "items": [
194                                 {
195                                     "listeners": {
196                                         "beforeload": "function (_self, o)\n{\n    if (!_this.form.findField('itemsite_item_id_item_number').getValue().length \n             && !_this.form.findField('location_name').getValue().length) {\n        _this.grid.ds.removeAll();\n        return false;\n    }\n    o.params['query[item_number]'] = _this.form.findField('itemsite_item_id_item_number').getValue();\n    o.params['query[location_name]']   = _this.form.findField('location_name').getValue();\n    o.params._with_item =1;\n        o.params._hide_void =1;\n}"
197                                     },
198                                     "*prop": "dataSource",
199                                     "remoteSort": true,
200                                     "xtype": "Store",
201                                     "|sortInfo": "{ field : 'invhist_transdate,invdetail_id', direction: 'DESC' }",
202                                     "|xns": "Roo.data",
203                                     "items": [
204                                         {
205                                             "*prop": "proxy",
206                                             "method": "GET",
207                                             "xtype": "HttpProxy",
208                                             "|url": "baseURL + '/Xtuple/Roo/invdetail.php'",
209                                             "|xns": "Roo.data"
210                                         },
211                                         {
212                                             "|xns": "Roo.data",
213                                             "xtype": "JsonReader",
214                                             "totalProperty": "total",
215                                             "root": "data",
216                                             "*prop": "reader",
217                                             "id": "id",
218                                             "|fields": "[\n    {\n        'name': 'invhist_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_itemsite_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_transdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'invhist_transtype',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_invqty',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_invuom',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_ordnumber',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_docnumber',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_qoh_before',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_qoh_after',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_unitcost',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_acct_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_xfer_warehous_id',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_posted',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_imported',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_hasdetail',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_ordtype',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_analyze',\n        'type': 'int'\n    },\n    {\n        'name': 'invhist_user',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'invhist_costmethod',\n        'type': 'string'\n    },\n    {\n        'name': 'invhist_value_before',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_value_after',\n        'type': 'float'\n    },\n    {\n        'name': 'invhist_series',\n        'type': 'int'\n    }\n]"
219                                         }
220                                     ]
221                                 },
222                                 {
223                                     "*prop": "footer",
224                                     "xtype": "PagingToolbar",
225                                     "pageSize": 25,
226                                     "displayInfo": true,
227                                     "displayMsg": "Displaying invhist{0} - {1} of {2}",
228                                     "emptyMsg": "No invhist found",
229                                     "|xns": "Roo"
230                                 },
231                                 {
232                                     "*prop": "colModel[]",
233                                     "dataIndex": "invhist_transdate",
234                                     "header": "Invhist transdate",
235                                     "width": 75,
236                                     "xtype": "ColumnModel",
237                                     "|renderer": "function(v) { \n    var vv = Date.parseDate(v.split(' ')[0],'Y-m-d' );\n    return String.format('{0}', vv ? vv.format('d/M/Y') : '');\n }",
238                                     "|xns": "Roo.grid"
239                                 },
240                                 {
241                                     "*prop": "colModel[]",
242                                     "dataIndex": "invhist_ordnumber",
243                                     "header": "Order#",
244                                     "width": 100,
245                                     "xtype": "ColumnModel",
246                                     "|renderer": "function(v) { return String.format('{0}', v); }",
247                                     "|xns": "Roo.grid"
248                                 },
249                                 {
250                                     "*prop": "colModel[]",
251                                     "dataIndex": "invhist_docnumber",
252                                     "header": "doc#",
253                                     "width": 100,
254                                     "xtype": "ColumnModel",
255                                     "|renderer": "function(v) { return String.format('{0}', v); }",
256                                     "|xns": "Roo.grid"
257                                 },
258                                 {
259                                     "*prop": "colModel[]",
260                                     "dataIndex": "invhist_transtype",
261                                     "header": "Type",
262                                     "width": 50,
263                                     "xtype": "ColumnModel",
264                                     "|renderer": "function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }",
265                                     "|xns": "Roo.grid"
266                                 },
267                                 {
268                                     "*prop": "colModel[]",
269                                     "align": "right",
270                                     "dataIndex": "invhist_unitcost",
271                                     "header": "unitcost",
272                                     "width": 50,
273                                     "xtype": "ColumnModel",
274                                     "|renderer": "function(v) { return String.format('{0}', v); }",
275                                     "|xns": "Roo.grid"
276                                 },
277                                 {
278                                     "*prop": "colModel[]",
279                                     "align": "right",
280                                     "dataIndex": "invfifo_unitcost",
281                                     "header": "fifocost",
282                                     "width": 50,
283                                     "xtype": "ColumnModel",
284                                     "|renderer": "function(v) { return String.format('{0}', v); }",
285                                     "|xns": "Roo.grid"
286                                 },
287                                 {
288                                     "*prop": "colModel[]",
289                                     "dataIndex": "location_name",
290                                     "header": "Location",
291                                     "width": 100,
292                                     "xtype": "ColumnModel",
293                                     "|renderer": "function(v) { return String.format('<B>{0}</B>', v); }",
294                                     "|xns": "Roo.grid"
295                                 },
296                                 {
297                                     "*prop": "colModel[]",
298                                     "align": "right",
299                                     "dataIndex": "invdetail_qty",
300                                     "header": "Change",
301                                     "width": 50,
302                                     "xtype": "ColumnModel",
303                                     "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }",
304                                     "|xns": "Roo.grid"
305                                 },
306                                 {
307                                     "*prop": "colModel[]",
308                                     "align": "right",
309                                     "dataIndex": "invdetail_bydate_qty",
310                                     "header": "Qty Before",
311                                     "width": 75,
312                                     "xtype": "ColumnModel",
313                                     "|renderer": "function(v,x,r) { return String.format('<B>{0}</B>', parseInt(v)- parseInt(r.data.invdetail_qty)); }",
314                                     "|xns": "Roo.grid"
315                                 },
316                                 {
317                                     "*prop": "colModel[]",
318                                     "align": "right",
319                                     "dataIndex": "invdetail_bydate_qty",
320                                     "header": "Qty after",
321                                     "width": 75,
322                                     "xtype": "ColumnModel",
323                                     "|renderer": "function(v) { return String.format('<B>{0}</B>', parseInt( v)); }",
324                                     "|xns": "Roo.grid"
325                                 },
326                                 {
327                                     "xtype": "ColumnModel",
328                                     "header": "Invhist comments",
329                                     "width": 200,
330                                     "dataIndex": "invhist_comments",
331                                     "|renderer": "function(v) { return String.format('{0}', v); }",
332                                     "|xns": "Roo.grid",
333                                     "*prop": "colModel[]"
334                                 }
335                             ]
336                         }
337                     ]
338                 },
339                 {
340                     "listeners": {
341                         "click": "function (_self, e)\n{\n    new Pman.Download({\n        grid : _this.grid\n    });\n}"
342                     },
343                     "*prop": "buttons[]",
344                     "text": "Download",
345                     "xtype": "Button",
346                     "|xns": "Roo"
347                 },
348                 {
349                     "listeners": {
350                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
351                     },
352                     "*prop": "buttons[]",
353                     "text": "Close",
354                     "xtype": "Button",
355                     "|xns": "Roo"
356                 }
357             ]
358         }
359     ],
360     "permname": "",
361     "modOrder": "001"
362 }