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

(-)a/Koha/Item.pm (-2 / +2 lines)
Lines 1216-1222 sub has_pending_hold { Link Here
1216
1216
1217
  my $has_pending_recall
1217
  my $has_pending_recall
1218
1218
1219
Return if whether has pending recall of not.
1219
Return whether item has been allocated to fill a recall request or not
1220
1220
1221
=cut
1221
=cut
1222
1222
Lines 1227-1233 sub has_pending_recall { Link Here
1227
    return Koha::Recalls->search(
1227
    return Koha::Recalls->search(
1228
        {
1228
        {
1229
            item_id   => $self->itemnumber,
1229
            item_id   => $self->itemnumber,
1230
            status    => 'waiting',
1230
            status    => [ 'waiting', 'in_transit' ],
1231
        }
1231
        }
1232
    )->count;
1232
    )->count;
1233
}
1233
}
(-)a/circ/pendingreserves.pl (-1 / +3 lines)
Lines 187-193 my @biblionumbers = $holds->get_column('biblionumber'); Link Here
187
my $all_items;
187
my $all_items;
188
if ( $holds->count ) {
188
if ( $holds->count ) {
189
    foreach my $item ( $holds->get_items_that_can_fill->as_list ) {
189
    foreach my $item ( $holds->get_items_that_can_fill->as_list ) {
190
        push @{ $all_items->{ $item->biblionumber } }, $item;
190
        unless ( $item->has_pending_recall ) {
191
            push @{ $all_items->{ $item->biblionumber } }, $item;
192
        }
191
    }
193
    }
192
}
194
}
193
195
(-)a/t/db_dependent/Koha/Item.t (-2 / +5 lines)
Lines 2442-2448 subtest 'store() tests' => sub { Link Here
2442
2442
2443
subtest 'Recalls tests' => sub {
2443
subtest 'Recalls tests' => sub {
2444
2444
2445
    plan tests => 23;
2445
    plan tests => 24;
2446
2446
2447
    $schema->storage->txn_begin;
2447
    $schema->storage->txn_begin;
2448
2448
Lines 2624-2629 subtest 'Recalls tests' => sub { Link Here
2624
2624
2625
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2625
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2626
2626
2627
    $recall2->start_transfer( { item => $item1 } );
2628
    is( $item1->has_pending_recall, 1, 'Item has a pending recall and is in transit to fill it' );
2629
    $recall2->revert_transfer;
2630
2627
    # return recall based on recalldate
2631
    # return recall based on recalldate
2628
    $check_recall = $item1->check_recalls;
2632
    $check_recall = $item1->check_recalls;
2629
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2633
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2630
- 

Return to bug 33364