Skip to content

Commit

Permalink
Bug 27992: Call AddReturn on stats patron
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
ricofreak authored and tomascohen committed Nov 6, 2023
1 parent f918c3f commit fe0f838
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
16 changes: 14 additions & 2 deletions C4/Circulation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
27 changes: 26 additions & 1 deletion koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,33 @@

[% IF ( STATS ) %]
<li>Local use recorded</li>
[% IF ( CHECKEDIN ) %]
<li>Item returned from: [% INCLUDE 'patron-title.inc' patron=BORROWER %]</li>
[% END %]
[% IF ( MESSAGES.ResFound ) %]
<li>Item on hold, please checkin.</li>
[% END %]
[% IF ( MESSAGES.ReturnClaims ) %]
<li>Item claimed returned, please checkin.</li>
[% END %]
[% IF ( MESSAGES.RecallFound ) %]
<li>Item can fill a recall, please checkin.</li>
[% END %]
[% IF ( MESSAGES.WasLost ) %]
[% IF ( Koha.Preference('BlockReturnOfLostItems') ) %]
<li>Item was lost, cannot be returned.</li>
[% ELSE %]
<li>Item was lost, now found.</li>
[% END %]
[% END %]
[% IF ( MESSAGES.withdrawn ) %]
[% IF ( Koha.Preference('BlockReturnOfWithdrawnItems') ) %]
<li>Item was withdrawn, cannot be returned.</li>
[% ELSE %]
<li>Item was withdrawn</li>
[% END %]
[% END %]
[% END %]

[% IF ( INVALID_DATE ) %]
<li>The due date &quot;[% INVALID_DATE | $KohaDates %]&quot; is invalid</li>
[% END %]
Expand Down

0 comments on commit fe0f838

Please sign in to comment.