[freeside-commits] branch FREESIDE_2_3_BRANCH updated. a60a4b806ce280ed589199fcfe0cc20824b43fa5

Ivan ivan at 420.am
Sat Nov 9 13:00:04 PST 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  a60a4b806ce280ed589199fcfe0cc20824b43fa5 (commit)
      from  b67aa7e32eddd8d67d53ef534a4803f1162f2cca (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 a60a4b806ce280ed589199fcfe0cc20824b43fa5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Nov 9 13:00:02 2013 -0800

    discounts with bulk packages, RT#24655

diff --git a/FS/FS/part_pkg/bulk_Common.pm b/FS/FS/part_pkg/bulk_Common.pm
index 67a683a..5011595 100644
--- a/FS/FS/part_pkg/bulk_Common.pm
+++ b/FS/FS/part_pkg/bulk_Common.pm
@@ -100,10 +100,13 @@ sub calc_recur {
     }
   }
 
-  sprintf('%.2f', $self->base_recur($cust_pkg, $sdate) + $total_svc_charge );
-}
+  my $charge = $self->base_recur($cust_pkg, $sdate) + $total_svc_charge;
+
+  $param->{'override_charges'} = $total_svc_charge / $self->freq;
+  my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
 
-sub can_discount { 0; }
+  sprintf('%.2f', $charge - $discount );
+}
 
 sub hide_svc_detail { 1; }
 

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

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




More information about the freeside-commits mailing list