% unless ( $opt{'js_only'} ) { % ### % # price % ### % ### % # action % ### % ### % # target % ### % ### % # amount % ###
% #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> tie my %targets, 'Tie::IxHash', # once? #'svc_acct.totalbytes' => { label => 'Megabytes', # mult => 1048576, # }, 'svc_acct.totalbytes' => { label => 'Gigabytes', mult => 1073741824, }, 'svc_acct.seconds' => { label => 'Hours', mult => 3600, }, 'svc_conferencing.participants' => { label => 'Conference Participants', mult => 1, }, #this will take more work: set action, not increment.. # and then value comes from a select, not a text field # 'svc_conferencing.confqualitynum' => { label => 'Conference Quality', # }, ; 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 {};