From 6505196292d187cd2ada95428a96f00a36de7926 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 19 May 2009 13:54:50 +0200 Subject: [PATCH] (bug #3235) improve searchorder If an supplierid is provided with a ordernumber, the search should be able to return everytime a record. This patch do the job. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Acquisition.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 9888dc1f6b..5fc05ce53c 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -685,7 +685,17 @@ sub SearchOrder { push( @searchterms, $search, $search, $biblionumber ); my $query; ### FIXME THIS CAN raise a problem if more THAN ONE biblioitem is linked to one biblio - if ($id) { + if($id and $search){ + @searchterms = ($id, $search); + $query = + "SELECT *,biblio.title + FROM aqorders + LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber + LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber + LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno + WHERE aqbasket.booksellerid = ? AND aqorders.ordernumber = ? + " + }elsif ($id) { $query = "SELECT *,biblio.title FROM aqorders @@ -722,7 +732,7 @@ sub SearchOrder { } if( $biblionumber and $biblionumber ne "" ){ - $query .= "AND aqorders.biblionumber = ? "; + $query .= "AND biblio.biblionumber = ? "; push (@searchterms, $biblionumber); } -- 2.39.5