From 3ee65fbf9d7418bbc66c0eeecf939f9102b13cbb 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 --- C4/Circulation.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a43c104d53..995ca52462 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