1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.XtupleCurrency = new Roo.XComponent({
6 part : ["Xtuple","Currency"],
7 order : '901-Pman.Tab.XtupleCurrency',
9 parent : 'Pman.Tab.XtupleAccountsTab',
10 name : "Pman.Tab.XtupleCurrency",
18 xtype: 'NestedLayoutPanel',
22 title : "Currency / Rates",
24 xtype: 'BorderLayout',
31 activate : function() {
34 _this.grid.footer.onClick('first');
42 tableName : 'curr_symbol',
43 title : "curr_symbol",
51 //_this.dialog = Pman.Dialog.FILL_IN
52 if (_this.panel.active) {
53 this.footer.onClick('first');
56 rowdblclick : function (_self, rowIndex, e)
58 Pman.Dialog.XtupleCurrency.show( this.getDataSource().getAt(rowIndex).data, function() {
59 _this.grid.footer.onClick('first');
63 autoExpandColumn : 'curr_name',
66 xtype: 'RowSelectionModel',
69 afterselectionchange : function (_self)
71 _this.rgrid.footer.onClick('first');
80 sortInfo : { field : 'curr_name', direction: 'ASC' },
85 url : baseURL + '/Roo/curr_symbol.php'
92 totalProperty : 'total',
107 'name': 'curr_symbol',
118 xtype: 'PagingToolbar',
121 displayMsg : "{0} - {1} of {2}",
122 emptyMsg : "Nothing found",
135 Pman.Dialog.XtupleCurrency.show( { curr_id : 0 } , function() {
136 _this.grid.footer.onClick('first');
140 cls : 'x-btn-text-icon',
142 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
156 url: baseURL+ '/Roo/curr_rate',
160 success : function() {
166 cls : 'x-btn-text-icon',
167 text : "Get this months rates",
168 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
174 xtype: 'ColumnModel',
176 dataIndex : 'curr_name',
179 renderer : function(v,x,r) {
181 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
186 xtype: 'ColumnModel',
188 dataIndex : 'curr_symbol',
191 renderer : function(v,x,r) {
193 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
198 xtype: 'ColumnModel',
200 dataIndex : 'curr_abbr',
203 renderer : function(v,x,r) {
205 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
216 activate : function() {
219 _this.rgrid.footer.onClick('first');
227 tableName : 'curr_rate',
236 //_this.dialog = Pman.Dialog.FILL_IN
237 if (_this.rpanel.active) {
238 this.footer.onClick('first');
241 rowdblclick : function (_self, rowIndex, e)
243 if (!_this.dialog) return;
244 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
245 _this.grid.footer.onClick('first');
249 autoExpandColumn : 'curr_rate',
255 beforeload : function (_self, options)
257 var s = _this.grid.selModel.getSelected();
262 options.params.curr_id = s.data.curr_id;
263 options.params._with_base_symbol = 1;
267 sortInfo : { field : 'curr_effective', direction: 'DESC' },
272 url : baseURL + '/Roo/curr_rate.php'
277 totalProperty : 'total',
282 'name': 'curr_rate_id',
298 'name': 'curr_effective',
300 'dateFormat': 'Y-m-d'
303 'name': 'curr_expires',
305 'dateFormat': 'Y-m-d'
311 xtype: 'PagingToolbar',
314 displayMsg : "Displaying curr_rate {0} - {1} of {2}",
315 emptyMsg : "No curr_rate found",
320 xtype: 'ColumnModel',
322 dataIndex : 'curr_effective',
325 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
328 xtype: 'ColumnModel',
330 dataIndex : 'curr_expires',
333 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
336 xtype: 'ColumnModel',
339 dataIndex : 'curr_rate',
342 renderer : function(v) { return String.format('{0}', v); }
345 xtype: 'ColumnModel',
348 dataIndex : 'curr_rate1',
351 renderer : function(v,x,r) {
353 return String.format('{1}1 = {2}{0}',
354 Roo.util.Format.number(r.data.curr_rate,2),
355 r.data.base_curr_symbol,
356 r.data.curr_id_curr_symbol
362 xtype: 'ColumnModel',
365 dataIndex : 'curr_rate2',
368 renderer : function(v,x,r) {
369 return String.format('{2}1 = {1}{0}',
370 Roo.util.Format.number(1.0/r.data.curr_rate,2),
371 r.data.base_curr_symbol,
372 r.data.curr_id_curr_symbol
381 xtype: 'LayoutRegion',
387 xtype: 'LayoutRegion',