[Bug 37201] New: Add a syspref to allow or not a checkout if a expired booking exists for the same patron
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Bug ID: 37201 Summary: Add a syspref to allow or not a checkout if a expired booking exists for the same patron Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Hello :) I've worked on a way to prevent checkout to patron if this same patron has a booking expired for the same item.. I think it's a setting that might not suit everyone, so I've introduced a new system preference. I'll put my patch in place and await your comments. Thanks ^^ -- 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=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36789 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36789 [Bug 36789] Transform a booking into checkout -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.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=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #1 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Created attachment 168159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168159&action=edit Bug 37201: Allow or not a checkout if a expired booking exists Test plan: 1) Apply this patch and run updatedatabase 2) Set a booking on a specific item 3) In database you can update the value to set a past date for booking end for example. 4) Go system preferences and search 'AllowExpiredBookingTransformation' 5) When you "Don\'t allow" normally you will find a pop up to confirm the checkout when you choose to 'Transform to checkout' from bookings list view. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168159|0 |1 is obsolete| | --- Comment #2 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Created attachment 168227 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168227&action=edit Bug 37201: Allow or not a checkout if a expired booking exists Test plan: 1) Apply this patch and run updatedatabase 2) Set a booking on a specific item 3) In database you can update the value to set a past date for booking end for example. 4) Go system preferences and search 'AllowExpiredBookingTransformation' 5) When you "Don\'t allow" normally you will find a pop up to confirm the checkout when you choose to 'Transform to checkout' from bookings list view. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Note: A patch for a dependency (bug 36789) no longer applies, so can't be tested until that is resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168227|0 |1 is obsolete| | --- Comment #4 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Created attachment 170192 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170192&action=edit Bug 37201: Allow or not a checkout if a expired booking exists Test plan: 1) Apply this patch and run updatedatabase 2) Set a booking on a specific item 3) In database you can update the value to set a past date for booking end for example. 4) Go system preferences and search 'AllowExpiredBookingTransformation' 5) When you "Don\'t allow" normally you will find a pop up to confirm the checkout when you choose to 'Transform to checkout' from bookings list view. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- When I try to apply this patch, it doesn't apply the dependencies, probably due to 36789 being set to 'Patch doesn't apply'. Just FYI. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Circulation| |bookings function| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Bug 37201 depends on bug 36789, which changed state. Bug 36789 Summary: Transform a booking into checkout https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36789 What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Bug 37201 depends on bug 36789, which changed state. Bug 36789 Summary: Transform a booking into checkout https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36789 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|DUPLICATE |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add a syspref to allow or |Add a system preference to |not a checkout if a expired |allow or not allow a |booking exists for the same |checkout if an expired |patron |booking exists for the | |patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #7 from David Nind <david@davidnind.com> --- I've attempted to test, but I'm not sure exactly what is intended here. I've attached some screenshots (next comment) without the patch and with the patch (with the new system preference set to allow and don't allow). Without this patch: 1. I can still checkout past or expired bookings. If attempted to change a booking to a checkout, staff have the option to "Yes, check out (Y)", or "No, don't check out (N)". With this patch: 1. Set to "Allow": no change 2. Set to "Don't allow": extra bulleted sentence: "Booking ended on 08/03/2026 would you force the checkout?" Testing notes (using KTD): 1. Step 3: - koha-mysql kohadev - update bookings set start_date = "2026-08-01 00:00:00"; - update bookings set end_date = "2026-08-03 00:00:00"; 2. When I set AllowExpiredBookingTransformation to "Don't allow", the only thing that is different is that for the "Please confirm checkout" (in yellow) there is an extra sentence at the start which says: "- Booking ended on 08/03/2026 would you force the checkout?" 3. Section for new system preference: - The ew system preference was put in Circulation > Lost item policy - I think this should be in Circulation > Booking module 4. Description for the new system preference: - Current: [Allow/Don't allow] patrons to transform a past booking into checkout. - Suggested: [Allow/Don't allow] staff to transform an expired booking into a checkout. - Rationale: "patrons" - can only be done in the staff interface, so "staff" or "staff patrons" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 204513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204513&action=edit Screenshots - "Please confirm checkout" messages before and after the patch Screenshots showing the differences before and after the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #204277|0 |1 is obsolete| | --- Comment #9 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 205142 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205142&action=edit Bug 37201: Add AllowExpiredBookingTransformation syspref When staff transform a booking into a checkout from the bookings list, Koha did not check whether the booking period had already ended. This patch adds the AllowExpiredBookingTransformation system preference (Administration > Circulation > Booking module, default "Allow"): - "Allow": an expired booking can be transformed into a checkout as before. - "Don't allow": CanBookBeIssued raises the BOOKED_EXPIRED confirmation. Staff without the "force_checkout" permission are blocked; staff with it can still override from the checkout screen. Test plan: 1) Apply patch, run updatedatabase and restart_all 2) Enable the booking module, make an item bookable and place a booking for a patron on it 3) Push the booking into the past: UPDATE bookings SET start_date = NOW() - INTERVAL XX DAY, end_date = NOW() - INTERVAL XX DAY; 4) Confirm the new pref shows under Administration > Circulation > Booking module, default "Allow" 5) With "Allow": from the bookings list click "Transform to checkout" -> checkout succeeds with a normal due date, no "date in the past" confirmation 6) Set the pref to "Don't allow": a) as staff WITHOUT the force_checkout permission: "Transform to checkout" is refused (only "No, don't check out" is offered) b) as staff WITH the force_checkout permission: the confirmation shows "This booking expired on DD/MM/YYYY." and "Yes, check out (Y)" completes the checkout 7) Set a booking with an end date in the future and check "Transform to checkout" still caps the due date at the booked end date Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #10 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 205143 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205143&action=edit Bug 37201: Unit tests Test plan: 1) prove t/db_dependent/Circulation.t 2) Tests pass Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37201 --- Comment #11 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- (In reply to David Nind from comment #7)
I've attempted to test, but I'm not sure exactly what is intended here.
I've attached some screenshots (next comment) without the patch and with the patch (with the new system preference set to allow and don't allow).
Without this patch: 1. I can still checkout past or expired bookings. If attempted to change a booking to a checkout, staff have the option to "Yes, check out (Y)", or "No, don't check out (N)".
With this patch: 1. Set to "Allow": no change 2. Set to "Don't allow": extra bulleted sentence: "Booking ended on 08/03/2026 would you force the checkout?"
Testing notes (using KTD):
1. Step 3: - koha-mysql kohadev - update bookings set start_date = "2026-08-01 00:00:00"; - update bookings set end_date = "2026-08-03 00:00:00";
2. When I set AllowExpiredBookingTransformation to "Don't allow", the only thing that is different is that for the "Please confirm checkout" (in yellow) there is an extra sentence at the start which says: "- Booking ended on 08/03/2026 would you force the checkout?"
3. Section for new system preference: - The ew system preference was put in Circulation > Lost item policy - I think this should be in Circulation > Booking module
4. Description for the new system preference: - Current: [Allow/Don't allow] patrons to transform a past booking into checkout. - Suggested: [Allow/Don't allow] staff to transform an expired booking into a checkout. - Rationale: "patrons" - can only be done in the staff interface, so "staff" or "staff patrons"
Hello David, Thanks for the testing. The previous patch was confusing and barely changed anything. New version attached. Note: the “Yes/No” prompt you saw without the patch is the generic “due date in the past” confirmation (the bookings list submits the booking’s past end_date as the checkout due date), not a booking check. I've reworked this and added a `BOOKED_EXPIRED` case, which is hopefully clearer. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org