X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fdiscount_Mixin.pm;h=801737b04b891737198e8bfbc5f3e287908d2750;hp=4c8675346ab6676bcf0e0784c375b0920ab3a6fa;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hpb=df55224db51bb12540137db34123b11e0f34880b diff --git a/FS/FS/part_pkg/discount_Mixin.pm b/FS/FS/part_pkg/discount_Mixin.pm index 4c8675346..801737b04 100644 --- a/FS/FS/part_pkg/discount_Mixin.pm +++ b/FS/FS/part_pkg/discount_Mixin.pm @@ -142,11 +142,12 @@ sub calc_discount { } else { # we are calculating a recurring fee discount. estimate the recurring - # fee: - # XXX it would be more accurate for calc_recur to just _tell us_ what - # it's going to charge + # fee. Note we use $months here rather than $chg_months so that if the + # remaining discount amount is for less time than the package period, + # the "estimated recurring fee" is only for as long as the discount + # lasts. - my $recur_charge = $br * $chg_months / $self->freq; + my $recur_charge = $br * $months / $self->freq; # round this, because the real recur charge is rounded $recur_charge = sprintf('%.2f', $recur_charge); @@ -233,7 +234,6 @@ sub calc_discount { 'pkgdiscountnum' => $cust_pkg_discount->pkgdiscountnum, 'amount' => $amount, 'months' => $months, - # 'setuprecur' is implied by the cust_pkg_discount link }; push @{ $param->{'discounts'} }, $cust_bill_pkg_discount; $tot_discount += $amount;