projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7497331
)
RT#33790: Proper handling for aborting a suspend/cancel
author
Jonathan Prykop
<jonathan@freeside.biz>
Thu, 30 Jun 2016 04:57:56 +0000
(23:57 -0500)
committer
Jonathan Prykop
<jonathan@freeside.biz>
Thu, 30 Jun 2016 04:57:56 +0000
(23:57 -0500)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
456847e
..
e3fb155
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-1400,14
+1400,15
@@
sub uncancel {
=item unexpire
=item unexpire
-Cancels any pending expiration (sets the expire field to null).
+Cancels any pending expiration (sets the expire field to null)
+for this package and any supplemental packages.
If there is an error, returns the error, otherwise returns false.
=cut
sub unexpire {
If there is an error, returns the error, otherwise returns false.
=cut
sub unexpire {
- my( $self
, %options
) = @_;
+ my( $self ) = @_;
my $error;
my $oldAutoCommit = $FS::UID::AutoCommit;
my $error;
my $oldAutoCommit = $FS::UID::AutoCommit;
@@
-1437,6
+1438,14
@@
sub unexpire {
return $error;
}
return $error;
}
+ foreach my $supp_pkg ( $self->supplemental_pkgs ) {
+ $error = $supp_pkg->unexpire;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "unexpiring supplemental pkg#".$supp_pkg->pkgnum.": $error";
+ }
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no errors
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no errors
@@
-2044,14
+2053,15
@@
sub unsuspend {
=item unadjourn
=item unadjourn
-Cancels any pending suspension (sets the adjourn field to null).
+Cancels any pending suspension (sets the adjourn field to null)
+for this package and any supplemental packages.
If there is an error, returns the error, otherwise returns false.
=cut
sub unadjourn {
If there is an error, returns the error, otherwise returns false.
=cut
sub unadjourn {
- my( $self
, %options
) = @_;
+ my( $self ) = @_;
my $error;
my $oldAutoCommit = $FS::UID::AutoCommit;
my $error;
my $oldAutoCommit = $FS::UID::AutoCommit;
@@
-2088,6
+2098,14
@@
sub unadjourn {
return $error;
}
return $error;
}
+ foreach my $supp_pkg ( $self->supplemental_pkgs ) {
+ $error = $supp_pkg->unadjourn;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "unadjourning supplemental pkg#".$supp_pkg->pkgnum.": $error";
+ }
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no errors
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no errors