From b6baccee51f14b22cc6f2bfb152d811c591207b2 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 Signed-off-by: Joy Nelson (cherry picked from commit e901fb7842aeddd5ac68f5e8004ad3d186789bab) Signed-off-by: Lucas Gass --- C4/Circulation.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 2518d871c9..eadf7e9165 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2155,6 +2155,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