From dbe26fdca3e23272fc2fdaca3dfef255640713ca 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 --- 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 91a77187d5..80059e2099 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -995,9 +995,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.30.2