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

(-)a/C4/HoldsQueue.pm (-8 / +25 lines)
Lines 371-390 sub GetItemsAvailableToFillHoldRequestsForBib { Link Here
371
=cut
371
=cut
372
372
373
sub _checkHoldPolicy {
373
sub _checkHoldPolicy {
374
    my ($item, $request) = @_;
374
    my ( $item, $request ) = @_;
375
375
376
    return 0 unless $item->{holdallowed};
376
    return 0 unless $item->{holdallowed};
377
    return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
378
377
379
    return 0 if $item->{'holdallowed'} == 3 && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
378
    return 0
379
      if $item->{holdallowed} == 1
380
      && $item->{homebranch} ne $request->{borrowerbranch};
381
382
    return 0
383
      if $item->{'holdallowed'} == 3
384
      && !Koha::Libraries->find( $item->{homebranch} )
385
              ->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } );
380
386
381
    my $hold_fulfillment_policy = $item->{hold_fulfillment_policy};
387
    my $hold_fulfillment_policy = $item->{hold_fulfillment_policy};
382
388
383
    return 0 if $hold_fulfillment_policy eq 'holdgroup' && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
389
    return 0
384
    return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
390
      if $hold_fulfillment_policy eq 'holdgroup'
385
    return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
391
      && !Koha::Libraries->find( $item->{homebranch} )
392
            ->validate_hold_sibling( { branchcode => $request->{branchcode} } );
393
394
    return 0
395
      if $hold_fulfillment_policy eq 'homebranch'
396
      && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
397
398
    return 0
399
      if $hold_fulfillment_policy eq 'holdingbranch'
400
      && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
386
401
387
    return 0 if $hold_fulfillment_policy eq 'patrongroup' && !Koha::Libraries->find($request->{borrowerbranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
402
    return 0
403
      if $hold_fulfillment_policy eq 'patrongroup'
404
      && !Koha::Libraries->find( $request->{borrowerbranch} )
405
              ->validate_hold_sibling( { branchcode => $request->{branchcode} } );
388
406
389
    return 1;
407
    return 1;
390
408
391
- 

Return to bug 27068