[freeside-commits] branch FREESIDE_3_BRANCH updated. 2def4560aa1f78ac741bfa74297404ad64165b8b

Mark Wells mark at 420.am
Sun Nov 16 21:20:50 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  2def4560aa1f78ac741bfa74297404ad64165b8b (commit)
       via  985f90f7d699c7fea9669d10d905da5ae202c8dc (commit)
      from  462a9a2808f839c1b4ab676ece47d4d1cebec2ef (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 2def4560aa1f78ac741bfa74297404ad64165b8b
Author: Mark Wells <mark at freeside.biz>
Date:   Sun Nov 16 21:19:25 2014 -0800

    fix discounts in general, #31273

diff --git a/FS/FS/part_pkg/discount_Mixin.pm b/FS/FS/part_pkg/discount_Mixin.pm
index 50b3312..3180275 100644
--- a/FS/FS/part_pkg/discount_Mixin.pm
+++ b/FS/FS/part_pkg/discount_Mixin.pm
@@ -162,6 +162,7 @@ sub calc_discount {
       'months'         => $months,
     };
     push @{ $param->{'discounts'} }, $cust_bill_pkg_discount;
+    $tot_discount += $amount;
 
     #add details on discount to invoice
     # no longer! this is now done during rendering based on the existence
@@ -189,7 +190,6 @@ sub calc_discount {
     #push @$details, $d;
     #push @$details, sprintf( $format, $money_char, $br );
 
-    #$tot_discount += $amount;
   }
 
   sprintf('%.2f', $tot_discount);

commit 985f90f7d699c7fea9669d10d905da5ae202c8dc
Author: Mark Wells <mark at freeside.biz>
Date:   Sun Nov 16 21:19:01 2014 -0800

    fix discounts on one-time charges, #28956

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 2c41ecb..a681080 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -1087,7 +1087,9 @@ sub _make_lines {
   my $setup = 0;
   my $unitsetup = 0;
   my @setup_discounts = ();
-  my %setup_param = ( 'discounts' => \@setup_discounts );
+  my %setup_param = ( 'discounts'    => \@setup_discounts,
+                      'real_pkgpart' => $params{real_pkgpart}
+                    );
   # Conditions for setting setup date and charging the setup fee:
   # - this is not a recurring-only billing run
   # - and the package is not currently being canceled

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

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




More information about the freeside-commits mailing list