X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTaxEngine%2Finternal.pm;h=6fb1ca756728aed8f87925427b07b792fe23f91b;hb=606acab48f55da2b8846e5539839d591b63ae18c;hp=5f5d2295a417ca7a9c56e7513d8e280a9fad20f5;hpb=b21864778ad131008d94a3672820a6acbd413b60;p=freeside.git diff --git a/FS/FS/TaxEngine/internal.pm b/FS/FS/TaxEngine/internal.pm index 5f5d2295a..6fb1ca756 100644 --- a/FS/FS/TaxEngine/internal.pm +++ b/FS/FS/TaxEngine/internal.pm @@ -105,6 +105,15 @@ sub taxline { my $taxable_charged = $cust_bill_pkg->setup + $cust_bill_pkg->recur or next; # don't create zero-amount exemptions + ## re-add the discounted amount if the tax needs to be charged pre discount + if ($tax_object->charge_prediscount) { + my $discount_amount = 0; + foreach my $discount (@{$cust_bill_pkg->discounts}) { + $discount_amount += $discount->amount; + } + $taxable_charged += $discount_amount; + } + # XXX the following procedure should probably be in cust_bill_pkg if ( $exempt_cust ) {