From af4e458ba3d891ae45e5fca050f6a02f3e231879 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 --- 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 dfc42a6b9e..75900c99b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -930,9 +930,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