<% include('/elements/header-popup.html', 'Cancel customer' ) %> <% include('/elements/error.html') %>

Permanently delete all services and cancel this customer? <% $ban %>

<% ntable("#cccccc", 2) %> <% include('/elements/tr-select-reason.html', 'field' => 'reasonnum', 'reason_class' => 'C', 'cgi' => $cgi, 'control_button' => "document.getElementById('confirm_cancel_cust_button')", ) %>

        

<%init> $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; my $custnum = $1; my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Cancel customer'); my $cust_main = qsearchs( { 'table' => 'cust_main', 'hashref' => { 'custnum' => $custnum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, } ); die "No customer # $custnum" unless $cust_main; my $ban = ''; if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { $ban = '

'. ' Ban this customer\'s '; if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { $ban .= 'credit card'; } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { $ban .= 'ACH account'; } }