$sth->execute(@bind_params);
my $items = [];
while ( my $row = $sth->fetchrow_hashref ){
- $row->{reservedate} = format_date($row->{reservedate});
my $record = GetMarcBiblio($row->{biblionumber});
if ($record){
$row->{subtitle} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
* it is not currently in transit
* it is not lost
* it is not sitting on the hold shelf
+ * it is not damaged (unless AllowHoldsOnDamagedItems is on)
=cut
AND (found IS NOT NULL OR priority = 0)
)
AND items.biblionumber = ?";
- $items_query .= " AND damaged = 0 "
- unless C4::Context->preference('AllowHoldsOnDamagedItems');
my @params = ($biblionumber, $biblionumber);
if ($branches_to_use && @$branches_to_use) {
}
}
$holdingbranch = $pickup_branch;
- $itemnumber ||= $holding_branch_items->[0]->{itemnumber};
}
elsif ($transport_cost_matrix) {
$pull_branches = [keys %items_by_branch];
$itemnumber = $item->{itemnumber};
last;
}
- $itemnumber ||= $holding_branch_items->[0]->{itemnumber};
}
else {
warn "No transport costs for $pickup_branch";
$holdingbranch ||= $branch;
foreach my $item (@$holding_branch_items) {
next if $pickup_branch ne $item->{homebranch};
+ next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} );
$itemnumber = $item->{itemnumber};
$holdingbranch = $branch;
unless ( $itemnumber ) {
foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) {
- if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $pickup_branch eq $current_item->{homebranch} ) ) {
+ if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $request->{borrowerbranch} eq $current_item->{homebranch} ) ) {
$itemnumber = $current_item->{itemnumber};
last; # quit this loop as soon as we have a suitable item
}