From 9dbc2737e1073794c653cb7b605d6be142d64996 Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Tue, 31 Oct 2023 13:57:00 +0100 Subject: [PATCH] Bug 18885: Specify due date behavior according to on-site checkbox When a on-site checkout is performed a date is automatically added but if you unchecked the date remains. Even with OnSiteCheckoutAutoCheck syspref Test plan: 1) Do an on-site checkout by clicking on checkbox and see date added 2) Unchecked and see that the date remains on input 3) Do another test with OnSiteCheckoutAutoCheck enabled 4) Apply this patch and repeat actions Normally now its works correctly Signed-off-by: tuxayo Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer (cherry picked from commit ec8897377e4179461b8d0495f1495fccbd0820db) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index baddf3dc45..521dbabcaa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1008,9 +1008,11 @@ // On-site checkout function toggle_onsite_checkout(){ + const duedatespec_fp = document.querySelector("#duedatespec")._flatpickr; if ( $("#onsite_checkout").prop('checked') ) { - const duedatespec_fp = document.querySelector("#duedatespec")._flatpickr; duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]"); + } else { + duedatespec_fp.setDate(""); } } -- 2.39.5