diff options
author | ivan <ivan> | 2003-11-29 08:08:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-11-29 08:08:36 +0000 |
commit | 23ec9b00410224868d6be1e47a0d72a6c8b3f6f5 (patch) | |
tree | 33839091532e09ff4efc376ab6e8553db42e45dc /httemplate | |
parent | e6c8cca8d3daec590f248e9ca16384dc8c94e21e (diff) |
postscript invoice redux
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/misc/print-invoice.cgi | 9 | ||||
-rwxr-xr-x | httemplate/view/cust_bill-ps.cgi | 13 |
2 files changed, 21 insertions, 1 deletions
diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi index a5500bff2..8c1240c05 100755 --- a/httemplate/misc/print-invoice.cgi +++ b/httemplate/misc/print-invoice.cgi @@ -11,7 +11,14 @@ my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Can't find invoice!\n" unless $cust_bill; open(LPR,"|$lpr") or die "Can't open $lpr: $!"; - print LPR $cust_bill->print_text; #( date ) + + if ( $conf->exists('invoice_latex') ) { + $cust_bill->print_ps; + #print LPR $cust_bill->print_ps; #( date ) + } else { + print LPR $cust_bill->print_text; #( date ) + } + close LPR or die $! ? "Error closing $lpr: $!" : "Exit status $? from $lpr"; diff --git a/httemplate/view/cust_bill-ps.cgi b/httemplate/view/cust_bill-ps.cgi new file mode 100755 index 000000000..03340a16f --- /dev/null +++ b/httemplate/view/cust_bill-ps.cgi @@ -0,0 +1,13 @@ +<% + +#untaint invnum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/; +my $invnum = $1; + +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); +die "Invoice #$invnum not found!" unless $cust_bill; + +http_header('Content-Type' => 'application/postscript' ); +%> +<%= $cust_bill->print_ps %> |