(bug #3149) fix searchorder
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Tue, 19 May 2009 09:53:50 +0000 (11:53 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:18:56 +0000 (23:18 +0200)
this patch fix the searchorder function, and add to the SQL query a "AND biblionumber" statement if a biblionumber is speficied.
Sometimes C4::Acquisitions::searchorder() find more than one result, so the user is looping to the same page to choose the great record, adding a contraint to biblionumber allows to be more strict.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
C4/Acquisition.pm

index ee7b384..9888dc1 100644 (file)
@@ -720,6 +720,12 @@ sub SearchOrder {
           )
           . ") or biblioitems.isbn=? OR (aqorders.ordernumber=? AND aqorders.biblionumber=?)) ";
     }
+    
+    if( $biblionumber and $biblionumber ne "" ){
+        $query .= "AND aqorders.biblionumber = ? ";
+        push (@searchterms, $biblionumber);
+    }
+    
     $query .= " GROUP BY aqorders.ordernumber";
     ### $query
     my $sth = $dbh->prepare($query);