Bug 37354 - Bookings should respect circulation rules for max loan periods
Summary: Bookings should respect circulation rules for max loan periods
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on: 34440
Blocks: 36271 37363 37618 39584
  Show dependency treegraph
 
Reported: 2024-07-14 06:02 UTC by Martin Renvoize (ashimema)
Modified: 2025-05-21 08:39 UTC (History)
15 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact: Aude Charillon
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/1009
Text to go in the release notes:
This enhancement builds on the bookings functionality added in the last cycle. We now prevent a booking from exceeding the maximum period laid out by the circulation rules for that item. We highlight the loan period and renewal periods in the bookings calendar upon selection of the booking start date and disallow bookings that exceed the loan period + renewal period * max renewals rules. **Sponsored by** *PTFS Europe*
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod (3.04 KB, patch)
2024-07-14 06:41 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod (3.04 KB, patch)
2024-07-15 10:08 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (4.93 KB, patch)
2024-07-15 10:08 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.59 KB, patch)
2024-07-15 10:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (5.27 KB, patch)
2024-07-15 10:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.63 KB, patch)
2024-07-15 15:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (5.32 KB, patch)
2024-07-15 15:42 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.60 KB, patch)
2024-07-25 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (5.32 KB, patch)
2024-07-25 16:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.60 KB, patch)
2024-07-26 08:05 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (6.35 KB, patch)
2024-07-26 08:05 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.65 KB, patch)
2024-08-05 14:18 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (6.41 KB, patch)
2024-08-05 14:18 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.65 KB, patch)
2024-10-17 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (6.41 KB, patch)
2024-10-17 14:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Fix circ rule selections (12.03 KB, patch)
2024-10-22 12:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: (QA follow-up) Reset periodPicker on rule change (2.20 KB, patch)
2024-10-23 12:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.71 KB, patch)
2024-10-29 12:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (6.47 KB, patch)
2024-10-29 12:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37354: Fix circ rule selections (12.09 KB, patch)
2024-10-29 12:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37354: (QA follow-up) Reset periodPicker on rule change (2.25 KB, patch)
2024-10-29 12:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) (3.71 KB, patch)
2024-11-08 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Add visual hint at usual loan periods (6.47 KB, patch)
2024-11-08 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: Fix circ rule selections (12.09 KB, patch)
2024-11-08 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: (QA follow-up) Reset periodPicker on rule change (2.25 KB, patch)
2024-11-08 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37354: (QA follow-up) Reset state on clear (1.46 KB, patch)
2024-11-08 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-07-14 06:02:17 UTC
+++ This bug was initially created as a clone of Bug #36271 +++
The original bug for this took on a life of its own and became broader in scope adding a series of circulation rules for the bookings system

I've cloned it here to propose my original more limited-in-scope solution using existing circulation rules for loan length * renewals count.

---------------------------------------------------------------
Currently, bookings are on/off at the item level, but the booking period is entirely open meaning an item can be booked for any period.

We should refine this to allow libraries to control the maximum length an item can be booked for.

During the original development, I suggested perhaps we should set the maximum to the loan length of the item times the max renewals from the circulation rules.. However, I didn't get much feedback as to whether this was appropriate or whether people wanted a distinct rule for these items or another alternative.
Comment 1 Martin Renvoize (ashimema) 2024-07-14 06:41:20 UTC
Created attachment 168950 [details] [review]
Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.
Comment 2 Martin Renvoize (ashimema) 2024-07-14 06:42:08 UTC
We'll likely want to also enforce this in the API controller level.. or perhaps at the koha object level.
Comment 3 Martin Renvoize (ashimema) 2024-07-15 10:08:44 UTC
Created attachment 168964 [details] [review]
Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.
Comment 4 Martin Renvoize (ashimema) 2024-07-15 10:08:47 UTC
Created attachment 168965 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.
Comment 5 Martin Renvoize (ashimema) 2024-07-15 10:20:07 UTC
Created attachment 168966 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.
Comment 6 Martin Renvoize (ashimema) 2024-07-15 10:20:09 UTC
Created attachment 168967 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.
Comment 7 Martin Renvoize (ashimema) 2024-07-15 15:42:33 UTC
Created attachment 169008 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.
Comment 8 Martin Renvoize (ashimema) 2024-07-15 15:42:35 UTC
Created attachment 169009 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.
Comment 9 Thibaud Guillot (thibaud_g) 2024-07-18 08:06:13 UTC
I would test it today but there is just a little conflict with a fresh main branch in koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js
Comment 10 Martin Renvoize (ashimema) 2024-07-25 16:12:14 UTC
Created attachment 169590 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.
Comment 11 Martin Renvoize (ashimema) 2024-07-25 16:12:17 UTC
Created attachment 169591 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.
Comment 12 Martin Renvoize (ashimema) 2024-07-25 16:14:37 UTC
Rebased and ready for testing again.
Comment 13 Martin Renvoize (ashimema) 2024-07-26 08:05:20 UTC
Created attachment 169685 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.
Comment 14 Martin Renvoize (ashimema) 2024-07-26 08:05:24 UTC
Created attachment 169686 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.
Comment 15 Sam Lau 2024-07-26 18:14:42 UTC
In testing I noticed that if you don't select an item and just leave it to the 'Any item' selection you can select whatever booking dates. Is the expected behavior? If so I can sign-off.
Comment 16 Paul Derscheid 2024-08-05 14:18:40 UTC
Created attachment 170066 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 17 Paul Derscheid 2024-08-05 14:18:43 UTC
Created attachment 170067 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 18 Martin Renvoize (ashimema) 2024-08-22 10:15:45 UTC
(In reply to Sam Lau from comment #15)
> In testing I noticed that if you don't select an item and just leave it to
> the 'Any item' selection you can select whatever booking dates. Is the
> expected behaviour? If so I can sign-off.

I'm afraid I couldn't replicate this.. maybe I've fixed it already inadvertently in the work I've continued on during bug 34440.
Comment 19 Martin Renvoize (ashimema) 2024-10-17 14:52:08 UTC
Created attachment 172890 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 20 Martin Renvoize (ashimema) 2024-10-17 14:52:10 UTC
Created attachment 172891 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 21 Martin Renvoize (ashimema) 2024-10-17 14:52:41 UTC
Just another rebase
Comment 22 Martin Renvoize (ashimema) 2024-10-22 12:55:36 UTC
Created attachment 173137 [details] [review]
Bug 37354: Fix circ rule selections

Only expose the bookings calendar picker input if we have enough detail
already defined to pick the corresponding circulation rules.

We currently use the item pickup location for selecting which rules to
apply, this corresponds to hard coding CircControl=ItemHomeLibrary +
ItemHomeOrHolding=holdingbranch for this use case. We can't easily
change this to match those rules dynamically without rethinking the 'Any
item' functionality and displays in the flatpickr.  We may revisit this
at some point in the future should that become a requirement.
Comment 23 Martin Renvoize (ashimema) 2024-10-23 12:10:21 UTC
Created attachment 173210 [details] [review]
Bug 37354: (QA follow-up) Reset periodPicker on rule change

This patch clears the periodPicker values when the applied circulation
rules change. This prevents selection of one booking period against one
set of rules and then a change of item to an itemtype where different
rules should apply but the old selected period remaining and thus 'rule
breaking' being allowed.
Comment 24 Nick Clemens (kidclamp) 2024-10-29 12:11:05 UTC
Created attachment 173620 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 25 Nick Clemens (kidclamp) 2024-10-29 12:11:08 UTC
Created attachment 173621 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 26 Nick Clemens (kidclamp) 2024-10-29 12:11:10 UTC
Created attachment 173622 [details] [review]
Bug 37354: Fix circ rule selections

Only expose the bookings calendar picker input if we have enough detail
already defined to pick the corresponding circulation rules.

We currently use the item pickup location for selecting which rules to
apply, this corresponds to hard coding CircControl=ItemHomeLibrary +
ItemHomeOrHolding=holdingbranch for this use case. We can't easily
change this to match those rules dynamically without rethinking the 'Any
item' functionality and displays in the flatpickr.  We may revisit this
at some point in the future should that become a requirement.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 27 Nick Clemens (kidclamp) 2024-10-29 12:11:13 UTC
Created attachment 173623 [details] [review]
Bug 37354: (QA follow-up) Reset periodPicker on rule change

This patch clears the periodPicker values when the applied circulation
rules change. This prevents selection of one booking period against one
set of rules and then a change of item to an itemtype where different
rules should apply but the old selected period remaining and thus 'rule
breaking' being allowed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 28 Katrin Fischer 2024-11-08 13:29:55 UTC
I am sorry, but I found a glitch:

What I did:

* Made item bookable on item level: http://localhost:8081/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=114&itemnumber=236#item236
* Itemtype is not bookable.
* Update all - all - all circulation rule to: 1 day loan period, 5 renewals of 1 day renewal period.
* Try to book it for Henry, pickup in Fairview, item type Books
* Select a start date, the dates after the calculated end date are greyed out.
* Realize you want a different date. Remove the current dates using X next to field to clear.
* Click on calendar: dates are still locked.
* Close booking modal, reopen: dates are still locked.
Comment 29 Martin Renvoize (ashimema) 2024-11-08 15:29:09 UTC
Created attachment 174275 [details] [review]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)

This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.

Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
   'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
   location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 30 Martin Renvoize (ashimema) 2024-11-08 15:29:12 UTC
Created attachment 174276 [details] [review]
Bug 37354: Add visual hint at usual loan periods

This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.

We use bold to highlight such dates.

Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
   become bold, the date a 'Loan period' after the start date will also
   be bold and you'll also have bold dates for the number of 'Renewals
   allowed' at each 'Renewal period' beyond the initial 'Loan period'
   date.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 31 Martin Renvoize (ashimema) 2024-11-08 15:29:16 UTC
Created attachment 174277 [details] [review]
Bug 37354: Fix circ rule selections

Only expose the bookings calendar picker input if we have enough detail
already defined to pick the corresponding circulation rules.

We currently use the item pickup location for selecting which rules to
apply, this corresponds to hard coding CircControl=ItemHomeLibrary +
ItemHomeOrHolding=holdingbranch for this use case. We can't easily
change this to match those rules dynamically without rethinking the 'Any
item' functionality and displays in the flatpickr.  We may revisit this
at some point in the future should that become a requirement.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 32 Martin Renvoize (ashimema) 2024-11-08 15:29:19 UTC
Created attachment 174278 [details] [review]
Bug 37354: (QA follow-up) Reset periodPicker on rule change

This patch clears the periodPicker values when the applied circulation
rules change. This prevents selection of one booking period against one
set of rules and then a change of item to an itemtype where different
rules should apply but the old selected period remaining and thus 'rule
breaking' being allowed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 33 Martin Renvoize (ashimema) 2024-11-08 15:29:22 UTC
Created attachment 174279 [details] [review]
Bug 37354: (QA follow-up) Reset state on clear

We were missing a reset for flatPickr state when using the clear option
for flatPickr.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 34 Katrin Fischer 2024-11-08 16:06:46 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 35 Lucas Gass (lukeg) 2024-11-22 21:46:15 UTC
Enhancement, no 24.05.x backport.
Comment 36 Aude Charillon 2025-01-31 16:31:44 UTC
Included in the Koha Manual.