3 # $Id: delete-customer.cgi,v 1.2 2001-08-11 04:15:14 ivan Exp $
5 # $Log: delete-customer.cgi,v $
6 # Revision 1.2 2001-08-11 04:15:14 ivan
9 # Revision 1.1 2001/07/30 07:36:04 ivan
12 # Revision 1.1 1999/04/15 16:44:36 ivan
17 use vars qw( $cgi $conf $query $custnum $new_custnum $cust_main );
19 use CGI::Carp qw(fatalsToBrowser);
20 use FS::UID qw(cgisuidsetup);
21 use FS::CGI qw(header popurl);
22 use FS::Record qw(qsearch qsearchs);
29 die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
31 if ( $cgi->param('error') ) {
32 $custnum = $cgi->param('custnum');
33 $new_custnum = $cgi->param('new_custnum');
35 ($query) = $cgi->keywords;
36 $query =~ /^(\d+)$/ or die "Illegal query: $query";
40 $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
41 or die "Customer not found: $custnum";
43 print $cgi->header ( '-expires' => 'now' ), header('Delete customer');
45 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
47 if $cgi->param('error');
50 qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
51 qq!<input type="hidden" name="custnum" value="$custnum">!;
53 if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
54 print "Move uncancelled packages to customer number ",
55 qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
59 This will <b>completely remove</b> all traces of this customer record. This
60 is <B>not</B> what you want if this is a real customer who has simply
61 canceled service with you. For that, cancel all of the customer's packages.
62 (you can optionally hide cancelled customers with the <a href="../docs/config.html#hidecancelledcustomers">hidecancelledcustomers</a> configuration file)
64 <br>Are you <b>absolutely sure</b> you want to delete this customer?
65 <br><input type="submit" value="Yes">