Bug 36248

Summary: Bookings place on 'any item' always use the first item
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize <martin.renvoize>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: data-27FC05A3CB97, lisette, marie.hedbom
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 29002    
Bug Blocks:    

Description Nick Clemens (kidclamp) 2024-03-06 14:45:15 UTC
When placing a booking and choosing 'any item' - Koha will use the first item available in a booking period - so multiple placed bookings will stack on this item. While overlapping periods are blocked, it does appear odd to the user, and maximizes the chances of an item not being returned in time.

It would be nice for libraries to force choosing an item, and/or to select the first item with no bookings, or the least bookings, or just to add some variation to the item selected.
Comment 1 jpl 2024-05-21 22:39:50 UTC
It seems that setting the item_id value of the booking (in the bookings) table causes the particular booking to be record level. So far it looks like everything still behaves correctly in terms of avoiding conflicting or overlapping bookings.

So possibly all that's needed might be to simply not set item_id when 'any item' is selected.
Comment 2 jpl 2024-05-21 22:41:00 UTC
(In reply to jpl from comment #1)
> It seems that setting the item_id value of the booking (in the bookings)
> table causes the particular booking to be record level. So far it looks like
> everything still behaves correctly in terms of avoiding conflicting or
> overlapping bookings.
> 
> So possibly all that's needed might be to simply not set item_id when 'any
> item' is selected.

Correction: setting item_id to NULL causes a record level booking.