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>
)
. ") 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);