X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Femail-invoice.cgi;h=b24e0420f435540ff9155e415af3b70c2c151fda;hp=34afa90841695d749b7d9e40fcf7a9ead1c7f4e3;hb=b282a5536ad5145f956ef27704e2267a124aacf5;hpb=c28a4c33a88dfa354436f81a2e213638088adcf1 diff --git a/httemplate/misc/email-invoice.cgi b/httemplate/misc/email-invoice.cgi index 34afa9084..b24e0420f 100755 --- a/httemplate/misc/email-invoice.cgi +++ b/httemplate/misc/email-invoice.cgi @@ -1,6 +1,8 @@ -<% +<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %> +<%init> -my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); #untaint invnum my($query) = $cgi->keywords; @@ -10,16 +12,8 @@ my $invnum = $3; my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Can't find invoice!\n" unless $cust_bill; -my $error = send_email( - $cust_bill->generate_email( - 'from' => - ( $cust_bill->_agent_invoice_from || $conf->config('invoice_from') ), - 'template' => $template, - ) -); -eidiot($error) if $error; +$cust_bill->email({ 'template' => $template }); my $custnum = $cust_bill->getfield('custnum'); -print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); -%> +