Bug 38232 - Materials specified note un-checks 'forgive overdue charges' box
Summary: Materials specified note un-checks 'forgive overdue charges' box
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Brendan Lawlor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-22 21:33 UTC by hebah
Modified: 2025-01-10 18:20 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the remembering of the options when checking in items from Circulation > Check in > options icon in the barcode field. If the "Forgive overdue charges" option was selected (shown when the finesMode system preference is set to "Calculate and charge"), this selection was not remembered after checking in an item with a materials specified note (952$3).
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form (1.97 KB, patch)
2024-11-08 16:22 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form (2.02 KB, patch)
2024-12-26 23:12 UTC, David Nind
Details | Diff | Splinter Review
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form (2.07 KB, patch)
2025-01-10 15:18 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description hebah 2024-10-22 21:33:02 UTC
To recreate:
FinesMode on, have an item with a materials specified note (952$3).
Check in item with 'forgive overdue charge' selected, no materials note, box stays checked. Materials note checkin deselects the box.

There have been similar issues with things deselecting a check in box (wrong transfer, bug 36199), and I know materials specified notes can interact with things like since-fixed bug 29671 (materials note items deselecting book drop mode), or current bug 37424 (batch checkout silently failing with materials notes)
Comment 1 Lucas Gass (lukeg) 2024-10-23 14:48:00 UTC
I cannot reproduce this in current main.
Comment 2 Lucas Gass (lukeg) 2024-11-08 16:13:22 UTC
One extra step to recreate in main is to make sure `CircConfirmItemParts` is on.
Comment 3 Lucas Gass (lukeg) 2024-11-08 16:22:46 UTC
Created attachment 174283 [details] [review]
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form

To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.
Comment 4 David Nind 2024-12-26 20:31:06 UTC
How do you get "... 'forgive overdue charge' selected... " to appear when you check the item in?
Comment 5 hebah 2024-12-26 20:42:17 UTC
FinesMode must also be on.
Comment 6 David Nind 2024-12-26 21:30:20 UTC
(In reply to hebah from comment #5)
> FinesMode must also be on.

This is what I did (using koha-testing-docker and the sample data):

1. Set system preference finesMode = "Calculate and charge".
2. Set system preference CircConfirmItemParts = "Require".
3. Edited the item for CGI programming with Perl (record number 11), so that it has some text in "3 - Materials specified (bound volume or other part for" (barcode 39999000000498, item number 32).
4. Check out 39999000000498 to Mary Burton, and specified the due date as 1 December 2024 (so it is overdue).
5. Checked the item in:
   - Only get dialog box with "Please confirm checkin - Please confirm that the accompanying materials are present: [text from 952$3].", with the option of "Yes, checkin (Y) and "No, don't checkin (N)".
    - "Yes" checks the item in.

I don't get the "forgive overdue charge" message, or any other messages.

So what needs to be done to make this appear?

Add a manual charge, something else?
Comment 7 hebah 2024-12-26 21:37:16 UTC
Ahhh. Bet you need a circ rule with some amount of fines.
Comment 8 hebah 2024-12-26 21:37:55 UTC
And a backdated due date such that it would otherwise accrue them.
Comment 9 David Nind 2024-12-26 23:12:04 UTC
Created attachment 175950 [details] [review]
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form

To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2024-12-26 23:28:49 UTC
I managed to work out how to replicate the issue (go to Circulation > Check in and select the icon in barcode field to show the options - not from the check in menu item in the header!), and have signed off.

While the change works as per the test plan, is this the correct behavour?

I understand the rationale for the other options remaining selected after you check in an item - it makes sense to remember these if you have multiple items to check in:
- Specify return date (MM/DD/YYYY)
- Remember return date for next check in
- Book drop mode

However, I would have thought that "Forgive overdue charges" would be a more one-off event, and you wouldn't want to remember this for each subsequent check in.

I'm sure there is a rationale for remembering the "Forgive overdue charges" option for the current session!

Here are my updated testing notes (using KTD):
1. Set system preference finesMode = "Calculate and charge".
2. Set system preference CircConfirmItemParts = "Require".
3. Edit an item so that it has some text in "3 - Materials specified (bound volume or other part for" (I did this for CGI programming with Perl (record number 11), barcode 39999000000498, item number 32).
4. Go to check in an item WITHOUT a material note (952$3), from Circulation > Check in :
   4.1. Go to Circulation > Check in (not from the check in menu item in the header!)
   4.2. Click the settings icon in the "Enter item barcode" box
   4.3. There are now options for:
        - Specify return date (MM/DD/YYYY)
        - Remember return date for next check in
        - Forgive overdue charges
        - Book drop mode
   4.4. Tick the box for "Forgive overdue charges"
   4.5. Paste in a barcode (I used 39999000005776)
   4.6. Note that "Forgive overdue charges" remains checked.
5. Repeat step 4 for an item WITH a material note (952$3) (I used 39999000000498):
   5.1. You get a dialog box with:
          "Please confirm checkin
           Please confirm that the accompanying materials are present: [text from 952$3].
           Yes, checkin (Y)  No, don't checkin (N)"
   5.2 Click "Yes".
   5.3 Note that the "Forgive overdue charges" option is no longer selected.
6. Apply the patch and go to Circulation > Check in again, and expand the check in options.
7. Repeat steps 4 and 5, the "Forgive overdue charges" option should now remain selected.

Additional notes:
1. I didn't really need to set up charging of fines in the circulation rules (for Patron category = All and Item type = All) and running misc/cronjobs/fines.pl to replicate the issue:
   - Fine amount: 5.00
   - Fine charging interval: 5
2. Checking an item in from the header bar (which is what I was doing), doesn't give you the settings icon and a chance to select any of the options.
Comment 11 Brendan Lawlor 2025-01-10 15:18:23 UTC
Created attachment 176365 [details] [review]
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form

To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 12 Brendan Lawlor 2025-01-10 15:22:44 UTC
This works and passes the qa script.

The code makes sense and is implemented the exact same way as in the other modals on the Check in page, the hold-found1, hold-found2 and item-transfer-modal.

Nice one, passing QA.
Comment 13 Katrin Fischer 2025-01-10 17:39:01 UTC
(In reply to Brendan Lawlor from comment #12)
> This works and passes the qa script.
> 
> The code makes sense and is implemented the exact same way as in the other
> modals on the Check in page, the hold-found1, hold-found2 and
> item-transfer-modal.
> 
> Nice one, passing QA.

Good job! :)
Comment 14 Katrin Fischer 2025-01-10 18:20:54 UTC
Pushed for 25.05!

Well done everyone, thank you!