summaryrefslogtreecommitdiff
path: root/rt/lib/RT/URI/freeside/Internal.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-11-24 14:39:18 -0600
committerJonathan Prykop <jonathan@freeside.biz>2015-11-24 14:39:18 -0600
commit1658a54e6008907666cc57c5d957fcd208a74a85 (patch)
tree6d86ce5158510c151f4fb525582b9d4eb4cede61 /rt/lib/RT/URI/freeside/Internal.pm
parent60cad35f8b6bebefd8c9d78a83d70e0d5ddd68bf (diff)
parent50c42300d50c01f61e6bf9ab74e72b97a6128ec5 (diff)
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_4_BRANCH
Diffstat (limited to 'rt/lib/RT/URI/freeside/Internal.pm')
-rw-r--r--rt/lib/RT/URI/freeside/Internal.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm
index d1479b5f9..33831bcac 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 {