X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FLocation.pm;h=3cb73ffe8c15a8ee931468c0028342df2f8ca422;hb=4fd1280540e2c9b90fa59c0c32d691f5222f65d4;hp=be375dda99ef9d5e2b0a9cc3d827687b31a60865;hpb=5556814b7ff65b0a4837390be9331e1841189427;p=freeside.git diff --git a/FS/FS/cust_main/Location.pm b/FS/FS/cust_main/Location.pm index be375dda9..3cb73ffe8 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 + }) + : '' + ); }