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', 'preserve_rate_detail' ], # 'rate', 'min_', 'sec_' ],
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 TYPE="hidden" NAME="preserve_rate_detail" VALUE="1">
32 <INPUT NAME="submit" TYPE="button" VALUE="<%
33 $rate->ratenum ? "Apply changes" : "Add rate plan"
34 %>" onClick="document.OneTrueForm.submit.disabled=true; process();">
37 % if($rate->ratenum) {
38 <BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
39 % if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
40 % 'curr_value' => $cdrtypenum,
41 % 'onchange' => 'form.submit();',
42 % 'name_col' => 'cdrtypename',
43 % 'value_col' => 'cdrtypenum',
44 % 'empty_label' => '(default)',
46 <FORM ACTION="<%$cgi->url%>" METHOD="GET">
47 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
48 <INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
49 <FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
53 <% include('/edit/elements/rate_detail.html',
54 'ratenum' => $rate->ratenum,
55 'countrycode' => $countrycode,
56 'cdrtypenum' => $cdrtypenum,
60 <% include('/elements/footer.html') %>
65 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
68 if ( $cgi->param('ratenum') ) {
69 $cgi->param('ratenum') =~ /^(\d+)$/;
70 $rate = qsearchs( 'rate', { 'ratenum' => $1 } );
72 $rate = new FS::rate {};
74 my $action = $rate->ratenum ? 'Edit' : 'Add';
77 if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
82 if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {