add svc_forward, depriciate svc_acct_sm
[freeside.git] / htdocs / view / cust_main.cgi
index de9ff7f..7c96ddf 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.20 2001-06-03 11:40:48 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.20  2001-06-03 11:40:48  ivan
+# inline doc clarification
+#
+# Revision 1.19  2001/04/22 01:38:39  ivan
+# svc_domain needs to import dbh sub from Record
+# view/cust_main.cgi needs to use ->owed method, not check (depriciated) owed field
+# search/cust_bill.cgi redirect error when there's only one invoice
+#
+# 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
@@ -240,7 +251,7 @@ print "</TABLE></TD></TR></TABLE></TD></TR></TABLE>";
 
 print qq!<BR><BR><A NAME="cust_pkg">Packages</A> !,
 #      qq!<BR>Click on package number to view/edit package.!,
-      qq!( <A HREF="!, popurl(2), qq!edit/cust_pkg.cgi?$custnum">Order and cancel packages</A> )!,
+      qq!( <A HREF="!, popurl(2), qq!edit/cust_pkg.cgi?$custnum">Order and cancel packages</A> (preserves services) )!,
 ;
 
 #display packages
@@ -257,8 +268,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) {
@@ -325,7 +339,7 @@ foreach $bill (@bills) {
   push @history,
     $bref->{_date} . qq!\t<A HREF="!. popurl(2). qq!view/cust_bill.cgi?! .
     $bref->{invnum} . qq!">Invoice #! . $bref->{invnum} .
-    qq! (Balance \$! . $bref->{owed} . qq!)</A>\t! .
+    qq! (Balance \$! . $bill->owed . qq!)</A>\t! .
     $bref->{charged} . qq!\t\t\t!;
 
   my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } );