4 #false laziness w/elements/cust_bill-typeset
7 unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation'); #View quotations ?
9 my $quotationnum = $cgi->param('quotationnum');
11 my $conf = new FS::Conf;
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,
20 die "Quotation #$quotationnum not found!" unless $quotation;
22 my $content = $quotation->print_pdf(); #\%opt);
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' );