From 4fd674761199c2cce6ffbd0c272ee22f19711c4f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Nov 2023 11:23:34 +0100 Subject: [PATCH] Bug 35273: Fix item selection when receiving For partial receives with items created on order, the aqorders_items table was not correctly updated when only some of the ordered items were received. To test: 1) Create a basket with creating items on order 2) Create an order line with 3 items 3) Close basked 4) Receive shipment and create invoice 5) Receive your created order line 6) Edit first item displayed, add barcode 7) Check checkbox and receive 8) Verify the order line has been split 2:1 9) Receive again - notice all 3 items are showing. We should only see the remaining 2 10) Undo receive 11) Apply patch 12) Repeat steps 5)-9) 13) Verify that in step 9) only the remaining 2 items display now. Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../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 a598ee2ec6..c20f14bf99 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -511,6 +511,11 @@ item._checked = $(tr).find('input[type="checkbox"]').prop('checked'); tr.html(''); _build_item(item, tr); + + var row = $("#order_edit").data('row'); + row.items.forEach((it, i) => { if (it.item_id == itemnumber) { + row.items[i] = item; + }}); } }); } -- 2.39.5