X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Ffax-invoice.cgi;h=f72fc7eaf08bb5f0c82de2e067864bb224d0940c;hp=d490b8e7963375dca4d2292da0e59d34a50ef656;hb=d2b55d07a9e6e64a38877136d7974ab93e14f1ed;hpb=c28a4c33a88dfa354436f81a2e213638088adcf1 diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi index d490b8e79..f72fc7eaf 100755 --- a/httemplate/misc/fax-invoice.cgi +++ b/httemplate/misc/fax-invoice.cgi @@ -1,7 +1,8 @@ -<% +<% $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; @@ -11,15 +12,8 @@ my $invnum = $3; 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"); - -%> +