Bug 23443 - Paying off a lost fee will return the item, even if it is checked out to a different patron
Summary: Paying off a lost fee will return the item, even if it is checked out to a di...
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-09 19:05 UTC by Nick Clemens
Modified: 2020-01-24 15:21 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 23443: Add tests (2.43 KB, patch)
2020-01-14 11:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid (1.23 KB, patch)
2020-01-14 11:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23443: Add tests (2.50 KB, patch)
2020-01-14 17:14 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid (1.29 KB, patch)
2020-01-14 17:14 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 23443: Add tests (2.59 KB, patch)
2020-01-24 08:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid (1.39 KB, patch)
2020-01-24 08:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-08-09 19:05:27 UTC
To recreate:
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
8 - The item is now checked in 

MarkIssueReturned (under the alias ReturnLostItem) is called from Koha::Account - it takes a borrowernumber and itemnumber, however, only the itemnumber is used for looking up the issue - we don't check against the borrower
Comment 1 Andrew Fuerste-Henry 2020-01-11 15:46:29 UTC
Bumping up the severity on this bug as it's pretty messy and I just ran into it with another library.
Comment 2 J. Evans 2020-01-11 15:57:23 UTC
We're one of the libraries affected by this. We have discovered that it will check the item in even if the item is currently checked out to another patron. That's not good!
Comment 3 Jonathan Druart 2020-01-14 11:41:33 UTC
Created attachment 97342 [details] [review]
Bug 23443: Add tests
Comment 4 Jonathan Druart 2020-01-14 11:41:36 UTC
Created attachment 97343 [details] [review]
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid

Test plan:
0 - Do not apply this patch
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
=> The item is now checked in
8 - Apply this patch and repeat 1 to 7
=> The item is still checked out
Comment 5 ByWater Sandboxes 2020-01-14 17:14:29 UTC
Created attachment 97362 [details] [review]
Bug 23443: Add tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 6 ByWater Sandboxes 2020-01-14 17:14:31 UTC
Created attachment 97363 [details] [review]
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid

Test plan:
0 - Do not apply this patch
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
=> The item is now checked in
8 - Apply this patch and repeat 1 to 7
=> The item is still checked out

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 7 Andrew Fuerste-Henry 2020-01-14 17:15:14 UTC
Works great, thanks! Also tested with paying the fee rather than writing it off.
Comment 8 Marcel de Rooy 2020-01-24 07:33:23 UTC
QAing
Comment 9 Marcel de Rooy 2020-01-24 08:49:07 UTC
Created attachment 97859 [details] [review]
Bug 23443: Add tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2020-01-24 08:49:12 UTC
Created attachment 97860 [details] [review]
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid

Test plan:
0 - Do not apply this patch
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
=> The item is now checked in
8 - Apply this patch and repeat 1 to 7
=> The item is still checked out

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Martin Renvoize 2020-01-24 15:21:12 UTC
Nice work everyone!

Pushed to master for 20.05