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.
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