[freeside-commits] branch FREESIDE_3_BRANCH updated. c8ea63ee0f94ff3d3ac3917e41b0e38fb53b3fd4
Mark Wells
mark at 420.am
Fri Jul 22 11:46:04 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via c8ea63ee0f94ff3d3ac3917e41b0e38fb53b3fd4 (commit)
from ecd90a9dae71b452430d23ae39c1fdb3863a876f (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 c8ea63ee0f94ff3d3ac3917e41b0e38fb53b3fd4
Author: Mark Wells <mark at freeside.biz>
Date: Fri Jul 22 11:45:54 2016 -0700
on 3.x, don't create a default cancel reason when an expire reason is missing, #71623
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index e4fc3db..8496684 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2501,15 +2501,7 @@ sub cancel_pkgs {
$lopt{'reason_otaker'} = $cpr->otaker;
} else {
warn "no reason found when canceling package ".$_->pkgnum."\n";
- # we're not actually required to pass a reason to cust_pkg::cancel,
- # but if we're getting to this point, something has gone awry.
- $null_reason ||= FS::reason->new_or_existing(
- reason => 'unknown reason',
- type => 'Cancel Reason',
- class => 'C',
- );
- $lopt{'reason'} = $null_reason->reasonnum;
- $lopt{'reason_otaker'} = $FS::CurrentUser::CurrentUser->username;
+ $lopt{'reason'} = '';
}
}
my $error = $_->cancel(%lopt);
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index b577702..e0e710e 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -815,9 +815,13 @@ the date. You are PROBABLY looking to expire the account instead of using
this.
=item reason - can be set to a cancellation reason (see L<FS:reason>),
-either a reasonnum of an existing reason, or passing a hashref will create
-a new reason. The hashref should have the following keys: typenum - Reason
-type (see L<FS::reason_type>, reason - Text of the new reason.
+either a reasonnum of an existing reason, or a hashref to create
+a new reason. The hashref should have the following keys:
+typenum - Reason type (see L<FS::reason_type>
+reason - Text of the new reason.
+
+If this argument isn't given or is a false value, then the package will be
+canceled with no reason.
=item date - can be set to a unix style timestamp to specify when to
cancel (expire)
@@ -1078,6 +1082,10 @@ Cancels this package if its expire date has been reached.
=cut
+# XXX should look for an expire reason
+# but seems to be unused; this is now handled more holistically in
+# cust_main::Billing
+
sub cancel_if_expired {
my $self = shift;
my $time = shift || time;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_main.pm | 10 +---------
FS/FS/cust_pkg.pm | 14 +++++++++++---
2 files changed, 12 insertions(+), 12 deletions(-)
More information about the freeside-commits
mailing list