https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41129

--- Comment #75 from Paul Derscheid <[email protected]> ---
Created attachment 203654
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203654&action=edit
Bug 41129: Allow assigned unbookable items when editing bookings

An item or its effective item type can become unbookable after the item has
been assigned to a booking. The availability endpoint then rejects the item,
and updating the booking can report a false capacity clash.

Allow the assigned item only when excluded_booking_id identifies its booking.
Include that item in the capacity calculation, but exclude bookings and
checkouts for items outside the resulting item pool. Return a 400 response when
an update has a genuine booking clash.

Test plan:
1. Create a booking assigned to a specific item.
2. Make the item unbookable and edit the booking.
3. Verify that the assigned item remains selected and its availability request
   succeeds.
4. Change the booking period and select Update.
5. Verify that the existing booking is updated and no duplicate is created.
6. Repeat the test after making the item's effective item type unbookable.
7. Verify that another unbookable item cannot be selected for the booking.
8. Create a conflicting booking for the assigned item and verify that the
update
   is rejected as a booking clash.
9. Run:
   `prove -v t/db_dependent/Koha/Biblio.t
   t/db_dependent/Koha/Biblio/Availability/Booking.t
   t/db_dependent/api/v1/biblios.t
   t/db_dependent/api/v1/bookings.t`

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Assisted-by: GPT 5.6 (OpenAI)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to