2 "name" : "Pman.Tab.XtupleCurrency",
3 "parent" : "Pman.Tab.XtupleAccountsTab",
4 "title" : "Pman.Tab.XtupleCurrency",
5 "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCurrency.bjs",
12 "title" : "Currency / Rates",
13 "xtype" : "NestedLayoutPanel",
17 "xtype" : "BorderLayout",
22 "xtype" : "LayoutRegion",
29 "xtype" : "LayoutRegion",
35 "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
40 "title" : "curr_symbol",
41 "xtype" : "GridPanel",
42 "fitContainer" : true,
44 "tableName" : "curr_symbol",
48 "|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",
49 "|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}"
51 "autoExpandColumn" : "curr_name",
59 "afterselectionchange" : "function (_self)\n{\n _this.rgrid.footer.onClick('first');\n}"
61 "xtype" : "RowSelectionModel",
62 "singleSelect" : true,
69 "$ sortInfo" : "{ field : 'curr_name', direction: 'ASC' }",
71 "* prop" : "dataSource",
74 "$ url" : "baseURL + '/Roo/curr_symbol.php'",
76 "xtype" : "HttpProxy",
83 "xtype" : "JsonReader",
84 "$ 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]",
87 "totalProperty" : "total"
93 "xtype" : "PagingToolbar",
94 "emptyMsg" : "Nothing found",
96 "displayMsg" : "{0} - {1} of {2}",
103 "* prop" : "toolbar",
107 "|click" : "function()\n{\n Pman.Dialog.XtupleCurrency.show( { curr_id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
111 "cls" : "x-btn-text-icon",
112 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
113 "$ xns" : "Roo.Toolbar"
117 "$ xns" : "Roo.Toolbar"
121 "|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"
123 "text" : "Get this months rates",
125 "cls" : "x-btn-text-icon",
126 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
127 "$ xns" : "Roo.Toolbar"
132 "xtype" : "ColumnModel",
135 "$ 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}",
136 "$ xns" : "Roo.grid",
137 "* prop" : "colModel[]",
138 "dataIndex" : "curr_name"
141 "xtype" : "ColumnModel",
144 "$ 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}",
145 "$ xns" : "Roo.grid",
146 "* prop" : "colModel[]",
147 "dataIndex" : "curr_symbol"
150 "xtype" : "ColumnModel",
153 "$ 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}",
154 "$ xns" : "Roo.grid",
155 "* prop" : "colModel[]",
156 "dataIndex" : "curr_abbr"
164 "|activate" : "function() {\n _this.rpanel = this;\n if (_this.rgrid) {\n _this.rgrid.footer.onClick('first');\n }\n}"
167 "background" : false,
169 "title" : "curr_rate",
170 "xtype" : "GridPanel",
171 "fitContainer" : true,
173 "tableName" : "curr_rate",
177 "|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}"
179 "autoExpandColumn" : "curr_rate",
182 "$ xns" : "Roo.grid",
186 "xtype" : "RowSelectionModel",
187 "singleSelect" : true,
188 "$ xns" : "Roo.grid",
194 "* prop" : "toolbar",
198 "$ xns" : "Roo.Toolbar"
202 "|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}"
206 "cls" : "x-btn-text-icon",
207 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
208 "$ xns" : "Roo.Toolbar"
214 "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}"
218 "$ sortInfo" : "{ field : 'curr_effective', direction: 'DESC' }",
219 "$ xns" : "Roo.data",
220 "* prop" : "dataSource",
223 "$ url" : "baseURL + '/Roo/curr_rate.php'",
225 "xtype" : "HttpProxy",
226 "$ xns" : "Roo.data",
232 "xtype" : "JsonReader",
233 "$ xns" : "Roo.data",
234 "$ 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]",
236 "totalProperty" : "total"
242 "xtype" : "PagingToolbar",
243 "emptyMsg" : "No curr_rate found",
245 "displayMsg" : "Displaying curr_rate {0} - {1} of {2}",
246 "displayInfo" : true,
250 "xtype" : "ColumnModel",
253 "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
254 "$ xns" : "Roo.grid",
255 "* prop" : "colModel[]",
256 "dataIndex" : "curr_effective"
259 "xtype" : "ColumnModel",
262 "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
263 "$ xns" : "Roo.grid",
264 "* prop" : "colModel[]",
265 "dataIndex" : "curr_expires"
269 "xtype" : "ColumnModel",
272 "$ renderer" : "function(v) { return String.format('{0}', v); }",
273 "$ xns" : "Roo.grid",
274 "* prop" : "colModel[]",
275 "dataIndex" : "curr_rate"
279 "xtype" : "ColumnModel",
282 "$ 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}",
283 "$ xns" : "Roo.grid",
284 "* prop" : "colModel[]",
285 "dataIndex" : "curr_rate1"
289 "xtype" : "ColumnModel",
292 "$ 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}",
293 "$ xns" : "Roo.grid",
294 "* prop" : "colModel[]",
295 "dataIndex" : "curr_rate2"