From a60a4b806ce280ed589199fcfe0cc20824b43fa5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 9 Nov 2013 13:00:02 -0800 Subject: [PATCH] discounts with bulk packages, RT#24655 --- FS/FS/part_pkg/bulk_Common.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FS/FS/part_pkg/bulk_Common.pm b/FS/FS/part_pkg/bulk_Common.pm index 67a683a12..50115958e 100644 --- a/FS/FS/part_pkg/bulk_Common.pm +++ b/FS/FS/part_pkg/bulk_Common.pm @@ -100,10 +100,13 @@ sub calc_recur { } } - sprintf('%.2f', $self->base_recur($cust_pkg, $sdate) + $total_svc_charge ); -} + my $charge = $self->base_recur($cust_pkg, $sdate) + $total_svc_charge; + + $param->{'override_charges'} = $total_svc_charge / $self->freq; + my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); -sub can_discount { 0; } + sprintf('%.2f', $charge - $discount ); +} sub hide_svc_detail { 1; } -- 2.11.0