1 <% include('/elements/header-popup.html', "Change Package") %>
3 <% include('/elements/error.html') %>
5 <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
8 <% ntable('#cccccc') %>
11 <TH ALIGN="right">Current package</TH>
13 <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
17 <% include('/elements/tr-select-cust-part_pkg.html',
19 'curr_value' => scalar($cgi->param('pkgpart')),
20 'classnum' => $part_pkg->classnum,
21 'cust_main' => $cust_main,
22 #'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart,
26 <% include('/elements/tr-select-cust_location.html',
28 'cust_main' => $cust_main,
34 <% include( '/elements/standardize_locations.html',
35 'form' => "OrderPkgForm",
38 'callback' => 'document.OrderPkgForm.submit();',
43 <INPUT NAME="submitButton" TYPE="button" VALUE="Change package" onClick="this.disabled=true; standardize_locations();">
51 my $conf = new FS::Conf;
53 my $curuser = $FS::CurrentUser::CurrentUser;
56 unless $curuser->access_right('Change customer package');
58 my $pkgnum = scalar($cgi->param('pkgnum'));
59 $pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
64 'table' => 'cust_pkg',
65 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
66 'hashref' => { 'pkgnum' => $pkgnum },
67 'extra_sql' => ' AND '. $curuser->agentnums_sql,
68 }) or die "unknown pkgnum $pkgnum";
70 my $cust_main = $cust_pkg->cust_main
71 or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
72 " ( pkgnum ". cust_pkg->pkgnum. ")";
74 my $part_pkg = $cust_pkg->part_pkg;