summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-11-09 13:00:00 -0800
committerIvan Kohler <ivan@freeside.biz>2013-11-09 13:00:00 -0800
commit7b153f2ca026421681ffd5f37c95efdff4f0a5d1 (patch)
treefae0cbe536b905b91c2a0d1690679d0afefd5c51 /FS/FS/part_pkg
parent0c04fc78f66d17a5736686757cd8f838715c8380 (diff)
discounts with bulk packages, RT#24655
Diffstat (limited to 'FS/FS/part_pkg')
-rw-r--r--FS/FS/part_pkg/bulk_Common.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/part_pkg/bulk_Common.pm b/FS/FS/part_pkg/bulk_Common.pm
index 26550df70..2ee25488b 100644
--- a/FS/FS/part_pkg/bulk_Common.pm
+++ b/FS/FS/part_pkg/bulk_Common.pm
@@ -106,10 +106,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; }