diff options
Diffstat (limited to 'httemplate/misc/print-invoice.cgi')
-rwxr-xr-x | httemplate/misc/print-invoice.cgi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi new file mode 100755 index 000000000..6a4c2d7f1 --- /dev/null +++ b/httemplate/misc/print-invoice.cgi @@ -0,0 +1,17 @@ +<% + +#untaint invnum +my($query) = $cgi->keywords; +$query =~ /^((.+)-)?(\d+)$/; +my $template = $2; +my $invnum = $3; +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); +die "Can't find invoice!\n" unless $cust_bill; + +$cust_bill->print($template); + +my $custnum = $cust_bill->getfield('custnum'); + +print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); + +%> |