From 4a253b17e11eb512b7ca6230209e14a9e6724766 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 21 Apr 2014 05:51:58 +0000 Subject: [PATCH] Bug 10859: (follow-up) clarify logic on multiple loans on same bib This patch clarifies the logic for determining if a given item to be checked out would be the second (or third, etc.) loan on the same bib. As a conseqence, if the item is already on loan to the patron, the circ staffer won't see the multiple-loans-on-a-bib warning, just the confirmation to renew the loan or the warning that no more renewals are lest. Signed-off-by: Galen Charlton http://bugs.koha-community.org/show_bug.cgi?id=8375 --- C4/Circulation.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b660950..bd9e1cc 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1015,7 +1015,13 @@ sub CanBookBeIssued { } } - if (not C4::Context->preference('AllowMultipleIssuesOnABiblio')) { + if ( + !C4::Context->preference('AllowMultipleIssuesOnABiblio') && + # don't do the multiple loans per bib check if we've + # already determined that we've got a loan on the same item + !$issuingimpossible{NO_MORE_RENEWALS} && + !$needsconfirmation{RENEW_ISSUE} + ) { # Check if borrower has already issued an item from the same biblio # Only if it's not a subscription my $biblionumber = $item->{biblionumber}; @@ -1027,8 +1033,9 @@ sub CanBookBeIssued { biblionumber => $biblionumber, } ); my @issues = $issues ? @$issues : (); - # If there is at least one issue on another item than the item we want to checkout - if (scalar @issues > 0 and $issues[0]->{itemnumber} != $item->{itemnumber}) { + # if we get here, we don't already have a loan on this item, + # so if there are any loans on this bib, ask for confirmation + if (scalar @issues > 0) { $needsconfirmation{BIBLIO_ALREADY_ISSUED} = 1; } } -- 1.8.3.2