Koha-clms/admin
Martin Renvoize c7673a9d6a
Bug 41898: Introduce 'issued' status and update booking display/filtering
Implements a 4-state booking lifecycle: new → issued (on checkout) →
completed (on return), plus cancelled at any point.

Backend changes:
- AddIssue sets booking status to 'issued' (was incorrectly 'completed')
- AddReturn transitions 'issued' → 'completed' via booking_id on the issue
- filter_by_active updated to status-based: status IN ('new', 'issued');
  previously it filtered by date range — active/inactive now reflect booking
  lifecycle rather than the current date relative to start/end dates
- _is_final_status_transition reverted to only skip clash detection for
  terminal statuses 'cancelled' and 'completed'; 'issued' is active and does
  not bypass clash detection
- GET /api/v1/bookings no longer pre-filters to active bookings server-side;
  callers must supply an explicit status filter if they need active-only

Display changes:
- Patron bookings tab: replaces the date-based expired/active toggle with
  per-status filters (completed, cancelled) using the AdditionalFilters
  framework; active bookings (new/issued) are shown by default
- Biblio bookings list: same status-based filters; removes the date-based
  expired filter that was still present
- Status column is always visible on both views (was previously hidden on
  the patron tab unless expired bookings were shown)
- Status badges: new=bg-success, issued=bg-info, completed/cancelled=bg-secondary
- Timeline isActive check corrected to ['new','issued']
- patron-detail-tabs.inc: rename expired_bookings_count → closed_bookings_count
  to reflect status-based (not date-based) counting
- Filter button colour fixed to use $link-color so both views are consistent

Test plan:
1. Enable the EnableBookings system preference.
2. Create a biblio with at least one bookable item.
3. Place a booking for a patron via the biblio's Bookings tab.
   - The booking should appear with status badge "New" (green).
4. Check out the booked item to that patron (Circulation → Check out).
   - Reload the Bookings tab; the booking should now show "Issued" (blue).
5. Return the item (Circulation → Check in).
   - Reload the Bookings tab; the booking should now show "Completed" (grey).
6. Place a second booking and cancel it from the Bookings tab Actions menu.
   - The booking should show "Cancelled" (grey), with the reason if provided.
7. On the biblio Bookings tab:
   - Completed and cancelled bookings are hidden by default.
   - Clicking "Include completed" shows completed bookings.
   - Clicking "Include cancelled" shows cancelled bookings.
   - Both can be toggled independently.
   - The Status column is always visible.
8. Navigate to the patron's detail page → Bookings tab.
   - Active bookings (new/issued) are shown by default.
   - Completed and cancelled can be toggled independently using the same
     filter buttons.
   - The Status column is always visible.
9. Confirm via the REST API that GET /api/v1/bookings (no filters) returns
   bookings of all statuses, not just active ones.

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-07-27 15:53:33 +00:00
..
searchengine/elasticsearch Bug 42156: Add a stdno index for authid 2026-04-23 09:25:03 -06:00
additional-fields.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
admin-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
adveditorshortcuts.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
aqbudgetperiods.pl Bug 42764: Fix spelling errors across the codebase 2026-06-03 16:09:04 +00:00
aqbudgets.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
aqcontract.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
aqplan.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
audio_alerts.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
auth_subfields_structure.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
auth_tag_structure.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
authorised_values.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
authtypes.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
background_jobs.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
biblio_framework.pl Bug 32773: Add ability to set biblio_framework.is_fast_add 2026-05-08 16:05:35 -06:00
branch_transfer_limits.pl Bug 41131: Don't allow limiting transfers from/to a single branch 2026-02-26 09:04:19 -07:00
branches.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cash_registers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
categories.pl Bug 26355: (follow-up) Fix handling of extended attributes 2026-05-01 09:30:04 -06:00
check_budget_parent.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_parent_total.pl Bug 42764: Fix spelling errors across the codebase 2026-06-03 16:09:04 +00:00
checkmarc.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cities.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
classsources.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
clone-rules.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
columns_settings.pl Bug 40680: Fix admin/columns_settings.pl 2025-12-01 08:33:58 -07:00
columns_settings.yml Bug 41898: Introduce 'issued' status and update booking display/filtering 2026-07-27 15:53:33 +00:00
credit_types.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
curbside_pickup.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
currency.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
debit_types.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
desks.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
didyoumean.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
edi_accounts.pl Bug 20253: Optionally use buyer's purchase order number from EDIFACT quote as basket name 2025-11-03 14:13:37 -07:00
edi_ean_accounts.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
file_transports.pl Bug 41798: Fix FTP passive mode not saving and add display indicator 2026-02-10 10:51:21 -07:00
float_limits.pl Bug 28530: (QA follow-up) Use DBIC in controller 2026-02-10 10:51:41 -07:00
identity_providers.pl Bug 37711: Domains CRUD update 2025-11-05 07:12:32 -07:00
ill_batch_statuses.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
import_export_authtype.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
import_export_framework.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
item_circulation_alerts.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
items_search_field.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
items_search_fields.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
itemtypes.pl Bug 38136: Refactor database translations (alternative) 2026-04-15 11:37:14 -06:00
koha2marclinks.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
library_groups.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
localization.pl Bug 38136: Refactor database translations (alternative) 2026-04-15 11:37:14 -06:00
marc-overlay-rules.pl Bug 35380: (QA follow-up) Minor code quality fixes 2026-03-26 09:50:53 +01:00
marc_order_accounts.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
marc_subfields_structure.pl Bug 38384: (follow-up) move require Koha::Plugins to use 2026-02-25 07:37:00 -07:00
marctagstructure.pl Bug 39825: Add a direct link to items tag in MARC bibliographic framework page 2025-11-03 14:13:43 -07:00
matching-rules.pl Bug 40680: Fix admin/matching-rules.pl 2025-12-01 08:33:58 -07:00
oai_servers.pl Bug 41043: Use op 'add_form' and 'edit_form' in oai servers 2026-02-06 15:17:11 -07:00
oai_set_mappings.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
oai_sets.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
overdrive.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
patron-attr-types.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
preferences.pl Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
record_sources.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
restrictions.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
search_filters.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
share_content.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
smart-rules.pl Bug 41267: Add fill_other_biblio_holds_policy circulation rule 2026-04-09 08:27:26 -06:00
sms_providers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
smtp_servers.pl Bug 29587: Test mail option in SMTP servers 2026-06-15 15:24:04 +00:00
sru_modmapping.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
systempreferences.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
transfer_limits.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
transport-cost-matrix.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
usage_statistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950servers.pl Bug 40841: Add limits configuration UI 2026-03-26 14:21:28 +01:00