{ "id": "roo-file-56", "name": "Pman.Tab.XtuplePriceLists", "parent": "Pman.Tab.XtupleManage", "title": "Pman.Tab.XtuplePriceLists", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePriceLists.bjs", "items": [ { "background": true, "fitContainer": true, "fitToFrame": true, "region": "center", "title": "Price List", "xtype": "NestedLayoutPanel", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "BorderLayout", "*prop": "layout", "items": [ { "*prop": "center", "xtype": "LayoutRegion", "|xns": "Roo" }, { "*prop": "east", "split": true, "width": 350, "xtype": "LayoutRegion", "|xns": "Roo" }, { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "background": true, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "ipshead", "title": "Price Lists", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.XtuplePriceList\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).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" }, "*prop": "grid", "autoExpandColumn": "ipshead_descrip", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "listeners": { "afterselectionchange": "function (_self)\n{\n _this.igrid.footer.onClick('first');\n}" }, "*prop": "sm", "singleSelect": true, "xtype": "RowSelectionModel", "|xns": "Roo.grid" }, { "*prop": "dataSource", "xtype": "Store", "remoteSort": true, "|sortInfo": "{ field : 'ipshead_name', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/ipshead.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|fields": "[\n {\n 'name': 'ipshead_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_name',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_descrip',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_effective',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_expires',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_updated',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_curr_id_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_curr_id_curr_base',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_curr_id_curr_name',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_curr_id_curr_symbol',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_curr_id_curr_abbr',\n 'type': 'string'\n }\n]" } ] }, { "*prop": "footer", "displayInfo": true, "displayMsg": "Displaying ipshead{0} - {1} of {2}", "emptyMsg": "No ipshead found", "pageSize": 25, "xtype": "PagingToolbar", "|xns": "Roo" }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "listeners": { "click": "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/Ipsiteminfo',\n params : {\n _pricegrid : 1\n }\n });\n}" }, "text": "Download Price Matrix", "xtype": "Button", "|xns": "Roo.Toolbar" }, { "listeners": { "click": "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Pricing'\n \n },\n function (data) {\n var msg = [];\n if (data.deleted) {\n msg.push(\"Deleted \" + data.deleted + \" Price(s)\");\n }\n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Price(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Price(s)\");\n }\n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}" }, "text": "Upload Price Matrix", "xtype": "Button", "|xns": "Roo.Toolbar" }, { "|xns": "Roo.Toolbar", "xtype": "Fill" }, { "text": "Add", "xtype": "Button", "cls": "x-btn-text-icon", "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", "listeners": { "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" }, "|xns": "Roo.Toolbar" }, { "text": "Delete", "cls": "x-btn-text-icon", "|icon": "rootURL + '/Pman/templates/images/trash.gif'", "xtype": "Button", "listeners": { "|click": "function()\n{\n Pman.genericDelete(_this, 'ipshead'); \n}\n " }, "|xns": "Roo.Toolbar" } ] }, { "*prop": "colModel[]", "dataIndex": "ipshead_curr_id_curr_name", "header": "Ipshead curr", "sortable": true, "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "ipshead_name", "header": "Ipshead name", "sortable": true, "width": 200, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "xtype": "ColumnModel", "header": "Ipshead descrip", "width": 200, "dataIndex": "ipshead_descrip", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "*prop": "colModel[]" }, { "xtype": "ColumnModel", "header": "Ipshead effective", "width": 75, "dataIndex": "ipshead_effective", "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", "|xns": "Roo.grid", "*prop": "colModel[]" }, { "*prop": "colModel[]", "dataIndex": "ipshead_expires", "header": "Ipshead expires", "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", "|xns": "Roo.grid" }, { "xtype": "ColumnModel", "header": "Ipshead updated", "width": 75, "dataIndex": "ipshead_updated", "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", "|xns": "Roo.grid", "*prop": "colModel[]" } ] } ] }, { "listeners": { "|activate": "function() {\n _this.ipanel = this;\n if (_this.igrid) {\n // _this.igrid.footer.onClick('first');\n }\n}" }, "background": true, "fitContainer": true, "fitToframe": true, "region": "east", "tableName": "item", "title": "Products", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|render": "function() \n{\n _this.igrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.ipanel.active) {\n //this.footer.onClick('first');\n }\n}", "afteredit": "function (e)\n{\n if(e.value == e.originalValue){\n return false; \n }\n \n var p = _this.grid.getSelectionModel().getSelected();\n \n if(!p || p.data.ipshead_id * 1 < 1){\n Roo.MessageBox.alert('Error','Please select a price list');\n return false; \n }\n \n new Pman.Request({\n url : baseURL +'/Roo/Item',\n method : 'POST',\n marks : 'Posting',\n params : {\n update_ipshead : 1,\n ipshead_id : p.data.ipshead_id,\n item_id : e.record.data.item_id,\n _price : e.value,\n },\n success : function() {\n _this.igrid.footer.onClick('refresh');\n }\n \n });\n \n}", "beforeedit": "function (e)\n{\n if(e.field != 'ipshead_price'){\n return false;\n }\n\n}" }, "*prop": "grid", "autoExpandColumn": "item_number", "clicksToEdit": 1, "loadMask": true, "xtype": "EditorGrid", "|xns": "Roo.grid", "items": [ { "listeners": { "beforeload": "function (_self, o)\n{\n o.params = o.params || {}\n \n var p = _this.grid.getSelectionModel().getSelected();\n \n if(!p || p.data.ipshead_id * 1 < 1){\n this.removeAll();\n return false;\n }\n \n //o.params.item_active = 1;\n o.params._ipshead_price = 1;\n o.params._ipshead_id = p.data.ipshead_id;\n\n}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'item_number', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/item.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[\n {\n 'name': 'item_id',\n 'type': 'int'\n },\n {\n 'name': 'item_number',\n 'type': 'string'\n }\n]", "|xns": "Roo.data" } ] }, { "*prop": "footer", "displayInfo": true, "displayMsg": "", "emptyMsg": "", "pageSize": 25, "xtype": "PagingToolbar", "|xns": "Roo" }, { "*prop": "colModel[]", "dataIndex": "item_number", "header": "Number", "width": 150, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "align": "right", "dataIndex": "ipshead_price", "header": "Price", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); }", "|xns": "Roo.grid", "items": [ { "|xns": "Roo.grid", "xtype": "GridEditor", "*prop": "editor", "items": [ { "*prop": "field", "decimalPrecision": 2, "minValue": 1, "style": "text-align:right", "xtype": "NumberField", "|xns": "Roo.form" } ] } ] } ] } ] } ] } ] } ], "permname": "", "modOrder": "001" }