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

(-)a/C4/Reserves.pm (-10 / +5 lines)
Lines 460-470 sub CanItemBeReserved { Link Here
460
        return { status => 'cannotReserveFromOtherBranches' };
460
        return { status => 'cannotReserveFromOtherBranches' };
461
    }
461
    }
462
462
463
    my $branch_control = C4::Context->preference('HomeOrHoldingBranch');
463
    my $item_library = Koha::Libraries->find( {branchcode => $item->homebranch} );
464
    my $itembranchcode = $branch_control eq 'holdingbranch' ? $item->holdingbranch : $item->homebranch;
465
    my $item_library = Koha::Libraries->find( {branchcode => $itembranchcode} );
466
    if ( $branchitemrule->{holdallowed} == 3) {
464
    if ( $branchitemrule->{holdallowed} == 3) {
467
        if($borrower->{branchcode} ne $itembranchcode && !$item_library->validate_hold_sibling( {branchcode => $borrower->{branchcode}} )) {
465
        if($borrower->{branchcode} ne $item->homebranch && !$item_library->validate_hold_sibling( {branchcode => $borrower->{branchcode}} )) {
468
            return { status => 'branchNotInHoldGroup' };
466
            return { status => 'branchNotInHoldGroup' };
469
        }
467
        }
470
    }
468
    }
Lines 812-818 sub CheckReserves { Link Here
812
                    my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype);
810
                    my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype);
813
                    next if ($branchitemrule->{'holdallowed'} == 0);
811
                    next if ($branchitemrule->{'holdallowed'} == 0);
814
                    next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode));
812
                    next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode));
815
                    my $library = Koha::Libraries->find({branchcode=>$branch});
813
                    my $library = Koha::Libraries->find({branchcode=>$item->homebranch});
816
                    next if (($branchitemrule->{'holdallowed'} == 3) && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) ));
814
                    next if (($branchitemrule->{'holdallowed'} == 3) && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) ));
817
                    my $hold_fulfillment_policy = $branchitemrule->{hold_fulfillment_policy};
815
                    my $hold_fulfillment_policy = $branchitemrule->{hold_fulfillment_policy};
818
                    next if ( ($hold_fulfillment_policy eq 'holdgroup') && (!$library->validate_hold_sibling({branchcode => $res->{branchcode}})) );
816
                    next if ( ($hold_fulfillment_policy eq 'holdgroup') && (!$library->validate_hold_sibling({branchcode => $res->{branchcode}})) );
Lines 1225-1233 sub IsAvailableForItemLevelRequest { Link Here
1225
        foreach my $i (@items) {
1223
        foreach my $i (@items) {
1226
            my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $patron->unblessed );
1224
            my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $patron->unblessed );
1227
            my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype );
1225
            my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype );
1228
            my $branch_control = C4::Context->preference('HomeOrHoldingBranch');
1226
            my $item_library = Koha::Libraries->find( {branchcode => $i->homebranch} );
1229
            my $itembranchcode = $branch_control eq 'holdingbranch' ? $item->holdingbranch : $item->homebranch;
1230
            my $item_library = Koha::Libraries->find( {branchcode => $itembranchcode} );
1231
1227
1232
1228
1233
            $any_available = 1
1229
            $any_available = 1
Lines 1240-1246 sub IsAvailableForItemLevelRequest { Link Here
1240
                && !C4::Context->preference('AllowHoldsOnDamagedItems') )
1236
                && !C4::Context->preference('AllowHoldsOnDamagedItems') )
1241
              || Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan
1237
              || Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan
1242
              || $branchitemrule->{holdallowed} == 1 && $patron->branchcode ne $i->homebranch
1238
              || $branchitemrule->{holdallowed} == 1 && $patron->branchcode ne $i->homebranch
1243
              || $branchitemrule->{holdallowed} == 3 && !$item_library->validate_hold_sibling( {branchcode => $pickup_branchcode} );
1239
              || $branchitemrule->{holdallowed} == 3 && !$item_library->validate_hold_sibling( {branchcode => $patron->branchcode} );
1244
        }
1240
        }
1245
1241
1246
        return $any_available ? 0 : 1;
1242
        return $any_available ? 0 : 1;
1247
- 

Return to bug 22284