[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 2ee2d0cf73e191a4fd276675eff543675a0c9676

Mark Wells mark at 420.am
Sat Mar 24 16:34:59 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  2ee2d0cf73e191a4fd276675eff543675a0c9676 (commit)
      from  7fd2b8885728374bbee5459fadd2f712bd4d9ec0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2ee2d0cf73e191a4fd276675eff543675a0c9676
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Mar 24 16:34:49 2012 -0700

    fix flat-rate discounts when charging zero months, #17043

diff --git a/FS/FS/part_pkg/discount_Mixin.pm b/FS/FS/part_pkg/discount_Mixin.pm
index 7de3bfe..7c53a8c 100644
--- a/FS/FS/part_pkg/discount_Mixin.pm
+++ b/FS/FS/part_pkg/discount_Mixin.pm
@@ -84,7 +84,9 @@ sub calc_discount {
     $amount += $discount->amount
         if $cust_pkg->pkgpart == $param->{'real_pkgpart'};
     $amount += sprintf('%.2f', $discount->percent * $br / 100 );
-    my $chg_months = $param->{'months'} || $cust_pkg->part_pkg->freq;
+    my $chg_months = defined($param->{'months'}) ?
+                      $param->{'months'} :
+                      $cust_pkg->part_pkg->freq;
 
     my $months = $discount->months
     ? min( $chg_months,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_pkg/discount_Mixin.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list