X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=036daf705bed63967a170bf5d6e5cf8b0b3de751;hb=c0660bdfce760cc982a145fc3aebaaec911fc32a;hp=e85da9da2d5617c05ec0462ff0c399a9212c3cbe;hpb=747fee2b23da71a4c124d610850bc55f71fcaa3c;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e85da9da2..036daf705 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1390,12 +1390,19 @@ sub tax_rates { $self->part_pkg_taxoverride($class); if (!@taxclassnums) { my $part_pkg_taxproduct = $self->taxproduct($class); + # If this isn't defined, then the class has no taxproduct designation, + # so return no tax rates. + return () if !$part_pkg_taxproduct; + + # convert the taxproduct to the tax classes that might apply to it in + # $geocode @taxclassnums = map { $_->taxclassnum } grep { $_->taxable eq 'Y' } # why do we need this? $part_pkg_taxproduct->part_pkg_taxrate($geocode); } return unless @taxclassnums; + # then look up the actual tax_rate entries warn "Found taxclassnum values of ". join(',', @taxclassnums) ."\n" if $DEBUG; my $extra_sql = "AND taxclassnum IN (". join(',', @taxclassnums) . ")";