Removing windows linefeeds \r
[koha.git] / C4 / Bookfund.pm
old mode 100755 (executable)
new mode 100644 (file)
index a86841b..403a1f3
@@ -17,7 +17,6 @@ package C4::Bookfund;
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
 
@@ -25,7 +24,7 @@ use strict;
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = 3.00;
 
 =head1 NAME
 
@@ -139,9 +138,9 @@ sub GetBookFunds {
     if ( $branch ne '' ) {
         $strsth = "
         SELECT *
-        FROM   aqbookfund,aqbudget
-        WHERE  aqbookfund.bookfundid=aqbudget.bookfundid
-            AND startdate<now()
+        FROM   aqbookfund
+        LEFT JOIN aqbudget ON aqbookfund.bookfundid=aqbudget.bookfundid
+        WHERE  startdate<now()
             AND enddate>now()
             AND (aqbookfund.branchcode='' OR aqbookfund.branchcode= ? )
       GROUP BY aqbookfund.bookfundid ORDER BY bookfundname";
@@ -149,10 +148,9 @@ sub GetBookFunds {
     else {
         $strsth = "
             SELECT *
-            FROM   aqbookfund,
-                   aqbudget
-            WHERE aqbookfund.bookfundid=aqbudget.bookfundid
-                AND startdate<now()
+            FROM   aqbookfund
+            LEFT JOIN aqbudget ON aqbookfund.bookfundid=aqbudget.bookfundid
+            WHERE startdate<now()
                 AND enddate>now()
             GROUP BY aqbookfund.bookfundid ORDER BY bookfundname
         ";
@@ -229,7 +227,7 @@ sub GetBookFundBreakdown {
         FROM   aqorders
         LEFT JOIN aqorderbreakdown ON aqorders.ordernumber=aqorderbreakdown.ordernumber
         LEFT JOIN aqbookfund ON (aqorderbreakdown.bookfundid=aqbookfund.bookfundid and aqorderbreakdown.branchcode=aqbookfund.branchcode)
-        LEFT JOIN aqbudget ON (aqbudget.bookfundid=aqbookfund.bookfundid and aqbudget.branchcode=aqbudget.branchcode)
+        LEFT JOIN aqbudget ON (aqbudget.bookfundid=aqbookfund.bookfundid and aqbudget.branchcode=aqbookfund.branchcode)
         WHERE  aqorderbreakdown.bookfundid=?
             AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00')
             AND ((budgetdate >= ? and budgetdate < ?) OR (startdate>=? and enddate<=?))