<% my $conf = new FS::Conf; die "Customer deletions not enabled" unless $conf->exists('deletecustomers'); my($custnum, $new_custnum); if ( $cgi->param('error') ) { $custnum = $cgi->param('custnum'); $new_custnum = $cgi->param('new_custnum'); } else { my($query) = $cgi->keywords; $query =~ /^(\d+)$/ or die "Illegal query: $query"; $custnum = $1; $new_custnum = ''; } my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ) or die "Customer not found: $custnum"; print header('Delete customer'); print qq!Error: !, $cgi->param('error'), "" if $cgi->param('error'); print qq!
!, qq!!; if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) { print "Move uncancelled packages to customer number ", qq!

!; } print <completely remove all traces of this customer record. This is not what you want if this is a real customer who has simply canceled service with you. For that, cancel all of the customer's packages. (you can optionally hide cancelled customers with the hidecancelledcustomers configuration file)

Are you absolutely sure you want to delete this customer?
END %>