This looks a bit over-enthusiastic :-) $ grep -rn '!!A booking exists!!' * koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt:596: <li>!!A booking exists!!</li>
Fixing the message is easy, but I have trouble coming up with a test plan to trigger it in the GUI. The only one I see is: Due for another patron booking by: 01/05/2024 I have tried with a patron without force_checkouts and made sure my attempted loan was within the booking period. I am not sure how to trigger the issuingimpossible case.
Pretty sure this was just debugging left in by mistake.
Created attachment 162973 [details] [review] Bug 35394: Correction to booked items logic This patch fixes the overly extreme message that was designed to appeared when someone tried to check out a booked item to the wrong user. However, the message never appeared due to a logic error within CanBookBeIssued which this patch also resolved. Test plan 1) Make an item bookable 2) Add a booking for the item to patron A from tomorrow 3) In the database, update the booking start_date to today (or wait a day before the next step) 4) Attempt to check the book out to patron B. Note that you are displayed with the new message 'The item is booked for another patron' and you are unable to check the item out.
Created attachment 162979 [details] [review] Bug 35394: Correction to booked items logic This patch fixes the overly extreme message that was designed to appeared when someone tried to check out a booked item to the wrong user. However, the message never appeared due to a logic error within CanBookBeIssued which this patch also resolved. Test plan 1) Make an item bookable 2) Add a booking for the item to patron A from tomorrow 3) In the database, update the booking start_date to today (or wait a day before the next step) 4) Attempt to check the book out to patron B. Note that you are displayed with the new message 'The item is booked for another patron' and you are unable to check the item out. Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. To make an item bookable: 1.1 In the staff interface, go to the details page for a record with items. 1.2 Click on the 'Items' tab. 1.3 For an item, change 'Bookable' to 'Yes' and click on 'Update'. 1.4 Go back to the normal tab for the record. 2. To place a booking - click on the "Place booking" button for a record. 3. SQL to update the booking start date (adjust start_date and booking_id as appropriate): 3.1 Access the database: koha-mysql kohadev 3.2 SQL query: update bookings set start_date="2024-03-08 11:00:00" where booking_id=1;
Created attachment 164998 [details] [review] Bug 35394: Correction to booked items logic This patch fixes the overly extreme message that was designed to appeared when someone tried to check out a booked item to the wrong user. However, the message never appeared due to a logic error within CanBookBeIssued which this patch also resolved. Test plan 1) Make an item bookable 2) Add a booking for the item to patron A from tomorrow 3) In the database, update the booking start_date to today (or wait a day before the next step) 4) Attempt to check the book out to patron B. Note that you are displayed with the new message 'The item is booked for another patron' and you are unable to check the item out. Signed-off-by: David Nind <david@davidnind.com>
Rebased.. this is another one in wide use in production here.
Created attachment 165172 [details] [review] Bug 35394: Correction to booked items logic This patch fixes the overly extreme message that was designed to appeared when someone tried to check out a booked item to the wrong user. However, the message never appeared due to a logic error within CanBookBeIssued which this patch also resolved. Test plan 1) Make an item bookable 2) Add a booking for the item to patron A from tomorrow 3) In the database, update the booking start_date to today (or wait a day before the next step) 4) Attempt to check the book out to patron B. Note that you are displayed with the new message 'The item is booked for another patron' and you are unable to check the item out. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Missing 23.05.x dependencies, no backport.