Bug 33789

Summary: Checkout information is missing when adding a credit
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Fines and feesAssignee: Lucas Gass (lukeg) <lucas>
Status: Needs documenting --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, Laura.escamilla, matt.blenkinsop
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.01
Circulation function:
Attachments: Bug 33789: Return issue info. when adding a credit
Bug 33789: Return issue info. when adding a credit
Bug 33789: Add unit test
Bug 33789: Return issue info. when adding a credit
Bug 33789: Add unit test
Bug 33789: Update POD

Description Lucas Gass (lukeg) 2023-05-19 22:02:32 UTC
add_credit does not pass any issue information when the credit is related to an issue. It would be handy if it did. 

To recreate:
1. Make sure MarkLostItemsAsReturned is set so a lost item will stay on a patrons account after being marked as lost.
2. Check an item out to a patron, make sure it has a replacementprice
3. Mark the item as lost.
4. Now check the item in. 
5. Go to the patrons account -> transaction tab. You should see 2 accountlines related to the item.
6. For the account type 'Lost item' you will see issue infomation ( check out date, due date, checkouted out from, etc )
7. For the account type 'Lost item fee refund' there is no issue information. 

It would be helpful for librarians if they could see this information in both places.
Comment 1 Lucas Gass (lukeg) 2023-05-19 22:10:34 UTC
Created attachment 151498 [details] [review]
Bug 33789: Return issue info. when adding a credit

To test:
1. Make sure MarkLostItemsAsReturned is set so a lost item will stay on a patrons account after being marked as lost.
2. Check an item out to a patron, make sure it has a replacementprice
3. Mark the item as lost.
4. Now check the item in.
5. Go to the patrons account -> transaction tab. You should see 2 accountlines related to the item.
6. For the account type 'Lost item' you will see issue infomation ( check out date, due date, checkouted out from, etc )
7. For the account type 'Lost item fee refund' there is no issue information.
8. Apply patch
9. Try 2 - 6 again. This time the 'Lost item fee refund' should include issue information.
Comment 2 ByWater Sandboxes 2023-05-22 13:18:47 UTC
Created attachment 151528 [details] [review]
Bug 33789: Return issue info. when adding a credit

To test:
1. Make sure MarkLostItemsAsReturned is set so a lost item will stay on a patrons account after being marked as lost.
2. Check an item out to a patron, make sure it has a replacementprice
3. Mark the item as lost.
4. Now check the item in.
5. Go to the patrons account -> transaction tab. You should see 2 accountlines related to the item.
6. For the account type 'Lost item' you will see issue infomation ( check out date, due date, checkouted out from, etc )
7. For the account type 'Lost item fee refund' there is no issue information.
8. Apply patch
9. Try 2 - 6 again. This time the 'Lost item fee refund' should include issue information.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 3 Jonathan Druart 2023-05-23 09:22:55 UTC
Please provide a test.
Comment 4 Lucas Gass (lukeg) 2023-05-24 18:39:22 UTC
Created attachment 151650 [details] [review]
Bug 33789: Add unit test
Comment 5 Jonathan Druart 2023-06-01 07:36:12 UTC
Created attachment 151897 [details] [review]
Bug 33789: Return issue info. when adding a credit

To test:
1. Make sure MarkLostItemsAsReturned is set so a lost item will stay on a patrons account after being marked as lost.
2. Check an item out to a patron, make sure it has a replacementprice
3. Mark the item as lost.
4. Now check the item in.
5. Go to the patrons account -> transaction tab. You should see 2 accountlines related to the item.
6. For the account type 'Lost item' you will see issue infomation ( check out date, due date, checkouted out from, etc )
7. For the account type 'Lost item fee refund' there is no issue information.
8. Apply patch
9. Try 2 - 6 again. This time the 'Lost item fee refund' should include issue information.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2023-06-01 07:36:14 UTC
Created attachment 151898 [details] [review]
Bug 33789: Add unit test

JD amended patch: Remove biblionumber => 144

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Tomás Cohen Arazi (tcohen) 2023-06-05 18:19:26 UTC
Created attachment 152014 [details] [review]
Bug 33789: Update POD
Comment 8 Tomás Cohen Arazi (tcohen) 2023-06-05 18:37:36 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Tomás Cohen Arazi (tcohen) 2023-06-09 14:08:05 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-06-12 10:14:14 UTC
Enhancement - not backporting to 22.11.x