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 if (!_this.dialog) return;
59 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
60 _this.grid.footer.onClick('first');
64 autoExpandColumn : 'curr_name',
67 xtype: 'RowSelectionModel',
70 afterselectionchange : function (_self)
72 _this.rgrid.footer.onClick('first');
81 sortInfo : { field : 'curr_name', direction: 'ASC' },
86 url : baseURL + '/Roo/curr_symbol.php'
93 totalProperty : 'total',
108 'name': 'curr_symbol',
119 xtype: 'PagingToolbar',
122 displayMsg : "{0} - {1} of {2}",
123 emptyMsg : "No curr_symbol found",
136 if (!_this.dialog) return;
137 _this.dialog.show( { id : 0 } , function() {
138 _this.grid.footer.onClick('first');
142 cls : 'x-btn-text-icon',
144 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
156 if (!_this.dialog) return;
157 _this.dialog.show( { id : 0 } , function() {
158 _this.grid.footer.onClick('first');
162 cls : 'x-btn-text-icon',
163 text : "Get this months rates",
164 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
170 xtype: 'ColumnModel',
172 dataIndex : 'curr_name',
175 renderer : function(v,x,r) {
177 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
182 xtype: 'ColumnModel',
184 dataIndex : 'curr_symbol',
187 renderer : function(v,x,r) {
189 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
194 xtype: 'ColumnModel',
196 dataIndex : 'curr_abbr',
199 renderer : function(v,x,r) {
201 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
212 activate : function() {
215 _this.rgrid.footer.onClick('first');
223 tableName : 'curr_rate',
232 //_this.dialog = Pman.Dialog.FILL_IN
233 if (_this.rpanel.active) {
234 this.footer.onClick('first');
237 rowdblclick : function (_self, rowIndex, e)
239 if (!_this.dialog) return;
240 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
241 _this.grid.footer.onClick('first');
245 autoExpandColumn : 'curr_rate',
251 beforeload : function (_self, options)
253 var s = _this.grid.selModel.getSelected();
258 options.params.curr_id = s.data.curr_id;
259 options.params._with_base_symbol = 1;
263 sortInfo : { field : 'curr_effective', direction: 'DESC' },
268 url : baseURL + '/Roo/curr_rate.php'
273 totalProperty : 'total',
278 'name': 'curr_rate_id',
294 'name': 'curr_effective',
296 'dateFormat': 'Y-m-d'
299 'name': 'curr_expires',
301 'dateFormat': 'Y-m-d'
307 xtype: 'PagingToolbar',
311 displayMsg : "Displaying curr_rate{0} - {1} of {2}",
312 emptyMsg : "No curr_rate found"
316 xtype: 'ColumnModel',
318 dataIndex : 'curr_effective',
321 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
324 xtype: 'ColumnModel',
326 dataIndex : 'curr_expires',
329 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
332 xtype: 'ColumnModel',
335 dataIndex : 'curr_rate',
338 renderer : function(v) { return String.format('{0}', v); }
341 xtype: 'ColumnModel',
344 dataIndex : 'curr_rate1',
347 renderer : function(v,x,r) {
349 return String.format('{1}1 = {2}{0}',
350 Roo.util.Format.number(r.data.curr_rate,2),
351 r.data.base_curr_symbol,
352 r.data.curr_id_curr_symbol
358 xtype: 'ColumnModel',
361 dataIndex : 'curr_rate2',
364 renderer : function(v,x,r) {
365 return String.format('{2}1 = {1}{0}',
366 Roo.util.Format.number(1.0/r.data.curr_rate,2),
367 r.data.base_curr_symbol,
368 r.data.curr_id_curr_symbol
377 xtype: 'LayoutRegion',
383 xtype: 'LayoutRegion',