Related to Issue 25663: Code review changes
authorPandeeswari Ramakrishnan <pandeeswari.ramakrishnan@openbravo.com>
Tue, 18 Feb 2014 16:48:32 +0530
changeset 22052 70a1852c6c64
parent 22050 c3bb94a4b13f
child 22053 2356d30e0be7
Related to Issue 25663: Code review changes
src-db/database/model/functions/M_INOUT_POST.xml
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Sun Feb 16 14:14:17 2014 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Tue Feb 18 16:48:32 2014 +0530
@@ -68,7 +68,6 @@
     Cur_InOutLine RECORD;
     Cur_Order RECORD;
     Cur_OrderLine RECORD;
-    Cur_InOutAcctDim RECORD;
     Cur_Lines RECORD;
     --
     v_Result NUMBER:=1;
@@ -76,7 +75,6 @@
     v_Warehouse_Org VARCHAR2(32);
     v_AD_Client_ID VARCHAR2(32);
     v_NextNo VARCHAR2(32);
-    v_AcctDim VARCHAR2(32);
     v_Qty NUMBER;
     v_QtyPO NUMBER;
     v_QtySO NUMBER;
@@ -1009,15 +1007,7 @@
               )
               ;
 
-           FOR Cur_InOutAcctDim IN
-            (SELECT *
-            FROM m_inoutline_acctdimension
-            WHERE M_InOutLine_ID=Cur_InOutLine.M_InOutLine_ID
-              AND IsActive='Y'  FOR UPDATE
-            )
-          LOOP
             -- Create InOut acctounting dimension
-            Ad_Sequence_Next('M_InOutLine_Acctdimension', Cur_InOutLine.M_InOutLine_ID, v_AcctDim) ;
             v_ResultStr:='CreateInOutLineAcctDimension';
             INSERT
             INTO M_INOUTLINE_ACCTDIMENSION
@@ -1028,16 +1018,15 @@
                 C_Project_ID, C_Campaign_ID, C_Activity_ID, A_Asset_ID,
                 User1_ID, User2_ID, C_CostCenter_ID
               )
-              VALUES
-              (
-                v_AcctDim, v_NextNo, Cur_InOutAcctDim.Quantity,
-                Cur_InOutAcctDim.AD_Client_ID, Cur_InOutAcctDim.AD_Org_ID, 'Y', now(),
-                v_User, now(), v_User, Cur_InOutAcctDim.M_Product_ID, Cur_InOutAcctDim.C_BPartner_ID,
-                Cur_InOutAcctDim.C_Project_ID, Cur_InOutAcctDim.C_Campaign_ID, Cur_InOutAcctDim.C_Activity_ID , Cur_InOutAcctDim.A_Asset_ID, 
-                Cur_InOutAcctDim.User1_ID, Cur_InOutAcctDim.User2_ID, Cur_InOutAcctDim.C_CostCenter_ID
-              )
-              ;
-            END LOOP;
+              SELECT
+                get_uuid(), v_NextNo, Quantity * -1,
+                AD_Client_ID, AD_Org_ID, 'Y', now(),
+                v_User, now(), v_User, M_Product_ID, C_BPartner_ID,
+                C_Project_ID, C_Campaign_ID, C_Activity_ID , A_Asset_ID,
+                User1_ID, User2_ID, C_CostCenter_ID
+              FROM M_INOUTLINE_ACCTDIMENSION where M_INOUTLINE_ID=Cur_InOutLine.M_INOUTLINE_ID
+              and IsActive = 'Y';
+
             INSERT INTO M_MATCHINV
               (M_MATCHINV_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,
               M_INOUTLINE_ID, C_INVOICELINE_ID, M_PRODUCT_ID, DATETRX, QTY, PROCESSING, PROCESSED, POSTED)