Bug 33153

Summary: Bibliographic references disappear from the payment history if the item is deleted
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: Fines and feesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: madamyk, sbrown
Version: Main   
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 Mathieu Saby 2023-03-07 11:18:02 UTC
When you create a payment for a user, if you specify the reference of an item, Koha keeps track of the item and the record in the payment history.

But if the item is deleted after the payment is done, this information disappears from payment history.
Comment 1 Mathieu Saby 2024-06-21 15:56:11 UTC
I see 2 ways to fix this behavior : 
- request the "deleted" tables
- when the payment is done, write the complete bibliographic reference of the document in a new field of accountlines table
Comment 2 Mathieu Saby 2025-03-08 11:34:41 UTC
I think we sholuld 
- add a deleted_itemnumber column in accountlines table, and copy the itemnumber in that column when the item is deleted
- edit templates to search item in that column in addition to the itemnumber column
Comment 3 Katrin Fischer 2025-03-08 17:45:50 UTC
*** Bug 38381 has been marked as a duplicate of this bug. ***