Bug 38787 - "Paid for?" message in item info lists patrons who did not pay for item
Summary: "Paid for?" message in item info lists patrons who did not pay for item
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 19919
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-26 21:05 UTC by Andrew Fuerste-Henry
Modified: 2025-01-02 21:57 UTC (History)
5 users (show)

See Also:
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 Andrew Fuerste-Henry 2024-12-26 21:05:36 UTC
To confirm:
- have an item checked out
- mark it lost, generating a fee on the patron account
- check it in, generating a full refund on the patron account
- mark the item lost again (it doesn't matter if it's checked out to another patron or not)
- go to moredetail.pl, see your item shows "Paid for: [your patron]"

Bug 19919 introduced logic to determine whether or not an item had previously been lost and then paid for. It will show the "Paid for" message and a patron's name and barcode if:
- the item is currently lost
- there is an accountlines entry linked to that item number with the following qualities:
-- accountlines.debit_type_code = LOST
-- accountlines.status != 'RETURNED'
-- accountlines.amountoutstanding = 0


So, show this if the item has an associated charge that reached $0 via means other than a return. But when a lost item gets checked in we update that status to "FOUND" and anyway the debit for a lost item that gets paid off has a NULL status, so it won't be found by looking for status != "FOUND".

Would it work to look for lines with debit_type_code='LOST', amoundoutstanding=0, and status IS NULL? I don't have a good enough handle on accountlines statuses to be sure.
Comment 1 Katrin Fischer 2024-12-27 09:05:55 UTC
It seems to me like we should use the issue_id to link the accountlines and the issue, so there can be no mistake in who the patron in question was.

As we have issue_id and old_issue_id on accountlines now, that would also be the saves approach for items that have already been returned. 

I think using the status won't work, as some libraries return lost items immediately when the status is set, but it doesn't tell you if the amount has been paid or not.
Comment 2 Andrew Fuerste-Henry 2024-12-27 17:07:14 UTC
Backing up a step, under which circumstances are we looking to show a patron here? 

For a library that doesn't refund paid lost fees when an item is found, the current logic could lead to misleading info on the screen when an item is paid for, returned, and later lost again. The same would be true for libraries that retain the item record in Koha when replacing the physical item.

It seems like what we're really aiming for here is to show a patron's name if they are the patron who caused and then paid for the item's *current* lost-ness. But Koha doesn't really have a conception of instances of lostness.
Comment 3 Kathleen L. 2025-01-02 21:57:14 UTC
Responding to Andrew's last comment, what you're describing is what I would expect that field to be: who lost and literally paid for the item which is still currently lost. If it gets returned, I would want/expect the "Paid for" field to go away. Hope that drop in the information bucket is somewhat helpful.