summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2011-04-29 12:16:47 +0000
committerlevinse <levinse>2011-04-29 12:16:47 +0000
commit046131d0a951a09c8674345c37bb130c910dc7c1 (patch)
tree71ae467f5e22f871a9ec5c6a5a0f89258e82ae27
parent8acc996345752f44f9bf55eff088f03739019c33 (diff)
apply discount to setup fees, part 1 of 2, RT11512
-rw-r--r--FS/FS/part_pkg/flat.pm7
1 files changed, 6 insertions, 1 deletions
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 {