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

(-)a/Koha/Item.pm (-3 / +8 lines)
Lines 289-297 sub current_holds { Link Here
289
=cut
289
=cut
290
290
291
sub is_waiting_or_transit {
291
sub is_waiting_or_transit {
292
    my ( $self ) = @_;
292
    my ($self) = @_;
293
    return 1 if Koha::Holds->search({ itemnumber => $self->itemnumber, found => ['W', 'T'] })->count > 0;
293
294
    return q{};
294
    return $self->_result->reserves->search(
295
        {
296
            itemnumber => $self->itemnumber,
297
            found => [ 'W', 'T' ],
298
        }
299
    )->count;
295
}
300
}
296
301
297
=head3 type
302
=head3 type
(-)a/t/db_dependent/Koha/Items.t (-2 / +1 lines)
Lines 174-180 subtest 'is_waiting_or_transit' => sub { Link Here
174
    is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 1,
174
    is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 1,
175
        'Item has transit hold' );
175
        'Item has transit hold' );
176
    $hold->found(undef)->store;
176
    $hold->found(undef)->store;
177
    is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, q{},
177
    is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 0,
178
        'Item should be available' );
178
        'Item should be available' );
179
};
179
};
180
180
181
- 

Return to bug 20469