% unless ( $opt{'js_only'} ) { % ### % # action % ###
% # maybe we should be a quantity entry instead of a select? even more % # javascript auto-calculation need to display a subtotal & total
% } <%init> my( %opt ) = @_; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; my $name = $opt{'element_name'} || $opt{'field'} || 'usagepricenum'; my $id = $opt{'id'} || $opt{'field'} || 'usagepricenum'; 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 $cust_pkg_usageprice = $curr_value ? qsearchs('cust_pkg_usageprice', { 'usagepricenum' => $curr_value } ) : new FS::cust_pkg_usageprice { 'usagepricepart' => $opt{usagepricepart} }; my $part_pkg_usageprice = $cust_pkg_usageprice->part_pkg_usageprice;