summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2001-08-21 02:03:32 +0000
committerivan <ivan>2001-08-21 02:03:32 +0000
commit75cbdf6ab6af5539382a63d21c8f4042d53ba6c1 (patch)
tree0e47cb0119196108120ff7027d5381a4f5aa3507
parent3d2530a7d08dfae1473015d96d7394dc15b86ce1 (diff)
deal with databases w/o separate shipping address
-rwxr-xr-xhttemplate/search/cust_pkg.cgi36
1 files changed, 20 insertions, 16 deletions
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index 2ab6e2b57..8a0dfd132 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -1,5 +1,5 @@
<%
-# <!-- $Id: cust_pkg.cgi,v 1.3 2001-08-19 08:32:43 ivan Exp $ -->
+# <!-- $Id: cust_pkg.cgi,v 1.4 2001-08-21 02:03:32 ivan Exp $ -->
use strict;
use vars qw ( $cgi @cust_pkg $sortby $query %part_pkg );
@@ -86,27 +86,31 @@ END
sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg)
) {
my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum});
- my($pkgnum, $custnum, $last, $first, $company,
- $ship_last, $ship_first, $ship_company)=(
+ my($pkgnum, $custnum, $last, $first, $company) = (
$cust_pkg->pkgnum,
$cust_pkg->custnum,
$cust_main ? $cust_main->last : '',
$cust_main ? $cust_main->first : '',
$cust_main ? $cust_main->company : '',
- $cust_main
- ? ( $cust_main->ship_last || $cust_main->getfield('last') )
- : '',
- $cust_main
- ? ( $cust_main->ship_last
- ? $cust_main->ship_first
- : $cust_main->first )
- : '',
- $cust_main
- ? ( $cust_main->ship_last
- ? $cust_main->ship_company
- : $cust_main->company )
- : '',
);
+ my($ship_last, $ship_first, $ship_company);
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ ($ship_last, $ship_first, $ship_company) = (
+ $cust_main
+ ? ( $cust_main->ship_last || $cust_main->getfield('last') )
+ : '',
+ $cust_main
+ ? ( $cust_main->ship_last
+ ? $cust_main->ship_first
+ : $cust_main->first )
+ : '',
+ $cust_main
+ ? ( $cust_main->ship_last
+ ? $cust_main->ship_company
+ : $cust_main->company )
+ : '',
+ );
+ }
my $pkg = $part_pkg{$cust_pkg->pkgpart}->pkg;
#$pkg .= ' - '. $part_pkg{$cust_pkg->pkgpart}->comment;
my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } );