diff options
author | Mark Wells <mark@freeside.biz> | 2014-04-28 23:29:03 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-04-28 23:29:03 -0700 |
commit | 59958b6c8ec8418cf30d679a9afea478bab1f366 (patch) | |
tree | 1bf591dce55cf05786fa25f32b1eaf811478b859 /FS/FS/cust_pkg.pm | |
parent | 00013557f2aecf4422d7f09ddcf97eea9f2b0289 (diff) |
make cust_main location upgrade non-blocking, and make the system somewhat functional before the upgrade is complete, #28883
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r-- | FS/FS/cust_pkg.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index d546e55..cf9e324 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -3416,7 +3416,16 @@ Returns the L<FS::cust_location> object for tax_locationnum. sub tax_location { my $self = shift; - FS::cust_location->by_key( $self->tax_locationnum ) + my $conf = FS::Conf->new; + if ( $conf->exists('tax-pkg_address') and $self->locationnum ) { + return FS::cust_location->by_key($self->locationnum); + } + elsif ( $conf->exists('tax-ship_address') ) { + return $self->cust_main->ship_location; + } + else { + return $self->cust_main->bill_location; + } } =item seconds_since TIMESTAMP |