This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / httemplate / misc / send-invoice.cgi
1 <% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
2 <%once>
3
4 my %method = ( map { $_=>1 } qw( email print fax_invoice ) );
5
6 </%once>
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');
11
12 my $invnum      = $cgi->param('invnum');
13 my $template    = $cgi->param('template');
14 my $notice_name = $cgi->param('notice_name') if $cgi->param('notice_name');
15 my $method      = $cgi->param('method');
16
17 $method .= '_invoice' if $method eq 'fax'; #!
18
19 die "unknown method $method" unless $method{$method};
20
21 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
22 die "Can't find invoice!\n" unless $cust_bill;
23
24 $cust_bill->$method({ 'template'    => $template,
25                       'notice_name' => $notice_name,
26                    }); 
27
28 my $custnum = $cust_bill->getfield('custnum');
29
30 </%init>