[freeside-commits] branch master updated. b5d9087e43d24bfa76ca1d87480cc7d95e85c285

Ivan ivan at 420.am
Thu Apr 27 09:23:27 PDT 2017


The branch, master has been updated
       via  b5d9087e43d24bfa76ca1d87480cc7d95e85c285 (commit)
      from  beaeb82e3a714f6b086c5fae4b4f2ec509c9978b (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 b5d9087e43d24bfa76ca1d87480cc7d95e85c285
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 27 09:23:26 2017 -0700

    now that quotations in v4 simulate a real billing, need a workaround for packages that start on hold, RT#75646

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 039943e..e2f7aca 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -60,6 +60,8 @@ our $upgrade = 0; #go away after setup+start dates cleaned up for old customers
 
 our $cache_enabled = 0;
 
+our $disable_start_on_hold = 0;
+
 sub _simplecache {
   my( $self, $hashref ) = @_;
   if ( $cache_enabled && $hashref->{'pkg'} && $hashref->{'plan'} ) {
@@ -397,7 +399,10 @@ sub insert {
       $self->start_date( timelocal_nocheck(0,0,0,1,$mon,$year) );
     }
 
-    if ($self->susp eq 'now' or $part_pkg->start_on_hold) {
+    if ( $self->susp eq 'now'
+           or ( $part_pkg->start_on_hold && ! $disable_start_on_hold )
+       )
+    {
       # if the package was ordered on hold:
       # - suspend it
       # - don't set the start date (it will be started manually)
diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
index 2f95425..520e11f 100644
--- a/FS/FS/quotation.pm
+++ b/FS/FS/quotation.pm
@@ -698,6 +698,7 @@ sub estimate {
     }
 
     # order packages
+    local($FS::cust_pkg::disable_start_on_hold) = 1;
     $error = $fake_self->order(\%pkgnum_of);
     die "$error (simulating package order)\n" if $error;
 

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

Summary of changes:
 FS/FS/cust_pkg.pm  |    7 ++++++-
 FS/FS/quotation.pm |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list