summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-10-18 19:25:39 +0000
committerivan <ivan>2011-10-18 19:25:39 +0000
commit140fba9bbf23d8b18ee066229bbabb5286aa9bb4 (patch)
tree9f1826b4743a9d1bb3691f1286523f1eb17f6719
parentbf79d364cb1beb5dcc00becb6f7689dc37adfbc0 (diff)
set the suspension date before calling service suspensions, fix RADIUS groups suspension, RT#14398
-rw-r--r--FS/FS/cust_pkg.pm26
1 files changed, 13 insertions, 13 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 27b8409cd..b1a4d0303 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1000,6 +1000,19 @@ sub suspend {
}
}
+ my %hash = $self->hash;
+ if ( $date ) {
+ $hash{'adjourn'} = $date;
+ } else {
+ $hash{'susp'} = $suspend_time;
+ }
+ my $new = new FS::cust_pkg ( \%hash );
+ $error = $new->replace( $self, options => { $self->options } );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
unless ( $date ) {
my @labels = ();
@@ -1055,19 +1068,6 @@ sub suspend {
}
- my %hash = $self->hash;
- if ( $date ) {
- $hash{'adjourn'} = $date;
- } else {
- $hash{'susp'} = $suspend_time;
- }
- my $new = new FS::cust_pkg ( \%hash );
- $error = $new->replace( $self, options => { $self->options } );
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return $error;
- }
-
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no errors