From: levinse Date: Fri, 29 Apr 2011 12:16:47 +0000 (+0000) Subject: apply discount to setup fees, part 1 of 2, RT11512 X-Git-Tag: freeside_2_1_3~246 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=046131d0a951a09c8674345c37bb130c910dc7c1;p=freeside.git apply discount to setup fees, part 1 of 2, RT11512 --- diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index c9f285898..7837acc96 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -98,7 +98,12 @@ sub calc_setup { my $quantity = $cust_pkg->quantity || 1; - sprintf("%.2f", $quantity * $self->unit_setup($cust_pkg, $sdate, $details) ); + my $charge = $quantity * $self->unit_setup($cust_pkg, $sdate, $details); + + my $param = { 'setup_charge' => $charge }; + my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); + + sprintf('%.2f', $charge - $discount); } sub unit_setup {