From 7246e60d5aeab6135f189df17e1312861a83ee3d 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." --- circ/circulation.pl | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index acabfa4d1db..d7d26d1ead0 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -364,19 +364,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.2