summaryrefslogtreecommitdiff
path: root/htdocs/search
diff options
context:
space:
mode:
authorivan <ivan>2000-07-17 12:49:29 +0000
committerivan <ivan>2000-07-17 12:49:29 +0000
commitf661a63aef925a50a7529504070c69dd0f18df80 (patch)
treece97c48fb02f8eda77c428ce115f27896b3b0412 /htdocs/search
parent3bff481a0fd820968b94653cb51093900a9fb188 (diff)
better error message if a package isn't linked to a customer (that shouldn't happen)
Diffstat (limited to 'htdocs/search')
-rwxr-xr-xhtdocs/search/cust_pkg.cgi23
1 files changed, 17 insertions, 6 deletions
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 <scott@ultimanet.com> 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 <<END;
<TR>
<TD><A HREF="${p}view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum</FONT></A></TD>
+END
+ if ( $cust_main ) {
+ print <<END;
<TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$custnum</A></FONT></TD>
<TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$name</A></FONT></TD>
<TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$company</A></FONT></TD>
</TR>
END
-
+ } else {
+ print <<END;
+ <TD COLSPAN=3><FONT SIZE=-1>WARNING: couldn't find cust_main.custnum $custnum (cust_pkg.pkgnum $pkgnum)</TD>
+ </TR>
+END
+ }
}
print <<END;