From 197e19d52c02f541850ca06f2628d86c2c3b9464 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 30 Jul 2011 23:14:23 +0000 Subject: rearrange flow of batch download, #947 --- httemplate/misc/download-bill_batch.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 httemplate/misc/download-bill_batch.html (limited to 'httemplate/misc') diff --git a/httemplate/misc/download-bill_batch.html b/httemplate/misc/download-bill_batch.html new file mode 100644 index 000000000..70e3003ce --- /dev/null +++ b/httemplate/misc/download-bill_batch.html @@ -0,0 +1,21 @@ +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); +my ($batchnum) = $cgi->keywords; +$batchnum =~ /^\d+$/ or die "invalid batchnum '$batchnum'"; +my $batch = FS::bill_batch->by_key($batchnum) + or die "Batch $batchnum not found"; + +# send the batch +my $content = $batch->pdf; +$m->clear_buffer; +$r->content_type('application/pdf'); +$r->headers_out->add( 'Content-Disposition' => + 'attachment;filename="invoice_batch_'.$batchnum.'.pdf"'); +$m->print($content); + +#$batch->pdf(''); +#my $error = $batch->replace; +# warn "error deleting cached PDF: '$error'\n" if $error; +#} + -- cgit v1.2.1