diff options
author | ivan <ivan> | 2010-12-02 19:03:58 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-12-02 19:03:58 +0000 |
commit | 2dced43b8c6083fa0ff7bbe2120c1387c8a2b604 (patch) | |
tree | eeec2192062f6fb8ab5b37772dd80d5326f3b940 /FS/FS/tax_rate.pm | |
parent | ad17d8651adb39fdef45f509490a6b2c6eac8301 (diff) |
count locations as accounts for cch taxation only when tax-pkg_address is on
Diffstat (limited to 'FS/FS/tax_rate.pm')
-rw-r--r-- | FS/FS/tax_rate.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index ef4333b..d8ee875 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -18,6 +18,7 @@ use DBIx::DBSchema; use DBIx::DBSchema::Table; use DBIx::DBSchema::Column; use FS::Record qw( qsearch qsearchs dbh dbdef ); +use FS::Conf; use FS::tax_class; use FS::cust_bill_pkg; use FS::cust_tax_location; @@ -455,12 +456,17 @@ sub taxline { return $self->_fatal_or_null( 'fee with minute unit type' ); } elsif ($self->unittype == 2) { #account - #$taxable_units = 1; - #number of distinct locations - my %seen = (); - foreach (@cust_bill_pkg) { - $taxable_units++ - unless $seen{$_->cust_pkg->locationnum}++; + + my $conf = new FS::Conf; + if ( $conf->exists('tax-pkg_address') ) { + #number of distinct locations + my %seen = (); + foreach (@cust_bill_pkg) { + $taxable_units++ + unless $seen{$_->cust_pkg->locationnum}++; + } + } else { + $taxable_units = 1; } } else { |