View | Details | Raw Unified | Return to bug 39270
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js (-10 / +14 lines)
Lines 353-367 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
353
353
354
                // Merge current checkouts into bookings
354
                // Merge current checkouts into bookings
355
                for (checkout of checkouts) {
355
                for (checkout of checkouts) {
356
                    let booking = {
356
                    let already_booked = bookings.some(
357
                        biblio_id: biblionumber,
357
                        b => b.item_id === checkout.item_id
358
                        booking_id: null,
358
                    );
359
                        end_date: checkout.due_date,
359
                    if (!already_booked) {
360
                        item_id: checkout.item_id,
360
                        let booking = {
361
                        patron_id: checkout.patron_id,
361
                            biblio_id: biblionumber,
362
                        start_date: new Date().toISOString(),
362
                            booking_id: null,
363
                    };
363
                            end_date: checkout.due_date,
364
                    bookings.unshift(booking);
364
                            item_id: checkout.item_id,
365
                            patron_id: checkout.patron_id,
366
                            start_date: new Date().toISOString(),
367
                        };
368
                        bookings.unshift(booking);
369
                    }
365
                }
370
                }
366
371
367
                // Update flatpickr mode
372
                // Update flatpickr mode
368
- 

Return to bug 39270