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

(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +1 lines)
Lines 47-53 sub do_renew_for { Link Here
47
47
48
    }
48
    }
49
    if ($renewokay){
49
    if ($renewokay){
50
        my $issue = AddIssue( $patron->unblessed, $self->{item}->id, undef, 0 );
50
        my $issue = AddIssue( $patron, $self->{item}->id, undef, 0 );
51
        $self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber});
51
        $self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber});
52
        $self->renewal_ok(1);
52
        $self->renewal_ok(1);
53
    } else {
53
    } else {
(-)a/t/db_dependent/Items.t (-2 / +2 lines)
Lines 455-462 subtest 'SearchItems test' => sub { Link Here
455
    is($total_results, 1, 'found all items of library1 with new_status=0 with ifnull = 0');
455
    is($total_results, 1, 'found all items of library1 with new_status=0 with ifnull = 0');
456
456
457
    t::lib::Mocks::mock_userenv({ branchcode => $item1->homebranch });
457
    t::lib::Mocks::mock_userenv({ branchcode => $item1->homebranch });
458
    my $patron_borrower = $builder->build_object({ class => 'Koha::Patrons' })->unblessed;
458
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
459
    AddIssue( $patron_borrower, $item1->barcode );
459
    AddIssue( $patron, $item1->barcode );
460
    # Search item where item is checked out
460
    # Search item where item is checked out
461
    $filter = {
461
    $filter = {
462
        conjunction => 'AND',
462
        conjunction => 'AND',
(-)a/t/db_dependent/Koha/Acquisition/Order.t (-2 / +2 lines)
Lines 698-704 subtest 'cancel() tests' => sub { Link Here
698
    t::lib::Mocks::mock_userenv({ patron => $patron });
698
    t::lib::Mocks::mock_userenv({ patron => $patron });
699
699
700
    # Add a checkout so deleting the item fails because od 'book_on_loan'
700
    # Add a checkout so deleting the item fails because od 'book_on_loan'
701
    C4::Circulation::AddIssue( $patron->unblessed, $item->barcode );
701
    C4::Circulation::AddIssue( $patron, $item->barcode );
702
702
703
    my $result = $order->cancel({ reason => $reason });
703
    my $result = $order->cancel({ reason => $reason });
704
    # refresh the order object
704
    # refresh the order object
Lines 966-972 subtest 'cancel() tests' => sub { Link Here
966
    $order->add_item( $item_3->id );
966
    $order->add_item( $item_3->id );
967
967
968
    # Add a checkout so deleting the item fails because od 'book_on_loan'
968
    # Add a checkout so deleting the item fails because od 'book_on_loan'
969
    C4::Circulation::AddIssue( $patron->unblessed, $item_2->barcode );
969
    C4::Circulation::AddIssue( $patron, $item_2->barcode );
970
    C4::Reserves::AddReserve(
970
    C4::Reserves::AddReserve(
971
        {
971
        {
972
            branchcode     => $item_3->holdingbranch,
972
            branchcode     => $item_3->holdingbranch,
(-)a/t/db_dependent/Koha/Holds.t (-1 / +1 lines)
Lines 483-489 subtest 'get_items_that_can_fill' => sub { Link Here
483
    );
483
    );
484
484
485
    # item 3 is on loan
485
    # item 3 is on loan
486
    AddIssue( $patron_3->unblessed, $item_3->barcode );
486
    AddIssue( $patron_3, $item_3->barcode );
487
487
488
    # item 4 is in transfer
488
    # item 4 is in transfer
489
    my $from = $builder->build_object( { class => 'Koha::Libraries' } );
489
    my $from = $builder->build_object( { class => 'Koha::Libraries' } );
(-)a/t/db_dependent/Koha/Item.t (-7 / +7 lines)
Lines 263-276 subtest 'add_to_bundle tests' => sub { Link Here
263
    'Koha::Exceptions::Item::Bundle::IsBundle',
263
    'Koha::Exceptions::Item::Bundle::IsBundle',
264
      'Exception thrown if you try to add a bundle host to a bundle item';
264
      'Exception thrown if you try to add a bundle host to a bundle item';
265
265
266
    C4::Circulation::AddIssue( $patron->unblessed, $host_item->barcode );
266
    C4::Circulation::AddIssue( $patron, $host_item->barcode );
267
    throws_ok { $host_item->add_to_bundle($bundle_item2) }
267
    throws_ok { $host_item->add_to_bundle($bundle_item2) }
268
    'Koha::Exceptions::Item::Bundle::BundleIsCheckedOut',
268
    'Koha::Exceptions::Item::Bundle::BundleIsCheckedOut',
269
      'Exception thrown if you try to add an item to a checked out bundle';
269
      'Exception thrown if you try to add an item to a checked out bundle';
270
    C4::Circulation::AddReturn( $host_item->barcode, $host_item->homebranch );
270
    C4::Circulation::AddReturn( $host_item->barcode, $host_item->homebranch );
271
    $host_item->discard_changes;
271
    $host_item->discard_changes;
272
272
273
    C4::Circulation::AddIssue( $patron->unblessed, $bundle_item2->barcode );
273
    C4::Circulation::AddIssue( $patron, $bundle_item2->barcode );
274
    throws_ok { $host_item->add_to_bundle($bundle_item2) }
274
    throws_ok { $host_item->add_to_bundle($bundle_item2) }
275
    'Koha::Exceptions::Item::Bundle::ItemIsCheckedOut',
275
    'Koha::Exceptions::Item::Bundle::ItemIsCheckedOut',
276
      'Exception thrown if you try to add a checked out item';
276
      'Exception thrown if you try to add a checked out item';
Lines 304-310 subtest 'remove_from_bundle tests' => sub { Link Here
304
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
304
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
305
    t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } );
305
    t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } );
306
306
307
    C4::Circulation::AddIssue( $patron->unblessed, $host_item->barcode );
307
    C4::Circulation::AddIssue( $patron, $host_item->barcode );
308
    throws_ok { $bundle_item1->remove_from_bundle }
308
    throws_ok { $bundle_item1->remove_from_bundle }
309
    'Koha::Exceptions::Item::Bundle::BundleIsCheckedOut',
309
    'Koha::Exceptions::Item::Bundle::BundleIsCheckedOut',
310
      'Exception thrown if you try to add an item to a checked out bundle';
310
      'Exception thrown if you try to add an item to a checked out bundle';
Lines 871-877 subtest 'deletion' => sub { Link Here
871
    $item = $builder->build_sample_item({ library => $library->branchcode });
871
    $item = $builder->build_sample_item({ library => $library->branchcode });
872
872
873
    # book_on_loan
873
    # book_on_loan
874
    C4::Circulation::AddIssue( $patron->unblessed, $item->barcode );
874
    C4::Circulation::AddIssue( $patron, $item->barcode );
875
875
876
    is(
876
    is(
877
        @{$item->safe_to_delete->messages}[0]->message,
877
        @{$item->safe_to_delete->messages}[0]->message,
Lines 1973-1979 subtest 'Recalls tests' => sub { Link Here
1973
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall item if not checked out" );
1973
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall item if not checked out" );
1974
1974
1975
    $item1->update({ withdrawn => 0 });
1975
    $item1->update({ withdrawn => 0 });
1976
    C4::Circulation::AddIssue( $patron2->unblessed, $item1->barcode );
1976
    C4::Circulation::AddIssue( $patron2, $item1->barcode );
1977
1977
1978
    Koha::CirculationRules->set_rules({
1978
    Koha::CirculationRules->set_rules({
1979
        branchcode => $branchcode,
1979
        branchcode => $branchcode,
Lines 2023-2029 subtest 'Recalls tests' => sub { Link Here
2023
    C4::Circulation::AddReturn( $item1->barcode, $branchcode );
2023
    C4::Circulation::AddReturn( $item1->barcode, $branchcode );
2024
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if no items are checked out" );
2024
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if no items are checked out" );
2025
2025
2026
    C4::Circulation::AddIssue( $patron2->unblessed, $item1->barcode );
2026
    C4::Circulation::AddIssue( $patron2, $item1->barcode );
2027
    is( $item1->can_be_recalled({ patron => $patron1 }), 1, "Can recall item" );
2027
    is( $item1->can_be_recalled({ patron => $patron1 }), 1, "Can recall item" );
2028
2028
2029
    $recall1 = Koha::Recall->new(
2029
    $recall1 = Koha::Recall->new(
Lines 2168-2174 subtest 'has_pending_recall() tests' => sub { Link Here
2168
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2168
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2169
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
2169
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
2170
2170
2171
    C4::Circulation::AddIssue( $patron->unblessed, $item->barcode );
2171
    C4::Circulation::AddIssue( $patron, $item->barcode );
2172
2172
2173
    my ($recall) = Koha::Recalls->add_recall({ biblio => $item->biblio, item => $item, patron => $patron });
2173
    my ($recall) = Koha::Recalls->add_recall({ biblio => $item->biblio, item => $item, patron => $patron });
2174
2174
(-)a/t/db_dependent/Koha/Patron.t (-2 / +2 lines)
Lines 1504-1511 subtest 'get_savings tests' => sub { Link Here
1504
1504
1505
    is( $patron->get_savings, 0, 'No checkouts with itemnumber, no savings' );
1505
    is( $patron->get_savings, 0, 'No checkouts with itemnumber, no savings' );
1506
1506
1507
    AddIssue( $patron->unblessed, $item1->barcode );
1507
    AddIssue( $patron, $item1->barcode );
1508
    AddIssue( $patron->unblessed, $item2->barcode );
1508
    AddIssue( $patron, $item2->barcode );
1509
1509
1510
    my $savings = $patron->get_savings;
1510
    my $savings = $patron->get_savings;
1511
    is( $savings + 0, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current issues" );
1511
    is( $savings + 0, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current issues" );
(-)a/t/db_dependent/SIP/ILS.t (-2 / +1 lines)
Lines 345-351 subtest renew => sub { Link Here
345
        }
345
        }
346
    );
346
    );
347
347
348
    AddIssue( $patron->unblessed, $item->barcode, undef, 0 );
348
    AddIssue( $patron, $item->barcode, undef, 0 );
349
    my $checkout = $item->checkout;
349
    my $checkout = $item->checkout;
350
    ok( defined($checkout), "Successfully checked out an item prior to renewal" );
350
    ok( defined($checkout), "Successfully checked out an item prior to renewal" );
351
351
352
- 

Return to bug 32496