[freeside-commits] branch FREESIDE_4_BRANCH updated. cc4e6579fd8aade3bf74cf9d8d826fe33576ccc8

Ivan Kohler ivan at freeside.biz
Fri Jul 26 11:10:34 PDT 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  cc4e6579fd8aade3bf74cf9d8d826fe33576ccc8 (commit)
      from  6db5c31175c207fd6fdae97b1d7ecb719d6c94aa (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 cc4e6579fd8aade3bf74cf9d8d826fe33576ccc8
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 26 11:10:28 2019 -0700

    fix intro rates packages vs discounts, RT#83503

diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 6fd9c7d08..a7a3768a3 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -114,9 +114,9 @@ sub price_info {
 }
 
 sub calc_setup {
-  my($self, $cust_pkg, $sdate, $details, $param ) = @_;
+  my($self, $cust_pkg, $time, $details, $param ) = @_;
 
-  return 0 if $self->prorate_setup($cust_pkg, $sdate);
+  return 0 if $self->prorate_setup($cust_pkg, $time);
 
   my $i = 0;
   my $count = $self->option( 'additional_count', 'quiet' ) || 0;
@@ -124,12 +124,12 @@ sub calc_setup {
     push @$details, $self->option( 'additional_info' . $i++ );
   }
 
-  my $charge = $self->base_setup($cust_pkg, $sdate, $details);
+  my $charge = $self->base_setup($cust_pkg, $time, $details);
 
   my $discount = 0;
   if ( $charge > 0 ) {
       $param->{'setup_charge'} = $charge;
-      $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+      $discount = $self->calc_discount($cust_pkg, \$time, $details, $param);
       delete $param->{'setup_charge'};
   }
 
@@ -137,7 +137,7 @@ sub calc_setup {
 }
 
 sub base_setup {
-  my($self, $cust_pkg, $sdate, $details ) = @_;
+  my($self, $cust_pkg, $time, $details ) = @_;
   $self->option('setup_fee', 1) || 0;
 }
 
diff --git a/FS/FS/part_pkg/recur_Common.pm b/FS/FS/part_pkg/recur_Common.pm
index 729fb6125..fc87628ea 100644
--- a/FS/FS/part_pkg/recur_Common.pm
+++ b/FS/FS/part_pkg/recur_Common.pm
@@ -21,16 +21,16 @@ sub base_recur {
 
 sub calc_setup {
   # moved from all descendant packages which just had $self->option('setup_fee')
-  my($self, $cust_pkg, $sdate, $details, $param) = @_;
+  my($self, $cust_pkg, $time, $details, $param) = @_;
 
-  return 0 if $self->prorate_setup($cust_pkg, $sdate);
+  return 0 if $self->prorate_setup($cust_pkg, $time);
 
   my $charge = $self->option('setup_fee');
 
   my $discount = 0;
   if ( $charge > 0 ) {
       $param->{'setup_charge'} = $charge;
-      $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+      $discount = $self->calc_discount($cust_pkg, \$time, $details, $param);
       delete $param->{'setup_charge'};
   }
 

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

Summary of changes:
 FS/FS/part_pkg/flat.pm         | 10 +++++-----
 FS/FS/part_pkg/recur_Common.pm |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list