+ if ( $biblioLoopIter{holdable} ) {
+ @not_available_at = uniq @not_available_at;
+ $biblioLoopIter{not_available_at} = \@not_available_at ;
+ }
+
+ unless ( $can_place_hold_if_available_at_pickup ) {
+ @not_available_at = uniq @not_available_at;
+ $biblioLoopIter{not_available_at} = \@not_available_at ;
+ # The record is not holdable is not available at any of the libraries
+ if ( Koha::Libraries->search->count == @not_available_at ) {
+ $biblioLoopIter{holdable} = 0;
+ }
+ }
+
+ $biblioLoopIter{holdable} &&= CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK';