[Bug 43852] New: When MarkLostItemsAsReturned includes claim_returned and a lost fee is not charged the accountline isn't updated properly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 Bug ID: 43852 Summary: When MarkLostItemsAsReturned includes claim_returned and a lost fee is not charged the accountline isn't updated properly Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: lisette@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- This causes a 500 error if you try to write off the overdue fines for some reason. 1. Set the system preferences: - ClaimReturnedLostValue set to "Claims Return" - ClaimReturnedChargeFee set to "Don't charge a fee" - DefaultLongOverdueSkipLostStatuses not configured - MarkLostItemsAsReturned from the batch item modification tool, from the items tab of the catalog module, from the longoverdue cronjob, when marking an item as a return claim, when receiving payment for the item 2. Have a patron with an item that has become overdue. - The overdue item should have fines. 3. "Claim returned" the overdue item. - Do not charge for the item or make any selections when claiming the item as returned. 4. Go to the patron's account and try to write off the fines. - See the 500 error. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lisette@bywatersolutions.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 --- Comment #1 from Lisette Scheer <lisette@bywatersolutions.com> --- Update, this happens when RenewAccruingItemWhenPaid is set to renew. The CanBookBeRenewed sub should only be called if the item is still checked out otherwise it causes this error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #2 from Lisette Scheer <lisette@bywatersolutions.com> --- To test: --BEFORE PATCH-- 1. Set the following system preferences: - ClaimReturnedLostValue set to "Missing" - ClaimReturnedChargeFee set to "Don't charge a fee" - MarkLostItemsAsReturned should include claim returns - RenewAccruingItemWhenPaid is set to renew 2. In the circulation and fine rules - Set a fine - Set a max fine greater than or equal to the fine - Set the interval to 1 3. Check out an item to a patron with a date in the past. I used patron 23529001000463 with item 39999000011418 4. Run misc/cronjobs/Fines.pm 5. Go to your patron and observe the fine exists 6. Claim return the item and observe it's no longer checked out. 7. Go to the accounts, press the button to write off the fine, confirm. Error! 8. Apply patches, restart all 9. Repeat step 7 fine should write off 10. Repeat steps 3-6 11. Write off all fine should write off 12. Repeat steps 3-6 13. Write off selected. fine should write off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 --- Comment #3 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 208552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208552&action=edit Bug 43852: Update overdue fine status to LOST when claim returns the item o test: --BEFORE PATCH-- 1. Set the following system preferences: - ClaimReturnedLostValue set to "Missing" - ClaimReturnedChargeFee set to "Don't charge a fee" - MarkLostItemsAsReturned should include claim returns - RenewAccruingItemWhenPaid is set to renew 2. In the circulation and fine rules - Set a fine - Set a max fine greater than or equal to the fine - Set the interval to 1 3. Check out an item to a patron with a date in the past. I used patron 23529001000463 with item 39999000011418 4. Run misc/cronjobs/Fines.pm 5. Go to your patron and observe the fine exists 6. Claim return the item and observe it's no longer checked out. 7. Go to the accounts, press the button to write off the fine, confirm. Error! 8. Apply patches, restart all 9. Repeat step 7 fine should write off 10. Repeat steps 3-6 11. Write off all fine should write off 12. Repeat steps 3-6 13. Write off selected. fine should write off 14. prove t/db_dependent/Circulation/ReturnClaims.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- I attempted to test, but still get the error after applying the patches. Note: I needed to also set the finesMode system preference to "Calculate and charge" for the fines to appear after running the cron job. Testing notes (using KTD): 1. System preferences (as per the test plan): - ClaimReturnedLostValue: Missing - ClaimReturnedChargeFee: don't charge a lost fee - MarkLostItemsAsReturned: All selected (by default "When marking an item as a return claim" was the only one not selected, I added that one as well = All selected) - RenewAccruingItemWhenPaid: renew 2. Circulation and fine rules - for the All All rule (I've used the column headings here): - Fine amount: 1.00 - Fine charging interval: 1 - Overdue fines cap (amount): 5.00 3. Checked out 39999000011418 to 23529001000463 (Edna Acosta): - Today's date: 21 October 2026 - Specified due date: 1 October 2026 4. Shows for Edna as: "Overdues: Patron has ITEMS OVERDUE See highlighted items below" 5. Run the fines cron job: misc/cronjobs/fines.pl -v Fines assessment -- 2026-10-20T18:14:22 Number of Overdue Items: counted 1 reported 1 updated 0 6. Needed to set finesMode to "Calculate and charge" so that a fine was added, then the output was Fines assessment -- 2026-10-20T18:31:39 Number of Overdue Items: counted 1 reported 1 updated 1 7. Clicking on "Claim returned" works as expected, item for record now shows as Missing (Claimed returned) 8. When I go to write off the fines (5.00) using any of the options I get the error: {UNKNOWN}: Can't call method "item" on an undefined value at /kohadevbox/koha/C4/Circulation.pm line 3377. at /kohadevbox/koha/Koha/Account/Line.pm line 695 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 ... 9. After applying the patches and restarting everything, I still get the error (I also cleared browser cache, as well as a yarn build and restart_all). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 --- Comment #5 from Lisette Scheer <lisette@bywatersolutions.com> --- I just tried on a fresh box and it worked for me. Is your KTD up to date? I had to update it recently. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 --- Comment #6 from David Nind <david@davidnind.com> --- (In reply to Lisette Scheer from comment #5)
I just tried on a fresh box and it worked for me. Is your KTD up to date? I had to update it recently.
I tried again - everything is up-to-date (koha repository, KTD, ktd images deleted and refreshed). Still get the same error message after the patch. Will leave to someone else to test - maybe something wrong with my setup (I tried in a sandbox, bit you can't run cron jobs....). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43852 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |andrew@bywatersolutions.com --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Following this test plan, I am able to write off off fines for checkouts performed and claimed after the patch is applied, but the fine for the checkout performed before the patch continues to give an error when attempting to write it off. It seems like this patch prevents further instances of these problematic fines from being created, but should also do something to prevent the error on fines for checkouts that have already been claimed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org