[freeside-commits] freeside/FS/FS tax_rate.pm,1.13,1.14

Jeff Finucane,420,, jeff at wavetail.420.am
Mon Jan 5 13:12:08 PST 2009


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

Modified Files:
	tax_rate.pm 
Log Message:
doh! change the interface here, too

Index: tax_rate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/tax_rate.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- tax_rate.pm	5 Dec 2008 17:23:49 -0000	1.13
+++ tax_rate.pm	5 Jan 2009 21:12:06 -0000	1.14
@@ -342,16 +342,28 @@
   $tax_passtypes{$self->passtype};
 }
 
-=item taxline CUST_BILL_PKG|AMOUNT, ...
+=item taxline TAXABLES, [ OPTIONSHASH ]
 
 Returns a listref of a name and an amount of tax calculated for the list
-of packages/amounts.  If an error occurs, a message is returned as a scalar.
+of packages/amounts referenced by TAXABLES.  If an error occurs, a message
+is returned as a scalar.
 
 =cut
 
 sub taxline {
   my $self = shift;
 
+  my $taxables;
+  my %opt = ();
+
+  if (ref($_[0]) eq 'ARRAY') {
+    $taxables = shift;
+    %opt = @_;
+  }else{
+    $taxables = [ @_ ];
+    #exemptions would be broken in this case
+  }
+
   my $name = $self->taxname;
   $name = 'Other surcharges'
     if ($self->passtype == 2);
@@ -361,7 +373,8 @@
     if $self->disabled;
 
   my $taxable_charged = 0;
-  my @cust_bill_pkg = grep { $taxable_charged += $_ unless ref; ref; } @_;
+  my @cust_bill_pkg = grep { $taxable_charged += $_ unless ref; ref; }
+                      @$taxables;
 
   warn "calculating taxes for ". $self->taxnum. " on ".
     join (",", map { $_->pkgnum } @cust_bill_pkg)



More information about the freeside-commits mailing list