{
- "id": "roo-file-529",
- "name": "Pman.Tab.XtupleCurrency",
- "parent": "",
- "title": "",
- "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCurrency.bjs",
- "items": [
+ "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" : [
{
- "|xns": "Roo",
- "xtype": "NestedLayoutPanel",
- "items": [
+ "background" : true,
+ "region" : "center",
+ "title" : "Currency / Rates",
+ "xtype" : "NestedLayoutPanel",
+ "$ xns" : "Roo",
+ "items" : [
{
- "|xns": "Roo",
- "xtype": "BorderLayout",
- "*prop": "layout",
- "items": [
+ "xtype" : "BorderLayout",
+ "$ xns" : "Roo",
+ "* prop" : "layout",
+ "items" : [
{
- "*prop": "west",
- "split": true,
- "width": 300,
- "xtype": "LayoutRegion",
- "|xns": "Roo"
+ "xtype" : "LayoutRegion",
+ "width" : 300,
+ "$ xns" : "Roo",
+ "split" : true,
+ "* prop" : "west"
},
{
- "|xns": "Roo",
- "xtype": "LayoutRegion",
- "*prop": "center"
+ "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}"
+ "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": "west",
- "tableName": "curr_symbol",
- "title": "curr_symbol",
- "xtype": "GridPanel",
- "|xns": "Roo",
- "items": [
+ "fitToframe" : true,
+ "background" : false,
+ "region" : "west",
+ "title" : "curr_symbol",
+ "xtype" : "GridPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "tableName" : "curr_symbol",
+ "items" : [
{
- "*prop": "grid",
- "xtype": "Grid",
- "autoExpandColumn": "curr_name",
- "loadMask": true,
- "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).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
+ "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}"
},
- "|xns": "Roo.grid",
- "items": [
+ "autoExpandColumn" : "curr_name",
+ "xtype" : "Grid",
+ "loadMask" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
{
- "*prop": "dataSource",
- "xtype": "Store",
- "remoteSort": true,
- "|sortInfo": "{ field : 'curr_name', direction: 'ASC' }",
- "|xns": "Roo.data",
- "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" : [
{
- "*prop": "proxy",
- "xtype": "HttpProxy",
- "method": "GET",
- "|url": "baseURL + '/Roo/curr_symbol.php'",
- "|xns": "Roo.data"
+ "$ url" : "baseURL + '/Roo/curr_symbol.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
},
{
- "|xns": "Roo.data",
- "xtype": "JsonReader",
- "totalProperty": "total",
- "root": "data",
- "*prop": "reader",
- "id": "id",
- "|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]"
+ "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"
}
]
},
{
- "*prop": "footer",
- "xtype": "PagingToolbar",
- "pageSize": 25,
- "displayInfo": true,
- "displayMsg": "Displaying curr_symbol{0} - {1} of {2}",
- "emptyMsg": "No curr_symbol found",
- "|xns": "Roo"
+ "pageSize" : 25,
+ "xtype" : "PagingToolbar",
+ "emptyMsg" : "Nothing found",
+ "$ xns" : "Roo",
+ "displayMsg" : "{0} - {1} of {2}",
+ "displayInfo" : true,
+ "* prop" : "footer"
},
{
- "*prop": "toolbar",
- "xtype": "Toolbar",
- "|xns": "Roo",
- "items": [
+ "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"
+ },
{
- "|xns": "Roo.Toolbar",
- "xtype": "Fill"
+ "xtype" : "Fill",
+ "$ xns" : "Roo.Toolbar"
},
{
- "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"
+ "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"
},
- "|xns": "Roo.Toolbar"
+ "text" : "Get this months rates",
+ "xtype" : "Button",
+ "cls" : "x-btn-text-icon",
+ "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+ "$ xns" : "Roo.Toolbar"
}
]
},
{
- "*prop": "colModel[]",
- "dataIndex": "curr_name",
- "header": "Name",
- "width": 80,
- "xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n \n}",
- "|xns": "Roo.grid"
+ "xtype" : "ColumnModel",
+ "header" : "Name",
+ "width" : 80,
+ "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n \n}",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "curr_name"
},
{
- "*prop": "colModel[]",
- "dataIndex": "curr_symbol",
- "header": "Symbol",
- "width": 80,
- "xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n \n}",
- "|xns": "Roo.grid"
+ "xtype" : "ColumnModel",
+ "header" : "Symbol",
+ "width" : 80,
+ "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n \n}",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "curr_symbol"
},
{
- "*prop": "colModel[]",
- "dataIndex": "curr_abbr",
- "header": "Abbr.",
- "width": 80,
- "xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n \n}",
- "|xns": "Roo.grid"
+ "xtype" : "ColumnModel",
+ "header" : "Abbr.",
+ "width" : 80,
+ "$ renderer" : "function(v,x,r) { \n\n return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{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}"
+ "listeners" : {
+ "|activate" : "function() {\n _this.rpanel = this;\n if (_this.rgrid) {\n _this.rgrid.footer.onClick('first');\n }\n}"
},
- "background": false,
- "fitContainer": true,
- "fitToframe": true,
- "region": "center",
- "tableName": "curr_rate",
- "title": "curr_rate",
- "xtype": "GridPanel",
- "|xns": "Roo",
- "items": [
+ "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}",
- "|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"
+ "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}"
},
- "*prop": "grid",
- "autoExpandColumn": "",
- "loadMask": true,
- "xtype": "Grid",
- "|xns": "Roo.grid",
- "items": [
+ "autoExpandColumn" : "curr_rate",
+ "xtype" : "Grid",
+ "loadMask" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
{
- "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.parms.curr_id = s.data.curr_id;\n}"
- },
- "*prop": "dataSource",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : '', direction: 'ASC' }",
- "|xns": "Roo.data",
- "items": [
+ "xtype" : "RowSelectionModel",
+ "singleSelect" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "sm"
+ },
+ {
+ "xtype" : "Toolbar",
+ "$ xns" : "Roo",
+ "* prop" : "toolbar",
+ "items" : [
{
- "*prop": "proxy",
- "xtype": "HttpProxy",
- "method": "GET",
- "|url": "baseURL + '/Roo/curr_rate.php'",
- "|xns": "Roo.data"
+ "xtype" : "Fill",
+ "$ xns" : "Roo.Toolbar"
},
{
- "|xns": "Roo.data",
- "xtype": "JsonReader",
- "totalProperty": "total",
- "root": "data",
- "*prop": "reader",
- "id": "id",
- "|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]"
+ "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"
}
]
},
{
- "*prop": "footer",
- "xtype": "PagingToolbar",
- "pageSize": 25,
- "displayInfo": true,
- "displayMsg": "Displaying curr_rate{0} - {1} of {2}",
- "emptyMsg": "No curr_rate found",
- "|xns": "Roo"
- },
- {
- "*prop": "toolbar",
- "xtype": "Toolbar",
- "|xns": "Roo",
- "items": [
+ "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" : [
{
- "|xns": "Roo.Toolbar",
- "xtype": "Fill"
+ "$ url" : "baseURL + '/Roo/curr_rate.php'",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
},
{
- "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"
+ "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"
}
]
},
{
- "*prop": "colModel[]",
- "dataIndex": "curr_effective",
- "header": "From",
- "width": 75,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
- "|xns": "Roo.grid"
+ "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"
},
{
- "*prop": "colModel[]",
- "dataIndex": "curr_expires",
- "header": "To",
- "width": 75,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
- "|xns": "Roo.grid"
+ "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"
},
{
- "xtype": "ColumnModel",
- "header": "Curr rate",
- "width": 75,
- "dataIndex": "curr_rate",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid",
- "*prop": "colModel[]"
+ "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"
}
]
}
}
]
}
- ],
- "permname": "",
- "modOrder": "001"
+ ]
}
\ No newline at end of file