blob: ec1f734f1cb2555e07ed18b12df0f9ea71620491 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<%
#<!-- $Id: delete-customer.cgi,v 1.4 2001-10-26 10:24:56 ivan Exp $ -->
use strict;
use vars qw( $cgi $conf $query $custnum $new_custnum $cust_main );
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup);
use FS::CGI qw(header popurl);
use FS::Record qw(qsearch qsearchs);
use FS::cust_main;
$cgi = new CGI;
cgisuidsetup($cgi);
$conf = new FS::Conf;
die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
if ( $cgi->param('error') ) {
$custnum = $cgi->param('custnum');
$new_custnum = $cgi->param('new_custnum');
} else {
($query) = $cgi->keywords;
$query =~ /^(\d+)$/ or die "Illegal query: $query";
$custnum = $1;
$new_custnum = '';
}
$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
or die "Customer not found: $custnum";
print $cgi->header ( @FS::CGI::header ), header('Delete customer');
print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
"</FONT>"
if $cgi->param('error');
print
qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
qq!<input type="hidden" name="custnum" value="$custnum">!;
if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
print "Move uncancelled packages to customer number ",
qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
}
print <<END;
This will <b>completely remove</b> all traces of this customer record. This
is <B>not</B> 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 <a href="../docs/config.html#hidecancelledcustomers">hidecancelledcustomers</a> configuration file)
<br>
<br>Are you <b>absolutely sure</b> you want to delete this customer?
<br><input type="submit" value="Yes">
</form></body></html>
END
%>
|