From 615d97d345429417843a2dd32e838075b3e27495 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=utf8 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 Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../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 4dac82afd1..578a08ae65 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.39.5