@@ -, +, @@ booksellers list --- C4/Acquisition.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -708,10 +708,12 @@ sub GetBasketsInfosByBookseller { LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno WHERE booksellerid = ?}; + $query.=" GROUP BY aqbasket.basketno, aqbasket.basketname, aqbasket.note, aqbasket.booksellernote, aqbasket.contractnumber, aqbasket.creationdate, aqbasket.closedate, aqbasket.booksellerid, aqbasket.authorisedby, aqbasket.booksellerinvoicenumber, aqbasket.basketgroupid, aqbasket.deliveryplace, aqbasket.billingplace, aqbasket.branch, aqbasket.is_standing, aqbasket.create_items"; + unless ( $allbaskets ) { - $query.=" AND (closedate IS NULL OR (aqorders.quantity > aqorders.quantityreceived AND datecancellationprinted IS NULL))"; + # Don't show the basket if it's NOT CLOSED or is FULLY RECIEVED + $query.=" HAVING (closedate IS NULL OR (expected_items > 0))" } - $query.=" GROUP BY aqbasket.basketno, aqbasket.basketname, aqbasket.note, aqbasket.booksellernote, aqbasket.contractnumber, aqbasket.creationdate, aqbasket.closedate, aqbasket.booksellerid, aqbasket.authorisedby, aqbasket.booksellerinvoicenumber, aqbasket.basketgroupid, aqbasket.deliveryplace, aqbasket.billingplace, aqbasket.branch, aqbasket.is_standing, aqbasket.create_items"; my $sth = $dbh->prepare($query); $sth->execute($supplierid); --