[freeside-commits] branch FREESIDE_4_BRANCH updated. 34636a1bc463209f1c43900d6e1a7c9626036edc

Ivan ivan at 420.am
Wed Aug 30 17:06:47 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  34636a1bc463209f1c43900d6e1a7c9626036edc (commit)
      from  7076cfd66dbb71b1577166f75875c091e6a67099 (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 34636a1bc463209f1c43900d6e1a7c9626036edc
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Aug 30 17:06:46 2017 -0700

    fix prorate_day without force_prorate_day for recur_Common packages configured as subscription or prorate, RT#77140, RT#38191

diff --git a/FS/FS/part_pkg/recur_Common.pm b/FS/FS/part_pkg/recur_Common.pm
index 4ed83a4..729fb61 100644
--- a/FS/FS/part_pkg/recur_Common.pm
+++ b/FS/FS/part_pkg/recur_Common.pm
@@ -43,12 +43,17 @@ sub cutoff_day {
   my $recur_method = $self->option('recur_method',1) || 'anniversary';
   my $cust_main = $cust_pkg->cust_main;
 
-  if ( $cust_main->force_prorate_day and $cust_main->prorate_day ) {
-     return ( $cust_main->prorate_day );
-  } elsif ($recur_method eq 'prorate' || $recur_method eq 'subscription') {
+  return ( $cust_main->prorate_day )
+    if $cust_main->prorate_day and (    $cust_main->force_prorate_day
+                                     || $recur_method eq 'prorate'
+                                     || $recur_method eq 'subscription'
+                                   );
 
-    return split(/\s*,\s*/, $self->option('cutoff_day', 1) || '1');
-  }
+  return split(/\s*,\s*/, $self->option('cutoff_day', 1) || '1')
+    if $recur_method eq 'prorate'
+    || $recur_method eq 'subscription';
+
+  return ();
 }
 
 sub calc_recur_Common {

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

Summary of changes:
 FS/FS/part_pkg/recur_Common.pm |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list