my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn );
# 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)
- if ( $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) {
+ if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) {
my $hold = C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } );
$resfound = 'Reserved';
$resrec = $hold->unblessed;
}
}
- if ( $issue ) {
+ if ( $doreturn and $issue ) {
my $checkin = Koha::Old::Checkouts->find($issue->id);
Koha::Plugins->call('after_circ_action', {