[freeside-commits] freeside/FS/FS tax_rate.pm,1.43.4.1,1.43.4.2

Ivan,,, ivan at wavetail.420.am
Thu Dec 2 11:04:01 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv20226

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	tax_rate.pm 
Log Message:
count locations as accounts for cch taxation only when tax-pkg_address is on

Index: tax_rate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/tax_rate.pm,v
retrieving revision 1.43.4.1
retrieving revision 1.43.4.2
diff -u -w -d -r1.43.4.1 -r1.43.4.2
--- tax_rate.pm	27 Nov 2010 23:53:55 -0000	1.43.4.1
+++ tax_rate.pm	2 Dec 2010 19:03:59 -0000	1.43.4.2
@@ -18,6 +18,7 @@
 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,13 +456,18 @@
       return $self->_fatal_or_null( 'fee with minute unit type' );
 
     } elsif ($self->unittype == 2) { #account
-      #$taxable_units = 1;
+
+      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 {
       return $self->_fatal_or_null( 'unknown unit type in tax'. $self->taxnum );



More information about the freeside-commits mailing list