From d388acd4825c7befb98438315a6ff8acd21cbbd9 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Tue, 6 Sep 2011 16:07:49 +1200 Subject: [PATCH] bug_6770: removed doubled override increment when using AllowHoldPolicyOverride Signed-off-by: Nicole C. Engard Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- reserve/request.pl | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index b34584541f..f27e5dbadd 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -433,20 +433,22 @@ foreach my $biblionumber (@biblionumbers) { $borrowerinfo->{'branchcode'} ne $item->{'homebranch'} ) ) { $policy_holdallowed = 0; } - - if (IsAvailableForItemLevelRequest($itemnumber) and - not $item->{cantreserve} and - CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) { - if ( $policy_holdallowed ) { - $item->{available} = 1; - $num_available++; - } - } elsif (C4::Context->preference( 'AllowHoldPolicyOverride' ) ) { - $item->{override} = 1; - $num_override++; + + if ( + $policy_holdallowed + && !$item->{cantreserve} + && IsAvailableForItemLevelRequest($itemnumber) + && CanItemBeReserved( + $borrowerinfo->{borrowernumber}, $itemnumber + ) + ) + { + $item->{available} = 1; + $num_available++; } - # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules - if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && !$item->{available} ) { + elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) { + +# If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules $item->{override} = 1; $num_override++; } -- 2.39.5