X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Ftax_rate.pm;h=bfb9c8c328a68308354edaa80ca3d41f2634b0df;hb=0269c850cfefc00d5da255f88c63a314e1ab6cd0;hp=4769b32ab22cc594bb42935aaa711c28f8c2c3cb;hpb=8381e7232f90ac22b3f655cdccd0d39e2bde1d63;p=freeside.git diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index 4769b32ab..bfb9c8c32 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -397,7 +397,12 @@ sub taxline { my $taxable_units = 0; unless ($self->recurtax =~ /^Y$/i) { if ($self->unittype == 0) { - $taxable_units += $_->units foreach @cust_bill_pkg; + my %seen = (); + foreach (@cust_bill_pkg) { + $taxable_units += $_->units + unless $seen{$_->pkgnum}; + $seen{$_->pkgnum}++; + } }elsif ($self->unittype == 1) { return qq!fatal: can't (yet) handle fee with minute unit type!; }elsif ($self->unittype == 2) { @@ -717,7 +722,7 @@ sub batch_import { $dbh->commit or die $dbh->errstr if $oldAutoCommit; - return "Empty file!" unless $imported; + return "Empty file!" unless ($imported || $format eq 'cch-update'); ''; #no error