1 <% include('/elements/header-popup.html', 'Cancel customer' ) %>
3 % if ( $cgi->param('error') ) {
4 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
8 <FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST>
9 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
12 <P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B>
18 <% ntable("#cccccc", 2) %>
20 <% include('/elements/tr-select-reason.html', 'reasonnum', 'C', '', '', '', 'document.cust_cancel_popup.submit',
28 <INPUT TYPE="submit" NAME="submit" VALUE="Cancel customer" disabled='true'> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
36 my($custnum, $reasonnum, $submit, $cust_main, $curuser, $class);
37 if ( $cgi->param('error') ) {
38 $custnum = $cgi->param('custnum');
39 $reasonnum = $cgi->param('reasonnum');
41 my( $query ) = $cgi->keywords;
42 if ( $query =~ /^(\d+)$/ ) {
45 die "illegal query ". $cgi->keywords;
49 $curuser = $FS::CurrentUser::CurrentUser;
51 $cust_main = qsearchs( {
52 'table' => 'cust_main',
53 'hashref' => { 'custnum' => $custnum },
54 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
56 die "No customer # $custnum" unless $cust_main;
59 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
60 $ban = '<BR><P ALIGN="center">'.
61 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\'s ';
62 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
63 $ban .= 'credit card';
64 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
65 $ban .= 'ACH account';