[freeside-commits] branch master updated. 07ed221540128b8c75f4cb5a2af1e01b25fa8e18

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


The branch, master has been updated
       via  07ed221540128b8c75f4cb5a2af1e01b25fa8e18 (commit)
       via  14f234a943f1e4b5bbc6fe90254b8f5ca677f028 (commit)
       via  74f4610304eb373363ac07fc6e655d16c5f0ed33 (commit)
      from  2009d9cee8038aeff5b4313113fc23f546455cf5 (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 07ed221540128b8c75f4cb5a2af1e01b25fa8e18
Merge: 14f234a94 2009d9cee
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 26 11:14:05 2019 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 14f234a943f1e4b5bbc6fe90254b8f5ca677f028
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 26 11:14:03 2019 -0700

    spacing, RT#83503

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 5f8dd9b4c..47cbbf17e 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -1087,7 +1087,9 @@ sub _make_lines {
     }
 
     $lineitems++
-    if $cust_pkg->waive_setup && $part_pkg->can('prorate_setup') && $part_pkg->prorate_setup($cust_pkg, $time);
+      if $cust_pkg->waive_setup
+      && $part_pkg->can('prorate_setup')
+      && $part_pkg->prorate_setup($cust_pkg, $time);
 
     if ( $cust_pkg->get('setup') ) {
       # don't change it

commit 74f4610304eb373363ac07fc6e655d16c5f0ed33
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jul 26 11:10:11 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 c06328b1b..762ecebc0 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -121,9 +121,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;
@@ -131,12 +131,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'};
   }
 
@@ -144,7 +144,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/cust_main/Billing.pm     |  4 +++-
 FS/FS/part_pkg/flat.pm         | 10 +++++-----
 FS/FS/part_pkg/recur_Common.pm |  6 +++---
 3 files changed, 11 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list