Bug 27068: Perltidy _checkHoldPolicy
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (cherry picked from commit40ccb7f371) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit8f34251746) Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
parent
b2c55f8440
commit
75ffbc53d9
|
|
@ -371,20 +371,38 @@ sub GetItemsAvailableToFillHoldRequestsForBib {
|
|||
=cut
|
||||
|
||||
sub _checkHoldPolicy {
|
||||
my ($item, $request) = @_;
|
||||
my ( $item, $request ) = @_;
|
||||
|
||||
return 0 unless $item->{holdallowed};
|
||||
return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
|
||||
|
||||
return 0 if $item->{'holdallowed'} == 3 && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
|
||||
return 0
|
||||
if $item->{holdallowed} == 1
|
||||
&& $item->{homebranch} ne $request->{borrowerbranch};
|
||||
|
||||
return 0
|
||||
if $item->{'holdallowed'} == 3
|
||||
&& !Koha::Libraries->find( $item->{homebranch} )
|
||||
->validate_hold_sibling( { branchcode => $request->{borrowerbranch} } );
|
||||
|
||||
my $hold_fulfillment_policy = $item->{hold_fulfillment_policy};
|
||||
|
||||
return 0 if $hold_fulfillment_policy eq 'holdgroup' && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
|
||||
return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
|
||||
return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
|
||||
return 0
|
||||
if $hold_fulfillment_policy eq 'holdgroup'
|
||||
&& !Koha::Libraries->find( $item->{homebranch} )
|
||||
->validate_hold_sibling( { branchcode => $request->{branchcode} } );
|
||||
|
||||
return 0 if $hold_fulfillment_policy eq 'patrongroup' && !Koha::Libraries->find($request->{borrowerbranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
|
||||
return 0
|
||||
if $hold_fulfillment_policy eq 'homebranch'
|
||||
&& $request->{branchcode} ne $item->{$hold_fulfillment_policy};
|
||||
|
||||
return 0
|
||||
if $hold_fulfillment_policy eq 'holdingbranch'
|
||||
&& $request->{branchcode} ne $item->{$hold_fulfillment_policy};
|
||||
|
||||
return 0
|
||||
if $hold_fulfillment_policy eq 'patrongroup'
|
||||
&& !Koha::Libraries->find( $request->{borrowerbranch} )
|
||||
->validate_hold_sibling( { branchcode => $request->{branchcode} } );
|
||||
|
||||
return 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue