@@ -, +, @@ pending recalls --- Koha/Item.pm | 4 ++-- circ/pendingreserves.pl | 4 +++- t/db_dependent/Koha/Item.t | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) --- a/Koha/Item.pm +++ a/Koha/Item.pm @@ -1193,7 +1193,7 @@ sub has_pending_hold { my $has_pending_recall -Return if whether has pending recall of not. +Return whether item has been allocated to fill a recall request or not =cut @@ -1204,7 +1204,7 @@ sub has_pending_recall { return Koha::Recalls->search( { item_id => $self->itemnumber, - status => 'waiting', + status => [ 'waiting', 'in_transit' ], } )->count; } --- a/circ/pendingreserves.pl +++ a/circ/pendingreserves.pl @@ -187,7 +187,9 @@ my @biblionumbers = $holds->get_column('biblionumber'); my $all_items; if ( $holds->count ) { foreach my $item ( $holds->get_items_that_can_fill->as_list ) { - push @{ $all_items->{ $item->biblionumber } }, $item; + unless ( $item->has_pending_recall ) { + push @{ $all_items->{ $item->biblionumber } }, $item; + } } } --- a/t/db_dependent/Koha/Item.t +++ a/t/db_dependent/Koha/Item.t @@ -2376,7 +2376,7 @@ subtest 'store() tests' => sub { subtest 'Recalls tests' => sub { - plan tests => 23; + plan tests => 24; $schema->storage->txn_begin; @@ -2558,6 +2558,10 @@ subtest 'Recalls tests' => sub { is( $item1->has_pending_recall, 0, 'Item does not have pending recall' ); + $recall2->start_transfer({ item => $item1 }); + is( $item1->has_pending_recall, 1, 'Item has a pending recall and is in transit to fill it' ); + $recall2->revert_transfer; + # return recall based on recalldate $check_recall = $item1->check_recalls; is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" ); --