diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 2e3fb00d03..ff42016fde 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -486,7 +486,12 @@ sub GetBasketsInfosByBookseller { SELECT aqbasket.*, SUM(aqorders.quantity) AS total_items, COUNT(DISTINCT aqorders.biblionumber) AS total_biblios, - SUM(IF(aqorders.datereceived IS NULL, aqorders.quantity, 0)) AS expected_items + SUM( + IF(aqorders.datereceived IS NULL + AND aqorders.datecancellationprinted IS NULL + , aqorders.quantity + , 0) + ) AS expected_items FROM aqbasket LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno WHERE booksellerid = ?