3 # $Id: delete-customer.cgi,v 1.1 1999-04-15 16:44:36 ivan Exp $
5 # $Log: delete-customer.cgi,v $
6 # Revision 1.1 1999-04-15 16:44:36 ivan
11 use vars qw( $cgi $conf $query $custnum $new_custnum $cust_main );
13 use CGI::Carp qw(fatalsToBrowser);
14 use FS::UID qw(cgisuidsetup);
15 use FS::CGI qw(header popurl);
16 use FS::Record qw(qsearch qsearchs);
23 die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
25 if ( $cgi->param('error') ) {
26 $custnum = $cgi->param('custnum');
27 $new_custnum = $cgi->param('new_custnum');
29 ($query) = $cgi->keywords;
30 $query =~ /^(\d+)$/ or die "Illegal query: $query";
34 $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
35 or die "Customer not found: $custnum";
37 print $cgi->header ( '-expires' => 'now' ), header('Delete customer');
39 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
41 if $cgi->param('error');
44 qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
45 qq!<input type="hidden" name="custnum" value="$custnum">!;
47 if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
48 print "Move uncancelled packages to customer number ",
49 qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
53 This will <b>completely remove</b> all traces of this customer record.
54 <br>Are you <b>absolutely sure</b> you want to delete this customer?
55 <br><input type="submit" value="Yes">