From 2be538e0155a084fde971b58cfe17a1b6ae2686b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 25 Oct 2021 21:22:14 +0000 Subject: [PATCH] Bug 27992: Call AddReturn if borrower is statistical patron To test: 1. Create a Statistical Patron 2. Check out an item to the Stat Patron, that is checked out to another user 3. See that the local use is recorded, but the item does not get checked in 4. Check out an item that has a lost status and note that the local use is recorded, and the lost status is cleared 5. Item is NOT checked in 6. Apply patch 7. Repeat steps 2 - 4. 8. Item is checked in and now seen as available 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 d8a1cf1a65..a87450c280 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -801,6 +801,9 @@ sub CanBookBeIssued { ccode => $item_object->ccode} ); ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item + if ( $item_object->onloan ) { + AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); + } return( { STATS => 1 }, {}); } -- 2.20.1