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 <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
push( @searchterms, $search, $search, $biblionumber );
my $query;
### FIXME THIS CAN raise a problem if more THAN ONE biblioitem is linked to one biblio
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 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
$query =
"SELECT *,biblio.title
FROM aqorders
}
if( $biblionumber and $biblionumber ne "" ){
}
if( $biblionumber and $biblionumber ne "" ){
- $query .= "AND aqorders.biblionumber = ? ";
+ $query .= "AND biblio.biblionumber = ? ";
push (@searchterms, $biblionumber);
}
push (@searchterms, $biblionumber);
}