src-db/database/model/functions/M_INOUT_POST.xml
changeset 24913 e10ca5e6571f
parent 24291 4e55d4ef021a
child 24928 b27f9251113c
--- 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