[Costing]Implement void internal consumptions.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Tue, 14 Feb 2012 15:32:27 +0100
changeset 17023 ca2426da7a03
parent 17022 265d1663c9ff
child 17024 7d2cb0c0dce2
[Costing]Implement void internal consumptions.
src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST.xml
src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml
src-db/database/model/tables/M_INTERNAL_CONSUMPTION.xml
src-db/database/model/tables/M_INTERNAL_CONSUMPTIONLINE.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
--- a/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -16,147 +16,13 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2010 Openbravo SLU
+* All portions are Copyright (C) 2001-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-  -- Logistice
-  v_ResultStr VARCHAR2(2000):='';
-  v_Message VARCHAR2(2000):='';
-  Record_ID VARCHAR2(32);
-  v_Result NUMBER:=1;
-  -- Parameter
-  TYPE RECORD IS REF CURSOR;
-  Cur_Parameter RECORD;
-
-  -- Parameter Variables
-  v_IsProcessing CHAR(1) ;
-  v_IsProcessed VARCHAR2(60) ;
-  v_MoveDate DATE;
-  v_Client_ID VARCHAR2(32) ;
-  v_Org_ID VARCHAR2(32);
-  v_User VARCHAR2(32);
-  v_line NUMBER;
-  v_Count NUMBER:=0;
 BEGIN
   --  Update AD_PInstance
-  DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || PInstance_ID) ;
-  v_ResultStr:='PInstanceNotFound';
-  AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'Y', NULL, NULL) ;
-  BEGIN --BODY
-    -- Get Parameters
-    v_ResultStr:='ReadingParameters';
-    FOR Cur_Parameter IN (
-        SELECT i.Record_ID, i.AD_User_ID, p.ParameterName,
-            p.P_String, p.P_Number, p.P_Date
-        FROM AD_PInstance i
-               LEFT JOIN AD_PInstance_Para p ON i.AD_PInstance_ID=p.AD_PInstance_ID
-        WHERE i.AD_PInstance_ID=PInstance_ID
-        ORDER BY p.SeqNo
-     ) LOOP
-      Record_ID := Cur_Parameter.Record_ID;
-      v_User := Cur_Parameter.AD_User_ID;
-    END LOOP; -- Get Parameter
-    DBMS_OUTPUT.PUT_LINE('  Record_ID=' || Record_ID) ;
-    -- Reading Internal_Consumption
-    SELECT MovementDate, Processing, Processed, AD_Client_ID, AD_Org_ID
-      INTO v_MoveDate, v_IsProcessing, v_IsProcessed, v_Client_ID, v_Org_ID
-    FROM M_Internal_Consumption
-    WHERE M_Internal_Consumption_ID=Record_ID  FOR UPDATE;
-    IF (v_IsProcessing = 'Y') THEN
-      RAISE_APPLICATION_ERROR(-20000, '@OtherProcessActive@') ;
-    END IF;
-    IF (v_IsProcessed = 'Y') THEN
-      RAISE_APPLICATION_ERROR(-20000, '@AlreadyPosted@') ;
-    END IF;
-
-    v_ResultStr:='CheckingRestrictions';
-    SELECT COUNT(*), MAX(line)
-      INTO v_Count, v_line
-    FROM M_Internal_ConsumptionLine M, M_Product P
-    WHERE M.M_PRODUCT_ID=P.M_PRODUCT_ID
-      AND P.M_ATTRIBUTESET_ID IS NOT NULL
-      AND (P.ATTRSETVALUETYPE IS NULL OR P.ATTRSETVALUETYPE <> 'F')
-      AND (SELECT ISONEATTRSETVALREQUIRED FROM M_ATTRIBUTESET WHERE M_ATTRIBUTESET_ID = P.M_ATTRIBUTESET_ID) = 'Y'
-      AND COALESCE(M.M_ATTRIBUTESETINSTANCE_ID, '0') = '0'
-      AND M.M_Internal_Consumption_ID=Record_ID;
-    IF (v_Count <> 0) THEN
-     RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@') ;
-    END IF;
-    -- Start Processing ------------------------------------------------------
-    v_ResultStr:='LockingInternal_Consumption';
-    UPDATE M_Internal_Consumption
-    SET Processing = 'Y',
-        Updated = now(),
-        UpdatedBy = v_User
-    WHERE M_Internal_Consumption_ID = Record_ID;
-    /**
-    * Accounting first step
-    */
-    DECLARE
-      Cur_MoveLine RECORD;
-    BEGIN --FOR COMMIT
-      FOR Cur_MoveLine IN (
-          SELECT *
-          FROM M_Internal_ConsumptionLine
-          WHERE M_Internal_Consumption_ID=Record_ID
-          ORDER BY Line
-      ) LOOP
-        v_ResultStr:='Transaction for line' || Cur_MoveLine.Line;
-
-        INSERT INTO M_Transaction (
-            M_Transaction_ID, AD_Client_ID, AD_Org_ID, IsActive,
-            Created, CreatedBy, Updated, UpdatedBy,
-            MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,
-            MovementDate, MovementQty, M_Internal_ConsumptionLine_ID, M_Product_UOM_ID,
-            QuantityOrder, C_UOM_ID
-        ) VALUES (
-            get_uuid(), Cur_MoveLine.AD_Client_ID, Cur_MoveLine.AD_Org_ID, 'Y',
-            now(), v_User, now(), v_User,
-            'D-', Cur_MoveLine.M_Locator_ID, Cur_MoveLine.M_Product_ID, COALESCE(Cur_MoveLine.M_AttributeSetInstance_ID, '0'),
-            v_MoveDate, (Cur_MoveLine.MovementQty * -1), Cur_MoveLine.M_Internal_ConsumptionLine_ID, Cur_MoveLine.M_Product_UOM_ID,
-            (Cur_MoveLine.QuantityOrder * -1), Cur_MoveLine.C_UOM_ID
-        );
-        M_Check_Stock(Cur_MoveLine.M_Product_ID, v_Client_ID, v_Org_ID, v_Result, v_Message) ;
-        IF (v_Result = 0) THEN
-          RAISE_APPLICATION_ERROR(-20000, v_Message||' '||'@line@'||' '||Cur_MoveLine.line) ;
-        END IF;
-      END LOOP;
-    END;--FOR  COMMIT
-    -- End Processing --------------------------------------------------------
-    --<<END_PROCESS>>
-    v_ResultStr:='ProcessingMovement';
-    UPDATE M_Internal_Consumption
-    SET Processed = 'Y',
-        Updated = now(),
-        UpdatedBy = v_User
-    WHERE M_Internal_Consumption_ID = Record_ID;
-
-    v_ResultStr := 'UnLockingMovement';
-    --<<END_PROCESSING>>
-    UPDATE M_Internal_Consumption
-    SET Processing = 'N',
-        Updated = now(),
-        UpdatedBy = v_User
-    WHERE M_Internal_Consumption_ID = Record_ID;
-    --  Update AD_PInstance
-    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
-    AD_UPDATE_PINSTANCE(PInstance_ID, v_User, 'N', v_Result, v_Message) ;
-    RETURN;
-  END; --BODY
-EXCEPTION
-WHEN OTHERS THEN
-  v_ResultStr:= '@ERROR=' || SQLERRM;
-  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
-  ROLLBACK;
-  UPDATE M_Internal_Consumption
-  SET Processing = 'N',
-      Updated = now(),
-      UpdatedBy = v_User
-  WHERE M_Internal_Consumption_ID=Record_ID;
-  -- Commented by cromero 19102006 COMMIT;
-  AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
-  RETURN;
+  M_INTERNAL_CONSUMPTION_POST1(pinstance_id, NULL, NULL);
 END M_INTERNAL_CONSUMPTION_POST
 ]]></body>
     </function>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -0,0 +1,244 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_INTERNAL_CONSUMPTION_POST1">
+    <function name="M_INTERNAL_CONSUMPTION_POST1" type="NULL">
+      <parameter name="pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_internal_cosumption_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_action" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2012 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  -- Logistice
+  v_ResultStr VARCHAR2(2000):='';
+  v_Message VARCHAR2(2000):='';
+  Record_ID VARCHAR2(32);
+  v_Result NUMBER:=1;
+  -- Parameter
+  TYPE RECORD IS REF CURSOR;
+  Cur_Parameter RECORD;
+
+  -- Parameter Variables
+  v_IsProcessing CHAR(1) ;
+  v_IsProcessed VARCHAR2(60) ;
+  v_MoveDate DATE;
+  v_Client_ID VARCHAR2(32) ;
+  v_Org_ID VARCHAR2(32);
+  v_User VARCHAR2(32);
+  v_line NUMBER;
+  v_Count NUMBER:=0;
+  v_action VARCHAR2(60):='CO';
+  v_status M_Internal_Consumption.status%TYPE;
+  v_name M_Internal_Consumption.name%TYPE;
+BEGIN
+  --  Update AD_PInstance
+  IF (pinstance_id IS NOT NULL) THEN
+    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || PInstance_ID) ;
+    v_ResultStr:='PInstanceNotFound';
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'Y', NULL, NULL) ;
+  END IF;
+BEGIN --BODY
+  -- Get Parameters
+  IF (pinstance_id IS NOT NULL) THEN
+    v_ResultStr:='ReadingParameters';
+    FOR Cur_Parameter IN (
+      SELECT i.Record_ID, i.AD_User_ID, p.ParameterName,
+          p.P_String, p.P_Number, p.P_Date
+      FROM AD_PInstance i
+             LEFT JOIN AD_PInstance_Para p ON i.AD_PInstance_ID=p.AD_PInstance_ID
+      WHERE i.AD_PInstance_ID=PInstance_ID
+      ORDER BY p.SeqNo
+    ) LOOP
+      IF (upper(cur_parameter.parametername) LIKE 'ACTION') THEN
+        v_action := cur_parameter.p_string;
+      END IF;
+      Record_ID := Cur_Parameter.Record_ID;
+      v_User := Cur_Parameter.AD_User_ID;
+    END LOOP; -- Get Parameter
+  ELSE
+    record_id := p_internal_cosumption_id;
+    v_action := p_action;
+  END IF;
+  DBMS_OUTPUT.PUT_LINE('  Record_ID=' || Record_ID) ;
+  -- Reading Internal_Consumption
+  SELECT MovementDate, Processing, Processed, AD_Client_ID,
+         AD_Org_ID, COALESCE(v_user, updatedby), status, name
+    INTO v_MoveDate, v_IsProcessing, v_IsProcessed, v_Client_ID,
+         v_Org_ID, v_user, v_status, v_name
+  FROM M_Internal_Consumption
+  WHERE M_Internal_Consumption_ID=Record_ID  FOR UPDATE;
+  IF (v_IsProcessing = 'Y') THEN
+    RAISE_APPLICATION_ERROR(-20000, '@OtherProcessActive@') ;
+  END IF;
+  IF (v_IsProcessed = 'Y' AND v_action <> 'VO') THEN
+    RAISE_APPLICATION_ERROR(-20000, '@AlreadyPosted@') ;
+  END IF;
+
+  v_ResultStr:='CheckingRestrictions';
+  SELECT COUNT(*), MAX(line)
+    INTO v_Count, v_line
+  FROM M_Internal_ConsumptionLine M, M_Product P
+  WHERE M.M_PRODUCT_ID=P.M_PRODUCT_ID
+    AND P.M_ATTRIBUTESET_ID IS NOT NULL
+    AND (P.ATTRSETVALUETYPE IS NULL OR P.ATTRSETVALUETYPE <> 'F')
+    AND (SELECT ISONEATTRSETVALREQUIRED FROM M_ATTRIBUTESET WHERE M_ATTRIBUTESET_ID = P.M_ATTRIBUTESET_ID) = 'Y'
+    AND COALESCE(M.M_ATTRIBUTESETINSTANCE_ID, '0') = '0'
+    AND M.M_Internal_Consumption_ID=Record_ID;
+  IF (v_Count <> 0) THEN
+    RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@') ;
+  END IF;
+  -- Start Processing ------------------------------------------------------
+  v_ResultStr:='LockingInternal_Consumption';
+  UPDATE M_Internal_Consumption
+  SET Processing = 'Y',
+      Updated = now(),
+      UpdatedBy = v_User
+  WHERE M_Internal_Consumption_ID = Record_ID;
+  IF (v_action IN ('CO')) THEN
+    /**
+    * Complete action: Create records on m_transaction and update status
+    */
+    DECLARE
+      Cur_MoveLine RECORD;
+    BEGIN
+      FOR Cur_MoveLine IN (
+          SELECT *
+          FROM M_Internal_ConsumptionLine
+          WHERE M_Internal_Consumption_ID=Record_ID
+          ORDER BY Line
+      ) LOOP
+        v_ResultStr:='Transaction for line' || Cur_MoveLine.Line;
+
+        INSERT INTO M_Transaction (
+            M_Transaction_ID, AD_Client_ID, AD_Org_ID, IsActive,
+            Created, CreatedBy, Updated, UpdatedBy,
+            MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,
+            MovementDate, MovementQty, M_Internal_ConsumptionLine_ID, M_Product_UOM_ID,
+            QuantityOrder, C_UOM_ID
+        ) VALUES (
+            get_uuid(), Cur_MoveLine.AD_Client_ID, Cur_MoveLine.AD_Org_ID, 'Y',
+            now(), v_User, now(), v_User,
+            'D-', Cur_MoveLine.M_Locator_ID, Cur_MoveLine.M_Product_ID, COALESCE(Cur_MoveLine.M_AttributeSetInstance_ID, '0'),
+            v_MoveDate, (Cur_MoveLine.MovementQty * -1), Cur_MoveLine.M_Internal_ConsumptionLine_ID, Cur_MoveLine.M_Product_UOM_ID,
+            (Cur_MoveLine.QuantityOrder * -1), Cur_MoveLine.C_UOM_ID
+        );
+        M_Check_Stock(Cur_MoveLine.M_Product_ID, v_Client_ID, v_Org_ID, v_Result, v_Message) ;
+        IF (v_Result = 0) THEN
+          RAISE_APPLICATION_ERROR(-20000, v_Message||' '||'@line@'||' '||Cur_MoveLine.line) ;
+        END IF;
+      END LOOP;
+      v_ResultStr:='ProcessingMovement';
+      UPDATE M_Internal_Consumption
+      SET Processed = 'Y',
+          Status = 'CO',
+          Updated = now(),
+          UpdatedBy = v_User
+      WHERE M_Internal_Consumption_ID = Record_ID;
+
+    END;
+  ELSIF (v_action IN ('VO')) THEN
+    /*
+    * Void Internal consumption.
+    *
+    * Create a new internal consumption negating the quantities and post it.
+    */
+    DECLARE
+      v_voidintconsumption_id VARCHAR2(32);
+      cur_intcons_line RECORD;
+    BEGIN
+      -- Checks
+      IF (v_status <> 'CO') THEN
+        RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+      END IF;
+      v_voidintconsumption_id := get_uuid();
+      -- Create void internal consumption.
+      INSERT INTO m_internal_consumption (
+          m_internal_consumption_id, ad_client_id, ad_org_id, isactive,
+          created, createdby, updated, updatedby,
+          name, movementdate
+      ) VALUES (
+          v_voidintconsumption_id, v_client_id, v_org_id, 'Y',
+          now(), v_user, now(), v_user,
+          'VO: '|| v_name, now()
+      );
+      
+      INSERT INTO m_internal_consumptionline (
+        m_internal_consumptionline_id, ad_client_id, ad_org_id, isactive,
+        created, createdby, updated, updatedby,
+        m_internal_consumption_id, line, m_locator_id,
+        m_product_id, m_attributesetinstance_id,
+        movementqty, c_uom_id, m_product_uom_id, quantityorder,
+        description, void_intconsumption_line_id
+      ) 
+      SELECT get_uuid(), ad_client_id, ad_org_id, isactive,
+          now(), v_user, now(), v_user,
+          v_voidintconsumption_id, line, m_locator_id,
+          m_product_id, m_attributesetinstance_id,
+          movementqty * -1, c_uom_id, m_product_uom_id, quantityorder * -1,
+          description, m_internal_consumptionline_id
+      FROM m_internal_consumptionline
+      WHERE m_internal_consumption_id = record_id;
+      
+      --Update void
+      UPDATE m_internal_consumption
+      SET status = 'VO',
+          updated = now(),
+          updatedby = v_user
+      WHERE m_internal_consumption_id = record_id;
+      -- post reveral internal consumption
+      M_INTERNAL_CONSUMPTION_POST1(NULL, v_voidintconsumption_id, 'CO');
+      -- update reversal internal consumption
+      UPDATE m_internal_consumption
+      SET status = 'VO',
+          updated = now(),
+          updatedby = v_user
+      WHERE m_internal_consumption_id = v_voidintconsumption_id;
+
+    END;
+  END IF;
+   v_ResultStr := 'UnLockingMovement';
+  --<<END_PROCESSING>>
+  UPDATE M_Internal_Consumption
+  SET Processing = 'N',
+      Updated = now(),
+      UpdatedBy = v_User
+  WHERE M_Internal_Consumption_ID = Record_ID;
+  --  Update AD_PInstance
+  DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
+  IF (pinstance_id IS NOT NULL) THEN
+    AD_UPDATE_PINSTANCE(PInstance_ID, v_User, 'N', v_Result, v_Message) ;
+  END IF;
+  RETURN;
+END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+  v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  IF (pinstance_id IS NOT NULL) THEN
+    ROLLBACK;
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  ELSE
+    RAISE;
+  END IF;
+  RETURN;
+END M_INTERNAL_CONSUMPTION_POST1
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/tables/M_INTERNAL_CONSUMPTION.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/model/tables/M_INTERNAL_CONSUMPTION.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -57,6 +57,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="STATUS" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[DR]]></default>
+        <onCreateDefault><![CDATA[CASE PROCESSED WHEN 'N' THEN 'DR' ELSE 'CO' END]]></onCreateDefault>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="AD_CLIENT_MINTERNALCONSUMPTION">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_INTERNAL_CONSUMPTIONLINE.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/model/tables/M_INTERNAL_CONSUMPTIONLINE.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -73,6 +73,13 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="VOID_INTCONSUMPTION_LINE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="M_INTERNAL_CONSUMPTIONLINE" name="M_INTCONSUMPTIONLINE_VOIDLINE">
+        <reference local="VOID_INTCONSUMPTION_LINE_ID" foreign="M_INTERNAL_CONSUMPTIONLINE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="M_INTERNAL_CONSUMPTIONLINE_AD_">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -275327,6 +275327,75 @@
 <!--B8A72B85E1134BEE8EACB1375DD6056F-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--B8A72B85E1134BEE8EACB1375DD6056F--></AD_COLUMN>
 
+<!--B8DC0F5F97E0FED0E040007F010035F6--><AD_COLUMN>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_COLUMN_ID><![CDATA[B8DC0F5F97E0FED0E040007F010035F6]]></AD_COLUMN_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <NAME><![CDATA[Alert Status]]></NAME>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <DESCRIPTION><![CDATA[Identifies the Status of the document]]></DESCRIPTION>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <HELP><![CDATA[Identifies the Status of the document]]></HELP>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <COLUMNNAME><![CDATA[Status]]></COLUMNNAME>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_TABLE_ID><![CDATA[800168]]></AD_TABLE_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_REFERENCE_VALUE_ID><![CDATA[A575717E83C24F7392511B7CC18B9D3C]]></AD_REFERENCE_VALUE_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <DEFAULTVALUE><![CDATA[DR]]></DEFAULTVALUE>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <SEQNO><![CDATA[150]]></SEQNO>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_ELEMENT_ID><![CDATA[6393DB0FCE8A4528A39135C54581DD88]]></AD_ELEMENT_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <POSITION><![CDATA[15]]></POSITION>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--B8DC0F5F97E0FED0E040007F010035F6-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--B8DC0F5F97E0FED0E040007F010035F6--></AD_COLUMN>
+
+<!--B8DC61A55A925645E040007F01003845--><AD_COLUMN>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_COLUMN_ID><![CDATA[B8DC61A55A925645E040007F01003845]]></AD_COLUMN_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8DC61A55A925645E040007F01003845-->  <NAME><![CDATA[Voided Internal Consumption Line]]></NAME>
+<!--B8DC61A55A925645E040007F01003845-->  <COLUMNNAME><![CDATA[Void_Intconsumption_Line_ID]]></COLUMNNAME>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_TABLE_ID><![CDATA[800169]]></AD_TABLE_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_REFERENCE_VALUE_ID><![CDATA[180774E575694F81B753B3DD46316E0E]]></AD_REFERENCE_VALUE_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--B8DC61A55A925645E040007F01003845-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--B8DC61A55A925645E040007F01003845-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--B8DC61A55A925645E040007F01003845-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--B8DC61A55A925645E040007F01003845-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--B8DC61A55A925645E040007F01003845-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--B8DC61A55A925645E040007F01003845-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--B8DC61A55A925645E040007F01003845-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--B8DC61A55A925645E040007F01003845-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B8DC61A55A925645E040007F01003845-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_ELEMENT_ID><![CDATA[B8DC6189A12B1226E040007F010036E2]]></AD_ELEMENT_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--B8DC61A55A925645E040007F01003845-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--B8DC61A55A925645E040007F01003845-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--B8DC61A55A925645E040007F01003845-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--B8DC61A55A925645E040007F01003845-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B8DC61A55A925645E040007F01003845-->  <POSITION><![CDATA[19]]></POSITION>
+<!--B8DC61A55A925645E040007F01003845-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--B8DC61A55A925645E040007F01003845-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--B8DC61A55A925645E040007F01003845-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--B8DC61A55A925645E040007F01003845-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--B8DC61A55A925645E040007F01003845--></AD_COLUMN>
+
 <!--B9336FB7C2B0400EB495358FAB55E17F--><AD_COLUMN>
 <!--B9336FB7C2B0400EB495358FAB55E17F-->  <AD_COLUMN_ID><![CDATA[B9336FB7C2B0400EB495358FAB55E17F]]></AD_COLUMN_ID>
 <!--B9336FB7C2B0400EB495358FAB55E17F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -24075,6 +24075,20 @@
 <!--63874B9705CB4B1F829ED815A16A46B3-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--63874B9705CB4B1F829ED815A16A46B3--></AD_ELEMENT>
 
+<!--6393DB0FCE8A4528A39135C54581DD88--><AD_ELEMENT>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <AD_ELEMENT_ID><![CDATA[6393DB0FCE8A4528A39135C54581DD88]]></AD_ELEMENT_ID>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <COLUMNNAME><![CDATA[Status]]></COLUMNNAME>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <NAME><![CDATA[Status]]></NAME>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <PRINTNAME><![CDATA[Status]]></PRINTNAME>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <DESCRIPTION><![CDATA[Identifies the Status of the document]]></DESCRIPTION>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <HELP><![CDATA[Identifies the Status of the document]]></HELP>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6393DB0FCE8A4528A39135C54581DD88-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--6393DB0FCE8A4528A39135C54581DD88--></AD_ELEMENT>
+
 <!--64F7ED4E80D511DD9EAB7F0741E062E6--><AD_ELEMENT>
 <!--64F7ED4E80D511DD9EAB7F0741E062E6-->  <AD_ELEMENT_ID><![CDATA[64F7ED4E80D511DD9EAB7F0741E062E6]]></AD_ELEMENT_ID>
 <!--64F7ED4E80D511DD9EAB7F0741E062E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -27962,6 +27976,18 @@
 <!--B80DC62676AE85DEE040007F01002BCA-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--B80DC62676AE85DEE040007F01002BCA--></AD_ELEMENT>
 
+<!--B8DC6189A12B1226E040007F010036E2--><AD_ELEMENT>
+<!--B8DC6189A12B1226E040007F010036E2-->  <AD_ELEMENT_ID><![CDATA[B8DC6189A12B1226E040007F010036E2]]></AD_ELEMENT_ID>
+<!--B8DC6189A12B1226E040007F010036E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8DC6189A12B1226E040007F010036E2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8DC6189A12B1226E040007F010036E2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8DC6189A12B1226E040007F010036E2-->  <COLUMNNAME><![CDATA[Void_Intconsumption_Line_ID]]></COLUMNNAME>
+<!--B8DC6189A12B1226E040007F010036E2-->  <NAME><![CDATA[Voided Internal Consumption Line]]></NAME>
+<!--B8DC6189A12B1226E040007F010036E2-->  <PRINTNAME><![CDATA[Voided Internal Consumption Line]]></PRINTNAME>
+<!--B8DC6189A12B1226E040007F010036E2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B8DC6189A12B1226E040007F010036E2-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--B8DC6189A12B1226E040007F010036E2--></AD_ELEMENT>
+
 <!--B99E543EAE5B4F97A3B7B5EEF28E5249--><AD_ELEMENT>
 <!--B99E543EAE5B4F97A3B7B5EEF28E5249-->  <AD_ELEMENT_ID><![CDATA[B99E543EAE5B4F97A3B7B5EEF28E5249]]></AD_ELEMENT_ID>
 <!--B99E543EAE5B4F97A3B7B5EEF28E5249-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -130630,7 +130630,7 @@
 <!--803071-->  <AD_TAB_ID><![CDATA[800202]]></AD_TAB_ID>
 <!--803071-->  <AD_COLUMN_ID><![CDATA[802761]]></AD_COLUMN_ID>
 <!--803071-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--803071-->  <DISPLAYLOGIC><![CDATA[@Processed@='N']]></DISPLAYLOGIC>
+<!--803071-->  <DISPLAYLOGIC><![CDATA[@Status@!'VO']]></DISPLAYLOGIC>
 <!--803071-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--803071-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--803071-->  <SEQNO><![CDATA[40]]></SEQNO>
@@ -207671,7 +207671,7 @@
 <!--B80D58B1D0ABE472E040007F01002116-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--B80D58B1D0ABE472E040007F01002116-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--B80D58B1D0ABE472E040007F01002116-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--B80D58B1D0ABE472E040007F01002116-->  <NAME><![CDATA[M_Costing_Algorithm_ID]]></NAME>
+<!--B80D58B1D0ABE472E040007F01002116-->  <NAME><![CDATA[Costing Algorithm]]></NAME>
 <!--B80D58B1D0ABE472E040007F01002116-->  <HELP><![CDATA[Identifies a Costing Algorithm]]></HELP>
 <!--B80D58B1D0ABE472E040007F01002116-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--B80D58B1D0ABE472E040007F01002116-->  <AD_TAB_ID><![CDATA[AC5EA97A85F14F28B417421F69963FDF]]></AD_TAB_ID>
@@ -208106,6 +208106,58 @@
 <!--B8CD44FF19E3491DB14C0383FFF23428-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--B8CD44FF19E3491DB14C0383FFF23428--></AD_FIELD>
 
+<!--B8DC6189A1311226E040007F010036E2--><AD_FIELD>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_FIELD_ID><![CDATA[B8DC6189A1311226E040007F010036E2]]></AD_FIELD_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8DC6189A1311226E040007F010036E2-->  <NAME><![CDATA[Status]]></NAME>
+<!--B8DC6189A1311226E040007F010036E2-->  <DESCRIPTION><![CDATA[Identifies the Status of the document]]></DESCRIPTION>
+<!--B8DC6189A1311226E040007F010036E2-->  <HELP><![CDATA[Identifies the Status of the document]]></HELP>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_TAB_ID><![CDATA[800202]]></AD_TAB_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_COLUMN_ID><![CDATA[B8DC0F5F97E0FED0E040007F010035F6]]></AD_COLUMN_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--B8DC6189A1311226E040007F010036E2-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B8DC6189A1311226E040007F010036E2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B8DC6189A1311226E040007F010036E2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B8DC6189A1311226E040007F010036E2-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--B8DC6189A1311226E040007F010036E2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B8DC6189A1311226E040007F010036E2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B8DC6189A1311226E040007F010036E2-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
+<!--B8DC6189A1311226E040007F010036E2--></AD_FIELD>
+
+<!--B8DC6189A1321226E040007F010036E2--><AD_FIELD>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_FIELD_ID><![CDATA[B8DC6189A1321226E040007F010036E2]]></AD_FIELD_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8DC6189A1321226E040007F010036E2-->  <NAME><![CDATA[Voided Internal Consumption Line]]></NAME>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_TAB_ID><![CDATA[800203]]></AD_TAB_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_COLUMN_ID><![CDATA[B8DC61A55A925645E040007F01003845]]></AD_COLUMN_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B8DC6189A1321226E040007F010036E2-->  <DISPLAYLOGIC><![CDATA[@Status@='VO']]></DISPLAYLOGIC>
+<!--B8DC6189A1321226E040007F010036E2-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--B8DC6189A1321226E040007F010036E2-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B8DC6189A1321226E040007F010036E2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B8DC6189A1321226E040007F010036E2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B8DC6189A1321226E040007F010036E2-->  <GRID_SEQNO><![CDATA[95]]></GRID_SEQNO>
+<!--B8DC6189A1321226E040007F010036E2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B8DC6189A1321226E040007F010036E2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B8DC6189A1321226E040007F010036E2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--B8DC6189A1321226E040007F010036E2--></AD_FIELD>
+
 <!--B8F69120A805422E8FC1B1D254B6B424--><AD_FIELD>
 <!--B8F69120A805422E8FC1B1D254B6B424-->  <AD_FIELD_ID><![CDATA[B8F69120A805422E8FC1B1D254B6B424]]></AD_FIELD_ID>
 <!--B8F69120A805422E8FC1B1D254B6B424-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -4370,6 +4370,27 @@
 <!--DD67C43EBCE14230AC3F04A2904231EB-->  <AD_ELEMENT_ID><![CDATA[1002100005]]></AD_ELEMENT_ID>
 <!--DD67C43EBCE14230AC3F04A2904231EB--></AD_PROCESS_PARA>
 
+<!--DEFA8930096D44C789B2F29FAEF6FDF4--><AD_PROCESS_PARA>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_PROCESS_PARA_ID><![CDATA[DEFA8930096D44C789B2F29FAEF6FDF4]]></AD_PROCESS_PARA_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <NAME><![CDATA[Action]]></NAME>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <DESCRIPTION><![CDATA[A drop down list box indicating the next step to take.]]></DESCRIPTION>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <HELP><![CDATA[The Action field indicates the Action to be performed for this element.]]></HELP>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_PROCESS_ID><![CDATA[800131]]></AD_PROCESS_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_REFERENCE_VALUE_ID><![CDATA[657B89EF105149F2B011CF8F5034FF92]]></AD_REFERENCE_VALUE_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_VAL_RULE_ID><![CDATA[C5A7AABB91A440EBAA53A0222B99FF2F]]></AD_VAL_RULE_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <COLUMNNAME><![CDATA[action]]></COLUMNNAME>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
+<!--DEFA8930096D44C789B2F29FAEF6FDF4--></AD_PROCESS_PARA>
+
 <!--F6C130E3B2DD4414A162FC6BA4F2808E--><AD_PROCESS_PARA>
 <!--F6C130E3B2DD4414A162FC6BA4F2808E-->  <AD_PROCESS_PARA_ID><![CDATA[F6C130E3B2DD4414A162FC6BA4F2808E]]></AD_PROCESS_PARA_ID>
 <!--F6C130E3B2DD4414A162FC6BA4F2808E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -4209,6 +4209,18 @@
 <!--1722C8B5D1BC4B349332167C3E3A4561-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--1722C8B5D1BC4B349332167C3E3A4561--></AD_REFERENCE>
 
+<!--180774E575694F81B753B3DD46316E0E--><AD_REFERENCE>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_REFERENCE_ID><![CDATA[180774E575694F81B753B3DD46316E0E]]></AD_REFERENCE_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--180774E575694F81B753B3DD46316E0E-->  <NAME><![CDATA[M_Internal_Consumption_Line]]></NAME>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--180774E575694F81B753B3DD46316E0E-->  <PARENTREFERENCE_ID><![CDATA[18]]></PARENTREFERENCE_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--180774E575694F81B753B3DD46316E0E--></AD_REFERENCE>
+
 <!--1CC9902786384893A551465428468C2A--><AD_REFERENCE>
 <!--1CC9902786384893A551465428468C2A-->  <AD_REFERENCE_ID><![CDATA[1CC9902786384893A551465428468C2A]]></AD_REFERENCE_ID>
 <!--1CC9902786384893A551465428468C2A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -4584,6 +4596,18 @@
 <!--65447418FD4D428CA025AC9AF26ADA21-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--65447418FD4D428CA025AC9AF26ADA21--></AD_REFERENCE>
 
+<!--657B89EF105149F2B011CF8F5034FF92--><AD_REFERENCE>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <AD_REFERENCE_ID><![CDATA[657B89EF105149F2B011CF8F5034FF92]]></AD_REFERENCE_ID>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <NAME><![CDATA[M_Internal_Consumption actions]]></NAME>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--657B89EF105149F2B011CF8F5034FF92-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--657B89EF105149F2B011CF8F5034FF92--></AD_REFERENCE>
+
 <!--665CE68BB382425BB43057256767B5DE--><AD_REFERENCE>
 <!--665CE68BB382425BB43057256767B5DE-->  <AD_REFERENCE_ID><![CDATA[665CE68BB382425BB43057256767B5DE]]></AD_REFERENCE_ID>
 <!--665CE68BB382425BB43057256767B5DE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -4828,6 +4852,18 @@
 <!--A26BA480E2014707B47257024C3CBFF7-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--A26BA480E2014707B47257024C3CBFF7--></AD_REFERENCE>
 
+<!--A575717E83C24F7392511B7CC18B9D3C--><AD_REFERENCE>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <AD_REFERENCE_ID><![CDATA[A575717E83C24F7392511B7CC18B9D3C]]></AD_REFERENCE_ID>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <NAME><![CDATA[M_Internal_Consumption Status]]></NAME>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--A575717E83C24F7392511B7CC18B9D3C-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--A575717E83C24F7392511B7CC18B9D3C--></AD_REFERENCE>
+
 <!--A6BDFA712FF948CE903C4C463E832FC1--><AD_REFERENCE>
 <!--A6BDFA712FF948CE903C4C463E832FC1-->  <AD_REFERENCE_ID><![CDATA[A6BDFA712FF948CE903C4C463E832FC1]]></AD_REFERENCE_ID>
 <!--A6BDFA712FF948CE903C4C463E832FC1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -8490,6 +8490,18 @@
 <!--3D1A6BA090B648449E74A41C15C44305-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3D1A6BA090B648449E74A41C15C44305--></AD_REF_LIST>
 
+<!--3D4C02EB56AA4380AF128782BDA72C3D--><AD_REF_LIST>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <AD_REF_LIST_ID><![CDATA[3D4C02EB56AA4380AF128782BDA72C3D]]></AD_REF_LIST_ID>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <VALUE><![CDATA[CO]]></VALUE>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <NAME><![CDATA[Complete]]></NAME>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <AD_REFERENCE_ID><![CDATA[657B89EF105149F2B011CF8F5034FF92]]></AD_REFERENCE_ID>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3D4C02EB56AA4380AF128782BDA72C3D-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--3D4C02EB56AA4380AF128782BDA72C3D--></AD_REF_LIST>
+
 <!--3E6F1F271AE44931BE140ECECE5C86A2--><AD_REF_LIST>
 <!--3E6F1F271AE44931BE140ECECE5C86A2-->  <AD_REF_LIST_ID><![CDATA[3E6F1F271AE44931BE140ECECE5C86A2]]></AD_REF_LIST_ID>
 <!--3E6F1F271AE44931BE140ECECE5C86A2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -8838,6 +8850,18 @@
 <!--58C82EFABC4743808AD3F7AAD6CCE6A2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--58C82EFABC4743808AD3F7AAD6CCE6A2--></AD_REF_LIST>
 
+<!--5E713D14D7504EE1BC0815590955BDFA--><AD_REF_LIST>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <AD_REF_LIST_ID><![CDATA[5E713D14D7504EE1BC0815590955BDFA]]></AD_REF_LIST_ID>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <VALUE><![CDATA[VO]]></VALUE>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <NAME><![CDATA[Void]]></NAME>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <AD_REFERENCE_ID><![CDATA[657B89EF105149F2B011CF8F5034FF92]]></AD_REFERENCE_ID>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5E713D14D7504EE1BC0815590955BDFA-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--5E713D14D7504EE1BC0815590955BDFA--></AD_REF_LIST>
+
 <!--61898FC4926F43F2A02BFCD3AF73870A--><AD_REF_LIST>
 <!--61898FC4926F43F2A02BFCD3AF73870A-->  <AD_REF_LIST_ID><![CDATA[61898FC4926F43F2A02BFCD3AF73870A]]></AD_REF_LIST_ID>
 <!--61898FC4926F43F2A02BFCD3AF73870A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -8985,6 +9009,18 @@
 <!--6968D8669BBA4F839D4015ACC4A61F68-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--6968D8669BBA4F839D4015ACC4A61F68--></AD_REF_LIST>
 
+<!--6FAB6C5F138E4314B32DD534A569F2B0--><AD_REF_LIST>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <AD_REF_LIST_ID><![CDATA[6FAB6C5F138E4314B32DD534A569F2B0]]></AD_REF_LIST_ID>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <VALUE><![CDATA[VO]]></VALUE>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <NAME><![CDATA[Voided]]></NAME>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <AD_REFERENCE_ID><![CDATA[A575717E83C24F7392511B7CC18B9D3C]]></AD_REFERENCE_ID>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6FAB6C5F138E4314B32DD534A569F2B0-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--6FAB6C5F138E4314B32DD534A569F2B0--></AD_REF_LIST>
+
 <!--71E0CA678ADC422F9B709BDE923470E0--><AD_REF_LIST>
 <!--71E0CA678ADC422F9B709BDE923470E0-->  <AD_REF_LIST_ID><![CDATA[71E0CA678ADC422F9B709BDE923470E0]]></AD_REF_LIST_ID>
 <!--71E0CA678ADC422F9B709BDE923470E0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -9358,6 +9394,18 @@
 <!--8CB6F661867449A0AF967F27B2F04ABD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8CB6F661867449A0AF967F27B2F04ABD--></AD_REF_LIST>
 
+<!--8DD7A5A2D5F547DC85B87D09F1875997--><AD_REF_LIST>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <AD_REF_LIST_ID><![CDATA[8DD7A5A2D5F547DC85B87D09F1875997]]></AD_REF_LIST_ID>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <VALUE><![CDATA[CO]]></VALUE>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <NAME><![CDATA[Completed]]></NAME>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <AD_REFERENCE_ID><![CDATA[A575717E83C24F7392511B7CC18B9D3C]]></AD_REFERENCE_ID>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8DD7A5A2D5F547DC85B87D09F1875997-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--8DD7A5A2D5F547DC85B87D09F1875997--></AD_REF_LIST>
+
 <!--8DD863CADC734203914EFC5AAFEF0BDA--><AD_REF_LIST>
 <!--8DD863CADC734203914EFC5AAFEF0BDA-->  <AD_REF_LIST_ID><![CDATA[8DD863CADC734203914EFC5AAFEF0BDA]]></AD_REF_LIST_ID>
 <!--8DD863CADC734203914EFC5AAFEF0BDA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -9610,6 +9658,18 @@
 <!--9D453B94D05B4C719DDD896DE80C8B5A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9D453B94D05B4C719DDD896DE80C8B5A--></AD_REF_LIST>
 
+<!--9E62AD3C959646F5ADA430E17844EDC6--><AD_REF_LIST>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <AD_REF_LIST_ID><![CDATA[9E62AD3C959646F5ADA430E17844EDC6]]></AD_REF_LIST_ID>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <VALUE><![CDATA[DR]]></VALUE>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <NAME><![CDATA[Draft]]></NAME>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <AD_REFERENCE_ID><![CDATA[A575717E83C24F7392511B7CC18B9D3C]]></AD_REFERENCE_ID>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9E62AD3C959646F5ADA430E17844EDC6-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--9E62AD3C959646F5ADA430E17844EDC6--></AD_REF_LIST>
+
 <!--A27B7159B661436A9A6C282BAFA4EA62--><AD_REF_LIST>
 <!--A27B7159B661436A9A6C282BAFA4EA62-->  <AD_REF_LIST_ID><![CDATA[A27B7159B661436A9A6C282BAFA4EA62]]></AD_REF_LIST_ID>
 <!--A27B7159B661436A9A6C282BAFA4EA62-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_TABLE.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_REF_TABLE.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -1096,6 +1096,17 @@
 <!--01F377BC3C0743E7868F81C20D062AA8-->  <WHERECLAUSE><![CDATA[FIN_Payment_Schedule.C_Invoice_ID is not null]]></WHERECLAUSE>
 <!--01F377BC3C0743E7868F81C20D062AA8--></AD_REF_TABLE>
 
+<!--180774E575694F81B753B3DD46316E0E--><AD_REF_TABLE>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_REFERENCE_ID><![CDATA[180774E575694F81B753B3DD46316E0E]]></AD_REFERENCE_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_TABLE_ID><![CDATA[800169]]></AD_TABLE_ID>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_KEY><![CDATA[802762]]></AD_KEY>
+<!--180774E575694F81B753B3DD46316E0E-->  <AD_DISPLAY><![CDATA[802772]]></AD_DISPLAY>
+<!--180774E575694F81B753B3DD46316E0E-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--180774E575694F81B753B3DD46316E0E--></AD_REF_TABLE>
+
 <!--1CC9902786384893A551465428468C2A--><AD_REF_TABLE>
 <!--1CC9902786384893A551465428468C2A-->  <AD_REFERENCE_ID><![CDATA[1CC9902786384893A551465428468C2A]]></AD_REFERENCE_ID>
 <!--1CC9902786384893A551465428468C2A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml	Mon Feb 13 17:30:46 2012 +0100
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml	Tue Feb 14 15:32:27 2012 +0100
@@ -1646,6 +1646,17 @@
 <!--C48E4CAE3C2A4C5DBC2E011D8AD2C428-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C48E4CAE3C2A4C5DBC2E011D8AD2C428--></AD_VAL_RULE>
 
+<!--C5A7AABB91A440EBAA53A0222B99FF2F--><AD_VAL_RULE>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <AD_VAL_RULE_ID><![CDATA[C5A7AABB91A440EBAA53A0222B99FF2F]]></AD_VAL_RULE_ID>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <NAME><![CDATA[M_Internal_Consumption valid actions]]></NAME>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <TYPE><![CDATA[S]]></TYPE>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <CODE><![CDATA[((@Status@ = 'DR' AND AD_Ref_List.value='CO') OR (@Status@ = 'CO' AND AD_Ref_List.value IN ('VO')))]]></CODE>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C5A7AABB91A440EBAA53A0222B99FF2F--></AD_VAL_RULE>
+
 <!--C9A72C5855CB4E29AFEB5DC17A5A9177--><AD_VAL_RULE>
 <!--C9A72C5855CB4E29AFEB5DC17A5A9177-->  <AD_VAL_RULE_ID><![CDATA[C9A72C5855CB4E29AFEB5DC17A5A9177]]></AD_VAL_RULE_ID>
 <!--C9A72C5855CB4E29AFEB5DC17A5A9177-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>