Bug 33292 - Claim return doesn't refund lost item charge when MarkLostItemsAsReturned includes "When marking an item as a return claim" and "Refund lost item fee" is on
Summary: Claim return doesn't refund lost item charge when MarkLostItemsAsReturned inc...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on: 27919
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-21 14:42 UTC by Lisette Scheer
Modified: 2024-10-30 14:28 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
**Sponsored by** *ByWater Solutions* and *Cuyahoga County Public Library*
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 33292: Add a checkbox to refund a lost fee on return claim (3.08 KB, patch)
2024-09-26 13:07 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 33292: Add logic to handle refunding a lost fee (3.70 KB, patch)
2024-09-26 13:07 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 33292: Add unit tests (4.75 KB, patch)
2024-09-26 13:07 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 33292: Add unit tests (4.79 KB, patch)
2024-10-01 13:43 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Popup Refund Fee (6.29 KB, image/png)
2024-10-01 13:46 UTC, Kristi
Details
Account Lines Claims Return Refund (48.93 KB, image/png)
2024-10-01 13:47 UTC, Kristi
Details
Bug 33292: Add a checkbox to refund a lost fee on return claim (3.12 KB, patch)
2024-10-10 22:25 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33292: Add logic to handle refunding a lost fee (3.74 KB, patch)
2024-10-10 22:25 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 33292: Add unit tests (4.85 KB, patch)
2024-10-10 22:25 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lisette Scheer 2023-03-21 14:42:45 UTC
When using Claim Return, if an item has already been charged as Long Overdue (lost) it does not get refunded when a claim is made, even if lost item fee refund on return policy is set to "Refund" and MarkLostItemsAsReturned includes "When marking an item as a return claim"

Since the library is not actually checking the item in it doesn't refund automatically. 

The library could check the item in and not resolve the claim, but that's an extra step and may not work with all workflows. 

Having the option to refund the lost fee on claim would be helpful for many libraries.
Comment 1 Michelle Spinney 2024-02-07 15:37:00 UTC
"Having the option to refund the lost fee on claim would be helpful for many libraries." I agree with Lisette, ALL of our libraries would appreciate this.
+1
Comment 2 Michelle Spinney 2024-07-22 17:53:27 UTC
I still agree with Lisette.
Comment 3 Matt Blenkinsop 2024-07-24 09:35:28 UTC
I have written a patch for this bug but I'm holding off submitting it until a way forward is agreed for bug 27919, currently awaiting QA
Comment 4 Matt Blenkinsop 2024-09-26 13:07:50 UTC
Created attachment 171966 [details] [review]
Bug 33292: Add a checkbox to refund a lost fee on return claim
Comment 5 Matt Blenkinsop 2024-09-26 13:07:53 UTC
Created attachment 171967 [details] [review]
Bug 33292: Add logic to handle refunding a lost fee

This patch allows the return claims endpoint to handle the refunding of a lost fee for the item if the checkbox is checked
Comment 6 Matt Blenkinsop 2024-09-26 13:07:55 UTC
Created attachment 171968 [details] [review]
Bug 33292: Add unit tests

Test plan:
1) In KTD, set ClaimReturnedLostValue to any value
2) Checkout an item to a patron
3) Add a manual invoice to that patron's account against that item barcode
4) In the patron's checkouts table, click the Claim returned button
5) The checkbox will have the option to "Refund previous lost fee"
6) Tick this box and submit
7) Have a look at the patron's transactions. There will now be a new line refunding the lost fee from step 3
8) Run the unit tests
prove t/db_dependent/Circulation/ReturnClaims.t
prove t/db_dependent/api/v1/return_claims.t
Comment 7 Martin Renvoize (ashimema) 2024-10-01 09:57:12 UTC
Do you happen to have any partners keen to test this for us Lisette?
Comment 8 Kristi 2024-10-01 13:07:13 UTC
If this can be done in a sandbox rather than KTD, I could give it a try.
Comment 9 Matt Blenkinsop 2024-10-01 13:11:20 UTC
Steps 1 - 7 should be fine to run in a sandbox (sandboxes are generally just KTD instances)
Comment 10 Kristi 2024-10-01 13:13:40 UTC
What would happen with step 8 then?
Comment 11 Matt Blenkinsop 2024-10-01 13:17:48 UTC
That could be covered at QA stage or we can ask someone to add another sign-off line for the tests. If you're happy to do steps 1 - 7 it would be good to prove the concept works :)
Comment 12 PTFS Europe Sandboxes 2024-10-01 13:43:02 UTC
Created attachment 172269 [details] [review]
Bug 33292: Add unit tests

Test plan:
1) In KTD, set ClaimReturnedLostValue to any value
2) Checkout an item to a patron
3) Add a manual invoice to that patron's account against that item barcode
4) In the patron's checkouts table, click the Claim returned button
5) The checkbox will have the option to "Refund previous lost fee"
6) Tick this box and submit
7) Have a look at the patron's transactions. There will now be a new line refunding the lost fee from step 3
8) Run the unit tests
prove t/db_dependent/Circulation/ReturnClaims.t
prove t/db_dependent/api/v1/return_claims.t

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Comment 13 Kristi 2024-10-01 13:45:07 UTC
Test plan:
1) In KTD, set ClaimReturnedLostValue to any value  -- I Used 'Lost'
2) Checkout an item to a patron -- I used 39999000012392
3) Add a manual invoice to that patron's account against that item barcode I used patron with card number 23529000318858 and added a 1.50 charge.
4) In the patron's checkouts table, click the Claim returned button
5) The checkbox will have the option to "Refund previous lost fee"
6) Tick this box and submit
7) Have a look at the patron's transactions. There will now be a new line refunding the lost fee from step 3

This all worked as expected. Screenshots of the "refund previous lost fee" popup and the account lines will be attached.
Comment 14 Kristi 2024-10-01 13:46:17 UTC
Created attachment 172270 [details]
Popup Refund Fee

Shows popup window for refund previous lost fee option on claims return.
Comment 15 Kristi 2024-10-01 13:47:09 UTC
Created attachment 172271 [details]
Account Lines Claims Return Refund

Shows the account line added when fee is refunded on claims return.
Comment 16 Lucas Gass (lukeg) 2024-10-10 22:25:14 UTC
Created attachment 172673 [details] [review]
Bug 33292: Add a checkbox to refund a lost fee on return claim

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 17 Lucas Gass (lukeg) 2024-10-10 22:25:17 UTC
Created attachment 172674 [details] [review]
Bug 33292: Add logic to handle refunding a lost fee

This patch allows the return claims endpoint to handle the refunding of a lost fee for the item if the checkbox is checked

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 18 Lucas Gass (lukeg) 2024-10-10 22:25:20 UTC
Created attachment 172675 [details] [review]
Bug 33292: Add unit tests

Test plan:
1) In KTD, set ClaimReturnedLostValue to any value
2) Checkout an item to a patron
3) Add a manual invoice to that patron's account against that item barcode
4) In the patron's checkouts table, click the Claim returned button
5) The checkbox will have the option to "Refund previous lost fee"
6) Tick this box and submit
7) Have a look at the patron's transactions. There will now be a new line refunding the lost fee from step 3
8) Run the unit tests
prove t/db_dependent/Circulation/ReturnClaims.t
prove t/db_dependent/api/v1/return_claims.t

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 19 Katrin Fischer 2024-10-24 09:41:38 UTC
Should this be "normal" instead of "enhancement"?
Comment 20 Katrin Fischer 2024-10-24 11:38:55 UTC
Pushed for 24.11!

Well done everyone, thank you!