summaryrefslogtreecommitdiff
path: root/FS/FS/discount_plan.pm
diff options
context:
space:
mode:
authorivan <ivan>2011-12-20 23:50:19 +0000
committerivan <ivan>2011-12-20 23:50:19 +0000
commit0aa75d8f76fd378816c1761307c39a68dd689974 (patch)
treeb28c7f69f495ecd1052ec400ff7bb870d562e914 /FS/FS/discount_plan.pm
parent3dbb7d158b87c6bab8467e8f1fae8be5c59d0153 (diff)
fix 'Can't call method "setup" on an undefined value' error when using into rates together with term discounts, RT#15661
Diffstat (limited to 'FS/FS/discount_plan.pm')
-rw-r--r--FS/FS/discount_plan.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/FS/FS/discount_plan.pm b/FS/FS/discount_plan.pm
index 4f97e33..3ae44c8 100644
--- a/FS/FS/discount_plan.pm
+++ b/FS/FS/discount_plan.pm
@@ -63,7 +63,7 @@ sub new {
my $recur = $cust_bill_pkg->recur || 0;
if ( $freq eq '1' ) { # monthly recurring package
- my $permonth = $part_pkg->base_recur_permonth || 0;
+ my $permonth = $part_pkg->base_recur_permonth($cust_pkg) || 0;
my ($discount) = grep { $_->months == $months }
map { $_->discount } $part_pkg->part_pkg_discount;