From d7c6497d575ece5c1b7fbb9a5615efe7ad64702f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 31 Jul 2020 10:21:27 +0200 Subject: [PATCH] Bug 21811: Add JS confirmation when receiving - at least 1 item to receive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When receiving, the "receive items" form should not be submitted if no items are going to be received Test plan: Create an order, close the basket, receive some items On the "receive items" form, do not select item (if items are created when placing the order) and submit the form => You must get a JS alert that prevent the form to be submitted Select at least one item, submit again => Now it's submitted Signed-off-by: Séverine QUEUNE --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 4dac82a..578a08a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -429,6 +429,11 @@ }; [% END %] + if( $("#quantity").val() < 1 ) { + alert(_("You must receive at least one item")); + return false; + } + return true; } -- 2.1.4