& /elements/header.html,
"$action Rate plan",
menubar(
'View all rate plans' => "${p}browse/rate.cgi",
'View packages that use this plan' => "${p}browse/part_pkg.cgi?ratenum="
. $rate->ratenum,
)
&>
<% include('/elements/progress-init.html',
'OneTrueForm',
[ 'rate', 'agentnum' ],
'process/rate.cgi',
$p.'browse/rate.cgi',
)
%>
% if($rate->ratenum) {
Rates in this plan
% if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
% 'curr_value' => $cdrtypenum,
% 'onchange' => 'form.submit();',
% 'name_col' => 'cdrtypename',
% 'value_col' => 'cdrtypenum',
% 'empty_label' => '(default)',
% ) ) {
% }
<% include('/edit/elements/rate_detail.html',
'ratenum' => $rate->ratenum,
'countrycode' => $countrycode,
'cdrtypenum' => $cdrtypenum,
) %>
% }
<% include('/elements/footer.html') %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $rate;
if ( $cgi->param('ratenum') ) {
$cgi->param('ratenum') =~ /^(\d+)$/;
$rate = qsearchs( 'rate', { 'ratenum' => $1 } );
} else { #adding
$rate = new FS::rate {};
}
my $action = $rate->ratenum ? 'Edit' : 'Add';
my $countrycode = '';
if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
$countrycode = $1;
}
my $cdrtypenum = '';
if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {
$cdrtypenum = $1;
}
%init>