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