% unless ( $opt{'js_only'} ) { % ### % # price % ### % ### % # action % ### % ### % # target % ### % ### % # amount % ### % my $amount = % scalar($cgi->param($name.'_amount')) % || ( $part_pkg_usageprice->amount % / ($targets->{$part_pkg_usageprice->target}{multiplier} || 1) ); % $amount = '' unless $amount > 0;
% #XXX lots more work for multi-currency... maybe larger UI changes :/ % foreach my $currency ( () ) { % #foreach my $currency ( sort $conf->config('currencies') ) { % }
Price <% $money_char %> >
<% $currency %> <% currency_symbol($currency, SYM_HTML) %> >
>
% } <%init> my $targets = FS::part_pkg_usageprice->targets; my( %opt ) = @_; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; my $name = $opt{'element_name'} || $opt{'field'} || 'usagepricepart'; my $id = $opt{'id'} || 'usagepricepart'; my $curr_value = $opt{'curr_value'} || $opt{'value'}; my $onchange = ''; if ( $opt{'onchange'} ) { $onchange = $opt{'onchange'}; $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/; $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange #callbacks should act the same $onchange = 'onChange="'. $onchange. '"'; } my $part_pkg_usageprice = $curr_value ? qsearchs('part_pkg_usageprice', { 'usagepricepart' => $curr_value } ) : new FS::part_pkg_usageprice {};