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'
154 var s = _this.grid.getSelectionModel().getSelected();
157 Roo.MessageBox.alert("Error", "Please select a currency!");
163 url: baseURL+ '/Roo/curr_rate',
167 success : function() {
173 cls : 'x-btn-text-icon',
174 text : "Get this months rates",
175 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
181 xtype: 'ColumnModel',
183 dataIndex : 'curr_name',
186 renderer : function(v,x,r) {
188 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
193 xtype: 'ColumnModel',
195 dataIndex : 'curr_symbol',
198 renderer : function(v,x,r) {
200 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
205 xtype: 'ColumnModel',
207 dataIndex : 'curr_abbr',
210 renderer : function(v,x,r) {
212 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
223 activate : function() {
226 _this.rgrid.footer.onClick('first');
234 tableName : 'curr_rate',
243 //_this.dialog = Pman.Dialog.FILL_IN
244 if (_this.rpanel.active) {
245 this.footer.onClick('first');
248 rowdblclick : function (_self, rowIndex, e)
250 if (!_this.dialog) return;
251 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
252 _this.grid.footer.onClick('first');
256 autoExpandColumn : 'curr_rate',
262 beforeload : function (_self, options)
264 var s = _this.grid.selModel.getSelected();
269 options.params.curr_id = s.data.curr_id;
270 options.params._with_base_symbol = 1;
274 sortInfo : { field : 'curr_effective', direction: 'DESC' },
279 url : baseURL + '/Roo/curr_rate.php'
284 totalProperty : 'total',
289 'name': 'curr_rate_id',
305 'name': 'curr_effective',
307 'dateFormat': 'Y-m-d'
310 'name': 'curr_expires',
312 'dateFormat': 'Y-m-d'
318 xtype: 'PagingToolbar',
321 displayMsg : "Displaying curr_rate {0} - {1} of {2}",
322 emptyMsg : "No curr_rate found",
327 xtype: 'ColumnModel',
329 dataIndex : 'curr_effective',
332 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
335 xtype: 'ColumnModel',
337 dataIndex : 'curr_expires',
340 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
343 xtype: 'ColumnModel',
346 dataIndex : 'curr_rate',
349 renderer : function(v) { return String.format('{0}', v); }
352 xtype: 'ColumnModel',
355 dataIndex : 'curr_rate1',
358 renderer : function(v,x,r) {
360 return String.format('{1}1 = {2}{0}',
361 Roo.util.Format.number(r.data.curr_rate,2),
362 r.data.base_curr_symbol,
363 r.data.curr_id_curr_symbol
369 xtype: 'ColumnModel',
372 dataIndex : 'curr_rate2',
375 renderer : function(v,x,r) {
376 return String.format('{2}1 = {1}{0}',
377 Roo.util.Format.number(1.0/r.data.curr_rate,2),
378 r.data.base_curr_symbol,
379 r.data.curr_id_curr_symbol
388 xtype: 'LayoutRegion',
394 xtype: 'LayoutRegion',