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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 836-842 sub CanBookBeIssued { Link Here
836
        );
836
        );
837
837
838
        #increment items.localuse
838
        #increment items.localuse
839
        my $localuse_count = $item_object->localuse;
839
        my $localuse_count = $item_object->localuse || 0;
840
        $localuse_count++;
840
        $localuse_count++;
841
        $item_object->localuse( $localuse_count )->store;
841
        $item_object->localuse( $localuse_count )->store;
842
842
(-)a/t/db_dependent/Circulation.t (-3 / +6 lines)
Lines 2434-2440 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
2434
};
2434
};
2435
2435
2436
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
2436
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
2437
    plan tests => 11;
2437
    plan tests => 13;
2438
2438
2439
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
2439
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
2440
    my $patron_category_x = $builder->build_object(
2440
    my $patron_category_x = $builder->build_object(
Lines 2481-2491 subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { Link Here
2481
    my $issue  = AddIssue( $patron_2, $item_2->barcode );
2481
    my $issue  = AddIssue( $patron_2, $item_2->barcode );
2482
    $item_2->discard_changes;
2482
    $item_2->discard_changes;
2483
    ok( $item_2->onloan, "Item is checked out" );
2483
    ok( $item_2->onloan, "Item is checked out" );
2484
    is( $item_2->localuse, undef , 'No localuse is recorded.');
2484
2485
2485
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode );
2486
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode );
2486
    $item_2->discard_changes;
2487
    $item_2->discard_changes;
2487
    ok( !$item_2->onloan, "Checked out item is returned" );
2488
    ok( !$item_2->onloan, "Checked out item is returned" );
2488
2489
2490
    AddIssue( $patron, $item_2->barcode);
2491
    $item_2->discard_changes; # refresh
2492
    is( $item_2->localuse, 1 , 'Localuse is recorded.');
2493
2489
    # TODO There are other tests to provide here
2494
    # TODO There are other tests to provide here
2490
};
2495
};
2491
2496
Lines 6217-6223 subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { Link Here
6217
6222
6218
};
6223
};
6219
6224
6220
6221
$schema->storage->txn_rollback;
6225
$schema->storage->txn_rollback;
6222
C4::Context->clear_syspref_cache();
6226
C4::Context->clear_syspref_cache();
6223
$branches = Koha::Libraries->search();
6227
$branches = Koha::Libraries->search();
6224
- 

Return to bug 16122