translated for 2.2.2 by hellen
[koha.git] / maninvoice.pl
index ac323c4..62d3d6f 100755 (executable)
@@ -22,7 +22,9 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use C4::Output;
+use C4::Interface::CGI::Output;
 use CGI;
 use C4::Search;
 use C4::Accounts2;
@@ -41,9 +43,20 @@ if ($add){
   my $amount=$input->param('amount');
   my $type=$input->param('type');
   manualinvoice($bornum,$itemnum,$desc,$type,$amount);
-  print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
+  print $input->redirect("/cgi-bin/koha/boraccount.pl?bornum=$bornum");
 } else {
-  my $template=gettemplate("maninvoice.tmpl");
-  $template->param( bornum => $bornum);
-  print "Content-Type: text/html\n\n", $template->output;
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => "maninvoice.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {borrowers => 1},
+                                       debug => 1,
+                                       });
+       $template->param(bornum => $bornum);
+       print $input->header(
+           -type => guesstype($template->output),
+           -cookie => $cookie
+       ),$template->output;
+
 }