scalar/array scope fix... new, multiple (i.e. canadian GST/PST) taxes work now!
authorivan <ivan>
Fri, 26 Sep 2003 09:31:11 +0000 (09:31 +0000)
committerivan <ivan>
Fri, 26 Sep 2003 09:31:11 +0000 (09:31 +0000)
FS/FS/cust_main.pm

index 3858993..90cf18e 100644 (file)
@@ -1165,18 +1165,20 @@ sub bill {
 
         unless ( $self->tax =~ /Y/i || $self->payby eq 'COMP' ) {
 
 
         unless ( $self->tax =~ /Y/i || $self->payby eq 'COMP' ) {
 
-          my @taxes =  qsearch( 'cust_main_county', {
-                                  'state'    => $self->state,
-                                  'county'   => $self->county,
-                                  'country'  => $self->country,
-                                  'taxclass' => $part_pkg->taxclass,
-                                                                      } )
-                    || qsearch( 'cust_main_county', {
+          my @taxes = qsearch( 'cust_main_county', {
+                                 'state'    => $self->state,
+                                 'county'   => $self->county,
+                                 'country'  => $self->country,
+                                 'taxclass' => $part_pkg->taxclass,
+                                                                      } );
+          unless ( @taxes ) {
+            @taxes =  qsearch( 'cust_main_county', {
                                   'state'    => $self->state,
                                   'county'   => $self->county,
                                   'country'  => $self->country,
                                   'taxclass' => '',
                                                                       } );
                                   'state'    => $self->state,
                                   'county'   => $self->county,
                                   'country'  => $self->country,
                                   'taxclass' => '',
                                                                       } );
+          }
 
           # maybe eliminate this entirely, along with all the 0% records
           unless ( @taxes ) {
 
           # maybe eliminate this entirely, along with all the 0% records
           unless ( @taxes ) {