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

(-)a/Koha/Items.pm (-2 / +12 lines)
Lines 24-29 use Carp; Link Here
24
use Koha::Database;
24
use Koha::Database;
25
25
26
use Koha::Item;
26
use Koha::Item;
27
use Koha::CirculationRules;
27
28
28
use base qw(Koha::Objects);
29
use base qw(Koha::Objects);
29
30
Lines 48-53 Return the items of the set that are holdable Link Here
48
sub filter_by_for_hold {
49
sub filter_by_for_hold {
49
    my ($self) = @_;
50
    my ($self) = @_;
50
51
52
    my @hold_not_allowed_itypes = Koha::CirculationRules->search(
53
        {
54
            rule_name    => 'holdallowed',
55
            branchcode   => undef,
56
            categorycode => undef,
57
            rule_value   => 'not_allowed',
58
        }
59
    )->get_column('itemtype');
60
51
    return $self->search(
61
    return $self->search(
52
        {
62
        {
53
            itemlost   => 0,
63
            itemlost   => 0,
Lines 55-61 sub filter_by_for_hold { Link Here
55
            notforloan => { '<=' => 0 }
65
            notforloan => { '<=' => 0 }
56
            ,    # items with negative or zero notforloan value are holdable
66
            ,    # items with negative or zero notforloan value are holdable
57
            onloan => undef,
67
            onloan => undef,
58
            ( C4::Context->preference('AllowHoldsOnDamagedItems') ? ( damaged => 0 ) : () )
68
            ( C4::Context->preference('AllowHoldsOnDamagedItems') ? ( damaged => 0 ) : () ),
69
            itype        => { -not_in => \@hold_not_allowed_itypes },
59
        }
70
        }
60
    );
71
    );
61
}
72
}
62
- 

Return to bug 3142