X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill-pdf.cgi;h=23d059dad684653a6dd485aa9e86ded07e8d7aec;hp=f09e1b74d4440ae281b53b25aee7ea52ef08c9b2;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1 diff --git a/httemplate/view/cust_bill-pdf.cgi b/httemplate/view/cust_bill-pdf.cgi index f09e1b74d..23d059dad 100755 --- a/httemplate/view/cust_bill-pdf.cgi +++ b/httemplate/view/cust_bill-pdf.cgi @@ -1,28 +1 @@ -<% $pdf %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)(.pdf)?$/; -my $templatename = $2; -my $invnum = $3; - -my $cust_bill = qsearchs({ - 'select' => 'cust_bill.*', - 'table' => 'cust_bill', - 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', - 'hashref' => { 'invnum' => $invnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -}); -die "Invoice #$invnum not found!" unless $cust_bill; - -my $pdf = $cust_bill->print_pdf( '', $templatename); - -http_header('Content-Type' => 'application/pdf' ); -http_header('Content-Length' => length($pdf) ); -http_header('Cache-control' => 'max-age=60' ); - - +<& elements/cust_bill-typeset, 'pdf' &>\