From 987f30277785ed27157875dadf17c883b16c4815 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 24 Jul 2026 11:27:00 +0200 Subject: [PATCH] Bug 42997: (QA follow-up) Keep on-site checkouts due at the end of the day circulation.pl still replaced the due date of an on-site checkout of a booked item with the booking end date: with SpecifyDueDate disabled the end-of-today due date computed for on-site checkouts was clobbered, and with it enabled the same happened whenever staff left the due date field empty. An on-site loan could therefore be due back days after the on-site session. - never stretch an on-site checkout to the booking end date; the due date behaves exactly as for a non-booked on-site checkout and AddIssue shrinks the booking end_date to the actual due date instead Test plan: 1. Enable OnSiteCheckouts, disable SpecifyDueDate 2. Book an item for a patron starting today 3. Check the item out to them with 'On-site checkout' ticked 4. Without this patch the checkout is due at the booking end date; with it the checkout is due at the end of today and the booking end date follows it 5. Repeat with SpecifyDueDate enabled and the due date field left empty; the due date follows the circulation rules instead of the booking end date Signed-off-by: Paul Derscheid Signed-off-by: Pedro Amorim --- circ/circulation.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index dbae2b9b7a..445fc6a693 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -584,9 +584,12 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { # 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 + # the booking end_date with the override where possible. On-site + # checkouts are due back the same day and must never stretch to the + # booking end date; AddIssue shrinks the booking to match instead if ( my $booked = $needsconfirmation->{BOOKED_EARLY} // $alerts->{BOOKED} ) { - $datedue = $booked->end_date unless ( $duedatespec_allow && $duedatespec ); + $datedue = $booked->end_date + unless ( ( $duedatespec_allow && $duedatespec ) || $onsite_checkout ); } # If renewing an item on hold, use renewonholdduedate (similar to renew.pl)