From: ivan Date: Tue, 18 Oct 2011 19:25:39 +0000 (+0000) Subject: set the suspension date before calling service suspensions, fix RADIUS groups suspens... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=140fba9bbf23d8b18ee066229bbabb5286aa9bb4 set the suspension date before calling service suspensions, fix RADIUS groups suspension, RT#14398 --- 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