Bug 42997: Honour explicit due date overrides for booked items at checkout

When checking out a booked item, circulation.pl unconditionally
replaced the due date with the booking end date, silently discarding
any due date staff had explicitly specified - even after they had just
confirmed the BOOKED_DUE_DATE_CLASH warning saying they wanted it.

The booking end date remains the default when no due date is
specified; an explicit override (with SpecifyDueDate enabled) is now
passed through to AddIssue, which syncs the booking end_date with it
where possible and keeps the original end date when the override would
clash with a subsequent booking (as warned).

Test plan:
1) Create a booking and check the item out without specifying a due
   date; confirm the due date defaults to the booking end date
2) Return the item, book it again, and check out specifying an
   explicit due date; confirm the checkout uses that date and the
   booking end date follows it

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>
This commit is contained in:
Martin Renvoize 2026-07-06 10:28:46 +01:00 committed by Pedro Amorim
parent 50115d8322
commit 11ab3a12f7
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 4 additions and 2 deletions

View File

@ -582,9 +582,11 @@ if ( @$barcodes && $op eq 'cud-checkout' ) {
}
# If booked (alerts or confirmation) update datedue to end of booking
# If booked (alerts or confirmation) update datedue to end of booking,
# unless staff explicitly specified a due date - AddIssue will sync
# the booking end_date with the override where possible
if ( my $booked = $needsconfirmation->{BOOKED_EARLY} // $alerts->{BOOKED} ) {
$datedue = $booked->end_date;
$datedue = $booked->end_date unless ( $duedatespec_allow && $duedatespec );
}
# If renewing an item on hold, use renewonholdduedate (similar to renew.pl)