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_symbol',
165 curr_id : s.data.curr_id,
168 success : function() {
169 _this.rgrid.footer.onClick('first');
174 cls : 'x-btn-text-icon',
175 text : "Get this months rates",
176 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
182 xtype: 'ColumnModel',
184 dataIndex : 'curr_name',
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_symbol',
199 renderer : function(v,x,r) {
201 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
206 xtype: 'ColumnModel',
208 dataIndex : 'curr_abbr',
211 renderer : function(v,x,r) {
213 return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v);
224 activate : function() {
227 _this.rgrid.footer.onClick('first');
235 tableName : 'curr_rate',
244 //_this.dialog = Pman.Dialog.FILL_IN
245 if (_this.rpanel.active) {
246 this.footer.onClick('first');
250 autoExpandColumn : 'curr_rate',
267 var sel = _this.invgrid.getSelectionModel().getSelected();
269 Roo.MessageBox.alert("Error", "Select a invoice");
272 // check current status of shipment..
275 // cobmisc_id : sel.data.cobmisc_id,
278 if (sel.data.cobmisc_id * 1) {
279 params.cobmisc_id = sel.data.cobmisc_id * 1 ;
281 if (sel.data.cobmisc_invchead_id_invchead_id * 1) {
282 params.invchead_id = sel.data.cobmisc_invchead_id_invchead_id * 1;
285 Roo.MessageBox.confirm("Are you sure", "Are you sure you want to VOID that invoice?",
292 url : baseURL + '/Roo/cobmisc',
295 success : function() {
296 _this.invgrid.ds.load({});
307 cls : 'x-btn-text-icon',
309 icon : rootURL + '/Pman/templates/images/trash.gif'
317 beforeload : function (_self, options)
319 var s = _this.grid.selModel.getSelected();
324 options.params.curr_id = s.data.curr_id;
325 options.params._with_base_symbol = 1;
329 sortInfo : { field : 'curr_effective', direction: 'DESC' },
334 url : baseURL + '/Roo/curr_rate.php'
339 totalProperty : 'total',
344 'name': 'curr_rate_id',
360 'name': 'curr_effective',
362 'dateFormat': 'Y-m-d'
365 'name': 'curr_expires',
367 'dateFormat': 'Y-m-d'
373 xtype: 'PagingToolbar',
376 displayMsg : "Displaying curr_rate {0} - {1} of {2}",
377 emptyMsg : "No curr_rate found",
382 xtype: 'ColumnModel',
384 dataIndex : 'curr_effective',
387 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
390 xtype: 'ColumnModel',
392 dataIndex : 'curr_expires',
395 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
398 xtype: 'ColumnModel',
401 dataIndex : 'curr_rate',
404 renderer : function(v) { return String.format('{0}', v); }
407 xtype: 'ColumnModel',
410 dataIndex : 'curr_rate1',
413 renderer : function(v,x,r) {
415 return String.format('{1}1 = {2}{0}',
416 Roo.util.Format.number(r.data.curr_rate,2),
417 r.data.base_curr_symbol,
418 r.data.curr_id_curr_symbol
424 xtype: 'ColumnModel',
427 dataIndex : 'curr_rate2',
430 renderer : function(v,x,r) {
431 return String.format('{2}1 = {1}{0}',
432 Roo.util.Format.number(1.0/r.data.curr_rate,2),
433 r.data.base_curr_symbol,
434 r.data.curr_id_curr_symbol
443 xtype: 'LayoutRegion',
449 xtype: 'LayoutRegion',