1 <& /elements/header-popup.html, mt("Change Package") &>
3 <SCRIPT TYPE="text/javascript" SRC="../elements/order_pkg.js"></SCRIPT>
5 <& /elements/error.html &>
7 <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
8 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
10 <% ntable('#cccccc') %>
13 <TH ALIGN="right"><% mt('Current package') |h %></TH>
15 <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
19 <& /elements/tr-select-cust-part_pkg.html,
20 'pre_label' => emt('New'),
21 'curr_value' => scalar($cgi->param('pkgpart')),
22 'classnum' => $part_pkg->classnum,
23 'cust_main' => $cust_main,
26 <& /elements/tr-select-cust_location.html,
28 'cust_main' => $cust_main,
33 <& /elements/standardize_locations.html,
34 'form' => "OrderPkgForm",
37 'callback' => 'document.OrderPkgForm.submit();',
41 <INPUT NAME = "submitButton"
43 VALUE = "<% mt("Change package") |h %>"
44 onClick = "this.disabled=true; standardize_new_location();"
45 <% scalar($cgi->param('pkgpart')) ? '' : 'DISABLED' %>
54 my $conf = new FS::Conf;
56 my $curuser = $FS::CurrentUser::CurrentUser;
59 unless $curuser->access_right('Change customer package');
61 my $pkgnum = scalar($cgi->param('pkgnum'));
62 $pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
67 'table' => 'cust_pkg',
68 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
69 'hashref' => { 'pkgnum' => $pkgnum },
70 'extra_sql' => ' AND '. $curuser->agentnums_sql,
71 }) or die "unknown pkgnum $pkgnum";
73 my $cust_main = $cust_pkg->cust_main
74 or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
75 " ( pkgnum ". cust_pkg->pkgnum. ")";
77 my $part_pkg = $cust_pkg->part_pkg;