<% include('/elements/header-popup.html', "Discount Package") %> <% include('/elements/error.html') %>
<% ntable('#cccccc') %> Current package  <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> - <% $part_pkg->comment |h %> <% include('/elements/tr-select-discount.html', 'empty_label' => ( $pkgdiscountnum ? '' : 'Select discount' ), 'onchange' => 'enable_discount_pkg()', 'cgi' => $cgi, ) %>
>
<%init> #some false laziness w/misc/change_pkg.cgi my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Discount customer package'); my $pkgnum = scalar($cgi->param('pkgnum')); $pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum"; $pkgnum = $1; my $pkgdiscountnum = ''; my $cust_pkg = qsearchs({ 'table' => 'cust_pkg', 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'pkgnum' => $pkgnum }, 'extra_sql' => ' AND '. $curuser->agentnums_sql, }) or die "unknown pkgnum $pkgnum"; #my $cust_main = $cust_pkg->cust_main # or die "can't get cust_main record for custnum ". $cust_pkg->custnum. # " ( pkgnum ". cust_pkg->pkgnum. ")"; my $part_pkg = $cust_pkg->part_pkg;