src-db/database/model/functions/M_INOUT_POST.xml
changeset 21220 237a498f9e4d
parent 21201 e81e664209d1
child 21243 e636887f6f83
child 21256 3f15c3810c05
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Mon Sep 30 17:25:31 2013 +0530
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Mon Sep 30 15:36:45 2013 +0200
@@ -47,7 +47,6 @@
   v_Message VARCHAR2(2000):='';
   v_Message_aux VARCHAR2(2000):='';
   v_Record_ID VARCHAR2(32);
-  v_DocStatus VARCHAR2(60);
   v_User VARCHAR2(32);
   v_PUser VARCHAR2(32);
   v_is_included NUMBER:=0;
@@ -603,25 +602,12 @@
               -- stocked product
               IF(Cur_InOutLine.M_Product_ID IS NOT NULL AND v_IsStocked=1) THEN
                 -- Update OrderLine (if C-, Qty is negative)
-                SELECT DOCSTATUS into v_DocStatus
-                FROM C_ORDER
-                WHERE C_ORDER_ID = (SELECT C_ORDER_ID
-                                    FROM C_ORDERLINE 
-                                    WHERE C_ORDERLINE_ID=Cur_InOutLine.C_OrderLine_ID);
-                IF (v_DocStatus = 'DR') THEN
-                  UPDATE C_ORDERLINE
-                    SET QtyDelivered=QtyDelivered + v_QtySO,
-                    Updated=now(),
-                    UpdatedBy=v_User
-                  WHERE C_OrderLine_ID=Cur_InOutLine.C_OrderLine_ID;
-                ELSE 
-                  UPDATE C_ORDERLINE
-                    SET QtyReserved=QtyReserved - v_QtyPO - v_QtySO,
-                    QtyDelivered=QtyDelivered + v_QtySO,
-                    Updated=now(),
-                    UpdatedBy=v_User
-                   WHERE C_OrderLine_ID=Cur_InOutLine.C_OrderLine_ID;
-                END IF;
+                UPDATE C_ORDERLINE
+                  SET QtyReserved=QtyReserved - v_QtyPO - v_QtySO,
+                  QtyDelivered=QtyDelivered + v_QtySO,
+                  Updated=now(),
+                  UpdatedBy=v_User
+                WHERE C_OrderLine_ID=Cur_InOutLine.C_OrderLine_ID;
                 -- Products not stocked
               ELSE
                 -- Update OrderLine (if C-, Qty is negative)