Lines 137-147
sub GetHoldsQueueItems {
Link Here
|
137 |
biblio.copyrightdate, biblio.subtitle, biblio.medium, |
137 |
biblio.copyrightdate, biblio.subtitle, biblio.medium, |
138 |
biblio.part_number, biblio.part_name, |
138 |
biblio.part_number, biblio.part_name, |
139 |
biblioitems.publicationyear, biblioitems.pages, biblioitems.size, |
139 |
biblioitems.publicationyear, biblioitems.pages, biblioitems.size, |
140 |
biblioitems.isbn, biblioitems.editionstatement, items.copynumber |
140 |
biblioitems.isbn, biblioitems.editionstatement, items.copynumber, |
|
|
141 |
volumes.id AS volume_id, volumes.description AS volume_description |
141 |
FROM tmp_holdsqueue |
142 |
FROM tmp_holdsqueue |
142 |
JOIN biblio USING (biblionumber) |
143 |
JOIN biblio USING (biblionumber) |
143 |
LEFT JOIN biblioitems USING (biblionumber) |
144 |
LEFT JOIN biblioitems USING (biblionumber) |
144 |
LEFT JOIN items USING ( itemnumber) |
145 |
LEFT JOIN items USING ( itemnumber) |
|
|
146 |
LEFT JOIN volume_items USING ( itemnumber) |
147 |
LEFT JOIN volumes ON ( volume_items.volume_id = volumes.id ) |
145 |
/; |
148 |
/; |
146 |
if ($branchlimit) { |
149 |
if ($branchlimit) { |
147 |
$query .=" WHERE tmp_holdsqueue.holdingbranch = ?"; |
150 |
$query .=" WHERE tmp_holdsqueue.holdingbranch = ?"; |
Lines 277-283
sub GetPendingHoldRequestsForBib {
Link Here
|
277 |
my $dbh = C4::Context->dbh; |
280 |
my $dbh = C4::Context->dbh; |
278 |
|
281 |
|
279 |
my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode, |
282 |
my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode, |
280 |
reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold |
283 |
reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold, volume_id |
281 |
FROM reserves |
284 |
FROM reserves |
282 |
JOIN borrowers USING (borrowernumber) |
285 |
JOIN borrowers USING (borrowernumber) |
283 |
WHERE biblionumber = ? |
286 |
WHERE biblionumber = ? |
Lines 411-416
sub MapItemsToHoldRequests {
Link Here
|
411 |
|
414 |
|
412 |
next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; |
415 |
next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; |
413 |
|
416 |
|
|
|
417 |
next if $request->{volume_id} && $item->{_object}->volume && $item->{_object}->volume->id ne $request->{volume_id}; |
418 |
|
414 |
next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
419 |
next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
415 |
|
420 |
|
416 |
my $local_holds_priority_item_branchcode = |
421 |
my $local_holds_priority_item_branchcode = |
Lines 466-471
sub MapItemsToHoldRequests {
Link Here
|
466 |
|| ( $request->{branchcode} eq $items_by_itemnumber{ $request->{itemnumber} }->{ $items_by_itemnumber{ $request->{itemnumber} }->{hold_fulfillment_policy} } ) |
471 |
|| ( $request->{branchcode} eq $items_by_itemnumber{ $request->{itemnumber} }->{ $items_by_itemnumber{ $request->{itemnumber} }->{hold_fulfillment_policy} } ) |
467 |
and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match |
472 |
and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match |
468 |
|| $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) |
473 |
|| $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) |
|
|
474 |
and ( !$request->{volume_id} # If hold volume is set, item's volume must match |
475 |
|| ( $items_by_itemnumber{ $request->{itemnumber} }->{_object}->volume |
476 |
&& $items_by_itemnumber{ $request->{itemnumber} }->{_object}->volume->id eq $request->{volume_id} ) ) |
469 |
) |
477 |
) |
470 |
and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ) |
478 |
and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ) |
471 |
|
479 |
|
Lines 523-528
sub MapItemsToHoldRequests {
Link Here
|
523 |
|| $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} } ) |
531 |
|| $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} } ) |
524 |
&& ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match |
532 |
&& ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match |
525 |
|| $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) |
533 |
|| $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) |
|
|
534 |
&& ( !$request->{volume_id} # If hold volume is set, item's volume must match |
535 |
|| ( $item->{_object}->volume && $item->{_object}->volume->id eq $request->{volume_id} ) ) |
526 |
) |
536 |
) |
527 |
{ |
537 |
{ |
528 |
$itemnumber = $item->{itemnumber}; |
538 |
$itemnumber = $item->{itemnumber}; |
Lines 549-554
sub MapItemsToHoldRequests {
Link Here
|
549 |
next unless ( !$request->{itemtype} |
559 |
next unless ( !$request->{itemtype} |
550 |
|| $item->{itype} eq $request->{itemtype} ); |
560 |
|| $item->{itype} eq $request->{itemtype} ); |
551 |
|
561 |
|
|
|
562 |
# If hold volume is set, item's volume must match |
563 |
next unless ( |
564 |
!$request->{volume_id} |
565 |
|| ( $item->{_object}->volume |
566 |
&& $item->{_object}->volume->id eq $request->{volume_id} ) |
567 |
); |
568 |
|
552 |
$itemnumber = $item->{itemnumber}; |
569 |
$itemnumber = $item->{itemnumber}; |
553 |
last; |
570 |
last; |
554 |
} |
571 |
} |
Lines 586-591
sub MapItemsToHoldRequests {
Link Here
|
586 |
next unless ( !$request->{itemtype} |
603 |
next unless ( !$request->{itemtype} |
587 |
|| $item->{itype} eq $request->{itemtype} ); |
604 |
|| $item->{itype} eq $request->{itemtype} ); |
588 |
|
605 |
|
|
|
606 |
# If hold volume is set, item's volume must match |
607 |
next unless ( |
608 |
!$request->{volume_id} |
609 |
|| ( $item->{_object}->volume |
610 |
&& $item->{_object}->volume->id eq $request->{volume_id} ) |
611 |
); |
612 |
|
589 |
$itemnumber = $item->{itemnumber}; |
613 |
$itemnumber = $item->{itemnumber}; |
590 |
$holdingbranch = $branch; |
614 |
$holdingbranch = $branch; |
591 |
last PULL_BRANCHES; |
615 |
last PULL_BRANCHES; |
Lines 605-610
sub MapItemsToHoldRequests {
Link Here
|
605 |
next unless ( !$request->{itemtype} |
629 |
next unless ( !$request->{itemtype} |
606 |
|| $current_item->{itype} eq $request->{itemtype} ); |
630 |
|| $current_item->{itype} eq $request->{itemtype} ); |
607 |
|
631 |
|
|
|
632 |
# If hold volume is set, item's volume must match |
633 |
next unless ( |
634 |
!$request->{volume_id} |
635 |
|| ( $current_item->{_object}->volume |
636 |
&& $current_item->{_object}->volume->id eq $request->{volume_id} ) |
637 |
); |
638 |
|
608 |
next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
639 |
next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
609 |
|
640 |
|
610 |
$itemnumber = $current_item->{itemnumber}; |
641 |
$itemnumber = $current_item->{itemnumber}; |
Lines 631-636
sub MapItemsToHoldRequests {
Link Here
|
631 |
next unless ( !$request->{itemtype} |
662 |
next unless ( !$request->{itemtype} |
632 |
|| $item->{itype} eq $request->{itemtype} ); |
663 |
|| $item->{itype} eq $request->{itemtype} ); |
633 |
|
664 |
|
|
|
665 |
# If hold volume is set, item's volume must match |
666 |
next unless ( |
667 |
!$request->{volume_id} |
668 |
|| ( $item->{_object}->volume |
669 |
&& $item->{_object}->volume->id eq $request->{volume_id} ) |
670 |
); |
671 |
|
634 |
next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
672 |
next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); |
635 |
|
673 |
|
636 |
$itemnumber = $item->{itemnumber}; |
674 |
$itemnumber = $item->{itemnumber}; |