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

(-)a/C4/HoldsQueue.pm (-3 / +5 lines)
Lines 370-382 sub GetItemsAvailableToFillHoldRequestsForBib { Link Here
370
370
371
=cut
371
=cut
372
372
373
our $libraries = {};
373
sub _checkHoldPolicy {
374
sub _checkHoldPolicy {
374
    my ($item, $request) = @_;
375
    my ($item, $request) = @_;
375
376
376
    return 0 unless $item->{holdallowed};
377
    return 0 unless $item->{holdallowed};
377
    return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
378
    return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
378
379
379
    my $library = Koha::Libraries->find($item->{homebranch});
380
    $libraries->{$item->{homebranch}} ||= Koha::Libraries->find($item->{homebranch});
381
    my $library = $libraries->{$item->{homebranch}};
380
382
381
    return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
383
    return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
382
384
Lines 386-392 sub _checkHoldPolicy { Link Here
386
    return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
388
    return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
387
    return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
389
    return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
388
390
389
    my $patronLibrary = Koha::Libraries->find($request->{borrowerbranch});
391
    $libraries->{$request->{borrowerbranch}} ||= Koha::Libraries->find($request->{borrowerbranch});
392
    my $patronLibrary = $libraries->{$request->{borrowerbranch}};
390
393
391
    return 0 if $hold_fulfillment_policy eq 'patrongroup' && !patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}});
394
    return 0 if $hold_fulfillment_policy eq 'patrongroup' && !patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}});
392
395
393
- 

Return to bug 27068