src-db/database/model/functions/M_RESERVATION_POST.xml
changeset 18745 7dfe05aa19c5
parent 18705 5966a12e0b3c
child 19073 79002a24b20a
--- a/src-db/database/model/functions/M_RESERVATION_POST.xml	Thu Nov 22 17:09:37 2012 +0100
+++ b/src-db/database/model/functions/M_RESERVATION_POST.xml	Thu Nov 22 17:37:04 2012 +0100
@@ -160,7 +160,8 @@
   
         UPDATE c_orderline
         SET so_res_status = CASE WHEN v_quantity = v_reservedqty THEN 'CR'
-                                 ELSE 'PR'
+                                 WHEN v_reservedqty > 0 THEN 'PR'
+                                 ELSE 'NR'
                             END
         WHERE c_orderline_id = v_orderline_id;
   
@@ -179,11 +180,11 @@
                             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';
-      -- ADD RESERVED STOCK
-      M_RESERVE_STOCK_AUTO(v_reservation_id, v_user_id, v_message);
     END;
 
   ELSIF (v_resaction = 'HO') THEN