[Reservations]Implement Reservation Post process.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 18 Oct 2012 10:44:46 +0200
changeset 18649 0cd06065418f
parent 18648 28bd51b48695
child 18650 151688afa57e
[Reservations]Implement Reservation Post process.
src-db/database/model/functions/M_RESERVATION_POST.xml
src-db/database/model/functions/M_RESERVATION_POST0.xml
src-db/database/model/functions/M_RESERVE_POST.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.xml
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_RESERVATION_POST.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -0,0 +1,165 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_RESERVATION_POST">
+    <function name="M_RESERVATION_POST" type="NULL">
+      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_reservation_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_resaction" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_user_id" 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):  ______________________________________.
+************************************************************************/
+  v_ResultStr       VARCHAR2(2000):='';
+  v_Message         VARCHAR2(2000):='';
+  v_reservation_id  VARCHAR2(32);
+  v_user_id         VARCHAR2(32);
+  v_Result          NUMBER:=1; --  Success
+  v_resaction       VARCHAR2(60);
+  v_resstatus       VARCHAR2(60);
+  v_newstatus       VARCHAR2(60);
+  v_newaction       VARCHAR2(60);
+
+TYPE RECORD IS REF CURSOR;
+  Cur_Parameter RECORD;
+
+BEGIN
+  IF (p_PInstance_ID IS NOT NULL) THEN
+    --  Update AD_PInstance
+    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_pinstance_id) ;
+    v_ResultStr:='PInstanceNotFound';
+    AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
+    --  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=p_pinstance_id
+        ORDER BY p.seqno
+    ) LOOP
+      IF (cur_parameter.parametername = 'RES_Action') THEN
+        v_resaction := cur_parameter.p_string;
+      END IF;
+      v_reservation_id := cur_parameter.record_id;
+      v_user_id := cur_parameter.ad_user_id;
+    END LOOP; --  Get Parameter
+    DBMS_OUTPUT.PUT_LINE('  v_Record_ID=' || v_reservation_id) ;
+  ELSE
+    v_reservation_id := p_reservation_id;
+    v_resaction := p_resaction;
+    v_user_id := p_user_id;
+  END IF;
+
+BEGIN
+  SELECT res_status
+    INTO v_resstatus
+  FROM m_reservation
+  WHERE m_reservation_id = v_reservation_id;
+  
+  IF (v_resaction = 'PR') THEN
+  /*
+    Reservation Complete Process
+  */
+    IF (v_resstatus != 'DR') THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+    END IF;
+    v_newstatus := 'CO';
+    v_newaction := 'HO';
+    
+    -- ADD RESERVED STOCK
+    v_message := M_CREATE_RESERVE_STOCK (v_reservation_id, v_user_id);
+
+  ELSIF (v_resaction = 'HO') THEN
+  /*
+    Reservation Hold Process
+  */
+    IF (v_resstatus != 'CO') THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+    END IF;
+    v_newstatus := 'HO';
+    v_newaction := 'UNHO';
+  
+  
+  ELSIF (v_resaction = 'UNHO') THEN
+  /*
+    Reservation Un-Hold Process
+  */
+    IF (v_resstatus != 'HO') THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+    END IF;
+    v_newstatus := 'CO';
+    v_newaction := 'HO';
+
+  ELSIF (v_resaction = 'RE') THEN
+  /*
+    Reservation Reactivate Process
+  */
+    IF (v_resstatus != 'CO') THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+    END IF;
+    v_newstatus := 'DR';
+    v_newaction := 'PR';
+  
+  ELSIF (v_resaction = 'CL') THEN
+  /*
+    Reservation Close Process
+  */
+    IF (v_resstatus != 'CO' AND v_resstatus != 'HO') THEN
+      RAISE_APPLICATION_ERROR(-20000, '@ActionNotSupported@');
+    END IF;
+    v_newstatus := 'CL';
+    v_newaction := 'CL';
+
+  ELSE
+    RAISE_APPLICATION_ERROR(-20000, '@UnsupportedResAction@');
+  END IF;
+
+  UPDATE m_reservation
+  SET res_status = v_newstatus,
+      res_process = v_newaction,
+      updated = now(),
+      updatedby = v_user_id
+  WHERE m_reservation_id = v_reservation_id;
+
+  IF (p_pinstance_id IS NOT NULL) THEN
+    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
+    AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;
+    DBMS_OUTPUT.PUT_LINE('--<<M_Reservation_Post finished>> ' || v_Message) ;
+  END IF;
+  RETURN;
+END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+  v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  IF (p_pinstance_id IS NOT NULL) THEN
+    ROLLBACK;
+    AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', 0, v_ResultStr) ;
+  ELSE
+    RAISE;
+  END IF;
+  RETURN;
+END M_RESERVATION_POST
+]]></body>
+    </function>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_RESERVATION_POST0.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_RESERVATION_POST0">
+    <function name="M_RESERVATION_POST0" type="NULL">
+      <parameter name="p_pinstance_id" 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):  ______________________________________.
+************************************************************************/
+BEGIN
+ M_RESERVATION_POST(p_PInstance_ID, NULL, NULL, NULL);
+END M_RESERVATION_POST0
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/functions/M_RESERVE_POST.xml	Thu Oct 18 10:44:18 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-  <database name="FUNCTION M_RESERVE_POST">
-    <function name="M_RESERVE_POST" type="NULL">
-      <parameter name="p_pinstance_id" 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):  ______________________________________.
-************************************************************************/
-  v_ResultStr VARCHAR2(2000):='';
-  v_Message VARCHAR2(2000):='';
-  v_Record_ID VARCHAR2(32);
-  v_Result NUMBER:=1; --  Success
-
-
-TYPE RECORD IS REF CURSOR;
-  Cur_Parameter RECORD;
-
-BEGIN
-  IF (p_PInstance_ID IS NOT NULL) THEN
-    --  Update AD_PInstance
-    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
-    v_ResultStr:='PInstanceNotFound';
-    AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
-    --  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=p_PInstance_ID
-      ORDER BY p.SeqNo
-      )
-    LOOP
-      v_Record_ID:=Cur_Parameter.Record_ID;
-    END LOOP; --  Get Parameter
-    DBMS_OUTPUT.PUT_LINE('  v_Record_ID=' || v_Record_ID) ;
-  END IF;
-
-END M_RESERVE_POST
-]]></body>
-    </function>
-  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -292032,7 +292032,7 @@
 <!--CC2F971F21803089E040007F01002D7C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--CC2F971F21803089E040007F01002D7C-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
 <!--CC2F971F21803089E040007F01002D7C-->  <AD_ELEMENT_ID><![CDATA[CC2F9E8FD66FD7CDE040007F01002E21]]></AD_ELEMENT_ID>
-<!--CC2F971F21803089E040007F01002D7C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--CC2F971F21803089E040007F01002D7C-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
 <!--CC2F971F21803089E040007F01002D7C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--CC2F971F21803089E040007F01002D7C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CC2F971F21803089E040007F01002D7C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
@@ -292068,6 +292068,7 @@
 <!--CC2F971F21813089E040007F01002D7C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--CC2F971F21813089E040007F01002D7C-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
 <!--CC2F971F21813089E040007F01002D7C-->  <AD_ELEMENT_ID><![CDATA[CC2F9E8FD670D7CDE040007F01002E21]]></AD_ELEMENT_ID>
+<!--CC2F971F21813089E040007F01002D7C-->  <AD_PROCESS_ID><![CDATA[5A2A0AF88AF54BB085DCC52FCC9B17B7]]></AD_PROCESS_ID>
 <!--CC2F971F21813089E040007F01002D7C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--CC2F971F21813089E040007F01002D7C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--CC2F971F21813089E040007F01002D7C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -28715,6 +28715,18 @@
 <!--CC2F9E8FD670D7CDE040007F01002E21-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--CC2F9E8FD670D7CDE040007F01002E21--></AD_ELEMENT>
 
+<!--CC52016D7E7BA603E040007F01000DF9--><AD_ELEMENT>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <AD_ELEMENT_ID><![CDATA[CC52016D7E7BA603E040007F01000DF9]]></AD_ELEMENT_ID>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <COLUMNNAME><![CDATA[RES_Action]]></COLUMNNAME>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <NAME><![CDATA[Process action]]></NAME>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <PRINTNAME><![CDATA[Process action]]></PRINTNAME>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CC52016D7E7BA603E040007F01000DF9-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--CC52016D7E7BA603E040007F01000DF9--></AD_ELEMENT>
+
 <!--CD57A1DBADD440EC9551AE6BC51E8643--><AD_ELEMENT>
 <!--CD57A1DBADD440EC9551AE6BC51E8643-->  <AD_ELEMENT_ID><![CDATA[CD57A1DBADD440EC9551AE6BC51E8643]]></AD_ELEMENT_ID>
 <!--CD57A1DBADD440EC9551AE6BC51E8643-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -232284,8 +232284,7 @@
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--CC2F9E8FD677D7CDE040007F01002E21-->  <NAME><![CDATA[Process]]></NAME>
-<!--CC2F9E8FD677D7CDE040007F01002E21-->  <HELP><![CDATA[Button to process reservation]]></HELP>
+<!--CC2F9E8FD677D7CDE040007F01002E21-->  <NAME><![CDATA[Reservation Process]]></NAME>
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <AD_TAB_ID><![CDATA[D53F675ADB2745059623175D8870A721]]></AD_TAB_ID>
 <!--CC2F9E8FD677D7CDE040007F01002E21-->  <AD_COLUMN_ID><![CDATA[CC2F971F21813089E040007F01002D7C]]></AD_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -5521,6 +5521,26 @@
 <!--58763832F5F3485CAD33B8B9FCD6C640-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--58763832F5F3485CAD33B8B9FCD6C640--></AD_PROCESS>
 
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7--><AD_PROCESS>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <AD_PROCESS_ID><![CDATA[5A2A0AF88AF54BB085DCC52FCC9B17B7]]></AD_PROCESS_ID>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <VALUE><![CDATA[M_Reservation_Post]]></VALUE>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <NAME><![CDATA[Reservation Process]]></NAME>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <PROCEDURENAME><![CDATA[M_Reservation_Post0]]></PROCEDURENAME>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--5A2A0AF88AF54BB085DCC52FCC9B17B7--></AD_PROCESS>
+
 <!--645271C57F8C4DA4A1F64C7ACE37B101--><AD_PROCESS>
 <!--645271C57F8C4DA4A1F64C7ACE37B101-->  <AD_PROCESS_ID><![CDATA[645271C57F8C4DA4A1F64C7ACE37B101]]></AD_PROCESS_ID>
 <!--645271C57F8C4DA4A1F64C7ACE37B101-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -4041,6 +4041,25 @@
 <!--208021A9537641BAB0AFC4294453D59F-->  <AD_ELEMENT_ID><![CDATA[275]]></AD_ELEMENT_ID>
 <!--208021A9537641BAB0AFC4294453D59F--></AD_PROCESS_PARA>
 
+<!--3401DE925FBB4A3AAC72E914595E1C71--><AD_PROCESS_PARA>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_PROCESS_PARA_ID><![CDATA[3401DE925FBB4A3AAC72E914595E1C71]]></AD_PROCESS_PARA_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <NAME><![CDATA[Process action]]></NAME>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_PROCESS_ID><![CDATA[5A2A0AF88AF54BB085DCC52FCC9B17B7]]></AD_PROCESS_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_REFERENCE_VALUE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_VALUE_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_VAL_RULE_ID><![CDATA[1645143617E44289A08A1EA4D617A184]]></AD_VAL_RULE_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <COLUMNNAME><![CDATA[RES_Action]]></COLUMNNAME>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--3401DE925FBB4A3AAC72E914595E1C71-->  <AD_ELEMENT_ID><![CDATA[CC52016D7E7BA603E040007F01000DF9]]></AD_ELEMENT_ID>
+<!--3401DE925FBB4A3AAC72E914595E1C71--></AD_PROCESS_PARA>
+
 <!--340BDE0BCC744A32976670B43AF11443--><AD_PROCESS_PARA>
 <!--340BDE0BCC744A32976670B43AF11443-->  <AD_PROCESS_PARA_ID><![CDATA[340BDE0BCC744A32976670B43AF11443]]></AD_PROCESS_PARA_ID>
 <!--340BDE0BCC744A32976670B43AF11443-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -8315,6 +8315,7 @@
 <!--28F1C8DD5F5746C5928626525EC81BB2-->  <NAME><![CDATA[Unhold]]></NAME>
 <!--28F1C8DD5F5746C5928626525EC81BB2-->  <AD_REFERENCE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_ID>
 <!--28F1C8DD5F5746C5928626525EC81BB2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--28F1C8DD5F5746C5928626525EC81BB2-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--28F1C8DD5F5746C5928626525EC81BB2--></AD_REF_LIST>
 
 <!--290E01195C77437F8B5672C6C7C9B2F4--><AD_REF_LIST>
@@ -8326,6 +8327,7 @@
 <!--290E01195C77437F8B5672C6C7C9B2F4-->  <NAME><![CDATA[Process]]></NAME>
 <!--290E01195C77437F8B5672C6C7C9B2F4-->  <AD_REFERENCE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_ID>
 <!--290E01195C77437F8B5672C6C7C9B2F4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--290E01195C77437F8B5672C6C7C9B2F4-->  <SEQNO><![CDATA[10]]></SEQNO>
 <!--290E01195C77437F8B5672C6C7C9B2F4--></AD_REF_LIST>
 
 <!--297E89663206449C92A875D1060A0734--><AD_REF_LIST>
@@ -9154,6 +9156,7 @@
 <!--76E16C4AE18543769413062DB3D717EB-->  <NAME><![CDATA[Reactivate]]></NAME>
 <!--76E16C4AE18543769413062DB3D717EB-->  <AD_REFERENCE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_ID>
 <!--76E16C4AE18543769413062DB3D717EB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--76E16C4AE18543769413062DB3D717EB-->  <SEQNO><![CDATA[30]]></SEQNO>
 <!--76E16C4AE18543769413062DB3D717EB--></AD_REF_LIST>
 
 <!--76FD693D964F428A86A33E586A8D449B--><AD_REF_LIST>
@@ -9346,6 +9349,7 @@
 <!--85666C41D834448F83D5B3613D7B59D4-->  <NAME><![CDATA[Close]]></NAME>
 <!--85666C41D834448F83D5B3613D7B59D4-->  <AD_REFERENCE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_ID>
 <!--85666C41D834448F83D5B3613D7B59D4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--85666C41D834448F83D5B3613D7B59D4-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--85666C41D834448F83D5B3613D7B59D4--></AD_REF_LIST>
 
 <!--85EB37162F364360A537301472F0914E--><AD_REF_LIST>
@@ -10198,6 +10202,7 @@
 <!--BCE300A9B1844973B6BDA0768E602299-->  <NAME><![CDATA[Put on Hold]]></NAME>
 <!--BCE300A9B1844973B6BDA0768E602299-->  <AD_REFERENCE_ID><![CDATA[440DDA64A43F4799AAFF48BC86DC8F78]]></AD_REFERENCE_ID>
 <!--BCE300A9B1844973B6BDA0768E602299-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BCE300A9B1844973B6BDA0768E602299-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--BCE300A9B1844973B6BDA0768E602299--></AD_REF_LIST>
 
 <!--BCEE6D067E8C4A47858651D4B129A181--><AD_REF_LIST>
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml	Thu Oct 18 10:44:18 2012 +0200
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml	Thu Oct 18 10:44:46 2012 +0200
@@ -1256,6 +1256,21 @@
 <!--156D1566AC284706ABFB363201DEC55C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--156D1566AC284706ABFB363201DEC55C--></AD_VAL_RULE>
 
+<!--1645143617E44289A08A1EA4D617A184--><AD_VAL_RULE>
+<!--1645143617E44289A08A1EA4D617A184-->  <AD_VAL_RULE_ID><![CDATA[1645143617E44289A08A1EA4D617A184]]></AD_VAL_RULE_ID>
+<!--1645143617E44289A08A1EA4D617A184-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1645143617E44289A08A1EA4D617A184-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1645143617E44289A08A1EA4D617A184-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1645143617E44289A08A1EA4D617A184-->  <NAME><![CDATA[M_Reservation Allowed Actions]]></NAME>
+<!--1645143617E44289A08A1EA4D617A184-->  <TYPE><![CDATA[S]]></TYPE>
+<!--1645143617E44289A08A1EA4D617A184-->  <CODE><![CDATA[((@res_status@ = 'DR' AND value IN ('PR'))
+ OR (@res_status@ = 'CO' AND value IN ('HO', 'RE', 'CL'))
+ OR (@res_status@ = 'HO' AND value IN ('UNHO', 'CL'))
+ OR (@res_status@ = 'CL' AND value IN ('--'))
+)]]></CODE>
+<!--1645143617E44289A08A1EA4D617A184-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1645143617E44289A08A1EA4D617A184--></AD_VAL_RULE>
+
 <!--16C9E72407D94B93968D1E81F32D537D--><AD_VAL_RULE>
 <!--16C9E72407D94B93968D1E81F32D537D-->  <AD_VAL_RULE_ID><![CDATA[16C9E72407D94B93968D1E81F32D537D]]></AD_VAL_RULE_ID>
 <!--16C9E72407D94B93968D1E81F32D537D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>