point to correct place for hidecancelledcustomers config option
[freeside.git] / httemplate / misc / delete-customer.cgi
index cb5fc76..4302317 100755 (executable)
@@ -1,43 +1,23 @@
+<!-- mason kludge -->
 <%
-#
-# $Id: delete-customer.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
-#
-# $Log: delete-customer.cgi,v $
-# Revision 1.1  2001-07-30 07:36:04  ivan
-# templates!!!
-#
-# Revision 1.1  1999/04/15 16:44:36  ivan
-# delete customers
-#
-
-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;
+my $conf = new FS::Conf;
 die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
 
+my($custnum, $new_custnum);
 if ( $cgi->param('error') ) {
   $custnum = $cgi->param('custnum');
   $new_custnum = $cgi->param('new_custnum');
 } else {
-  ($query) = $cgi->keywords;
+  my($query) = $cgi->keywords;
   $query =~ /^(\d+)$/ or die "Illegal query: $query";
   $custnum = $1;
   $new_custnum = '';
 }
-$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
+my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
   or die "Customer not found: $custnum";
 
-print $cgi->header ( '-expires' => 'now' ), header('Delete customer');
+print header('Delete customer');
 
 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
       "</FONT>"
@@ -53,10 +33,28 @@ if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
 }
 
 print <<END;
-This will <b>completely remove</b> all traces of this customer record.
+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="../config/config-view.cgi#hidecancelledcustomers">hidecancelledcustomers</a> configuration option)
+<br>
 <br>Are you <b>absolutely sure</b> you want to delete this customer?
 <br><input type="submit" value="Yes">
 </form></body></html>
 END
 
+#Deleting a customer you have financial records on (i.e. credits) is
+#typically considered fraudulant bookkeeping.  Remember, deleting   
+#customers should ONLY be used for completely bogus records.  You should
+#NOT delete real customers who simply discontinue service.
+#
+#For real customers who simply discontinue service, cancel all of the
+#customer's packages.  Customers with all cancelled packages are not  
+#billed.  There is no need to take further action to prevent billing on
+#customers with all cancelled packages.
+#
+#Also see the "hidecancelledcustomers" and "hidecancelledpackages"
+#configuration options, which will allow you to surpress the display of
+#cancelled customers and packages, respectively.
+
 %>