summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authormark <mark>2011-07-30 23:20:37 +0000
committermark <mark>2011-07-30 23:20:37 +0000
commit873ec8e0528b7a944aec88936538fe9a04cd0b3f (patch)
treea23fc0f4fa9bd45cc4d0ea8c18edca5ae4e66302 /FS
parentb1c1559dec0570bc401ccd0e29e66a9bf6f151e1 (diff)
rearrange flow of batch download, #947
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/bill_batch.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/bill_batch.pm b/FS/FS/bill_batch.pm
index 3afe20915..7300f4587 100644
--- a/FS/FS/bill_batch.pm
+++ b/FS/FS/bill_batch.pm
@@ -80,6 +80,7 @@ sub print_pdf {
die $error if $error;
}
}
+ $job->update_statustext(100, 'Combining invoices') if $job;
return $pdf_out->toPDF;
}
@@ -128,6 +129,11 @@ sub process_print_pdf {
my $batch = FS::bill_batch->by_key($param->{batchnum});
die "batch '$param->{batchnum}' not found!\n" if !$batch;
+ if ( $param->{'close'} ) {
+ my $error = $batch->close;
+ die $error if $error;
+ }
+
my $pdf = $batch->print_pdf($job);
$batch->pdf($pdf);
my $error = $batch->replace;