Bug 33153 - Bibliographic references disappear from the payment history if the item is deleted
Summary: Bibliographic references disappear from the payment history if the item is de...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 38381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-07 11:18 UTC by Mathieu Saby
Modified: 2025-09-29 13:59 UTC (History)
6 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***
Comment 4 Andrew Fuerste-Henry 2025-09-24 16:21:29 UTC
On Bug 30648 we resolved a similar issue with lost of bibliographic detail in Holds History by adding a deleted_biblionumber to the reserves table.

Bug 20271 offers a different approach, merging items and deleted_items. It's In Discussion, as that's a large change and not without issues.
Comment 5 Mathieu Saby 2025-09-25 07:27:02 UTC
We should not wait for bug 20271. It has been opened for ages and there is no consensus...
Comment 6 Steve, OSLRI, USA 2025-09-26 20:04:59 UTC
I would very much like to see the itemnumber itself retained.  The biblionumber alone does not help me attribute the fines based on owning library rules in a consortial environment.  I need to be able to crosswalk from the itemnumber to the homebranch.  A separate deleteditemnumber field would be a dandy solution.

I just assumed the itemnumber would not be rmmoved and had already built my query to check the deleteditems table if it wasn't present in the items table, and only learn this year when running stats that this wasn't the case.