RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / view / quotation-pdf.cgi
1 <% $content %>\
2 <%init>
3
4 #false laziness w/elements/cust_bill-typeset
5
6 die "access denied"
7   unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation'); #View quotations ?
8
9 my $quotationnum = $cgi->param('quotationnum');
10
11 my $conf = new FS::Conf;
12
13 my $quotation = qsearchs({
14   'select'    => 'quotation.*',
15   'table'     => 'quotation',
16   #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
17   'hashref'   => { 'quotationnum' => $quotationnum },
18   #'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
19 });
20 die "Quotation #$quotationnum not found!" unless $quotation;
21
22 my $content = $quotation->print_pdf(); #\%opt);
23
24 http_header('Content-Type' => 'application/pdf');
25 http_header('Content-Disposition' => "filename=$quotationnum.pdf" );
26 http_header('Content-Length' => length($content) );
27 http_header('Cache-control' => 'max-age=60' );
28
29 </%init>