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 : "Nothing found",
136 Pman.Dialog.XtupleCurrency.show( { curr_id : 0 } , function() {
137 _this.grid.footer.onClick('first');
141 cls : 'x-btn-text-icon',
143 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
155 if (!_this.dialog) return;
156 _this.dialog.show( { id : 0 } , function() {
157 _this.grid.footer.onClick('first');
161 cls : 'x-btn-text-icon',
162 text : "Get this months rates",
163 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
169 xtype: 'ColumnModel',
171 dataIndex : 'curr_name',
174 renderer : function(v,x,r) {
176 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
181 xtype: 'ColumnModel',
183 dataIndex : 'curr_symbol',
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_abbr',
198 renderer : function(v,x,r) {
200 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
211 activate : function() {
214 _this.rgrid.footer.onClick('first');
222 tableName : 'curr_rate',
231 //_this.dialog = Pman.Dialog.FILL_IN
232 if (_this.rpanel.active) {
233 this.footer.onClick('first');
236 rowdblclick : function (_self, rowIndex, e)
238 if (!_this.dialog) return;
239 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
240 _this.grid.footer.onClick('first');
244 autoExpandColumn : 'curr_rate',
250 beforeload : function (_self, options)
252 var s = _this.grid.selModel.getSelected();
257 options.params.curr_id = s.data.curr_id;
258 options.params._with_base_symbol = 1;
262 sortInfo : { field : 'curr_effective', direction: 'DESC' },
267 url : baseURL + '/Roo/curr_rate.php'
272 totalProperty : 'total',
277 'name': 'curr_rate_id',
293 'name': 'curr_effective',
295 'dateFormat': 'Y-m-d'
298 'name': 'curr_expires',
300 'dateFormat': 'Y-m-d'
306 xtype: 'PagingToolbar',
310 displayMsg : "Displaying curr_rate{0} - {1} of {2}",
311 emptyMsg : "No curr_rate found"
315 xtype: 'ColumnModel',
317 dataIndex : 'curr_effective',
320 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
323 xtype: 'ColumnModel',
325 dataIndex : 'curr_expires',
328 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
331 xtype: 'ColumnModel',
334 dataIndex : 'curr_rate',
337 renderer : function(v) { return String.format('{0}', v); }
340 xtype: 'ColumnModel',
343 dataIndex : 'curr_rate1',
346 renderer : function(v,x,r) {
348 return String.format('{1}1 = {2}{0}',
349 Roo.util.Format.number(r.data.curr_rate,2),
350 r.data.base_curr_symbol,
351 r.data.curr_id_curr_symbol
357 xtype: 'ColumnModel',
360 dataIndex : 'curr_rate2',
363 renderer : function(v,x,r) {
364 return String.format('{2}1 = {1}{0}',
365 Roo.util.Format.number(1.0/r.data.curr_rate,2),
366 r.data.base_curr_symbol,
367 r.data.curr_id_curr_symbol
376 xtype: 'LayoutRegion',
382 xtype: 'LayoutRegion',