summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-03-27 14:20:11 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-04-02 10:47:28 -0400
commit4238deb67701a30d328d4b032a907de208491de1 (patch)
tree116f2be3111051028576cb5f027fca15c979d257 /FS/FS/part_pkg
parent48bbf0e77b2350ef14d2dc47fe1d2d768a89fd8a (diff)
RT# 33362 - fixed Argument 1d is not numeric when trying to discount daily recuring packages
Diffstat (limited to 'FS/FS/part_pkg')
-rw-r--r--FS/FS/part_pkg/discount_Mixin.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/FS/FS/part_pkg/discount_Mixin.pm b/FS/FS/part_pkg/discount_Mixin.pm
index 1e46536..ec37624 100644
--- a/FS/FS/part_pkg/discount_Mixin.pm
+++ b/FS/FS/part_pkg/discount_Mixin.pm
@@ -102,7 +102,10 @@ sub calc_discount {
# $chg_months: the number of months we are charging recur for
# $months: $chg_months or the months left on the discount, whchever is less
- my $chg_months = $cust_pkg->part_pkg->freq || 1;
+ my $chg_months = 1;
+ unless ($cust_pkg->part_pkg->freq !~ /^\d+$/) {
+ $chg_months = $cust_pkg->part_pkg->freq || 1;
+ }
if ( defined($param->{'months'}) ) { # then override
$chg_months = $param->{'months'};
}