Bug 28137

Summary: Lost items checked in through inventory do not follow "refund on return" policy in circ rules
Product: Koha Reporter: Donna <bwsdonna>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall
Version: 20.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Donna 2021-04-12 19:46:56 UTC
When an item that is marked as lost and is checked out on a patron's account is checked in through the inventory function, the Default lost item fee refund on return policy is not followed.  

To recreate:
1. Set Default lost item fee refund on return policy to YES 
2. Check out an item to patron
3. Mark it lost and see that the fee has been charged, and item is still checked out to the patron
4.  Put that barcode through the Inventory process, making sure checked out items are set to be returned
5.  Note that the item is checked in, but patron does not get lost item fee returned.
Comment 1 Jonathan Druart 2021-04-14 14:27:43 UTC
My bet is that it's because of the following lines in inventory.pl:

219                 # Modify date last seen for scanned items, remove lost status
220                 $item->set({ itemlost => 0, datelastseen => $date })->store;

We should not remove the lost status before the AddReturn call.