From fe0f8389b2710f83256aff4b0b05a9809190bd6a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 27 Oct 2023 23:36:05 +0000 Subject: [PATCH] Bug 27992: Call AddReturn on stats 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. Item is checked in. 8. Set BlockReturnOfLostItems to Block. 9. Have a checkout to another patron then mark it as lost. 10. Check it out to the Statistical Patron. You should see the message "Item was lost, cannot be returned." 12. Conform the item remains on the patron's account. 13. Turn off BlockReturnOfLostItems, check out the same item to the Statistical Patron. You should see a message "Item was lost, now found." 14. Conform the item was actually checked in. 15. Set BlockReturnOfWithdrawnItems to Block. 16. Have a checkout to another patron then mark it as withdrawn. 17. Check it out to the Statistical Patron. You should see the message "Item was withdrawn, cannot be returned." 18. Conform the item remains on the patron's account. 19. Turn off BlockReturnOfWithdrawnItems, check out the same item to the Statistical Patron. You should see a message "Item was withdrawn." 20. Conform the item was actually checked in. 21. Have an item on a regular patron account that has a hold on it. 22. Check it out to the Statistical Patron 23. See the message "Item on hold, please checkin." 24. Have an item on a regular patron account that has a claim return on it. 25. Checkit it out to the Statistical Patron. 26. See the message "Item claimed returned, please checkin." 27. Have an item on a regular patron account that has been recalled. 28. Checkit it out to the Statistical Patron. 29. See the message "Item can fill a recall, please checkin." Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 16 +++++++++-- .../prog/en/modules/circ/circulation.tt | 27 ++++++++++++++++++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e11a94e26b..7341efe42e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -826,8 +826,20 @@ sub CanBookBeIssued { interface => C4::Context->interface, } ); - ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item - return( { STATS => 1 }, {}); + my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; + my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower) = + AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); + ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item + return ( + { + STATS => 1, + CHECKEDIN => $stats_return, + MESSAGES => $stats_messages, + ITEM => $stats_iteminformation, + BORROWER => $stats_borrower, + }, + {} + ); } if ( $patron->gonenoaddress && $patron->gonenoaddress == 1 ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 6048d1a189..ec907ef604 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -451,8 +451,33 @@ [% IF ( STATS ) %]
  • Local use recorded
  • + [% IF ( CHECKEDIN ) %] +
  • Item returned from: [% INCLUDE 'patron-title.inc' patron=BORROWER %]
  • + [% END %] + [% IF ( MESSAGES.ResFound ) %] +
  • Item on hold, please checkin.
  • + [% END %] + [% IF ( MESSAGES.ReturnClaims ) %] +
  • Item claimed returned, please checkin.
  • + [% END %] + [% IF ( MESSAGES.RecallFound ) %] +
  • Item can fill a recall, please checkin.
  • + [% END %] + [% IF ( MESSAGES.WasLost ) %] + [% IF ( Koha.Preference('BlockReturnOfLostItems') ) %] +
  • Item was lost, cannot be returned.
  • + [% ELSE %] +
  • Item was lost, now found.
  • + [% END %] + [% END %] + [% IF ( MESSAGES.withdrawn ) %] + [% IF ( Koha.Preference('BlockReturnOfWithdrawnItems') ) %] +
  • Item was withdrawn, cannot be returned.
  • + [% ELSE %] +
  • Item was withdrawn
  • + [% END %] + [% END %] [% END %] - [% IF ( INVALID_DATE ) %]
  • The due date "[% INVALID_DATE | $KohaDates %]" is invalid
  • [% END %] -- 2.39.5