Lines 432-438
sub MapItemsToHoldRequests {
Link Here
|
432 |
} |
432 |
} |
433 |
} |
433 |
} |
434 |
$holdingbranch = $pickup_branch; |
434 |
$holdingbranch = $pickup_branch; |
435 |
$itemnumber ||= $holding_branch_items->[0]->{itemnumber}; |
|
|
436 |
} |
435 |
} |
437 |
elsif ($transport_cost_matrix) { |
436 |
elsif ($transport_cost_matrix) { |
438 |
$pull_branches = [keys %items_by_branch]; |
437 |
$pull_branches = [keys %items_by_branch]; |
Lines 467-472
sub MapItemsToHoldRequests {
Link Here
|
467 |
$holdingbranch ||= $branch; |
466 |
$holdingbranch ||= $branch; |
468 |
foreach my $item (@$holding_branch_items) { |
467 |
foreach my $item (@$holding_branch_items) { |
469 |
next if $pickup_branch ne $item->{homebranch}; |
468 |
next if $pickup_branch ne $item->{homebranch}; |
|
|
469 |
next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} ); |
470 |
|
470 |
|
471 |
$itemnumber = $item->{itemnumber}; |
471 |
$itemnumber = $item->{itemnumber}; |
472 |
$holdingbranch = $branch; |
472 |
$holdingbranch = $branch; |
Lines 476-482
sub MapItemsToHoldRequests {
Link Here
|
476 |
|
476 |
|
477 |
unless ( $itemnumber ) { |
477 |
unless ( $itemnumber ) { |
478 |
foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) { |
478 |
foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) { |
479 |
if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $pickup_branch eq $current_item->{homebranch} ) ) { |
479 |
if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $request->{borrowerbranch} eq $current_item->{homebranch} ) ) { |
480 |
$itemnumber = $current_item->{itemnumber}; |
480 |
$itemnumber = $current_item->{itemnumber}; |
481 |
last; # quit this loop as soon as we have a suitable item |
481 |
last; # quit this loop as soon as we have a suitable item |
482 |
} |
482 |
} |