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

(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 970-976 sub _availability { Link Here
970
    my $location = $library ? $library->branchname : '';
970
    my $location = $library ? $library->branchname : '';
971
    my $itemcallnumber = $item->itemcallnumber;
971
    my $itemcallnumber = $item->itemcallnumber;
972
972
973
    if ( $item->is_notforloan ) {
973
    if ( $item->effective_notforloan ) {
974
        return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber );
974
        return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber );
975
    } elsif ( $item->onloan ) {
975
    } elsif ( $item->onloan ) {
976
        return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber );
976
        return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber );
(-)a/Koha/Item.pm (-14 lines)
Lines 2398-2417 sub check_recalls { Link Here
2398
    return $recall;
2398
    return $recall;
2399
}
2399
}
2400
2400
2401
=head3 is_notforloan
2402
2403
    my $is_notforloan = $item->is_notforloan;
2404
2405
Determine whether or not this item is "notforloan" based on
2406
the item's notforloan status or its item type
2407
2408
=cut
2409
2410
sub is_notforloan {
2411
    my ( $self ) = @_;
2412
    return $self->not_for_loan;
2413
}
2414
2415
=head3 is_denied_renewal
2401
=head3 is_denied_renewal
2416
2402
2417
    my $is_denied_renewal = $item->is_denied_renewal;
2403
    my $is_denied_renewal = $item->is_denied_renewal;
(-)a/t/db_dependent/Koha/Item.t (-20 lines)
Lines 2242-2266 subtest 'Recalls tests' => sub { Link Here
2242
    $schema->storage->txn_rollback;
2242
    $schema->storage->txn_rollback;
2243
};
2243
};
2244
2244
2245
subtest 'Notforloan tests' => sub {
2246
2247
    plan tests => 3;
2248
2249
    $schema->storage->txn_begin;
2250
2251
    my $item1 = $builder->build_sample_item;
2252
    $item1->update({ notforloan => 0 });
2253
    $item1->itemtype->notforloan(0);
2254
    ok( !$item1->is_notforloan, 'Notforloan is correctly false by item status and item type');
2255
    $item1->update({ notforloan => 1 });
2256
    ok( $item1->is_notforloan, 'Notforloan is correctly true by item status');
2257
    $item1->update({ notforloan => 0 });
2258
    $item1->itemtype->update({ notforloan => 1 });
2259
    ok( $item1->is_notforloan, 'Notforloan is correctly true by item type');
2260
2261
    $schema->storage->txn_rollback;
2262
};
2263
2264
subtest 'item_group() tests' => sub {
2245
subtest 'item_group() tests' => sub {
2265
2246
2266
    plan tests => 4;
2247
    plan tests => 4;
2267
- 

Return to bug 28762