[freeside-commits] branch FREESIDE_3_BRANCH updated. f1731704579a2de6a1723b98af92be654eb23095

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


The branch, FREESIDE_3_BRANCH has been updated
       via  f1731704579a2de6a1723b98af92be654eb23095 (commit)
      from  4c385c9d52247aa9540678cd0a9a8feaa5b6be32 (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 f1731704579a2de6a1723b98af92be654eb23095
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Nov 9 13:00:01 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