4 <% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
8 my %method = ( map { $_=>1 } qw( email print fax_invoice ) );
14 unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');
16 my $invnum = $cgi->param('invnum');
17 my $template = $cgi->param('template');
18 my $notice_name = $cgi->param('notice_name') if $cgi->param('notice_name');
19 my $method = $cgi->param('method');
21 if ( $cgi->param('mode') =~ /^(\d+)$/ ) {
25 $method .= '_invoice' if $method eq 'fax'; #!
27 die "unknown method $method" unless $method{$method};
29 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
30 die "Can't find invoice!\n" unless $cust_bill;
32 $cust_bill->set('mode' => $mode) if $mode;
34 #these methods die instead of return errors, so, handle that without a backtrace
35 eval { $cust_bill->$method({ 'template' => $template,
36 'notice_name' => $notice_name,
41 my $custnum = $cust_bill->getfield('custnum');