Bug 28051 - On upgrade to 19.11, per-item Writeoff got confused with Lost
Summary: On upgrade to 19.11, per-item Writeoff got confused with Lost
Status: RESOLVED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: 19.11
Hardware: All All
: P3 normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-30 10:31 UTC by Pongtawat
Modified: 2023-07-01 07:03 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pongtawat 2021-03-30 10:31:39 UTC
During upgrade to 19.11, database upgrade script introduced by Bug #22563 (convert "lost" handling) also handle case of normal per-item writeoff like those writeoff generated from lost. So, all patron with normal per-item writeoff will now see additional account line of 'LOST' type. 

This is due to the following code in updatedatabase.pl:

    # Find and correct pathalogical cases of L having been converted to W
    $sth = $dbh->prepare( "SELECT accountlines_id, issue_id, borrowernumber, itemnumber, amount, manager_id FROM accountlines WHERE accounttype = 'W' AND itemnumber IS NOT NULL" );
...

Step to reproduce:

1. Start with Koha 18.05.
2. Create overdue fine on item X for patron A, amount=100.
3. Per-item write-off amount=50 on item X for patron A. This will create 'W' line in accountlines with amount=50 and item=X
4. Upgrade to Koha 19.11 or later (in our case 20.05)
5. Patron A now has an additional 'LOST' with amount=50 and item=X in their accountlines.

This additional 'LOST' line is incorrect in this case.

Also, I notice that this per-item writeoff is in debit side (red). I don't know if this is correct or not, but shouldn't writeoff be on credit side?
Comment 1 Katrin Fischer 2023-07-01 07:03:33 UTC
These versions are too old now to provide a fix, marking WONTFIX. But as I can't test there is a possibility it was fixed elsewhere.