[freeside-commits] branch master updated. ddf8a73dc4f6fd76f5fdc148935543a85884dc4a

Ivan ivan at 420.am
Wed Jun 21 12:37:01 PDT 2017


The branch, master has been updated
       via  ddf8a73dc4f6fd76f5fdc148935543a85884dc4a (commit)
      from  e5b2660aefd03bc4b32386e1c38c53814c002c8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ddf8a73dc4f6fd76f5fdc148935543a85884dc4a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 21 12:37:00 2017 -0700

    fix RT vs v4-style location-less customers

diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm
index 2b09c87..f7b9bab 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;
 }

-----------------------------------------------------------------------

Summary of changes:
 rt/lib/RT/URI/freeside/Internal.pm |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list