per-agent disable_previous_balance, #15863
[freeside.git] / FS / FS / bill_batch.pm
index ec5c194..1a46db0 100644 (file)
@@ -84,6 +84,7 @@ sub print_pdf {
       die $error if $error;
     }
   }
+  $job->update_statustext(100, 'Combining invoices') if $job;
 
   return $pdf_out->toPDF;
 }
@@ -144,6 +145,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;