4 my $conf = new FS::Conf;
5 die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
7 my($custnum, $new_custnum);
8 if ( $cgi->param('error') ) {
9 $custnum = $cgi->param('custnum');
10 $new_custnum = $cgi->param('new_custnum');
12 my($query) = $cgi->keywords;
13 $query =~ /^(\d+)$/ or die "Illegal query: $query";
17 my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
18 or die "Customer not found: $custnum";
20 print header('Delete customer');
22 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
24 if $cgi->param('error');
27 qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
28 qq!<input type="hidden" name="custnum" value="$custnum">!;
30 if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
31 print "Move uncancelled packages to customer number ",
32 qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
36 This will <b>completely remove</b> all traces of this customer record. This
37 is <B>not</B> what you want if this is a real customer who has simply
38 canceled service with you. For that, cancel all of the customer's packages.
39 (you can optionally hide cancelled customers with the <a href="../config/config-view.cgi#hidecancelledcustomers">hidecancelledcustomers</a> configuration option)
41 <br>Are you <b>absolutely sure</b> you want to delete this customer?
42 <br><input type="submit" value="Yes">
46 #Deleting a customer you have financial records on (i.e. credits) is
47 #typically considered fraudulant bookkeeping. Remember, deleting
48 #customers should ONLY be used for completely bogus records. You should
49 #NOT delete real customers who simply discontinue service.
51 #For real customers who simply discontinue service, cancel all of the
52 #customer's packages. Customers with all cancelled packages are not
53 #billed. There is no need to take further action to prevent billing on
54 #customers with all cancelled packages.
56 #Also see the "hidecancelledcustomers" and "hidecancelledpackages"
57 #configuration options, which will allow you to surpress the display of
58 #cancelled customers and packages, respectively.