X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FURI%2Ffreeside%2FInternal.pm;fp=rt%2Flib%2FRT%2FURI%2Ffreeside%2FInternal.pm;h=f7b9bab0bc783df5eda3dd227d740fc40a36932f;hb=94cda7ff5fd7fe41d9d0b14d544cb85fbff55dc0;hp=2b09c879b29f2ce6d9eb09fbe72f7ae15a169dfe;hpb=e50a777b5631fec07604d3576ff0527209016075;p=freeside.git diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm index 2b09c879b..f7b9bab0b 100644 --- a/rt/lib/RT/URI/freeside/Internal.pm +++ b/rt/lib/RT/URI/freeside/Internal.pm @@ -234,10 +234,6 @@ sub CustomerInfo { my $referral = qsearchs('part_referral', { refnum => $cust_main->refnum }); my @part_tags = $cust_main->part_tag; - my @lf = $cust_main->location_fields; - my $bill_location = $cust_main->bill_location; - my $ship_location = $cust_main->ship_location; - my $info = { %$rec, @@ -254,12 +250,18 @@ sub CustomerInfo { BillingType => FS::payby->longname($cust_main->payby), }; + my @lf = $cust_main->location_fields; + my $bill_location = $cust_main->bill_location; + my $ship_location = $cust_main->ship_location; + foreach my $field (@lf) { - $info->{"bill_$field"} = $bill_location->get($field); - $info->{"ship_$field"} = $ship_location->get($field); + $info->{"bill_$field"} = $bill_location->get($field) if $bill_location; + $info->{"ship_$field"} = $ship_location->get($field) if $ship_location; } - $info->{"bill_location"} = $bill_location->location_label(no_prefix => 1); - $info->{"ship_location"} = $ship_location->location_label(no_prefix => 1); + $info->{"bill_location"} = $bill_location->location_label(no_prefix => 1) + if $bill_location; + $info->{"ship_location"} = $ship_location->location_label(no_prefix => 1) + if $ship_location; return $self->{CustomerInfo} = $info; }