3 "name": "Pman.Dialog.XtupleInvHistory",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleInvHistory.bjs",
14 "title": "View inventory history",
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 "specialkey": "function (_self, e)\n{\n\n _this.grid.footer.onClick('first');\n}"
55 "fieldLabel": "Search Product",
56 "name": "search_name",
62 "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}"
65 "displayField": "itemsite_item_id_item_number",
67 "emptyText": "Select itemsite",
69 "forceSelection": true,
71 "loadingText": "Searching...",
73 "name": "itemsite_item_id_item_number",
75 "qtip": "Select itemsite",
76 "queryParam": "query[number]",
77 "selectOnFocus": true,
78 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> {itemsite_item_id_item_descrip1}</div>",
79 "triggerAction": "all",
81 "valueField": "itemsite_item_id_item_number",
88 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
93 "|sortInfo": "{ direction : 'ASC', field: 'id' }",
100 "|url": "baseURL + '/Roo/itemsite.php'",
105 "xtype": "JsonReader",
109 "totalProperty": "total",
110 "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]"
118 "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}"
121 "displayField": "location_descrip",
123 "emptyText": "Select location",
124 "fieldLabel": "location",
125 "forceSelection": true,
126 "hiddenName": "location_name",
128 "loadingText": "Searching...",
130 "name": "location_descrip",
132 "qtip": "Select location",
133 "queryParam": "query[location_name]",
134 "selectOnFocus": true,
135 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_descrip}</b> </div>",
136 "triggerAction": "all",
138 "valueField": "location_name",
145 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
150 "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
156 "xtype": "HttpProxy",
157 "|url": "baseURL + '/Roo/location.php'",
162 "xtype": "JsonReader",
166 "totalProperty": "total",
167 "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]"
181 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
184 "fitContainer": true,
187 "tableName": "invhist",
189 "xtype": "GridPanel",
194 "|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}",
195 "|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"
198 "autoExpandColumn": "invhist_comments",
205 "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.form.findField('search_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['search[item]'] = _this.form.findField('search_name').getValue();\n \n \n o.params._with_item =1;\n o.params._hide_void =1;\n o.params._with_balance = 1;\n \n}"
207 "*prop": "dataSource",
210 "|sortInfo": "{ field : 'invhist_transdate,invdetail_id', direction: 'DESC' }",
216 "xtype": "HttpProxy",
217 "|url": "baseURL + '/Roo/invdetail.php'",
222 "xtype": "JsonReader",
223 "totalProperty": "total",
227 "|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]"
233 "xtype": "PagingToolbar",
236 "displayMsg": "Displaying invhist{0} - {1} of {2}",
237 "emptyMsg": "No invhist found",
241 "*prop": "colModel[]",
242 "dataIndex": "invhist_transdate",
243 "header": "Invhist transdate",
245 "xtype": "ColumnModel",
246 "|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 }",
250 "*prop": "colModel[]",
251 "dataIndex": "invhist_ordnumber",
254 "xtype": "ColumnModel",
255 "|renderer": "function(v) { return String.format('{0}', v); }",
259 "*prop": "colModel[]",
260 "dataIndex": "item_number",
263 "xtype": "ColumnModel",
264 "|renderer": "function(v) { return String.format('{0}', v); }",
268 "*prop": "colModel[]",
269 "dataIndex": "item_descrip1",
272 "xtype": "ColumnModel",
273 "|renderer": "function(v) { return String.format('{0}', v); }",
277 "*prop": "colModel[]",
278 "dataIndex": "invhist_docnumber",
281 "xtype": "ColumnModel",
282 "|renderer": "function(v) { return String.format('{0}', v); }",
286 "*prop": "colModel[]",
287 "dataIndex": "invhist_transtype",
290 "xtype": "ColumnModel",
291 "|renderer": "function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }",
295 "*prop": "colModel[]",
297 "dataIndex": "invhist_unitcost",
298 "header": " unitcost",
300 "xtype": "ColumnModel",
301 "|renderer": "function(v) { return String.format('{0}', v); }",
305 "*prop": "colModel[]",
306 "dataIndex": "location_name",
307 "header": "Location",
309 "xtype": "ColumnModel",
310 "|renderer": "function(v) { return String.format('<B>{0}</B>', v); }",
314 "*prop": "colModel[]",
316 "dataIndex": "invdetail_qty",
319 "xtype": "ColumnModel",
320 "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }",
324 "*prop": "colModel[]",
326 "dataIndex": "invdetail_before_qty",
327 "header": "Opening Balance",
329 "xtype": "ColumnModel",
330 "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }",
334 "*prop": "colModel[]",
336 "dataIndex": "invdetail_balance_qty",
337 "header": "Closing Balance",
339 "xtype": "ColumnModel",
340 "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }",
344 "*prop": "colModel[]",
345 "dataIndex": "invhist_comments",
346 "header": "Invhist comments",
348 "xtype": "ColumnModel",
349 "|renderer": "function(v) { return String.format('{0}', v); }",
358 "click": "function (_self, e)\n{\n Pman.Dialog.XtupleInvHistoryOld.show({\n itemsite_item_id_item_number : _this.data.itemsite_item_id_item_number,\n\n location_name : _this.data.location_name,\n location_descrip : _this.data.location_descrip, \n invhist_transdate : _this.data.invhist_transdate\n }); \n}"
360 "*prop": "buttons[]",
361 "text": "View (HK data)",
363 "|hidden": "(function() {\n return !!baseURL.match(/hk\\.php/);\n})()",
368 "click": "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n}"
370 "*prop": "buttons[]",
377 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
379 "*prop": "buttons[]",