<BR><FONT SIZE="-1">(comma-separated)</FONT>
</TD>
<TD>
- <TEXTAREA NAME="npa" WRAP=SOFT><% join(', ', map $_->npa, @rate_prefix ) %></TEXTAREA>
+ <TEXTAREA NAME="npa" WRAP=SOFT><% join(', ', map { $_->npa. (length($_->nxx) ? '-'.$_->nxx : '') } @rate_prefix ) %></TEXTAREA>
</TD>
</TR>
Rate plan
</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">
- <FONT SIZE=-1>Included<BR>minutes</FONT>
+ <FONT SIZE=-1>Included<BR>minutes/calls</FONT>
</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">
- <FONT SIZE=-1>Charge per<BR>minute</FONT>
+ <FONT SIZE=-1>Connection<BR>charge</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Connection<BR>charge for</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Charge per<BR>minute/call</FONT>
</TH>
<TH CLASS="grid" BGCOLOR="#cccccc">
<FONT SIZE=-1>Granularity</FONT>
</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Usage class</FONT>
+ </TH>
</TR>
% foreach my $rate ( qsearch('rate', {}) ) {
</TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <INPUT TYPE="text" SIZE=5 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included %>">
+ <INPUT TYPE="text" SIZE=9 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included |h %>">
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$money_char%><INPUT TYPE="text" SIZE=9 NAME="conn_charge<%$n%>" VALUE="<% $cgi->param("conn_charge$n") || $rate_detail->conn_charge |h %>">
</TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
- $<INPUT TYPE="text" SIZE=4 NAME="min_charge<%$n%>" VALUE="<% sprintf('%.2f', $cgi->param("min_charge$n") || $rate_detail->min_charge ) %>">
+ <SELECT NAME="conn_sec<%$n%>">
+% foreach my $conn_sec ( keys %conn_secs ) {
+% my $curr_value = $cgi->param("conn_sec$n") || $rate_detail->conn_sec;
+% my $selected = ($conn_sec==$curr_value) ? ' SELECTED' : '';
+ <OPTION VALUE="<% $conn_sec %>" <%$selected%>><% $conn_secs{$conn_sec} %></OPTION>
+% }
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$money_char%><INPUT TYPE="text" SIZE=6 NAME="min_charge<%$n%>" VALUE="<% $cgi->param("min_charge$n") || $rate_detail->min_charge |h %>">
</TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
</SELECT>
</TD>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <% include( '/elements/select-table.html',
+ 'element_name' => "classnum$n",
+ 'table' => 'usage_class',
+ 'name_col' => 'classname',
+ 'empty_label' => '(default)',
+ 'hashref' => { disabled => '' },
+ 'curr_value' => ( $cgi->param("classnum$n") ||
+ $rate_detail->classnum ),
+ )
+ %>
+ </TD>
+
</TR>
% }
</FORM>
<% include('/elements/footer.html') %>
+<%once>
+tie my %conn_secs, 'Tie::IxHash', FS::rate_detail::conn_secs();
+
+</%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
+
my $rate_region;
if ( $cgi->param('error') ) {
$rate_region = new FS::rate_region ( {
my $p1 = popurl(1);
-tie my %granularity, 'Tie::IxHash',
- '1', => '1 second',
- '6' => '6 second',
- '30' => '30 second', # '1/2 minute',
- '60' => 'minute',
-;
+tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
my @rate_prefix = $rate_region->rate_prefix;
my $countrycode = '';