{ "id": "roo-file-9", "name": "Pman.Dialog.XtupleInvHistory", "parent": "", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleInvHistory.bjs", "items": [ { "closable": false, "collapsible": false, "height": 500, "modal": true, "resizable": false, "title": "View inventory history", "width": 1000, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "*prop": "north", "height": 50, "xtype": "LayoutRegion", "|xns": "Roo" }, { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "north", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "|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", "|rendered": "function (form)\n{\n _this.form= form;\n}\n" }, "method": "POST", "style": "margin:10px;", "xtype": "Form", "|url": "baseURL + '/Roo/invhist.php'", "|xns": "Roo.form", "items": [ { "width": 1000, "xtype": "Row", "|xns": "Roo.form", "items": [ { "listeners": { "specialkey": "function (_self, e)\n{\n\n _this.grid.footer.onClick('first');\n}" }, "fieldLabel": "Search Product", "name": "search_name", "xtype": "TextField", "|xns": "Roo.form" }, { "listeners": { "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}" }, "allowBlank": true, "displayField": "itemsite_item_id_item_number", "editable": true, "emptyText": "Select itemsite", "fieldLabel": "Item", "forceSelection": true, "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "itemsite_item_id_item_number", "pageSize": 20, "qtip": "Select itemsite", "queryParam": "query[number]", "selectOnFocus": true, "tpl": "
{itemsite_item_id_item_number} {itemsite_item_id_item_descrip1}
", "triggerAction": "all", "typeAhead": true, "valueField": "itemsite_item_id_item_number", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/itemsite.php'", "|xns": "Roo.data" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"itemsite_abcclass\",\"type\":\"string\"}]" } ] } ] }, { "listeners": { "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}" }, "allowBlank": true, "displayField": "location_descrip", "editable": true, "emptyText": "Select location", "fieldLabel": "location", "forceSelection": true, "hiddenName": "location_name", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "location_descrip", "pageSize": 40, "qtip": "Select location", "queryParam": "query[location_name]", "selectOnFocus": true, "tpl": "
{location_descrip}
", "triggerAction": "all", "typeAhead": true, "valueField": "location_name", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'location_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/location.php'", "|xns": "Roo.data" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"location_name\",\"type\":\"string\"}]" } ] } ] } ] } ] } ] }, { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "background": false, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "invhist", "title": "invhist", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|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}", "|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" }, "*prop": "grid", "autoExpandColumn": "invhist_comments", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "listeners": { "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}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'invhist_transdate,invdetail_id', direction: 'DESC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/invdetail.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|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]" } ] }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying invhist{0} - {1} of {2}", "emptyMsg": "No invhist found", "|xns": "Roo" }, { "*prop": "colModel[]", "dataIndex": "invhist_transdate", "header": "Invhist transdate", "width": 75, "xtype": "ColumnModel", "|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 }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "invhist_ordnumber", "header": "Order#", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "item_number", "header": "SKU", "width": 50, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "item_descrip1", "header": "Descr.", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "invhist_docnumber", "header": "doc#", "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "invhist_transtype", "header": "Type", "width": 50, "xtype": "ColumnModel", "|renderer": "function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "align": "right", "dataIndex": "invhist_unitcost", "header": " unitcost", "width": 50, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "location_name", "header": "Location", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "align": "right", "dataIndex": "invdetail_qty", "header": "Change", "width": 50, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "align": "right", "dataIndex": "invdetail_before_qty", "header": "Opening Balance", "width": 90, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "align": "right", "dataIndex": "invdetail_balance_qty", "header": "Closing Balance", "width": 85, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', parseInt( v)); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "invhist_comments", "header": "Invhist comments", "width": 150, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" } ] } ] }, { "listeners": { "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}" }, "*prop": "buttons[]", "text": "View (HK data)", "xtype": "Button", "|hidden": "(function() {\n return !!baseURL.match(/hk\\.php/);\n})()", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n}" }, "*prop": "buttons[]", "text": "Download", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "Close", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }