-<%
+<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
+<%init>
-my $conf = new FS::Conf;
-my $lpr = $conf->config('lpr');
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');
#untaint invnum
my($query) = $cgi->keywords;
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Can't find invoice!\n" unless $cust_bill;
-my $error = &FS::Misc::send_fax(
- dialstring => $cust_bill->cust_main->getfield('fax'),
- docdata => [ $cust_bill->print_ps('', $template) ],
-);
-
-die $error if $error;
+$cust_bill->fax_invoice({ 'template' => $template });
my $custnum = $cust_bill->getfield('custnum');
-print $cgi->redirect("${p}view/cust_main.cgi?$custnum");
-
-%>
+</%init>