Bugzilla – Attachment 183743 Details for
Bug 40296
Bookings that are checked out do not have status updated to completed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40296: Mark booking as completed when issuing to booking patron
Bug-40296-Mark-booking-as-completed-when-issuing-t.patch (text/plain), 2.44 KB, created by
Martin Renvoize (ashimema)
on 2025-07-03 10:55:32 UTC
(
hide
)
Description:
Bug 40296: Mark booking as completed when issuing to booking patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-07-03 10:55:32 UTC
Size:
2.44 KB
patch
obsolete
>From 6412b90bf9fd2c8b38ad1352f1722dd18ba66430 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 2 Jul 2025 20:17:39 +0000 >Subject: [PATCH] Bug 40296: Mark booking as completed when issuing to booking > patron > >This patch adds logic to automatically mark a patron's booking as >'completed' when they check out the item they have booked. > >When AddIssue is called, the system now: >- Checks if there's a conflicting booking for the checkout period >- Marks the booking status as 'completed' if found > >This ensures booking status accurately reflects when items are >actually checked out to fulfill bookings. > >Test plan: >1. Enable bookings system preference >2. Create a bookable item (set bookable = 1 in items table or via item editor) >3. Create a booking for a patron for that item with start date = today, > end date = 7 days from now >4. Go to circulation and check out the item to the same patron who made > the booking >5. Check the booking status in the database or via the bookings interface >6. Verify the booking status has changed from 'new' to 'completed' >7. Confirm the checkout was successful and shows normally in patron's > checkouts list > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > C4/Circulation.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index bf93c32a590..60c8c209acc 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1766,6 +1766,17 @@ sub AddIssue { > # In the case that the borrower has an on-site checkout > # and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout > $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } ); >+ >+ #if this checkout is a booking mark it as completed >+ if ( >+ my $booking = $item_object->find_booking( >+ { checkout_date => $issuedate, due_date => $datedue, patron_id => $patron->borrowernumber } >+ ) >+ ) >+ { >+ $booking->status('completed')->store; >+ } >+ > if ($issue) { > $issue->set($issue_attributes)->store; > } else { >@@ -1783,6 +1794,7 @@ sub AddIssue { > ); > } > $issue->discard_changes; >+ > $patron->update_lastseen('check_out'); > if ( $item_object->location > && $item_object->location eq 'CART' >-- >2.50.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40296
:
183717
| 183743 |
183744
|
183745