removed <!-- $Id$ --> from all files to fix any redirects, whew
[freeside.git] / httemplate / misc / delete-customer.cgi
1 <%
2
3 my $conf = new FS::Conf;
4 die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
5
6 my($custnum, $new_custnum);
7 if ( $cgi->param('error') ) {
8   $custnum = $cgi->param('custnum');
9   $new_custnum = $cgi->param('new_custnum');
10 } else {
11   my($query) = $cgi->keywords;
12   $query =~ /^(\d+)$/ or die "Illegal query: $query";
13   $custnum = $1;
14   $new_custnum = '';
15 }
16 my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
17   or die "Customer not found: $custnum";
18
19 print header('Delete customer');
20
21 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
22       "</FONT>"
23   if $cgi->param('error');
24
25 print 
26   qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
27   qq!<input type="hidden" name="custnum" value="$custnum">!;
28
29 if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
30   print "Move uncancelled packages to customer number ",
31         qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
32 }
33
34 print <<END;
35 This will <b>completely remove</b> all traces of this customer record.  This
36 is <B>not</B> what you want if this is a real customer who has simply
37 canceled service with you.  For that, cancel all of the customer's packages.
38 (you can optionally hide cancelled customers with the <a href="../docs/config.html#hidecancelledcustomers">hidecancelledcustomers</a> configuration file)
39 <br>
40 <br>Are you <b>absolutely sure</b> you want to delete this customer?
41 <br><input type="submit" value="Yes">
42 </form></body></html>
43 END
44
45 %>