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

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

Return to bug 21944