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

(-)a/t/db_dependent/Circulation.t (-2 / +20 lines)
Lines 6252-6272 subtest 'Tests for transfer not in transit' => sub { Link Here
6252
6252
6253
subtest 'Tests for RecordLocalUseOnReturn' => sub {
6253
subtest 'Tests for RecordLocalUseOnReturn' => sub {
6254
6254
6255
    plan tests => 2;
6255
    plan tests => 5;
6256
6256
6257
    t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0);
6257
    t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0);
6258
    my $item = $builder->build_sample_item();
6258
    my $item = $builder->build_sample_item();
6259
6260
    my $item_2 = $builder->build_sample_item(
6261
        {
6262
            onloan => undef,
6263
        }
6264
    );
6265
6259
    $item->withdrawn(1)->itemlost(1)->store;
6266
    $item->withdrawn(1)->itemlost(1)->store;
6260
    my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef );
6267
    my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef );
6261
    is_deeply(
6268
    is_deeply(
6262
        \@return,
6269
        \@return,
6263
        [ 0, { NotIssued => $item->barcode, withdrawn => 1  }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded");
6270
        [ 0, { NotIssued => $item->barcode, withdrawn => 1  }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded");
6264
6271
6272
    AddReturn( $item_2->barcode, $item_2->homebranch );
6273
    $item_2->discard_changes; # refresh
6274
    is( $item_2->localuse, undef , 'Without RecordLocalUseOnReturn no localuse is recorded.');
6275
6265
    t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1);
6276
    t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1);
6266
    my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef );
6277
    my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef );
6267
    is_deeply(
6278
    is_deeply(
6268
        \@return2,
6279
        \@return2,
6269
        [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1  }, undef, {} ], "Local use is recorded");
6280
        [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1  }, undef, {} ], "Local use is recorded");
6281
6282
    AddReturn( $item_2->barcode, $item_2->homebranch );
6283
    $item_2->discard_changes; # refresh
6284
    is( $item_2->localuse, 1 , 'With RecordLocalUseOnReturn localuse is recorded.');
6285
6286
    AddReturn( $item_2->barcode, $item_2->homebranch );
6287
    $item_2->discard_changes; # refresh
6288
    is( $item_2->localuse, 2 , 'With RecordLocalUseOnReturn localuse is recorded.');
6270
};
6289
};
6271
6290
6272
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub {
6291
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub {
6273
- 

Return to bug 16122