From 768183c598ef3bd5e9d13cd7512229a28ac9ce5f Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 29 Aug 2024 21:54:57 +0000 Subject: [PATCH] Bug 37505: Remove onloan check when checking out to stats patron To test: 1. Create a Statistical Patron 2. Set BlockReturnOfLostItems to Block. 3.. Mark an item as lost 4. Check it out to the Statistical Patron. You should see the message "Item was lost, cannot be returned." 5. Set BlockReturnOfWithdrawnItems to Block. 6. Mark an item as withdrawn 7. Check it out to the Statistical Patron. You should see the message "Item was withdrawn, cannot be returned." 8. Turn off BlockReturnOfWithdrawnItems, check out the same item to the Statistical Patron. You should see a message "Item was withdrawn." 9. Place an item on hold. 10. Check it out to the Statistical Patron 11. See the message "Item on hold, please checkin." 12. Make sure ClaimReturnedLostValue is set to a lost value 13. Claim a return, making sure it is not still checked out to the patron 14. Checkit it out to the Statistical Patron. 15. See the message "Item claimed returned, please checkin." 16. Have an item on a regular patron account that has been recalled. 17. Checkit it out to the Statistical Patron. 18. See the message "Item can fill a recall, please checkin." Signed-off-by: Kelly Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer (cherry picked from commit 5ee142c7f7b4c7a1071cfd92a410aa11b59d2bee) Signed-off-by: Lucas Gass (cherry picked from commit 6bd354f74ddfbbf310666776ce7207f5a7cb67b8) Signed-off-by: Fridolin Somers --- circ/circulation.pl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index c7d42bb708..8441cc2c4f 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -362,19 +362,17 @@ if (@$barcodes) { } if ( $issuingimpossible->{'STATS'} ) { - $template->param( STATS => 1 ); + my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = + AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ); - if ( $item->onloan ) { - my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = - AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ); + $template->param( + STATS => 1, + CHECKEDIN => $stats_return, + MESSAGES => $stats_messages, + ITEM => $stats_iteminformation, + BORROWER => $stats_borrower, + ); - $template->param( - CHECKEDIN => $stats_return, - MESSAGES => $stats_messages, - ITEM => $stats_iteminformation, - BORROWER => $stats_borrower, - ); - } } # Fix for bug 7494: optional checkout-time fallback search for a book