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

Ivan,,, ivan at wavetail.420.am
Sat Nov 27 15:53:57 PST 2010


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	tax_rate.pm 
Log Message:
with cch taxation, consider "account" taxes per- (distinct) location instead of per -customer, RT#10248

Index: tax_rate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/tax_rate.pm,v
retrieving revision 1.43
retrieving revision 1.43.4.1
diff -u -w -d -r1.43 -r1.43.4.1
--- tax_rate.pm	30 Jul 2010 00:13:20 -0000	1.43
+++ tax_rate.pm	27 Nov 2010 23:53:55 -0000	1.43.4.1
@@ -443,20 +443,30 @@
 
   my $taxable_units = 0;
   unless ($self->recurtax =~ /^Y$/i) {
-    if (( $self->unittype || 0 ) == 0) {
+
+    if (( $self->unittype || 0 ) == 0) { #access line
       my %seen = ();
       foreach (@cust_bill_pkg) {
         $taxable_units += $_->units
-          unless $seen{$_->pkgnum};
-        $seen{$_->pkgnum}++;
+          unless $seen{$_->pkgnum}++;
       }
-    }elsif ($self->unittype == 1) {
+
+    } elsif ($self->unittype == 1) { #minute
       return $self->_fatal_or_null( 'fee with minute unit type' );
-    }elsif ($self->unittype == 2) {
-      $taxable_units = 1;
+
+    } 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}++;
+      }
+
     }else {
       return $self->_fatal_or_null( 'unknown unit type in tax'. $self->taxnum );
     }
+
   }
 
   #



More information about the freeside-commits mailing list