This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / httemplate / view / cust_bill-ps.cgi
1 <% $cust_bill->print_ps( '', $templatename) %>
2 <%init>
3
4 die "access denied"
5   unless $FS::CurrentUser::CurrentUser->access_right('View invoices');
6
7 #untaint invnum
8 my($query) = $cgi->keywords;
9 $query =~ /^((.+)-)?(\d+)$/;
10 my $templatename = $2;
11 my $invnum = $3;
12
13 my $cust_bill = qsearchs({
14   'select'    => 'cust_bill.*',
15   'table'     => 'cust_bill',
16   'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
17   'hashref'   => { 'invnum' => $invnum },
18   'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
19 });
20 die "Invoice #$invnum not found!" unless $cust_bill;
21
22 http_header('Content-Type' => 'application/postscript' );
23
24 </%init>