1 <% include("/elements/header.html","$action Rate plan", menubar(
2 'View all rate plans' => "${p}browse/rate.cgi",
6 <% include('/elements/progress-init.html',
8 [ 'rate', 'agentnum' ],
13 <FORM NAME="OneTrueForm">
14 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
16 <TABLE CLASS="fsinnerbox">
18 <& /elements/tr-select-agent.html,
19 disable_empty => ! $FS::CurrentUser::CurrentUser->access_right('Configuration'), #, 'Edit global CDR rates'
20 empty_label => '(global)',
25 <TD><INPUT TYPE="text" NAME="ratename" SIZE=32 VALUE="<% $rate->ratename %>"></TD>
30 <INPUT NAME="submit" TYPE="button" VALUE="<%
31 $rate->ratenum ? "Apply changes" : "Add rate plan"
32 %>" onClick="document.OneTrueForm.submit.disabled=true; process();">
35 % if($rate->ratenum) {
36 <BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
37 % if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
38 % 'curr_value' => $cdrtypenum,
39 % 'onchange' => 'form.submit();',
40 % 'name_col' => 'cdrtypename',
41 % 'value_col' => 'cdrtypenum',
42 % 'empty_label' => '(default)',
44 <FORM ACTION="<%$cgi->url%>" METHOD="GET">
45 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
46 <INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
47 <FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
51 <% include('/edit/elements/rate_detail.html',
52 'ratenum' => $rate->ratenum,
53 'countrycode' => $countrycode,
54 'cdrtypenum' => $cdrtypenum,
58 <% include('/elements/footer.html') %>
63 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
66 if ( $cgi->param('ratenum') ) {
67 $cgi->param('ratenum') =~ /^(\d+)$/;
68 $rate = qsearchs( 'rate', { 'ratenum' => $1 } );
70 $rate = new FS::rate {};
72 my $action = $rate->ratenum ? 'Edit' : 'Add';
75 if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
80 if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {