Bug 36248 - Bookings place on 'any item' always use the first item
Summary: Bookings place on 'any item' always use the first item
Status: RESOLVED DUPLICATE of bug 38175
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 29002
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-06 14:45 UTC by Nick Clemens (kidclamp)
Modified: 2024-10-23 10:25 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function: bookings


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 3 Martin Renvoize (ashimema) 2024-10-23 10:25:37 UTC
The intention was to allow record-level bookings, but the picker logic can't currently handle that so I added the auto-assignment at booking time as a workaround.

We fix the randomisation of item selection in bug 38175 also.. where I add unit tests for the assignment function.

*** This bug has been marked as a duplicate of bug 38175 ***