changing haspermission() to require that user has ALL requiredflags, not ANYOF requir...
[koha_fer] / C4 / Acquisition.pm
index 743a8a0..4853da2 100644 (file)
@@ -17,7 +17,6 @@ package C4::Acquisition;
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
 require Exporter;
@@ -30,7 +29,7 @@ use Time::localtime;
 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;
 
 # used in receiveorder subroutine
 # to provide library specific handling
@@ -95,15 +94,16 @@ sub GetBasket {
     my $dbh        = C4::Context->dbh;
     my $query = "
         SELECT  aqbasket.*,
-                borrowers.firstname+' '+borrowers.surname AS authorisedbyname,
-                borrowers.branchcode AS branch
+                concat( b.firstname,' ',b.surname) AS authorisedbyname,
+                b.branchcode AS branch
         FROM    aqbasket
-        LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber
+        LEFT JOIN borrowers b ON aqbasket.authorisedby=b.borrowernumber
         WHERE basketno=?
     ";
     my $sth=$dbh->prepare($query);
     $sth->execute($basketno);
-    return ( $sth->fetchrow_hashref );
+    my $basket = $sth->fetchrow_hashref;
+       return ( $basket );
 }
 
 #------------------------------------------------------------#
@@ -1072,7 +1072,8 @@ sub GetHistory {
                 aqorders.ecost,
                 aqorders.ordernumber,
                 aqorders.booksellerinvoicenumber as invoicenumber,
-                aqbooksellers.id as id
+                aqbooksellers.id as id,
+                aqorders.biblionumber
             FROM aqorders 
             LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno 
             LEFT JOIN aqbooksellers ON aqbasket.booksellerid=aqbooksellers.id
@@ -1096,6 +1097,7 @@ sub GetHistory {
 
         $query .= " AND creationdate<" . $dbh->quote($to_placed_on)
           if $to_placed_on;
+        $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00')";
 
         if ( C4::Context->preference("IndependantBranches") ) {
             my $userenv = C4::Context->userenv;