[Cancel and Replace] Buttons, Process Definition & Temporal Order Creation 1
authorAnder Iraceburu <ander.iraceburu@openbravo.com>
Thu, 29 Jan 2015 18:51:43 +0100
changeset 27869 68cecd15b9b8
parent 25799 c28206c4abc9
child 27870 9a06c7987d4c
[Cancel and Replace] Buttons, Process Definition & Temporal Order Creation 1
src-db/database/model/tables/C_ORDER.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_REF_LIST.xml
src-db/database/sourcedata/M_OFFER_TYPE.xml
src-db/database/sourcedata/OBUIAPP_PROCESS.xml
src/org/openbravo/common/actionhandler/CancelAndReplaceSalesOrder.java
src/org/openbravo/common/actionhandler/ConfirmCancelAndReplaceSalesOrder.java
--- a/src-db/database/model/tables/C_ORDER.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/model/tables/C_ORDER.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -341,6 +341,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="CANCELANDREPLACE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="CONFIRMCANCELANDREPLACE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="C_DOCTYPE" name="C_DOCTYPE_CORDER">
         <reference local="C_DOCTYPE_ID" foreign="C_DOCTYPE_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -242193,6 +242193,40 @@
 <!--5198CDCA0D104187AC593A5E1968B66B-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--5198CDCA0D104187AC593A5E1968B66B--></AD_COLUMN>
 
+<!--51E299D6B5824EC480B524E1ED726985--><AD_COLUMN>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_COLUMN_ID><![CDATA[51E299D6B5824EC480B524E1ED726985]]></AD_COLUMN_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <NAME><![CDATA[Confirmcancelandreplace]]></NAME>
+<!--51E299D6B5824EC480B524E1ED726985-->  <COLUMNNAME><![CDATA[Confirmcancelandreplace]]></COLUMNNAME>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--51E299D6B5824EC480B524E1ED726985-->  <SEQNO><![CDATA[710]]></SEQNO>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_ELEMENT_ID><![CDATA[11F2729B6B6B452F854E4A3BA8EA732B]]></AD_ELEMENT_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--51E299D6B5824EC480B524E1ED726985-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--51E299D6B5824EC480B524E1ED726985-->  <POSITION><![CDATA[94]]></POSITION>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--51E299D6B5824EC480B524E1ED726985-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[0C2AFAEFB67B4CB8A1429195EB119A49]]></EM_OBUIAPP_PROCESS_ID>
+<!--51E299D6B5824EC480B524E1ED726985--></AD_COLUMN>
+
 <!--521EA21E6E7577ABE040007F010016C0--><AD_COLUMN>
 <!--521EA21E6E7577ABE040007F010016C0-->  <AD_COLUMN_ID><![CDATA[521EA21E6E7577ABE040007F010016C0]]></AD_COLUMN_ID>
 <!--521EA21E6E7577ABE040007F010016C0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -299193,6 +299227,40 @@
 <!--9ACB466C69F848F4AE2DB1393D780160-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--9ACB466C69F848F4AE2DB1393D780160--></AD_COLUMN>
 
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D--><AD_COLUMN>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_COLUMN_ID><![CDATA[9AEBE3623CCD4E6F820A2EB70F2F243D]]></AD_COLUMN_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <NAME><![CDATA[Cancelandreplace]]></NAME>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <COLUMNNAME><![CDATA[Cancelandreplace]]></COLUMNNAME>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <SEQNO><![CDATA[700]]></SEQNO>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_ELEMENT_ID><![CDATA[5AF7D5DB814D4907B10F78961BE9EFA8]]></AD_ELEMENT_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <POSITION><![CDATA[86]]></POSITION>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[A2FAF49712D1445ABE750315CE1B473A]]></EM_OBUIAPP_PROCESS_ID>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D--></AD_COLUMN>
+
 <!--9AFE960A44A147ECAADB875D96399AA2--><AD_COLUMN>
 <!--9AFE960A44A147ECAADB875D96399AA2-->  <AD_COLUMN_ID><![CDATA[9AFE960A44A147ECAADB875D96399AA2]]></AD_COLUMN_ID>
 <!--9AFE960A44A147ECAADB875D96399AA2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -21376,6 +21376,18 @@
 <!--11C2BC5D35EE4A098C6C99FE71F06590-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--11C2BC5D35EE4A098C6C99FE71F06590--></AD_ELEMENT>
 
+<!--11F2729B6B6B452F854E4A3BA8EA732B--><AD_ELEMENT>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <AD_ELEMENT_ID><![CDATA[11F2729B6B6B452F854E4A3BA8EA732B]]></AD_ELEMENT_ID>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <COLUMNNAME><![CDATA[Confirmcancelandreplace]]></COLUMNNAME>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <NAME><![CDATA[Confirm Cancel and Replace]]></NAME>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <PRINTNAME><![CDATA[Confirm Cancel and Replace]]></PRINTNAME>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--11F2729B6B6B452F854E4A3BA8EA732B--></AD_ELEMENT>
+
 <!--13338440A6404E389A502A20DCDDF226--><AD_ELEMENT>
 <!--13338440A6404E389A502A20DCDDF226-->  <AD_ELEMENT_ID><![CDATA[13338440A6404E389A502A20DCDDF226]]></AD_ELEMENT_ID>
 <!--13338440A6404E389A502A20DCDDF226-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -25159,6 +25171,18 @@
 <!--5ACB703E0038CD12E040007F010160B4-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--5ACB703E0038CD12E040007F010160B4--></AD_ELEMENT>
 
+<!--5AF7D5DB814D4907B10F78961BE9EFA8--><AD_ELEMENT>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <AD_ELEMENT_ID><![CDATA[5AF7D5DB814D4907B10F78961BE9EFA8]]></AD_ELEMENT_ID>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <COLUMNNAME><![CDATA[Cancelandreplace]]></COLUMNNAME>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <NAME><![CDATA[Cancel and Replace]]></NAME>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <PRINTNAME><![CDATA[Cancel and Replace]]></PRINTNAME>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8--></AD_ELEMENT>
+
 <!--5AFB22E6D5924B6DBE8F5C4FE839A5AE--><AD_ELEMENT>
 <!--5AFB22E6D5924B6DBE8F5C4FE839A5AE-->  <AD_ELEMENT_ID><![CDATA[5AFB22E6D5924B6DBE8F5C4FE839A5AE]]></AD_ELEMENT_ID>
 <!--5AFB22E6D5924B6DBE8F5C4FE839A5AE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -199430,6 +199430,33 @@
 <!--3C9B4A09C20D453FAFD2E8A768B71324-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--3C9B4A09C20D453FAFD2E8A768B71324--></AD_FIELD>
 
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73--><AD_FIELD>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_FIELD_ID><![CDATA[3C9B97CD980A4D809BDE5B9FDC3E0E73]]></AD_FIELD_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <NAME><![CDATA[Cancel and Replace]]></NAME>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_COLUMN_ID><![CDATA[9AEBE3623CCD4E6F820A2EB70F2F243D]]></AD_COLUMN_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <DISPLAYLOGIC><![CDATA[@DocStatus@='CO']]></DISPLAYLOGIC>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <SEQNO><![CDATA[2140]]></SEQNO>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73--></AD_FIELD>
+
 <!--3C9BD03FD58E4B32AD993C9712287066--><AD_FIELD>
 <!--3C9BD03FD58E4B32AD993C9712287066-->  <AD_FIELD_ID><![CDATA[3C9BD03FD58E4B32AD993C9712287066]]></AD_FIELD_ID>
 <!--3C9BD03FD58E4B32AD993C9712287066-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -296355,6 +296382,33 @@
 <!--F0A3A82183604553A1DB29504DBA1F45-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F0A3A82183604553A1DB29504DBA1F45--></AD_FIELD>
 
+<!--F0BF2E4561024D30B93AC7B471DBF5D7--><AD_FIELD>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_FIELD_ID><![CDATA[F0BF2E4561024D30B93AC7B471DBF5D7]]></AD_FIELD_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <NAME><![CDATA[Confirm Cancel and Replace]]></NAME>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_COLUMN_ID><![CDATA[51E299D6B5824EC480B524E1ED726985]]></AD_COLUMN_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <DISPLAYLOGIC><![CDATA[@DocStatus@='TMP']]></DISPLAYLOGIC>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <SEQNO><![CDATA[2160]]></SEQNO>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7--></AD_FIELD>
+
 <!--F0D198AB8059467299309D4DA1506A8E--><AD_FIELD>
 <!--F0D198AB8059467299309D4DA1506A8E-->  <AD_FIELD_ID><![CDATA[F0D198AB8059467299309D4DA1506A8E]]></AD_FIELD_ID>
 <!--F0D198AB8059467299309D4DA1506A8E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -12117,6 +12117,17 @@
 <!--D9FFDD5DD51D434FB45628FCBAD10A4E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--D9FFDD5DD51D434FB45628FCBAD10A4E--></AD_REF_LIST>
 
+<!--DA3E593E14834F0C9895132B46C51369--><AD_REF_LIST>
+<!--DA3E593E14834F0C9895132B46C51369-->  <AD_REF_LIST_ID><![CDATA[DA3E593E14834F0C9895132B46C51369]]></AD_REF_LIST_ID>
+<!--DA3E593E14834F0C9895132B46C51369-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DA3E593E14834F0C9895132B46C51369-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DA3E593E14834F0C9895132B46C51369-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DA3E593E14834F0C9895132B46C51369-->  <VALUE><![CDATA[TMP]]></VALUE>
+<!--DA3E593E14834F0C9895132B46C51369-->  <NAME><![CDATA[Temporal]]></NAME>
+<!--DA3E593E14834F0C9895132B46C51369-->  <AD_REFERENCE_ID><![CDATA[FF80818130217A350130218D802B0011]]></AD_REFERENCE_ID>
+<!--DA3E593E14834F0C9895132B46C51369-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DA3E593E14834F0C9895132B46C51369--></AD_REF_LIST>
+
 <!--DAC02370F50D485BAA4F79957AA1A7A4--><AD_REF_LIST>
 <!--DAC02370F50D485BAA4F79957AA1A7A4-->  <AD_REF_LIST_ID><![CDATA[DAC02370F50D485BAA4F79957AA1A7A4]]></AD_REF_LIST_ID>
 <!--DAC02370F50D485BAA4F79957AA1A7A4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/M_OFFER_TYPE.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/M_OFFER_TYPE.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -8,6 +8,7 @@
 <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579-->  <NAME><![CDATA[Price Adjustment]]></NAME>
 <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579-->  <PL_ORDER_IMPLEMENTOR><![CDATA[M_Promotion_Adjustment]]></PL_ORDER_IMPLEMENTOR>
+<!--5D4BAF6BB86D4D2C9ED3D5A6FC051579-->  <EM_OBPOS_ISCATEGORY><![CDATA[N]]></EM_OBPOS_ISCATEGORY>
 <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--></M_OFFER_TYPE>
 
 </data>
--- a/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Fri Jan 16 10:29:45 2015 +0000
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Thu Jan 29 18:51:43 2015 +0100
@@ -1,5 +1,23 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49--><OBUIAPP_PROCESS>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <OBUIAPP_PROCESS_ID><![CDATA[0C2AFAEFB67B4CB8A1429195EB119A49]]></OBUIAPP_PROCESS_ID>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <VALUE><![CDATA[Confirmcancelandreplacesalesorder]]></VALUE>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <NAME><![CDATA[Confirm Cancel and Replace Sales Order]]></NAME>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <CLASSNAME><![CDATA[org.openbravo.common.actionhandler.ConfirmCancelAndReplaceSalesOrder]]></CLASSNAME>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISMULTIRECORD><![CDATA[N]]></ISMULTIRECORD>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49--></OBUIAPP_PROCESS>
+
 <!--24E052E6FEB64295B64E683B5196230B--><OBUIAPP_PROCESS>
 <!--24E052E6FEB64295B64E683B5196230B-->  <OBUIAPP_PROCESS_ID><![CDATA[24E052E6FEB64295B64E683B5196230B]]></OBUIAPP_PROCESS_ID>
 <!--24E052E6FEB64295B64E683B5196230B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -359,6 +377,26 @@
 <!--A2C19D0EF6594D14A64BC62E99A89CC3-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
 <!--A2C19D0EF6594D14A64BC62E99A89CC3--></OBUIAPP_PROCESS>
 
+<!--A2FAF49712D1445ABE750315CE1B473A--><OBUIAPP_PROCESS>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <OBUIAPP_PROCESS_ID><![CDATA[A2FAF49712D1445ABE750315CE1B473A]]></OBUIAPP_PROCESS_ID>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <VALUE><![CDATA[CancelAndReplaceSalesOrder]]></VALUE>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <NAME><![CDATA[Cancel and Replace Sales Order]]></NAME>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <DESCRIPTION><![CDATA[This process action will open a copy of the current row in edit mode. After changing the desired values press Confirm in order to create a copy of the opened Sales Order but with negative quantities and complete it. Aftewards the process will create a new]]></DESCRIPTION>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <HELP><![CDATA[This process action will open a copy of the current row in edit mode. After changing the desired values press Confirm in order to create a copy of the opened Sales Order but with negative quantities and complete it. Aftewards the process will create a new Sales Order with the new values in draft status.]]></HELP>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ACCESSLEVEL><![CDATA[7]]></ACCESSLEVEL>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <CLASSNAME><![CDATA[org.openbravo.common.actionhandler.CancelAndReplaceSalesOrder]]></CLASSNAME>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISMULTIRECORD><![CDATA[N]]></ISMULTIRECORD>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--A2FAF49712D1445ABE750315CE1B473A--></OBUIAPP_PROCESS>
+
 <!--A832A5DA28FB4BB391BDE883E928DFC5--><OBUIAPP_PROCESS>
 <!--A832A5DA28FB4BB391BDE883E928DFC5-->  <OBUIAPP_PROCESS_ID><![CDATA[A832A5DA28FB4BB391BDE883E928DFC5]]></OBUIAPP_PROCESS_ID>
 <!--A832A5DA28FB4BB391BDE883E928DFC5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/CancelAndReplaceSalesOrder.java	Thu Jan 29 18:51:43 2015 +0100
@@ -0,0 +1,94 @@
+package org.openbravo.common.actionhandler;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.advpaymentmngt.utility.FIN_Utility;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.common.order.Order;
+import org.openbravo.model.common.order.OrderLine;
+
+public class CancelAndReplaceSalesOrder extends BaseProcessActionHandler {
+  private static final Logger log = Logger.getLogger(CancelAndReplaceSalesOrder.class);
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+    try {
+
+      // Get request parameters
+      JSONObject request = new JSONObject(content);
+      String oldOrderId = request.getString("inpcOrderId");
+      String tabId = request.getString("inpTabId");
+      // FIN_Utility.getDocumentNo();
+
+      // Get new Order
+      Order oldOrder = OBDal.getInstance().get(Order.class, oldOrderId);
+
+      // Create new Order header
+      Order newOrder = (Order) DalUtil.copy(oldOrder, false, true);
+      // TODO Change order values
+      newOrder.setProcessed(false);
+      newOrder.setPosted("N");
+      newOrder.setDocumentStatus("TMP");
+      String newDocumentNo = FIN_Utility.getDocumentNo(newOrder.getDocumentType(), "C_Order");
+      newOrder.setDocumentNo(newDocumentNo);
+      OBDal.getInstance().save(newOrder);
+
+      // Create new Order lines
+      List<OrderLine> orderLineList = oldOrder.getOrderLineList();
+      for (OrderLine oldOrderLine : orderLineList) {
+        OrderLine newOrderLine = (OrderLine) DalUtil.copy(oldOrderLine, false, true);
+        newOrderLine.setSalesOrder(newOrder);
+        OBDal.getInstance().save(newOrderLine);
+      }
+
+      // Get new Order id
+      String newOrderId = newOrder.get(Order.PROPERTY_ID).toString();
+
+      // Return result
+      JSONObject result = new JSONObject();
+      // Execute process and prepare an array with actions to be executed after execution
+      JSONArray actions = new JSONArray();
+
+      // Old record message
+      // JSONObject oldWindowMessage = new JSONObject();
+      // oldWindowMessage.put("msgType", "info");
+      // oldWindowMessage.put("msgTitle", "Old record");
+      // oldWindowMessage.put("msgText", "Old record message");
+      // JSONObject oldWindowMessageAction = new JSONObject();
+      // oldWindowMessageAction.put("showMsgInProcessView", oldWindowMessage);
+      // actions.put(oldWindowMessageAction);
+
+      // New record info
+      JSONObject recordInfo = new JSONObject();
+      recordInfo.put("tabId", tabId);
+      recordInfo.put("recordId", newOrderId);
+      recordInfo.put("wait", true);
+      JSONObject recordInfoAction = new JSONObject();
+      recordInfoAction.put("openDirectTab", recordInfo);
+      actions.put(recordInfoAction);
+
+      // New record message
+      // JSONObject newWindowMessage = new JSONObject();
+      // newWindowMessage.put("msgType", "success");
+      // newWindowMessage.put("msgTitle", "Update Sales Order");
+      // newWindowMessage.put("msgText", "This record was opened from process execution");
+      // JSONObject newWindowMessageAction = new JSONObject();
+      // newWindowMessageAction.put("showMsgInProcessView", newWindowMessage);
+      // actions.put(newWindowMessageAction);
+
+      result.put("responseActions", actions);
+
+      return result;
+    } catch (JSONException e) {
+      log.error("Error in process", e);
+      return new JSONObject();
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/ConfirmCancelAndReplaceSalesOrder.java	Thu Jan 29 18:51:43 2015 +0100
@@ -0,0 +1,16 @@
+package org.openbravo.common.actionhandler;
+
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+
+public class ConfirmCancelAndReplaceSalesOrder extends BaseProcessActionHandler {
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+}