Bug 25227: Display correct message if item is lost and lost returns are allowed
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 21 Apr 2020 11:11:08 +0000 (07:11 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Apr 2020 15:13:03 +0000 (16:13 +0100)
Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/SIP/ILS.pm

index 822a6d3..94bc154 100644 (file)
@@ -223,7 +223,7 @@ sub checkin {
     } elsif ( $data->{messages}->{withdrawn} && !$circ->ok ) {
             $circ->screen_msg("Item withdrawn, return not allowed");
             syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item withdrawn");
-    } elsif ( $data->{messages}->{WasLost} && !$circ->ok ) {
+    } elsif ( $data->{messages}->{WasLost} && !$circ->ok && C4::Context->preference("BlockReturnOfLostItems") ) {
             $circ->screen_msg("Item lost, return not allowed");
             syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item lost");
     } elsif ( !$item->{patron} ) {