From: mark Date: Tue, 12 Apr 2011 01:25:23 +0000 (+0000) Subject: fix batch closure, #12351 X-Git-Tag: freeside_2_1_3~309 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=907208e350fe518f676aebca33d2da3ce44a8974;p=freeside.git fix batch closure, #12351 --- diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 850335e84..79c47498a 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -383,20 +383,21 @@ sub import_results { } # foreach (@all_values) + my $close = 1; if ( defined($close_condition) ) { # Allow the module to decide whether to close the batch. # $close_condition can also die() to abort the whole import. - my $close = eval { $close_condition->($self) }; + $close = eval { $close_condition->($self) }; if ( $@ ) { $dbh->rollback; die $@; } - if ( $close ) { - my $error = $self->set_status('R'); - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return $error; - } + } + if ( $close ) { + my $error = $self->set_status('R'); + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; } }