From: Christopher Burger Date: Tue, 27 Mar 2018 18:20:11 +0000 (-0400) Subject: RT# 33362 - fixed Argument 1d is not numeric when trying to discount daily recuring... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e75717bd49c68a49940ebd668368a6542097a234 RT# 33362 - fixed Argument 1d is not numeric when trying to discount daily recuring packages --- diff --git a/FS/FS/part_pkg/discount_Mixin.pm b/FS/FS/part_pkg/discount_Mixin.pm index 1e4653639..ec37624f2 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'}; }