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)',
29 <TD><INPUT TYPE="text" NAME="ratename" SIZE=32 VALUE="<% $rate->ratename %>"></TD>
34 <INPUT NAME="submit" TYPE="button" VALUE="<%
35 $rate->ratenum ? "Apply changes" : "Add rate plan"
36 %>" onClick="document.OneTrueForm.submit.disabled=true; process();">
39 % if($rate->ratenum) {
40 <BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
41 % if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
42 % 'curr_value' => $cdrtypenum,
43 % 'onchange' => 'form.submit();',
44 % 'name_col' => 'cdrtypename',
45 % 'value_col' => 'cdrtypenum',
46 % 'empty_label' => '(default)',
48 <FORM ACTION="<%$cgi->url%>" METHOD="GET">
49 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
50 <INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
51 <FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
55 <% include('/edit/elements/rate_detail.html',
56 'ratenum' => $rate->ratenum,
57 'countrycode' => $countrycode,
58 'cdrtypenum' => $cdrtypenum,
62 <% include('/elements/footer.html') %>
67 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
70 if ( $cgi->param('ratenum') ) {
71 $cgi->param('ratenum') =~ /^(\d+)$/;
72 $rate = qsearchs( 'rate', { 'ratenum' => $1 } );
74 $rate = new FS::rate {};
76 my $action = $rate->ratenum ? 'Edit' : 'Add';
79 if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
84 if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {