summaryrefslogtreecommitdiff
path: root/httemplate/misc/print-invoice.cgi
blob: 5ce6e76dff60b68adf9564e0793d615fbb9baa73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');

#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' => $template});

my $custnum = $cust_bill->getfield('custnum');

</%init>