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',
20 #XXX these need to be sticky on errors too...
22 'control_button' => 'document.cust_cancel_popup.submit',
30 <INPUT TYPE="submit" NAME="submit" VALUE="Cancel customer" disabled='true'> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
38 my($custnum, $reasonnum, $submit, $cust_main, $curuser, $class);
39 if ( $cgi->param('error') ) {
40 $custnum = $cgi->param('custnum');
41 $reasonnum = $cgi->param('reasonnum');
43 my( $query ) = $cgi->keywords;
44 if ( $query =~ /^(\d+)$/ ) {
47 die "illegal query ". $cgi->keywords;
51 $curuser = $FS::CurrentUser::CurrentUser;
53 $cust_main = qsearchs( {
54 'table' => 'cust_main',
55 'hashref' => { 'custnum' => $custnum },
56 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
58 die "No customer # $custnum" unless $cust_main;
61 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
62 $ban = '<BR><P ALIGN="center">'.
63 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\'s ';
64 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
65 $ban .= 'credit card';
66 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
67 $ban .= 'ACH account';