3 "name": "Pman.Dialog.XtupleInvHistoryOld",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleInvHistoryOld.bjs",
14 "title": "View inventory history - Hong Kong",
16 "xtype": "LayoutDialog",
22 "xtype": "LayoutRegion",
27 "xtype": "LayoutRegion",
32 "xtype": "ContentPanel",
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"
41 "style": "margin:10px;",
43 "|url": "baseURL + '/Roo/invhist.php'",
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}"
56 "displayField": "itemsite_item_id_item_number",
58 "emptyText": "Select itemsite",
60 "forceSelection": true,
62 "loadingText": "Searching...",
64 "name": "itemsite_item_id_item_number",
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",
72 "valueField": "itemsite_item_id_item_number",
79 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
84 "|sortInfo": "{ direction : 'ASC', field: 'id' }",
91 "|url": "baseURL + '/Xtuple/Roo/itemsite.php'",
96 "xtype": "JsonReader",
100 "totalProperty": "total",
101 "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]"
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}"
112 "displayField": "location_descrip",
114 "emptyText": "Select location",
115 "fieldLabel": "location",
116 "forceSelection": true,
117 "hiddenName": "location_name",
119 "loadingText": "Searching...",
121 "name": "location_descrip",
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",
129 "valueField": "location_name",
136 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
141 "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
147 "xtype": "HttpProxy",
148 "|url": "baseURL + '/Xtuple/Roo/location.php'",
153 "xtype": "JsonReader",
157 "totalProperty": "total",
158 "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
172 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
175 "fitContainer": true,
178 "tableName": "invhist",
180 "xtype": "GridPanel",
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"
189 "autoExpandColumn": "invhist_comments",
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}"
198 "*prop": "dataSource",
201 "|sortInfo": "{ field : 'invhist_transdate,invdetail_id', direction: 'DESC' }",
207 "xtype": "HttpProxy",
208 "|url": "baseURL + '/Xtuple/Roo/invdetail.php'",
213 "xtype": "JsonReader",
214 "totalProperty": "total",
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]"
224 "xtype": "PagingToolbar",
227 "displayMsg": "Displaying invhist{0} - {1} of {2}",
228 "emptyMsg": "No invhist found",
232 "*prop": "colModel[]",
233 "dataIndex": "invhist_transdate",
234 "header": "Invhist transdate",
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 }",
241 "*prop": "colModel[]",
242 "dataIndex": "invhist_ordnumber",
245 "xtype": "ColumnModel",
246 "|renderer": "function(v) { return String.format('{0}', v); }",
250 "*prop": "colModel[]",
251 "dataIndex": "invhist_docnumber",
254 "xtype": "ColumnModel",
255 "|renderer": "function(v) { return String.format('{0}', v); }",
259 "*prop": "colModel[]",
260 "dataIndex": "invhist_transtype",
263 "xtype": "ColumnModel",
264 "|renderer": "function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }",
268 "*prop": "colModel[]",
270 "dataIndex": "invhist_unitcost",
271 "header": "unitcost",
273 "xtype": "ColumnModel",
274 "|renderer": "function(v) { return String.format('{0}', v); }",
278 "*prop": "colModel[]",
280 "dataIndex": "invfifo_unitcost",
281 "header": "fifocost",
283 "xtype": "ColumnModel",
284 "|renderer": "function(v) { return String.format('{0}', v); }",
288 "*prop": "colModel[]",
289 "dataIndex": "location_name",
290 "header": "Location",
292 "xtype": "ColumnModel",
293 "|renderer": "function(v) { return String.format('<B>{0}</B>', v); }",
297 "*prop": "colModel[]",
299 "dataIndex": "invdetail_qty",
302 "xtype": "ColumnModel",
303 "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }",
307 "*prop": "colModel[]",
309 "dataIndex": "invdetail_bydate_qty",
310 "header": "Qty Before",
312 "xtype": "ColumnModel",
313 "|renderer": "function(v,x,r) { return String.format('<B>{0}</B>', parseInt(v)- parseInt(r.data.invdetail_qty)); }",
317 "*prop": "colModel[]",
319 "dataIndex": "invdetail_bydate_qty",
320 "header": "Qty after",
322 "xtype": "ColumnModel",
323 "|renderer": "function(v) { return String.format('<B>{0}</B>', parseInt( v)); }",
327 "xtype": "ColumnModel",
328 "header": "Invhist comments",
330 "dataIndex": "invhist_comments",
331 "|renderer": "function(v) { return String.format('{0}', v); }",
333 "*prop": "colModel[]"
341 "click": "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n}"
343 "*prop": "buttons[]",
350 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
352 "*prop": "buttons[]",