@@ -, +, @@ Koha interface. - An item is returned, and there is a reservation on record-level: block - An item is returned, and there is a reservation on this very item: block - An item is returned, and there is a reservation on another item: allow --- C4/SIP/ILS/Transaction/Checkin.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ a/C4/SIP/ILS/Transaction/Checkin.pm @@ -13,7 +13,7 @@ use C4::SIP::ILS::Transaction; use C4::Circulation qw( AddReturn LostItem ); use C4::Items qw( ModItemTransfer ); -use C4::Reserves qw( ModReserve ModReserveAffect ); +use C4::Reserves qw( ModReserve ModReserveAffect CheckReserves ); use Koha::DateUtils qw( dt_from_string ); use Koha::Items; @@ -87,7 +87,14 @@ sub do_checkin { $messages->{additional_materials} = 1; } - my $checkin_blocked_by_holds = $holds_block_checkin && $item->biblio->holds->count; + my $reserved; + my $lookahead = C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds + my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); + if ( $resfound eq "Reserved") { + $reserved = 1; + } + + my $checkin_blocked_by_holds = $holds_block_checkin && $reserved; ( $return, $messages, $issue, $borrower ) = AddReturn( $barcode, $branch, undef, $return_date ) --