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

(-)a/C4/Circulation.pm (-16 / +14 lines)
Lines 2679-2702 sub CanBookBeRenewed : PureFunction { Link Here
2679
            # can be filled with available items. We can get the union of the sets simply
2679
            # can be filled with available items. We can get the union of the sets simply
2680
            # by pushing all the elements onto an array and removing the duplicates.
2680
            # by pushing all the elements onto an array and removing the duplicates.
2681
            my @reservable;
2681
            my @reservable;
2682
            foreach my $b (@borrowernumbers) {
2682
            my %borrowers;
2683
                my ($borr) = C4::Members::GetMember( borrowernumber => $b);
2683
            ITEM: foreach my $i (@itemnumbers) {
2684
                foreach my $i (@itemnumbers) {
2684
                my $item = GetItem($i);
2685
                    my $item = GetItem($i);
2685
                next if IsItemOnHoldAndFound($i);
2686
                    if (  !IsItemOnHoldAndFound($i)
2686
                for my $b (@borrowernumbers) {
2687
                        && IsAvailableForItemLevelRequest( $item, $borr )
2687
                    my $borr = $borrowers{$b}//= C4::Members::GetMember(borrowernumber => $_);
2688
                        && CanItemBeReserved( $b, $i ) )
2688
                    next unless IsAvailableForItemLevelRequest($item, $borr);
2689
                    {
2689
                    next unless CanItemBeReserved($b,$i);
2690
                        push( @reservable, $i );
2690
2691
                    push @reservable;
2692
                    if (@reservable >= @borrowernumbers) {
2693
                        $resfound = 0;
2694
                        last ITEM;
2691
                    }
2695
                    }
2696
                    last;
2692
                }
2697
                }
2693
            }
2698
            }
2694
2695
            @reservable = uniq(@reservable);
2696
2697
            if ( @reservable >= @borrowernumbers ) {
2698
                $resfound = 0;
2699
            }
2700
        }
2699
        }
2701
    }
2700
    }
2702
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2701
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2703
- 

Return to bug 17941