src-db/database/model/functions/M_INOUT_POST.xml
changeset 18683 a3b01ae29b19
parent 18681 ff35907f8977
child 18706 9a3777570122
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Tue Nov 06 12:35:32 2012 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Tue Nov 06 13:00:40 2012 +0100
@@ -370,6 +370,7 @@
                       WHERE c_orderline_id = cur_inoutline.c_orderline_id
                         AND m_locator_id = cur_inoutline.m_locator_id
                         AND m_reservation_id = cur_reserve_stock.m_reservation_id
+                        AND isallocated = 'Y'
                         AND COALESCE(m_attributesetinstance_id, '0') = COALESCE(Cur_InOutLine.M_AttributeSetInstance_ID, '0');
                     -- UPDATE EXISTING PRERESERVED STOCK TO DECREASE RESERVED QTY
                     UPDATE m_reservation_stock
@@ -390,7 +391,7 @@
                         get_uuid(), cur_reserve_stock.ad_client_id, cur_reserve_stock.ad_org_id, 'Y',
                         now(), v_user, now(), v_user,
                         cur_reserve_stock.m_reservation_id, cur_inoutline.m_attributesetinstance_id, cur_inoutline.m_locator_id, cur_inoutline.c_orderline_id,
-                        v_qtyaux, 0, 'N'
+                        v_qtyaux, 0, 'Y'
                       );
                     END IF;
                     v_pendingqty := v_pendingqty - v_qtyaux;