i think this was right after all, we do want to look for a county-less state+country...
authorivan <ivan>
Mon, 26 Jan 2009 04:22:33 +0000 (04:22 +0000)
committerivan <ivan>
Mon, 26 Jan 2009 04:22:33 +0000 (04:22 +0000)
FS/FS/cust_main.pm

index 038577a..fa2ccaa 100644 (file)
@@ -2829,22 +2829,10 @@ sub _handle_taxes {
 
       my %taxhash_elim = %taxhash;
 
-      # no, unexpected change in behavior.
-      #my @elim = qw( taxclass county state );
-      #while ( !scalar(@taxes) && scalar(@elim) ) {
-      #  $taxhash_elim{ shift(@elim) } = '';
-      #  @taxes = qsearch( 'cust_main_county', \%taxhash_elim );
-      #}
-
-      #just try taxclass first, then state+county, not county in the middle
-      unless ( @taxes ) {
-        $taxhash_elim{'taxclass'} = '';
-        @taxes =  qsearch( 'cust_main_county', \%taxhash_elim );
-      }
-      #one more try at a whole-country tax rate
-      unless ( @taxes ) {
-        $taxhash_elim{$_} = '' foreach qw( state county );
-        @taxes =  qsearch( 'cust_main_county', \%taxhash_elim );
+      my @elim = qw( taxclass county state );
+      while ( !scalar(@taxes) && scalar(@elim) ) {
+        $taxhash_elim{ shift(@elim) } = '';
+        @taxes = qsearch( 'cust_main_county', \%taxhash_elim );
       }
 
       if ( $conf->exists('tax-pkg_address') && $cust_pkg->locationnum ) {