X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htdocs%2Fsearch%2Fcust_pkg.cgi;h=b6439d654654e30ad48ec680b16f98e426812c0f;hb=e890290677daab75e0ce28d5679baddb8a997a8e;hp=b7afc62a556f5f3b7c6ae529a6994197b1e86f72;hpb=e0da34d97b1463b55a334e8dae10cd55796e2312;p=freeside.git diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi index b7afc62a5..b6439d654 100755 --- a/htdocs/search/cust_pkg.cgi +++ b/htdocs/search/cust_pkg.cgi @@ -1,11 +1,24 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pkg.cgi,v 1.7 1999-02-07 09:59:37 ivan Exp $ +# $Id: cust_pkg.cgi,v 1.11 2000-07-17 16:45:41 ivan Exp $ # # based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 # # $Log: cust_pkg.cgi,v $ -# Revision 1.7 1999-02-07 09:59:37 ivan +# Revision 1.11 2000-07-17 16:45:41 ivan +# first shot at invoice browsing and some other cleanups +# +# Revision 1.10 2000/07/17 12:49:29 ivan +# better error message if a package isn't linked to a customer (that shouldn't happen) +# +# Revision 1.9 1999/07/17 10:38:52 ivan +# scott nelson noticed this mod_perl-triggered bug and +# gave me a great bugreport at the last rhythmethod +# +# Revision 1.8 1999/02/09 09:22:57 ivan +# visual and bugfixes +# +# Revision 1.7 1999/02/07 09:59:37 ivan # more mod_perl fixes, and bugfixes Peter Wemm sent via email # # Revision 1.6 1999/01/19 05:14:13 ivan @@ -48,7 +61,7 @@ if ( $query eq 'pkgnum' ) { @cust_pkg=qsearch('cust_pkg',{}); } elsif ( $query eq 'APKG_pkgnum' ) { $sortby=\*pkgnum_sort; - + @cust_pkg=(); #perhaps this should go in cust_pkg as a qsearch-like constructor? my($cust_pkg); foreach $cust_pkg (qsearch('cust_pkg',{})) { @@ -87,7 +100,7 @@ if ( scalar(@cust_pkg) == 1 ) { Package # Customer # - Name + Contact name Company END @@ -99,19 +112,28 @@ END my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum}); my($pkgnum,$custnum,$name,$company)=( $cust_pkg->pkgnum, - $cust_main->custnum, - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, + $cust_pkg->custnum, + $cust_main ? $cust_main->last. ', '. $cust_main->first : '', + $cust_main ? $cust_main->company : '', ); + my $p = popurl(2); print < - $pkgnum - $custnum - $name - $company + $pkgnum +END + if ( $cust_main ) { + print <$custnum + $name + $company END - + } else { + print <WARNING: couldn't find cust_main.custnum $custnum (cust_pkg.pkgnum $pkgnum) + +END + } } print <