4 <% $cgi->redirect(popurl(2)) %>
10 unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service')
11 && $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services');
14 my($query) = $cgi->keywords;
19 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
21 my $cust_pkg = $cust_svc->cust_pkg;
23 errorpage( 'This account has already been audited. Cancel the '.
24 qq!<A HREF="${p}view/cust_main.cgi?!. $cust_pkg->custnum.
25 '#cust_pkg'. $cust_pkg->pkgnum. '">'.
26 'package</A> instead.'); #'
29 $error = $cust_svc->cancel;
31 # the rare obscure case: svc_x without cust_svc
33 foreach my $svcdb (FS::part_svc->svc_tables) {
34 $svc_x = qsearchs($svcdb, { 'svcnum' => $svcnum });
38 $error = $svc_x->return_inventory
39 || $svc_x->FS::Record::delete;
41 # the svcnum really doesn't exist
42 $error = "svcnum $svcnum not found";