1 <& /elements/header.html,
4 'View all rate plans' => "${p}browse/rate.cgi",
5 'View packages that use this plan' => "${p}browse/part_pkg.cgi?ratenum="
10 <% include('/elements/progress-init.html',
12 [ 'rate', 'agentnum' ],
17 <FORM NAME="OneTrueForm">
18 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
20 <TABLE CLASS="fsinnerbox">
22 <& /elements/tr-select-agent.html,
23 disable_empty => ! $FS::CurrentUser::CurrentUser->access_right('Configuration'), #, 'Edit global CDR rates'
24 empty_label => '(global)',
27 % if ( $rate->agent_rateid ) {
29 <TH ALIGN="right">Legacy #</TH>
30 <TD><% $rate->agent_rateid |h %></TD>
36 <TD><INPUT TYPE="text" NAME="ratename" SIZE=32 VALUE="<% $rate->ratename %>"></TD>
41 <INPUT NAME="submit" TYPE="button" VALUE="<%
42 $rate->ratenum ? "Apply changes" : "Add rate plan"
43 %>" onClick="document.OneTrueForm.submit.disabled=true; process();">
46 % if($rate->ratenum) {
47 <BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
48 % if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
49 % 'curr_value' => $cdrtypenum,
50 % 'onchange' => 'form.submit();',
51 % 'name_col' => 'cdrtypename',
52 % 'value_col' => 'cdrtypenum',
53 % 'empty_label' => '(default)',
55 <FORM ACTION="<%$cgi->url%>" METHOD="GET">
56 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
57 <INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
58 <FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
62 <% include('/edit/elements/rate_detail.html',
63 'ratenum' => $rate->ratenum,
64 'countrycode' => $countrycode,
65 'cdrtypenum' => $cdrtypenum,
69 <% include('/elements/footer.html') %>
74 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
77 if ( $cgi->param('ratenum') ) {
78 $cgi->param('ratenum') =~ /^(\d+)$/;
79 $rate = qsearchs( 'rate', { 'ratenum' => $1 } );
81 $rate = new FS::rate {};
83 my $action = $rate->ratenum ? 'Edit' : 'Add';
86 if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
91 if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {