From 518bb04d8a56edceeada645755de69530844f435 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Jan 2020 12:39:38 +0100 Subject: [PATCH] Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid Test plan: 0 - Do not apply this patch 1 - Check out an item to a patron 2 - Make sure a fee will be charged when lost 3 - Mark the item lost 4 - Make sure the fee will not be refunded on return of the item 5 - Return the item 6 - Check it out to a new patron 7 - Write off the fine for the original patron => The item is now checked in 8 - Apply this patch and repeat 1 to 7 => The item is still checked out Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- C4/Circulation.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e58aa2c983..ad196ab843 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2166,6 +2166,9 @@ sub MarkIssueReturned { # Retrieve the issue my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; + + return unless $issue->borrowernumber == $borrowernumber; # If the item is checked out to another patron we do not return it + my $issue_id = $issue->issue_id; my $anonymouspatron; -- 2.39.5