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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2568-2574 sub AddReturn { Link Here
2568
2568
2569
    # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly)
2569
    # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly)
2570
    if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) {
2570
    if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) {
2571
        $hold->revert_waiting();
2571
        $hold->revert_found();
2572
        $resfound = 'Reserved';
2572
        $resfound = 'Reserved';
2573
        $resrec   = $hold->unblessed;
2573
        $resrec   = $hold->unblessed;
2574
    }
2574
    }
(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 2085-2091 sub MoveReserve { Link Here
2085
2085
2086
        $hold = Koha::Holds->find( $res->{reserve_id} );
2086
        $hold = Koha::Holds->find( $res->{reserve_id} );
2087
        if ( $cancelreserve eq 'revert' ) {
2087
        if ( $cancelreserve eq 'revert' ) {
2088
            $hold->revert_waiting();
2088
            $hold->revert_found();
2089
        } elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) {    # cancel reserves on this item
2089
        } elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) {    # cancel reserves on this item
2090
            $hold->cancel;
2090
            $hold->cancel;
2091
        }
2091
        }
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 103-109 if ( $op eq 'cud-move' ) { Link Here
103
    my $hold_itemnumber = $input->param('itemnumber');
103
    my $hold_itemnumber = $input->param('itemnumber');
104
    if ( $prev_priority == 0 && $next_priority == 1 ) {
104
    if ( $prev_priority == 0 && $next_priority == 1 ) {
105
        my $hold = Koha::Holds->find($reserve_id);
105
        my $hold = Koha::Holds->find($reserve_id);
106
        $hold->revert_waiting();
106
        $hold->revert_found();
107
    } else {
107
    } else {
108
        AlterPriority(
108
        AlterPriority(
109
            $where,         $reserve_id,     $prev_priority,
109
            $where,         $reserve_id,     $prev_priority,
(-)a/t/db_dependent/Hold.t (-2 / +2 lines)
Lines 257-263 subtest "store() tests" => sub { Link Here
257
    $hold->discard_changes;
257
    $hold->discard_changes;
258
258
259
    $hold->set_waiting;
259
    $hold->set_waiting;
260
    $hold->revert_waiting();
260
    $hold->revert_found();
261
    $hold->discard_changes;
261
    $hold->discard_changes;
262
262
263
    $expected_date = dt_from_string( $hold->reservedate )->add( years => 2 )->ymd;
263
    $expected_date = dt_from_string( $hold->reservedate )->add( years => 2 )->ymd;
Lines 283-289 subtest "store() tests" => sub { Link Here
283
    $hold->discard_changes;
283
    $hold->discard_changes;
284
284
285
    $hold->set_waiting;
285
    $hold->set_waiting;
286
    $hold->revert_waiting();
286
    $hold->revert_found();
287
    $hold->discard_changes;
287
    $hold->discard_changes;
288
288
289
    is(
289
    is(
(-)a/t/db_dependent/Koha/Holds.t (-2 / +2 lines)
Lines 992-998 subtest 'set_waiting+patron_expiration_date' => sub { Link Here
992
        is( $hold->expirationdate,         $patron_expiration_date );
992
        is( $hold->expirationdate,         $patron_expiration_date );
993
        is( $hold->patron_expiration_date, $patron_expiration_date );
993
        is( $hold->patron_expiration_date, $patron_expiration_date );
994
994
995
        $hold->revert_waiting();
995
        $hold->revert_found();
996
996
997
        $hold = $hold->get_from_storage;
997
        $hold = $hold->get_from_storage;
998
        is( $hold->expirationdate,         $patron_expiration_date );
998
        is( $hold->expirationdate,         $patron_expiration_date );
Lines 1033-1039 subtest 'set_waiting+patron_expiration_date' => sub { Link Here
1033
        is( $hold->expirationdate,         $new_expiration_date );
1033
        is( $hold->expirationdate,         $new_expiration_date );
1034
        is( $hold->patron_expiration_date, $patron_expiration_date );
1034
        is( $hold->patron_expiration_date, $patron_expiration_date );
1035
1035
1036
        $hold->revert_waiting();
1036
        $hold->revert_found();
1037
1037
1038
        $hold = $hold->get_from_storage;
1038
        $hold = $hold->get_from_storage;
1039
        is( $hold->expirationdate,         $patron_expiration_date );
1039
        is( $hold->expirationdate,         $patron_expiration_date );
(-)a/t/db_dependent/Reserves.t (-1 / +1 lines)
Lines 1105-1111 subtest 'MoveReserve additional test' => sub { Link Here
1105
};
1105
};
1106
1106
1107
# FIXME: Should be in Circulation.t
1107
# FIXME: Should be in Circulation.t
1108
subtest 'AddIssue calls $hold->revert_waiting()' => sub {
1108
subtest 'AddIssue calls $hold->revert_found()' => sub {
1109
1109
1110
    plan tests => 2;
1110
    plan tests => 2;
1111
1111
(-)a/t/db_dependent/SIP/Transaction.t (-2 / +1 lines)
Lines 1119-1125 subtest do_checkout_with_holds => sub { Link Here
1119
1119
1120
    # Test non-attached holds
1120
    # Test non-attached holds
1121
    $hold->set_waiting();
1121
    $hold->set_waiting();
1122
    $hold->revert_waiting();
1122
    $hold->revert_found();
1123
    t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckoutSIP', '0' );
1123
    t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckoutSIP', '0' );
1124
    $co_transaction->do_checkout();
1124
    $co_transaction->do_checkout();
1125
    is( $patron->checkouts->count, 0, 'Checkout refused due to hold and AllowItemsOnHoldCheckoutSIP' );
1125
    is( $patron->checkouts->count, 0, 'Checkout refused due to hold and AllowItemsOnHoldCheckoutSIP' );
1126
- 

Return to bug 40671