From 5ee142c7f7b4c7a1071cfd92a410aa11b59d2bee 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 --- circ/circulation.pl | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 9230347ce0..2ae9447cf6 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -365,19 +365,16 @@ if (@$barcodes && $op eq 'cud-checkout') { } 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( - CHECKEDIN => $stats_return, - MESSAGES => $stats_messages, - ITEM => $stats_iteminformation, - BORROWER => $stats_borrower, - ); - } + $template->param( + STATS => 1, + CHECKEDIN => $stats_return, + MESSAGES => $stats_messages, + ITEM => $stats_iteminformation, + BORROWER => $stats_borrower, + ); #increment items.localuse my $localuse_count = $item->localuse; -- 2.39.5