[freeside-commits] branch master updated. cfe0406764d057feeea74b676acc08917fa23f26

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


The branch, master has been updated
       via  cfe0406764d057feeea74b676acc08917fa23f26 (commit)
      from  0ba5bbd31a7bd3bc99c6173d28ea9de7103c1b84 (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 cfe0406764d057feeea74b676acc08917fa23f26
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Aug 30 17:06:44 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