blob: aec7cb39c75c1d5b10637d38e93144a86f84d154 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<!-- $Id: print-invoice.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
my $conf = new FS::Conf;
my $lpr = $conf->config('lpr');
#untaint invnum
my($query) = $cgi->keywords;
$query =~ /^(\d*)$/;
my $invnum = $1;
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 )
close LPR
or die $! ? "Error closing $lpr: $!"
: "Exit status $? from $lpr";
my $custnum = $cust_bill->getfield('custnum');
print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history");
%>
|