1 <% header("Location disabled") %>
2 <SCRIPT TYPE="text/javascript">
3 window.top.location.reload();
9 my $curuser = $FS::CurrentUser::CurrentUser;
13 unless $curuser->access_right('Change customer package');
15 my $locationnum = $cgi->param('locationnum');
16 my $cust_location = qsearchs({
17 'select' => 'cust_location.*',
18 'table' => 'cust_location',
19 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
20 'hashref' => { 'locationnum' => $locationnum },
21 'extra_sql' => ' AND '. $curuser->agentnums_sql,
23 die "unknown locationnum $locationnum" unless $cust_location;
25 my @pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum,
28 $error = "Location $locationnum has active packages"
31 $cust_location->disabled('Y');
32 $error = $cust_location->replace;