summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main/Location.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-02-10 01:38:56 -0800
committerIvan Kohler <ivan@freeside.biz>2015-02-10 01:38:56 -0800
commita4d4d3df88b33a6db30b565921f6d62efb252351 (patch)
tree0ddfa8fe885dfe6776a0c074aed9e1e0735a7cd7 /FS/FS/cust_main/Location.pm
parent6615733676adb431ae48c78ce24758fe571614c1 (diff)
multiple payment options, RT#23741
Diffstat (limited to 'FS/FS/cust_main/Location.pm')
-rw-r--r--FS/FS/cust_main/Location.pm22
1 files changed, 16 insertions, 6 deletions
diff --git a/FS/FS/cust_main/Location.pm b/FS/FS/cust_main/Location.pm
index be375dd..3cb73ff 100644
--- a/FS/FS/cust_main/Location.pm
+++ b/FS/FS/cust_main/Location.pm
@@ -74,9 +74,11 @@ sub bill_location {
$self->hashref->{bill_location}
||= FS::cust_location->by_key($self->bill_locationnum)
# degraded mode--let the system keep running during upgrades
- || FS::cust_location->new({
- map { $_ => $self->get($_) } @location_fields
- })
+ || ( $self->get('address1')
+ && FS::cust_location->new({
+ map { $_ => $self->get($_) } @location_fields
+ })
+ );
}
=item ship_location
@@ -89,9 +91,17 @@ sub ship_location {
my $self = shift;
$self->hashref->{ship_location}
||= FS::cust_location->by_key($self->ship_locationnum)
- || FS::cust_location->new({
- map { $_ => $self->get('ship_'.$_) || $self->get($_) } @location_fields
- })
+ # degraded mode--let the system keep running during upgrades
+ || ( $self->get('ship_address1')
+ ? FS::cust_location->new({
+ map { $_ => $self->get('ship_'.$_) } @location_fields
+ })
+ : $self->get('address1')
+ ? FS::cust_location->new({
+ map { $_ => $self->get($_) } @location_fields
+ })
+ : ''
+ );
}