show a better message when no results are found
[freeside.git] / httemplate / view / cust_bill-pdf.cgi
1 <%
2
3 #untaint invnum
4 my($query) = $cgi->keywords;
5 $query =~ /^(\d+)(.pdf)?$/;
6 my $invnum = $1;
7
8 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
9 die "Invoice #$invnum not found!" unless $cust_bill;
10
11 my $pdf = $cust_bill->print_pdf;
12
13 http_header('Content-Type' => 'application/pdf' );
14 http_header('Content-Length' => length($pdf) );
15 http_header('Cache-control' => 'max-age=60' );
16 %>
17 <%= $pdf %>