<& /elements/header.html, 'Exchange rates' &>
<& /elements/table-grid.html &> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; % my $bgcolor = ''; From Rate To %foreach my $currency (@currencies) { % % if ( $bgcolor eq $bgcolor1 ) { % $bgcolor = $bgcolor2; % } else { % $bgcolor = $bgcolor1; % } % % my %hash = ( 'from_currency' => $currency, % 'to_currency' => $to_currency, % ); % % my $currency_exchange = qsearchs('currency_exchange', \%hash) % || new FS::currency_exchange \%hash; % % $currency_exchange->rate('1.000000') if length($currency_exchange->rate) == 0; <% $currency %>: <% code2currency($currency) %> " VALUE = "<% $currency_exchange->rate %>" SIZE = 14 MAXLENGTH = 14 > <% $to_currency %>: <% code2currency($to_currency) %> % }
<& /elements/footer.html &> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my $conf = new FS::Conf; my $to_currency = $conf->config('currency') || 'USD'; my @currencies = sort { $a cmp $b } $conf->config('currencies');