To test:
1 - prove -v t/db_dpendent/Acquisition/GetBasketsInfosByBookseller.t
2 - Apply patch
3 - prove -v t/db_dpendent/Acquisition/GetBasketsInfosByBookseller.t
4 - It passes
5 - Have some open/closed and some fully and not full received baskets
6 - View a vendor and confirm baskets are shwn as expected
7 - Check 'Show all baskets' shows all baskets
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note sure this is the best thing but it fixes the issue
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
unless ( $allbaskets ) {
# Don't show the basket if it's NOT CLOSED or is FULLY RECEIVED
- $query.=" HAVING (closedate IS NULL OR (expected_items > 0))"
+ $query.=" HAVING (closedate IS NULL OR (
+ SUM(
+ IF(aqorders.datereceived IS NULL
+ AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
+ , aqorders.quantity
+ , 0)
+ ) > 0))"
}
my $sth = $dbh->prepare($query);