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

(-)a/C4/HoldsQueue.pm (-4 / +10 lines)
Lines 334-340 sub GetItemsAvailableToFillHoldRequestsForBib { Link Here
334
    my @items = grep { ! scalar GetTransfers($_->{itemnumber}) } @$itm;
334
    my @items = grep { ! scalar GetTransfers($_->{itemnumber}) } @$itm;
335
    return [ grep {
335
    return [ grep {
336
        my $rule = GetBranchItemRule($_->{homebranch}, $_->{itype});
336
        my $rule = GetBranchItemRule($_->{homebranch}, $_->{itype});
337
        $_->{holdallowed} = $rule->{holdallowed} != 0
337
        $_->{holdallowed} = $rule->{holdallowed};
338
    } @items ];
338
    } @items ];
339
}
339
}
340
340
Lines 467-474 sub MapItemsToHoldRequests { Link Here
467
                    last PULL_BRANCHES;
467
                    last PULL_BRANCHES;
468
                }
468
                }
469
            }
469
            }
470
            $itemnumber ||= $items_by_branch{$holdingbranch}->[0]->{itemnumber}
470
471
              if $holdingbranch;
471
            unless ( $itemnumber ) {
472
                foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) {
473
                    if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $pickup_branch eq $current_item->{homebranch} ) ) {
474
                        $itemnumber = $current_item->{itemnumber};
475
                        last; # quit this loop as soon as we have a suitable item
476
                    }
477
                }
478
            }
472
        }
479
        }
473
480
474
        if ($itemnumber) {
481
        if ($itemnumber) {
475
- 

Return to bug 10243