[costAdjs]void shipment or internal consump: the trxs are checked as permanent costs
authorMiguel A. Alsasua <miguel.alsasua@openbravo.com>
Fri, 19 Sep 2014 11:53:32 +0200
changeset 24913 e10ca5e6571f
parent 24912 fa7c2a34e0fc
child 24914 79600686a7af
[costAdjs]void shipment or internal consump: the trxs are checked as permanent costs
src-db/database/model/functions/M_INOUT_POST.xml
src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Fri Sep 19 09:21:59 2014 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Fri Sep 19 11:53:32 2014 +0200
@@ -1130,6 +1130,14 @@
             UpdatedBy=v_User,
             DocStatus='VO' -- the reversal transaction
           WHERE M_InOut_ID=v_RInOut_ID;
+
+          -- transactions related with original inout and with voided inout will be mark as is cost permanent
+          UPDATE M_TRANSACTION TRX
+          SET ISCOSTPERMANENT='Y'
+          WHERE TRX.M_INOUTLINE_ID IN (SELECT M_INOUTLINE_ID 
+                                       FROM M_INOUTLINE
+                                       WHERE (M_INOUT_ID = v_RInOut_ID 
+                                              OR M_INOUT_ID = Cur_InOut.m_inout_id));
         END IF; -- ReverseCorrection
 
         --M_Inout_Post - Finish_Process Extension Point
--- a/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml	Fri Sep 19 09:21:59 2014 +0200
+++ b/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml	Fri Sep 19 11:53:32 2014 +0200
@@ -230,6 +230,13 @@
           updatedby = v_user
       WHERE m_internal_consumption_id = v_voidintconsumption_id;
 
+      -- transactions related with original inout and with voided inout will be mark as is cost permanent
+      UPDATE M_TRANSACTION TRX
+      SET ISCOSTPERMANENT='Y'
+      WHERE TRX.M_INTERNAL_CONSUMPTIONLINE_ID IN (SELECT M_INTERNAL_CONSUMPTIONLINE_ID 
+                                   FROM M_INTERNAL_CONSUMPTIONLINE
+                                   WHERE (M_INTERNAL_CONSUMPTION_ID = record_id
+                                          OR M_INTERNAL_CONSUMPTION_ID =  v_voidintconsumption_id));
     END;
   END IF;
    v_ResultStr := 'UnLockingMovement';