fix fallout from discount work, RT#10025
[freeside.git] / httemplate / misc / unprovision.cgi
1 %if ( $error ) {
2 %  errorpage($error);
3 %} else {
4 <% $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum") %>
5 %}
6 <%init>
7
8 die "access denied"
9   unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service');
10
11 #untaint svcnum
12 my($query) = $cgi->keywords;
13 $query =~ /^(\d+)$/;
14 my $svcnum = $1;
15
16 #my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
17 #die "Unknown svcnum!" unless $svc_acct;
18
19 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
20 die "Unknown svcnum!" unless $cust_svc;
21
22 my $custnum = $cust_svc->cust_pkg->custnum;
23
24 my $error = $cust_svc->cancel;
25
26 </%init>