projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c2f7d8b
)
external taxes: avoid failing when the package has taxproductnums but no default...
author
Mark Wells
<mark@freeside.biz>
Thu, 5 Jun 2014 21:17:13 +0000
(14:17 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 5 Jun 2014 21:17:13 +0000
(14:17 -0700)
FS/FS/part_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg.pm
b/FS/FS/part_pkg.pm
index
0165455
..
ffbeba2
100644
(file)
--- a/
FS/FS/part_pkg.pm
+++ b/
FS/FS/part_pkg.pm
@@
-1475,12
+1475,19
@@
sub tax_rates {
$self->part_pkg_taxoverride($class);
if (!@taxclassnums) {
my $part_pkg_taxproduct = $self->taxproduct($class);
$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;
@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) . ")";
warn "Found taxclassnum values of ". join(',', @taxclassnums) ."\n"
if $DEBUG;
my $extra_sql = "AND taxclassnum IN (". join(',', @taxclassnums) . ")";