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

(-)a/C4/HoldsQueue.pm (-2 / +18 lines)
Lines 415-420 sub MapItemsToHoldRequests { Link Here
415
                    && $item->{homebranch} ne $request->{borrowerbranch} )
415
                    && $item->{homebranch} ne $request->{borrowerbranch} )
416
                  || $item->{_object}->exclude_from_local_holds_priority;
416
                  || $item->{_object}->exclude_from_local_holds_priority;
417
417
418
                # Group holds
419
                next if $item->{holdallowed} == 3 && !Koha::Libraries->find( $item->{homebranch} )->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } );
420
418
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
421
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
419
422
420
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
423
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
Lines 584-589 sub MapItemsToHoldRequests { Link Here
584
                foreach my $item (@$holding_branch_items) {
587
                foreach my $item (@$holding_branch_items) {
585
                    next if $pickup_branch ne $item->{homebranch};
588
                    next if $pickup_branch ne $item->{homebranch};
586
                    next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} );
589
                    next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} );
590
591
                    # Group holds
592
                    next if $item->{holdallowed} == 3 && !Koha::Libraries->find( $item->{homebranch} )->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } );
593
587
                    next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
594
                    next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
588
595
589
                    # Don't fill item level holds that contravene the hold pickup policy at this time
596
                    # Don't fill item level holds that contravene the hold pickup policy at this time
Lines 603-609 sub MapItemsToHoldRequests { Link Here
603
            # Now try items from the least cost branch based on the transport cost matrix or StaticHoldsQueueWeight
610
            # Now try items from the least cost branch based on the transport cost matrix or StaticHoldsQueueWeight
604
            unless ( $itemnumber ) {
611
            unless ( $itemnumber ) {
605
                foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) {
612
                foreach my $current_item ( @{ $items_by_branch{$holdingbranch} } ) {
606
                    if ( $holdingbranch && ( $current_item->{holdallowed} == 2 || $request->{borrowerbranch} eq $current_item->{homebranch} ) ) {
613
                    if ( $holdingbranch && ( 
614
                            $current_item->{holdallowed} == 2 
615
                            || $request->{borrowerbranch} eq $current_item->{homebranch} # holdallowed == 1
616
                             # Group holds 
617
                            || ( $current_item->{holdallowed} == 3 && Koha::Libraries->find( $current_item->{homebranch} )->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } ) )
618
                        ) ) {
607
619
608
                        # Don't fill item level holds that contravene the hold pickup policy at this time
620
                        # Don't fill item level holds that contravene the hold pickup policy at this time
609
                        next unless $current_item->{hold_fulfillment_policy} eq 'any'
621
                        next unless $current_item->{hold_fulfillment_policy} eq 'any'
Lines 631-636 sub MapItemsToHoldRequests { Link Here
631
                    foreach my $item (@$holding_branch_items) {
643
                    foreach my $item (@$holding_branch_items) {
632
                        next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} );
644
                        next if ( $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch} );
633
645
646
                        # Group holds
647
                        next if $item->{holdallowed} == 3 
648
                          && !Koha::Libraries->find( $item->{homebranch} )
649
                               ->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } );
650
634
                        # Don't fill item level holds that contravene the hold pickup policy at this time
651
                        # Don't fill item level holds that contravene the hold pickup policy at this time
635
                        next unless $item->{hold_fulfillment_policy} eq 'any'
652
                        next unless $item->{hold_fulfillment_policy} eq 'any'
636
                            || $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} };
653
                            || $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} };
637
- 

Return to bug 27068