From d3d96581e7cb06a9eebc6aed5f14f3ddac0f8e81 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 7 Sep 2023 19:02:08 +0000 Subject: [PATCH] Bug 34736: Don't trigger quantity change on loading order We have a change event to automatically check or uncheck the first items on a list when the value is changed directly. The code is calling this when setting the quantity when loading an order, but this is causing a problem in that we are setting the quantity to load.switch orders and triggering the checkboxes wrongly To test: 1 - Create a new basket, create items on placing the order 2 - Create an order line with 4 items 3 - Create another order line with 2 items 4 - Close the basket 5 - Receive shipment and create an invoice 6 - Select both orders via the checkboxes got multi-receive 7 - Click "receive selected" 8 - Edit first order line, quantity received = 1 (1 out of 4) 9 - Verify that one item is also selected in the table 10 - Switch to "next order" 11 - Quantity received is 0, no items checked in the second order 12 - Switch to "Previous order" 13 - ERROR: Item checkbox was lost, quantity received still correct 14 - Switch to next order 15 - ERROR: item is now checked, quantity received 0 16 - Note: We see a mix up of the information entered, one has the checkbox now, the other the quantity. 17 - Save changes 18 - Click confirm 19 - Continue (complaint about the second order left unchanged) 20 - You are back on the summary: * pending order: quantity changed from 4 to 3 - correct * received order: quantity shows 1 - correct 21 - Click on receive for your updated order line (with 3 items) * 4 items show to be received (should be 3) 22 - Apply patch 23 - Cancel receipt of items 24 - Repeat 1-12 25 - Items are loaded correctly 26 - Try with various checkboxes and switch back and forth 27 - Confirm that manually adjusting quantity received checks the first n boxes 28 - Confirm setting quantity to 0 unchecks the boxes Signed-off-by: Katrin Fischer Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 08858b161c597b329d21815f8ae0d787e71d7e2e) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 32540c9c94..613960cef1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -1173,8 +1173,7 @@ } $("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id); $("#quantity").val( effective_create_items == 'cataloguing' ? row.quantity_received || 1 : row.quantity_received ) - .prop('readonly', !row.subscription_id && effective_create_items == 'receiving') - .change(); + .prop('readonly', !row.subscription_id && effective_create_items == 'receiving'); [% IF only_one_order %] $(".modal-save").prop('disabled', $("#quantity").val() == 0); [% END %] -- 2.39.5