summaryrefslogtreecommitdiff
path: root/FS/FS/pay_batch.pm
diff options
context:
space:
mode:
authormark <mark>2011-04-12 01:25:14 +0000
committermark <mark>2011-04-12 01:25:14 +0000
commitd1384806285ae03e8132ad2844d376ff64bd5e6d (patch)
tree7460501043a057b005f1f7dd161590b823c1c44d /FS/FS/pay_batch.pm
parentff4aa23fb709044951949331a834b60d8feaadbb (diff)
fix batch closure, #12351
Diffstat (limited to 'FS/FS/pay_batch.pm')
-rw-r--r--FS/FS/pay_batch.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm
index 850335e..79c4749 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;
}
}