From ec8897377e4179461b8d0495f1495fccbd0820db 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 --- 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 308d8cc60d..d4aa69dc30 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1040,9 +1040,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