Bug 9824 - Hide basket with no expected items in basqket list by bookseller
authorLyon3 Team <koha@univ-lyon3.fr>
Thu, 21 Mar 2013 13:47:43 +0000 (14:47 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 17 May 2013 11:59:08 +0000 (07:59 -0400)
Before patch you will see in acqui/booksellers.pl all the baskets ever
created.
After the patch you will see in acqui/booksellers.pl only the basket
with expected items.

Test plan :
* Create a basket with some orders lines
You should see this basket in acqui/booksellers.pl
* receive or cancel all the line in this basket
This basket shouldn't appear any more in acqui/booksellers.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Acquisition.pm

index d11f2a9..2bbb21c 100644 (file)
@@ -595,7 +595,8 @@ sub GetBasketsInfosByBookseller {
           ) AS expected_items
         FROM aqbasket
           LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
-        WHERE booksellerid = ?
+        WHERE booksellerid = ? AND ( aqorders.quantity > aqorders.quantityreceived OR quantityreceived IS NULL)
+         AND datecancellationprinted IS NULL
         GROUP BY aqbasket.basketno
     };
     my $sth = $dbh->prepare($query);