From e50a32fb0beb50b56ee1fc69c6d87ad3a10796b1 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 19 May 2009 11:53:50 +0200 Subject: [PATCH] (bug #3149) fix searchorder 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 Signed-off-by: Henri-Damien LAURENT --- C4/Acquisition.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index ee7b384462..9888dc1f6b 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -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); -- 2.39.5