Bugzilla – Attachment 179416 Details for
Bug 39270
Some bookable items cannot be booked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39270: Check to make sure checkouts are not already booked
Bug-39270-Check-to-make-sure-checkouts-are-not-alr.patch (text/plain), 2.76 KB, created by
Martin Renvoize (ashimema)
on 2025-03-17 16:25:25 UTC
(
hide
)
Description:
Bug 39270: Check to make sure checkouts are not already booked
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-17 16:25:25 UTC
Size:
2.76 KB
patch
obsolete
>From 0ba09b008a000b14b86a56413722adae558b9ba7 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 7 Mar 2025 00:02:30 +0000 >Subject: [PATCH] Bug 39270: Check to make sure checkouts are not already > booked > >To test: > >1. Find an item that is bookable, I turned on Bookable at the item type level for BK. I am using biblionumber=28 in k-t-d with 3 items >2. Book item with barcode ( 39999000001297 ). I did March 7 - April 1 >3. Book item with barcode ( 39999000001259 ). I did March 7 - April 1 >4. Now checkout 39999000001297 to the patron is was booked to. When asked about early collection say yes. >5. Now item with barcode ( 39999000001273 ) is not checked out or booked. It should be bookable >6. Try to book it, it is not available till April 2, though it should be available right now. >7. APPLY PATCH >8. Try the bookings again. >9. You should correctly not be able to book 39999000001297 or 39999000001259. >10. You should be able to book 39999000001273. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/js/modals/place_booking.js | 23 +++++++++++-------- > 1 file changed, 14 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >index 3ce9cf0f1de..84330c3960b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >@@ -353,15 +353,20 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > > // Merge current checkouts into bookings > for (checkout of checkouts) { >- let booking = { >- biblio_id: biblionumber, >- booking_id: null, >- end_date: checkout.due_date, >- item_id: checkout.item_id, >- patron_id: checkout.patron_id, >- start_date: new Date().toISOString(), >- }; >- bookings.unshift(booking); >+ let already_booked = bookings.some( >+ b => b.item_id === checkout.item_id >+ ); >+ if (!already_booked) { >+ let booking = { >+ biblio_id: biblionumber, >+ booking_id: null, >+ end_date: checkout.due_date, >+ item_id: checkout.item_id, >+ patron_id: checkout.patron_id, >+ start_date: new Date().toISOString(), >+ }; >+ bookings.unshift(booking); >+ } > } > > // Update flatpickr mode >-- >2.48.1
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 39270
:
179023
| 179416