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',
18 'field' => 'reasonnum',
19 'reason_class' => 'C',
21 'control_button' => "document.getElementById('confirm_cancel_cust_button')",
29 <INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
37 $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
40 my $curuser = $FS::CurrentUser::CurrentUser;
42 die "access denied" unless $curuser->access_right('Cancel customer');
44 my $cust_main = qsearchs( {
45 'table' => 'cust_main',
46 'hashref' => { 'custnum' => $custnum },
47 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
49 die "No customer # $custnum" unless $cust_main;
52 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
53 $ban = '<BR><P ALIGN="center">'.
54 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\'s ';
55 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
56 $ban .= 'credit card';
57 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
58 $ban .= 'ACH account';