From 8b9e57fe55cb0f0be6c521dbe436f31d117b457f Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 22 Sep 2023 08:53:23 +0000 Subject: [PATCH] Bug 34880: (follow-up) Make condition more specific To test (applies to both patches): * Add a new basket as 'standing order' and with 'items created in cataloguing' * Create an order line * Receive shipment and create an invoice * Receive your order * Verify: * Quantity ordered: 1 * Quantity received: 1 (pre-filled) * No item form on the right * Confirm * Receive error: Order X: No quantity to receive set. No items will be created. * Verify no receive was processed (received orders remains empty) * Apply patch * Verify receive works as expected Other possible combinations to test: * Standing order, items on receive * Standing order, items on order (no items are created) * Standing order + order from subscription + any item setting (no items are created) * No standing order + items in cataloguing * No standing order + items on receive * No standing order + items on order * No standing oder + order from subscription + all item settings (no items are created) Signed-off-by: Katrin Fischer Signed-off-by: Michaela Sieber Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit e28ea9c4af380cae9b29b56ebe03ab0f244d2c47) Signed-off-by: Fridolin Somers --- .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 5 ++--- 1 file changed, 2 insertions(+), 3 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 2a3fcc5181..f3fd7d3642 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -1093,12 +1093,13 @@ var set_editor = function() { var modal = $("#order_edit"); var row = modal.data('row'); + var effective_create_items = row.basket.create_items || AcqCreateItem; var origrec = $("#order_edit").data('origrec')||{}; if(!origrec.hasOwnProperty(row.order_id)) { origrec[row.order_id] = row.quantity_received; $("#order_edit").data('origrec', origrec); } - if(row.subscription_id || row.basket.standing === true) { + if(row.subscription_id || ( row.basket.standing === true && effective_create_items == 'cataloguing') ) { row.quantity_received = row.quantity; } var keep = $("#order_edit").data('kept'); @@ -1150,8 +1151,6 @@ $("#suggestion_fieldset").hide(); } - var effective_create_items = row.basket.create_items || AcqCreateItem; - // set today if no date_received in row document.querySelector("#datereceived")._flatpickr.setDate(row.date_received||new Date()); -- 2.39.5