hidecancelledpackages config option
authorivan <ivan>
Thu, 12 Aug 1999 04:16:01 +0000 (04:16 +0000)
committerivan <ivan>
Thu, 12 Aug 1999 04:16:01 +0000 (04:16 +0000)
FS/FS/cust_main.pm
htdocs/docs/config.html
htdocs/view/cust_main.cgi

index 25b6b9f..50535da 100644 (file)
@@ -6,7 +6,7 @@ package FS::cust_main;
 
 use strict;
 use vars qw( @ISA $conf $lpr $processor $xaction $E_NoErr $invoice_from
-             $smtpmachine );
+             $smtpmachine $Debug );
 use Safe;
 use Carp;
 use Time::Local;
@@ -30,6 +30,9 @@ use FS::cust_main_invoice;
 
 @ISA = qw( FS::Record );
 
+$Debug = 0;
+#$Debug = 1;
+
 #ask FS::UID to run this stuff for us later
 $FS::UID::callback{'FS::cust_main'} = sub { 
   $conf = new FS::Conf;
@@ -392,7 +395,12 @@ sub ncancelled_pkgs {
   qsearch( 'cust_pkg', {
     'custnum' => $self->custnum,
     'cancel'  => '',
-  });
+  }),
+  qsearch( 'cust_pkg', {
+    'custnum' => $self->custnum,
+    'cancel'  => 0,
+  }),
+  ;
 }
 
 =item bill OPTIONS
@@ -602,6 +610,7 @@ sub collect {
   my $invoice_time = $options{'invoice_time'} || time;
 
   my $total_owed = $self->balance;
+  warn "collect: total owed $total_owed " if $Debug;
   return '' unless $total_owed > 0; #redundant?????
 
   #put below somehow?
@@ -627,7 +636,7 @@ sub collect {
 
     next if qsearchs( 'cust_pay_batch', { 'invnum' => $cust_bill->invnum } );
 
-    #warn "invnum ". $cust_bill->invnum. " (owed ". $cust_bill->owed. ", amount $amount, total_owed $total_owed)";
+    warn "invnum ". $cust_bill->invnum. " (owed ". $cust_bill->owed. ", amount $amount, total_owed $total_owed)" if $Debug;
 
     next unless $amount > 0;
 
@@ -930,7 +939,7 @@ sub check_invoicing_list {
 
 =head1 VERSION
 
-$Id: cust_main.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+$Id: cust_main.pm,v 1.2 1999-08-12 04:16:01 ivan Exp $
 
 =head1 BUGS
 
index 3d4e743..cad10ce 100644 (file)
@@ -25,10 +25,12 @@ All further configuration files and directories are located in
   <li>bsdshellmachines - Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd' and `/etc/master.passwd'.
   <li>cybercash2 - <a href="http://www.cybercash.com/cybercash/services/cashreg214.html">CyberCash v2</a> support, four lines: paymentserverhost, paymentserverport, paymentserversecret, and transaction type (`mauthonly' or `mauthcapture').  CCLib.pm is required.
   <li>cybercash3.2 - <a href="http://www.cybercash.com/cybercash/services/technology.html">CyberCash v3.2</a> support.  Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture').  CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required.
-  <li>deletecustomers - The existance of this file will enable customer deletions.
+  <li>deletecustomers - The existance of this file will enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers' packages if they cancel service.
   <li>domain - Your domain name.
   <li>editreferrals - The existance of this file will allow you to change the referral of existing customers.
   <li>erpcdmachines - Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'.
+  <li>hidecancelledpackages - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)
+  <li>hidecancelledcustomers - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)
   <li>home - For new users, prefixed to usrename to create a directory name.  Should have a leading but not a trailing slash.
   <li>invoice_from - Return address on email invoices.
   <li>lpr - Print command for paper invoices, for example `lpr -h'.
index de9ff7f..0552565 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
-# $Id: cust_main.cgi,v 1.17 1999-04-15 16:44:36 ivan Exp $
+# $Id: cust_main.cgi,v 1.18 1999-08-12 04:16:01 ivan Exp $
 #
 # Usage: cust_main.cgi custnum
 #        http://server.name/path/cust_main.cgi?custnum
 # lose background, FS::CGI ivan@sisd.com 98-sep-2
 #
 # $Log: cust_main.cgi,v $
-# Revision 1.17  1999-04-15 16:44:36  ivan
+# Revision 1.18  1999-08-12 04:16:01  ivan
+# hidecancelledpackages config option
+#
+# Revision 1.17  1999/04/15 16:44:36  ivan
 # delete customers
 #
 # Revision 1.16  1999/04/09 04:22:34  ivan
@@ -257,8 +260,11 @@ print qq!!, &table(), "\n",
       qq!</TR>\n!;
 
 #get package info
-@packages = $cust_main->all_pkgs;
-#@packages = $cust_main->ncancelled_pkgs;
+if ( $conf->exists('hidecancelledpackages') ) {
+  @packages = $cust_main->ncancelled_pkgs;
+} else {
+  @packages = $cust_main->all_pkgs;
+}
 
 $n1 = '<TR>';
 foreach $package (@packages) {