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

(-)a/C4/Circulation.pm (-2 / +8 lines)
Lines 2056-2065 sub AddReturn { Link Here
2056
    }
2056
    }
2057
2057
2058
    # find reserves.....
2058
    # find reserves.....
2059
    # if we don't have a reserve with the status W, we launch the Checkreserves routine
2059
    # launch the Checkreserves routine to find any holds
2060
    my ($resfound, $resrec);
2060
    my ($resfound, $resrec);
2061
    my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
2061
    my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
2062
    ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn );
2062
    ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn );
2063
    # 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)
2064
    if ( $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) {
2065
        C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } );
2066
        #If the hold is reverted we need to refetch for the return values
2067
        ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn );
2068
    }
2069
    ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn );
2063
    if ($resfound) {
2070
    if ($resfound) {
2064
          $resrec->{'ResFound'} = $resfound;
2071
          $resrec->{'ResFound'} = $resfound;
2065
        $messages->{'ResFound'} = $resrec;
2072
        $messages->{'ResFound'} = $resrec;
2066
- 

Return to bug 21944