1 <% include('/elements/header-popup.html', 'Cancel customer' ) %>
3 <% include('/elements/error.html') %>
5 <FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
9 <P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B>
15 <% ntable("#cccccc", 2) %>
17 <% include('/elements/tr-select-reason.html', 'reasonnum', 'C', $reasonnum, '', '', "document.getElementById('confirm_cancel_cust_button')",
25 <INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
33 $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
37 if ( $cgi->param('error') ) {
38 $reasonnum = $cgi->param('reasonnum');
41 my $curuser = $FS::CurrentUser::CurrentUser;
43 die "access denied" unless $curuser->access_right('Cancel customer');
45 my $cust_main = qsearchs( {
46 'table' => 'cust_main',
47 'hashref' => { 'custnum' => $custnum },
48 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
50 die "No customer # $custnum" unless $cust_main;
53 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
54 $ban = '<BR><P ALIGN="center">'.
55 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\'s ';
56 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
57 $ban .= 'credit card';
58 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
59 $ban .= 'ACH account';