{ "name" : "Pman.Tab.XtupleCurrency", "parent" : "Pman.Tab.XtupleAccountsTab", "title" : "Pman.Tab.XtupleCurrency", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCurrency.bjs", "permname" : "", "modOrder" : "600", "items" : [ { "background" : true, "region" : "center", "title" : "Currency / Rates", "xtype" : "NestedLayoutPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "width" : 300, "$ xns" : "Roo", "split" : true, "* prop" : "west" }, { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : false, "region" : "west", "title" : "curr_symbol", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "curr_symbol", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n Pman.Dialog.XtupleCurrency.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", "|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}" }, "autoExpandColumn" : "curr_name", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "afterselectionchange" : "function (_self)\n{\n _this.rgrid.footer.onClick('first');\n}" }, "xtype" : "RowSelectionModel", "singleSelect" : true, "$ xns" : "Roo.grid", "* prop" : "sm" }, { "remoteSort" : true, "xtype" : "Store", "$ sortInfo" : "{ field : 'curr_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/curr_symbol.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'curr_id',\n 'type': 'int'\n },\n {\n 'name': 'curr_base',\n 'type': 'int'\n },\n {\n 'name': 'curr_name',\n 'type': 'string'\n },\n {\n 'name': 'curr_symbol',\n 'type': 'string'\n },\n {\n 'name': 'curr_abbr',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "Nothing found", "$ xns" : "Roo", "displayMsg" : "{0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|click" : "function()\n{\n Pman.Dialog.XtupleCurrency.show( { curr_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelected();\n \n if(!s){\n Roo.MessageBox.alert(\"Error\", \"Please select a currency!\");\n return;\n }\n \n new Pman.Request({\n method: 'POST',\n url: baseURL+ '/Roo/curr_symbol',\n params : {\n curr_id : s.data.curr_id,\n _load_rates : 1\n },\n success : function() {\n _this.rgrid.footer.onClick('first');\n }\n });\n}\n" }, "text" : "Get this months rates", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "header" : "Name", "width" : 80, "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '{0}' : '{0}', v); \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_name" }, { "xtype" : "ColumnModel", "header" : "Symbol", "width" : 80, "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '{0}' : '{0}', v); \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_symbol" }, { "xtype" : "ColumnModel", "header" : "Abbr.", "width" : 80, "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '{0}' : '{0}', v); \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_abbr" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.rpanel = this;\n if (_this.rgrid) {\n _this.rgrid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : false, "region" : "center", "title" : "curr_rate", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "curr_rate", "items" : [ { "listeners" : { "|render" : "function() \n{\n _this.rgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.rpanel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "curr_rate", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "xtype" : "RowSelectionModel", "singleSelect" : true, "$ xns" : "Roo.grid", "* prop" : "sm" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function ()\n{\n\n var sel = _this.rgrid.getSelectionModel().getSelected();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a rate\");\n return;\n }\n \n Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to delete this rate?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n new Pman.Request({\n mask : 'Deleting',\n url : baseURL + '/Roo/curr_rate',\n method : 'POST',\n params : {\n _delete : sel.data.curr_rate_id\n },\n success : function() {\n _this.rgrid.footer.onClick('first');\n }\n })\n \n }\n );\n \n \n \n}" }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "listeners" : { "beforeload" : "function (_self, options)\n{\n var s = _this.grid.selModel.getSelected();\n if (!s) { \n this.removeAll();\n return false;\n }\n options.params.curr_id = s.data.curr_id;\n options.params._with_base_symbol = 1;\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'curr_effective', direction: 'DESC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/curr_rate.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'curr_rate_id',\n 'type': 'int'\n },\n {\n 'name': 'curr_id',\n 'type': 'int'\n },\n {\n 'name': 'curr_id',\n 'type': 'int'\n },\n {\n 'name': 'curr_rate',\n 'type': 'float'\n },\n {\n 'name': 'curr_effective',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'curr_expires',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No curr_rate found", "$ xns" : "Roo", "displayMsg" : "Displaying curr_rate {0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "header" : "From", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_effective" }, { "xtype" : "ColumnModel", "header" : "To", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_expires" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Rate", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_rate" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Rate", "width" : 150, "$ renderer" : "function(v,x,r) {\n\n return String.format('{1}1 = {2}{0}', \n Roo.util.Format.number(r.data.curr_rate,2),\n r.data.base_curr_symbol,\n r.data.curr_id_curr_symbol\n ); \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_rate1" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Rate", "width" : 150, "$ renderer" : "function(v,x,r) { \n return String.format('{2}1 = {1}{0}', \n Roo.util.Format.number(1.0/r.data.curr_rate,2),\n r.data.base_curr_symbol,\n r.data.curr_id_curr_symbol\n ); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "curr_rate2" } ] } ] } ] } ] } ] }