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

(-)a/Koha/Item.pm (-2 / +2 lines)
Lines 1193-1199 sub has_pending_hold { Link Here
1193
1193
1194
  my $has_pending_recall
1194
  my $has_pending_recall
1195
1195
1196
Return if whether has pending recall of not.
1196
Return whether item has been allocated to fill a recall request or not
1197
1197
1198
=cut
1198
=cut
1199
1199
Lines 1204-1210 sub has_pending_recall { Link Here
1204
    return Koha::Recalls->search(
1204
    return Koha::Recalls->search(
1205
        {
1205
        {
1206
            item_id   => $self->itemnumber,
1206
            item_id   => $self->itemnumber,
1207
            status    => 'waiting',
1207
            status    => [ 'waiting', 'in_transit' ],
1208
        }
1208
        }
1209
    )->count;
1209
    )->count;
1210
}
1210
}
(-)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 2376-2382 subtest 'store() tests' => sub { Link Here
2376
2376
2377
subtest 'Recalls tests' => sub {
2377
subtest 'Recalls tests' => sub {
2378
2378
2379
    plan tests => 23;
2379
    plan tests => 24;
2380
2380
2381
    $schema->storage->txn_begin;
2381
    $schema->storage->txn_begin;
2382
2382
Lines 2558-2563 subtest 'Recalls tests' => sub { Link Here
2558
2558
2559
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2559
    is( $item1->has_pending_recall, 0, 'Item does not have pending recall' );
2560
2560
2561
    $recall2->start_transfer({ item => $item1 });
2562
    is( $item1->has_pending_recall, 1, 'Item has a pending recall and is in transit to fill it' );
2563
    $recall2->revert_transfer;
2564
2561
    # return recall based on recalldate
2565
    # return recall based on recalldate
2562
    $check_recall = $item1->check_recalls;
2566
    $check_recall = $item1->check_recalls;
2563
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2567
    is( $check_recall->patron_id, $patron1->borrowernumber, "No waiting recall, so oldest recall is returned" );
2564
- 

Return to bug 33364