diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-03-11 02:17:13 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-03-11 02:17:13 -0700 |
| commit | 627b53dd54c81b8bf16bf4c6b53184a0b76011a8 (patch) | |
| tree | d015777e81a5fea3379345220cfe6672e2553d0b /httemplate | |
| parent | 53a1130923c4905b267239c369949aadde657c7c (diff) | |
fix quotations, RT#21103
Diffstat (limited to 'httemplate')
| -rwxr-xr-x | httemplate/view/quotation-pdf.cgi | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/httemplate/view/quotation-pdf.cgi b/httemplate/view/quotation-pdf.cgi new file mode 100755 index 000000000..7f62ce173 --- /dev/null +++ b/httemplate/view/quotation-pdf.cgi @@ -0,0 +1,29 @@ +<% $content %>\ +<%init> + +#false laziness w/elements/cust_bill-typeset + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation'); #View quotations ? + +my $quotationnum = $cgi->param('quotationnum'); + +my $conf = new FS::Conf; + +my $quotation = qsearchs({ + 'select' => 'quotation.*', + 'table' => 'quotation', + #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'quotationnum' => $quotationnum }, + #'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +}); +die "Quotation #$quotationnum not found!" unless $quotation; + +my $content = $quotation->print_pdf(); #\%opt); + +http_header('Content-Type' => 'application/pdf'); +http_header('Content-Disposition' => "filename=$quotationnum.pdf" ); +http_header('Content-Length' => length($content) ); +http_header('Cache-control' => 'max-age=60' ); + +</%init> |
