View | Details | Raw Unified | Return to bug 33364
Collapse All | Expand All

(-)a/Koha/Item.pm (-2 / +2 lines)
Lines 908-914 sub has_pending_hold { Link Here
908
908
909
  my $has_pending_recall
909
  my $has_pending_recall
910
910
911
Return if whether has pending recall of not.
911
Return whether item has been allocated to fill a recall request or not
912
912
913
=cut
913
=cut
914
914
Lines 919-925 sub has_pending_recall { Link Here
919
    return Koha::Recalls->search(
919
    return Koha::Recalls->search(
920
        {
920
        {
921
            item_id   => $self->itemnumber,
921
            item_id   => $self->itemnumber,
922
            status    => 'waiting',
922
            status    => [ 'waiting', 'in_transit' ],
923
        }
923
        }
924
    )->count;
924
    )->count;
925
}
925
}
(-)a/circ/pendingreserves.pl (-1 / +3 lines)
Lines 196-202 my @biblionumbers = $holds->get_column('biblionumber'); Link Here
196
my $all_items;
196
my $all_items;
197
if ( $holds->count ) {
197
if ( $holds->count ) {
198
    foreach my $item ( $holds->get_items_that_can_fill->as_list ) {
198
    foreach my $item ( $holds->get_items_that_can_fill->as_list ) {
199
        push @{ $all_items->{ $item->biblionumber } }, $item;
199
        unless ( $item->has_pending_recall ) {
200
            push @{ $all_items->{ $item->biblionumber } }, $item;
201
        }
200
    }
202
    }
201
}
203
}
202
204
(-)a/t/db_dependent/Koha/Item.t (-2 / +5 lines)
Lines 1836-1842 subtest 'store() tests' => sub { Link Here
1836
1836
1837
subtest 'Recalls tests' => sub {
1837
subtest 'Recalls tests' => sub {
1838
1838
1839
    plan tests => 22;
1839
    plan tests => 23;
1840
1840
1841
    $schema->storage->txn_begin;
1841
    $schema->storage->txn_begin;
1842
1842
Lines 2017-2022 subtest 'Recalls tests' => sub { Link Here
2017
2017
2018
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2018
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2019
2019
2020
    $recall2->start_transfer({ item => $item1 });
2021
    is( $item1->has_pending_recall, 1, 'Item has a pending recall and is in transit to fill it' );
2022
    $recall2->revert_transfer;
2023
2020
    # return recall based on recalldate
2024
    # return recall based on recalldate
2021
    $check_recall = $item1->check_recalls;
2025
    $check_recall = $item1->check_recalls;
2022
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2026
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2023
- 

Return to bug 33364