1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.XtupleCurrency = new Roo.XComponent({
8 part : ["Xtuple", "Currency" ],
9 order : '600-Pman.Tab.XtupleCurrency',
11 parent : 'Pman.Tab.XtupleAccountsTab',
12 name : "Pman.Tab.XtupleCurrency",
23 xtype : 'LayoutRegion',
30 xtype : 'LayoutRegion',
34 xtype : 'BorderLayout',
41 xtype : 'RowSelectionModel',
45 afterselectionchange : function (_self)
47 _this.rgrid.footer.onClick('first');
54 url : baseURL + '/Roo/curr_symbol.php',
78 'name': 'curr_symbol',
87 totalProperty : 'total'
92 sortInfo : { field : 'curr_name', direction: 'ASC' },
102 xtype : 'PagingToolbar',
103 emptyMsg : "Nothing found",
105 displayMsg : "{0} - {1} of {2}",
114 '|xns' : 'Roo.Toolbar',
117 cls : 'x-btn-text-icon',
118 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
123 Pman.Dialog.XtupleCurrency.show( { curr_id : 0 } , function() {
124 _this.grid.footer.onClick('first');
130 '|xns' : 'Roo.Toolbar',
135 '|xns' : 'Roo.Toolbar',
136 text : "Get this months rates",
138 cls : 'x-btn-text-icon',
139 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
144 var s = _this.grid.getSelectionModel().getSelected();
147 Roo.MessageBox.alert("Error", "Please select a currency!");
153 url: baseURL+ '/Roo/curr_symbol',
155 curr_id : s.data.curr_id,
158 success : function() {
159 _this.rgrid.footer.onClick('first');
169 autoExpandColumn : 'curr_name',
176 xtype : 'ColumnModel',
179 renderer : function(v,x,r) {
181 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
185 dataIndex : 'curr_name'
189 xtype : 'ColumnModel',
192 renderer : function(v,x,r) {
194 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
198 dataIndex : 'curr_symbol'
202 xtype : 'ColumnModel',
205 renderer : function(v,x,r) {
207 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
211 dataIndex : 'curr_abbr'
215 rowdblclick : function (_self, rowIndex, e)
217 Pman.Dialog.XtupleCurrency.show( this.getDataSource().getAt(rowIndex).data, function() {
218 _this.grid.footer.onClick('first');
224 //_this.dialog = Pman.Dialog.FILL_IN
225 if (_this.panel.active) {
226 this.footer.onClick('first');
239 title : "curr_symbol",
243 tableName : 'curr_symbol',
245 activate : function() {
248 _this.grid.footer.onClick('first');
261 xtype : 'RowSelectionModel',
271 '|xns' : 'Roo.Toolbar',
276 '|xns' : 'Roo.Toolbar',
279 cls : 'x-btn-text-icon',
280 icon : rootURL + '/Pman/templates/images/trash.gif',
286 var sel = _this.rgrid.getSelectionModel().getSelected();
288 Roo.MessageBox.alert("Error", "Select a rate");
292 Roo.MessageBox.confirm("Are you sure", "Are you sure you want to delete this rate?",
299 url : baseURL + '/Roo/curr_rate',
302 _delete : sel.data.curr_rate_id
304 success : function() {
305 _this.rgrid.footer.onClick('first');
323 url : baseURL + '/Roo/curr_rate.php',
332 xtype : 'JsonReader',
336 'name': 'curr_rate_id',
352 'name': 'curr_effective',
354 'dateFormat': 'Y-m-d'
357 'name': 'curr_expires',
359 'dateFormat': 'Y-m-d'
362 totalProperty : 'total'
367 sortInfo : { field : 'curr_effective', direction: 'DESC' },
370 beforeload : function (_self, options)
372 var s = _this.grid.selModel.getSelected();
377 options.params.curr_id = s.data.curr_id;
378 options.params._with_base_symbol = 1;
389 xtype : 'PagingToolbar',
390 emptyMsg : "No curr_rate found",
392 displayMsg : "Displaying curr_rate {0} - {1} of {2}",
396 autoExpandColumn : 'curr_rate',
403 xtype : 'ColumnModel',
406 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
408 dataIndex : 'curr_effective'
412 xtype : 'ColumnModel',
415 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
417 dataIndex : 'curr_expires'
422 xtype : 'ColumnModel',
425 renderer : function(v) { return String.format('{0}', v); },
427 dataIndex : 'curr_rate'
432 xtype : 'ColumnModel',
435 renderer : function(v,x,r) {
437 return String.format('{1}1 = {2}{0}',
438 Roo.util.Format.number(r.data.curr_rate,2),
439 r.data.base_curr_symbol,
440 r.data.curr_id_curr_symbol
445 dataIndex : 'curr_rate1'
450 xtype : 'ColumnModel',
453 renderer : function(v,x,r) {
454 return String.format('{2}1 = {1}{0}',
455 Roo.util.Format.number(1.0/r.data.curr_rate,2),
456 r.data.base_curr_symbol,
457 r.data.curr_id_curr_symbol
461 dataIndex : 'curr_rate2'
468 //_this.dialog = Pman.Dialog.FILL_IN
469 if (_this.rpanel.active) {
470 this.footer.onClick('first');
487 tableName : 'curr_rate',
489 activate : function() {
492 _this.rgrid.footer.onClick('first');
507 title : "Currency / Rates",
508 xtype : 'NestedLayoutPanel',