[freeside-commits] branch master updated. d5f8aa5cf1787238224add1a836f0d7577f3b9b7

Mark Wells mark at 420.am
Tue Nov 24 12:38:24 PST 2015


The branch, master has been updated
       via  d5f8aa5cf1787238224add1a836f0d7577f3b9b7 (commit)
      from  9f480e19adb21d793cff899bae5dc80be4746092 (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 d5f8aa5cf1787238224add1a836f0d7577f3b9b7
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Nov 24 12:23:14 2015 -0800

    add billing address fields to RT ticket search, #19154

diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index 7f4aa9a..ae24fc2 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -647,6 +647,11 @@ Prospect object (see L<FS::prospect_main>)
 
 String used to join location elements
 
+=item no_prefix
+
+Don't label the default service location as "Default service location".
+May become the default at some point.
+
 =back
 
 =cut
@@ -656,6 +661,7 @@ sub location_label {
 
   my $prefix = $self->label_prefix;
   $prefix .= ($opt{join_string} ||  ': ') if $prefix;
+  $prefix = '' if $opt{'no_prefix'};
 
   $prefix . $self->SUPER::location_label(%opt);
 }
diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm
index d1479b5..33831bc 100644
--- a/rt/lib/RT/URI/freeside/Internal.pm
+++ b/rt/lib/RT/URI/freeside/Internal.pm
@@ -211,6 +211,8 @@ sub CustomerResolver {
 sub CustomerInfo {
   my $self = shift;
   $self = $self->CustomerResolver;
+  return $self->{CustomerInfo} if $self->{CustomerInfo};
+
   my $rec = $self->_FreesideGetRecord() if $self;
   if (!$rec) {
     # AsStringLong will report an error;
@@ -232,7 +234,11 @@ sub CustomerInfo {
   my $referral = qsearchs('part_referral', { refnum => $cust_main->refnum });
   my @part_tags = $cust_main->part_tag;
 
-  return $self->{CustomerInfo} ||= {
+  my @lf = $cust_main->location_fields;
+  my $bill_location = $cust_main->bill_location;
+  my $ship_location = $cust_main->ship_location;
+
+  my $info = {
     %$rec,
 
     AgentName     => ($agent ? ($agent->agentnum.': '.$agent->agent) : ''),
@@ -246,7 +252,17 @@ sub CustomerInfo {
     Referral      => ($referral ? $referral->referral : ''),
     InvoiceEmail  => $cust_main->invoicing_list_emailonly_scalar,
     BillingType   => FS::payby->longname($cust_main->payby),
+  };
+
+  foreach my $field (@lf) {
+    $info->{"bill_$field"} = $bill_location->get($field);
+    $info->{"ship_$field"} = $ship_location->get($field);
   }
+  $info->{"bill_location"} = $bill_location->location_label(no_prefix => 1);
+  $info->{"ship_location"} = $ship_location->location_label(no_prefix => 1);
+
+
+  return $self->{CustomerInfo} = $info;
 }
 
 sub ServiceInfo {
diff --git a/rt/share/html/Elements/CustomerFields b/rt/share/html/Elements/CustomerFields
index d5419d2..226378e 100644
--- a/rt/share/html/Elements/CustomerFields
+++ b/rt/share/html/Elements/CustomerFields
@@ -90,16 +90,29 @@ my @customer_fields = ( # ordered
     # query/sort needed?
   },
   {
+    Name    => 'BillingAddress',
+    Label   => 'Billing Address',
+    Display => 'bill_location',
+  },
+  {
+    Name    => 'StreetAddress1',
+    Label   => 'Street Address',
+    Display => 'bill_address1',
+  },
+  {
+    Name    => 'StreetAddress2',
+    Label   => '',
+    Display => 'bill_address2',
+  },
+  {
     Name    => 'City',
     Label   => 'City',
-    Display => 'city',
-    OrderBy => 'Customer.city',
+    Display => 'bill_city',
   },
   {
     Name    => 'State',
     Label   => 'State',
-    Display => 'state',
-    OrderBy => 'Customer.state',
+    Display => 'bill_state',
   },
   {
     Name    => 'CustomerTags',

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

Summary of changes:
 FS/FS/cust_location.pm                |    6 ++++++
 rt/lib/RT/URI/freeside/Internal.pm    |   18 +++++++++++++++++-
 rt/share/html/Elements/CustomerFields |   21 +++++++++++++++++----
 3 files changed, 40 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list