From: ivan Date: Mon, 17 Jul 2000 12:49:29 +0000 (+0000) Subject: better error message if a package isn't linked to a customer (that shouldn't happen) X-Git-Tag: freeside_1_3_0~85 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f661a63aef925a50a7529504070c69dd0f18df80 better error message if a package isn't linked to a customer (that shouldn't happen) --- diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi index 033bc2585..c645ad6c1 100755 --- a/htdocs/search/cust_pkg.cgi +++ b/htdocs/search/cust_pkg.cgi @@ -1,11 +1,14 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pkg.cgi,v 1.9 1999-07-17 10:38:52 ivan Exp $ +# $Id: cust_pkg.cgi,v 1.10 2000-07-17 12:49:29 ivan Exp $ # # based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 # # $Log: cust_pkg.cgi,v $ -# Revision 1.9 1999-07-17 10:38:52 ivan +# 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 # @@ -106,20 +109,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 +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 <