Partial fix for Bug 1578: detect material type and don't load COinS unless the materi...
[koha_fer] / acqui / bookfund.pl
index 18c0683..76e14fe 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 # Copyright 2006 Katipo Communications
 #                                     
@@ -21,7 +21,7 @@ use C4::Context;
 use strict;
 use CGI;
 use C4::Auth;
-use C4::Interface::CGI::Output;
+use C4::Output;
 
 my $dbh      = C4::Context->dbh;
 my $input    = new CGI;
@@ -64,15 +64,14 @@ SELECT quantity,
       ON aqorderbreakdown.ordernumber = aqorders.ordernumber
     INNER JOIN aqbasket
       ON aqbasket.basketno = aqorders.basketno
-    LEFT JOIN biblio
-      ON biblio.biblionumber = aqorders.biblionumber
+    LEFT JOIN biblioitems
+      ON biblioitems.biblioitemnumber = aqorders.biblioitemnumber
   WHERE bookfundid = ?
     AND budgetdate >= ?
     AND budgetdate < ?
     AND (datecancellationprinted IS NULL
          OR datecancellationprinted = \'0000-00-00\')
 ';
-##warn $query;
 my $sth = $dbh->prepare($query);
 $sth->execute( $bookfund, $start, $end );
 my @commited_loop;
@@ -97,6 +96,6 @@ $template->param(
     total        => $total
 );
 $sth->finish;
-#$dbh->disconnect;
+$dbh->disconnect;
 
 output_html_with_http_headers $input, $cookie, $template->output;