summaryrefslogtreecommitdiff
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 12:54:17 -0400
commita140ffb44cd6ce9f5346e337eac68a4f874b7675 (patch)
treec9ced60d19587af1e4a0681a5bda6fda386b2204
parent6f401f92ef5362b8e42e76fee24d89e46d78a0dd (diff)
RT# 33362 - fixed Argument 1d is not numeric when trying to discount daily recuring packages
-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 5bcf561c2..f634913cc 100644
--- a/FS/FS/part_pkg/discount_Mixin.pm
+++ b/FS/FS/part_pkg/discount_Mixin.pm
@@ -92,7 +92,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'};
}