<% my $rate; if ( $cgi->keywords ) { my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $rate = qsearchs( 'rate', { 'ratenum' => $1 } ); } else { #adding $rate = new FS::rate {}; } my $action = $rate->ratenum ? 'Edit' : 'Add'; my $p1 = popurl(1); my %granularity = ( '6' => '6 second', '60' => 'minute', ); my $nous = < <%= header("$action Rate plan", menubar( 'Main Menu' => $p, 'View all rate plans' => "${p}browse/rate.cgi", )) %>
Rate plan

<%= table() %> Region Prefix(es) Included
minutes
Charge per
minute
Granularity <% foreach my $rate_region ( qsearch( 'rate_region', {}, '', "$nous ORDER BY regionname", ) ) { my $n = $rate_region->regionnum; my $rate_detail = $rate->dest_detail($rate_region) || new FS::rate_detail { 'min_included' => 0, 'min_charge' => 0, 'sec_granularity' => '60' }; %> <%= $rate_region->regionname %> <%= $rate_region->prefixes_short %> min_included %>"> $min_charge ) %>"> <% } %> Add a region
" onClick="document.OneTrueForm.submit.disabled=true; process();"> Please make sure to allow popups from this site in order to view the progress window.