src-db/database/model/functions/M_RESERVATION_POST.xml
changeset 21157 2e9ce78cf1e3
parent 20972 3f5e8c7117d6
child 24152 bae6b944d95a
--- a/src-db/database/model/functions/M_RESERVATION_POST.xml	Tue Sep 17 15:52:35 2013 +0200
+++ b/src-db/database/model/functions/M_RESERVATION_POST.xml	Wed Sep 18 10:10:40 2013 +0200
@@ -272,8 +272,6 @@
                             END
         WHERE c_order_id = v_sales_order_id;
       END IF;
-      -- ADD RESERVED STOCK
-      M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
 
       v_newstatus := 'CO';
       v_newaction := 'HO';
@@ -401,6 +399,11 @@
       updatedby = v_user_id
   WHERE m_reservation_id = v_reservation_id;
 
+  IF (v_resaction = 'PR') THEN
+    -- ADD RESERVED STOCK
+    M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
+  END IF;
+
   IF (p_pinstance_id IS NOT NULL) THEN
     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
     AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;