projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
800a40a
)
fix over-discounting resulting in an error, RT#13450
author
ivan
<ivan>
Mon, 27 Jun 2011 21:27:36 +0000
(21:27 +0000)
committer
ivan
<ivan>
Mon, 27 Jun 2011 21:27:36 +0000
(21:27 +0000)
FS/FS/part_pkg/discount_Mixin.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/discount_Mixin.pm
b/FS/FS/part_pkg/discount_Mixin.pm
index
a789ab3
..
87ec3a7
100644
(file)
--- a/
FS/FS/part_pkg/discount_Mixin.pm
+++ b/
FS/FS/part_pkg/discount_Mixin.pm
@@
-130,11
+130,12
@@
sub calc_discount {
&& ! defined $param->{'setup_charge'});
die "error discounting: $error" if $error;
+ $amount = min($amount, $br);
$amount *= $months;
$amount = sprintf('%.2f', $amount);
next unless $amount > 0;
-
+
# transfer remainder of discount, if any, to setup
if ( $discount->setup && $discount->amount
&& (!$discount->months || $discount->months != 1)