[freeside-commits] branch FREESIDE_3_BRANCH updated. b77a4f001a6a94e6b40f19d2e78655102dcc3aa7

Jonathan Prykop jonathan at 420.am
Fri Mar 13 13:37:57 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  b77a4f001a6a94e6b40f19d2e78655102dcc3aa7 (commit)
       via  70889cbb815cd80925c21891fcf145c95983ad8b (commit)
      from  972904e944a37256e67cda6335049079e6fe5f8b (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 b77a4f001a6a94e6b40f19d2e78655102dcc3aa7
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Mar 12 20:16:25 2015 -0500

    RT#14671 [documentation changes only]

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 39c0a42..cbe3411 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -791,14 +791,9 @@ to a different pkgpart or location, and probably shouldn't be in any other
 case.  If it's not set, the 'unused_credit_cancel' part_pkg option will 
 be used.
 
-=item delay_cancel - for internal use, to allow proper handling of
-supplemental packages when the main package is flagged to suspend 
-before cancelling, probably shouldn't be used otherwise (set the
-corresponding package option instead)
-
-=item no_delay_cancel - for internal use, prevents delay_cancel behavior
+=item no_delay_cancel - prevents delay_cancel behavior
 no matter what other options say, for use when changing packages (or any
-other time you're really sure you want an unadulterated cancel)
+other time you're really sure you want an immediate cancel)
 
 =back
 
@@ -806,6 +801,12 @@ If there is an error, returns the error, otherwise returns false.
 
 =cut
 
+#NOT DOCUMENTING - this should only be used when calling recursively
+#=item delay_cancel - for internal use, to allow proper handling of
+#supplemental packages when the main package is flagged to suspend 
+#before cancelling, probably shouldn't be used otherwise (set the
+#corresponding package option instead)
+
 sub cancel {
   my( $self, %options ) = @_;
   my $error;

commit 70889cbb815cd80925c21891fcf145c95983ad8b
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Wed Mar 11 16:50:22 2015 -0500

    RT#14671 Usage for current day when billing outstanding usage (for cancelling customers) [added no_delay_cancel]

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 88afe35..39c0a42 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -793,7 +793,12 @@ be used.
 
 =item delay_cancel - for internal use, to allow proper handling of
 supplemental packages when the main package is flagged to suspend 
-before cancelling
+before cancelling, probably shouldn't be used otherwise (set the
+corresponding package option instead)
+
+=item no_delay_cancel - for internal use, prevents delay_cancel behavior
+no matter what other options say, for use when changing packages (or any
+other time you're really sure you want an unadulterated cancel)
 
 =back
 
@@ -841,9 +846,10 @@ sub cancel {
   my $date = $options{'date'} if $options{'date'}; # expire/cancel later
   $date = '' if ($date && $date <= $cancel_time);      # complain instead?
 
-  my $delay_cancel = $options{'delay_cancel'};
+  my $delay_cancel = $options{'no_delay_cancel'} ? 0 : $options{'delay_cancel'};
   if ( !$date && $self->part_pkg->option('delay_cancel',1)
        && (($self->status eq 'active') || ($self->status eq 'suspended'))
+       && !$options{'no_delay_cancel'}
   ) {
     my $expdays = $conf->config('part_pkg-delay_cancel-days') || 1;
     my $expsecs = 60*60*24*$expdays;
@@ -944,7 +950,7 @@ sub cancel {
   $error = $new->replace( $self, options => { $self->options } );
   if ( $self->change_to_pkgnum ) {
     my $change_to = FS::cust_pkg->by_key($self->change_to_pkgnum);
-    $error ||= $change_to->cancel || $change_to->delete;
+    $error ||= $change_to->cancel('no_delay_cancel' => 1) || $change_to->delete;
   }
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
@@ -2228,6 +2234,7 @@ sub change {
     unused_credit  => $unused_credit,
     nobill         => $keep_dates,
     change_custnum => ( $self->custnum != $custnum ? $custnum : '' ),
+    no_delay_cancel => 1,
   );
   if ($error) {
     $dbh->rollback if $oldAutoCommit;
@@ -2325,7 +2332,7 @@ sub change_later {
 
         $error = $self->replace       ||
                  $err_or_pkg->replace ||
-                 $change_to->cancel   ||
+                 $change_to->cancel('no_delay_cancel' => 1) ||
                  $change_to->delete;
       } else {
         $error = $err_or_pkg;
@@ -5497,7 +5504,7 @@ sub order {
       $dbh->rollback if $oldAutoCommit;
       return "Unable to transfer all services from package ".$old_pkg->pkgnum;
     }
-    $error = $old_pkg->cancel( quiet=>1 );
+    $error = $old_pkg->cancel( quiet=>1, 'no_delay_cancel'=>1 );
     if ($error) {
       $dbh->rollback;
       return $error;

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

Summary of changes:
 FS/FS/cust_pkg.pm |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list