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

--- Comment #4 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 201558
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201558&action=edit
Bug 42790: Add booking-aware Extend action for issued bookings

This patch adds an Extend action to the bookings tables for issued
bookings, visible to users with the circulate permission on both the
patron bookings tab and the biblio bookings page.

The button opens a new modal showing the current booking end date and
the current checkout due date, with a flatpickr date picker that:

* blocks the date ranges of any other new or issued booking for the
  same item
* caps the maximum selectable date at the day before the earliest
  subsequent booking starts

On confirm, the extension is performed as a staff authorised renewal
of the linked checkout - a single call to
POST /api/v1/checkouts/{checkout_id}/renewal with the requested
due_date and the renewal_limit override. The server validates the date
against bookings for the item and keeps booking.end_date in sync with
the renewed due date. Errors (clash with the next booking, renewal
limits with overrides disabled) are displayed inside the modal without
closing it, so staff can pick an earlier date.

The Extend button only renders when the booking has a linked checkout
to renew.

Test plan:
1) Create a booking, check the item out to the patron (booking becomes
   issued) and confirm the Extend button appears on both the patron
   bookings tab and the biblio bookings page
2) Click Extend; confirm the modal shows the current end date and the
   checkout due date
3) Create a subsequent booking for the same item; re-open the modal
   and confirm its dates are blocked in the picker and dates beyond
   its start cannot be selected
4) Select a valid new date and confirm; verify both the booking
   end_date and the checkout due date are updated
5) Confirm the checkout now shows a renewal in its renewal history

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to