Merged from PI
authorAsier Martirena <asier.martirena@openbravo.com>
Mon, 29 Aug 2016 09:04:15 +0200
changeset 30189 62ec74ab9c44
parent 30073 bec173360631 (diff)
parent 30188 66e7cb68bdbe (current diff)
child 30190 7937b0a6f8c7
Merged from PI
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.apachejdbcconnectionpool/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_MODULE.xml
src/org/openbravo/service/importprocess/ImportEntryManager.java
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -111,6 +111,52 @@
 <!--038E6E9140CB4924B22060672E2847A2-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--038E6E9140CB4924B22060672E2847A2--></AD_COLUMN>
 
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB--><AD_COLUMN>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_COLUMN_ID><![CDATA[03EBACA2EF974E3F9E58A6FE8EF8AECB]]></AD_COLUMN_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <NAME><![CDATA[EM_APRM_FinancialAccount]]></NAME>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <DESCRIPTION><![CDATA[Financial Account in sales invoice details]]></DESCRIPTION>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <HELP><![CDATA[Financial Account in sales invoice details]]></HELP>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <COLUMNNAME><![CDATA[EM_APRM_FinancialAccount]]></COLUMNNAME>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_TABLE_ID><![CDATA[C0233061EA504EFEAB0483E836BBAF31]]></AD_TABLE_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_REFERENCE_VALUE_ID><![CDATA[03D336BF39A7455C8FD64CBCCFB4FC1C]]></AD_REFERENCE_VALUE_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <SEQNO><![CDATA[290]]></SEQNO>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_ELEMENT_ID><![CDATA[D62D89A819A840B3978E4434C9B66C86]]></AD_ELEMENT_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <SQLLOGIC><![CDATA[(select
+   case p.amount
+     when 0 then null
+     else p.fin_financial_account_id
+   end
+ from fin_payment_detail pd
+   join fin_payment p on p.fin_payment_id=pd.fin_payment_id
+ where pd.fin_payment_detail_id=fin_payment_detail_id)]]></SQLLOGIC>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--03EBACA2EF974E3F9E58A6FE8EF8AECB--></AD_COLUMN>
+
 <!--046498C716474A6EAAEA0CA26E09C69D--><AD_COLUMN>
 <!--046498C716474A6EAAEA0CA26E09C69D-->  <AD_COLUMN_ID><![CDATA[046498C716474A6EAAEA0CA26E09C69D]]></AD_COLUMN_ID>
 <!--046498C716474A6EAAEA0CA26E09C69D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -11578,6 +11624,52 @@
 <!--E6DB13E1516947B7A8DC5741D58A7AB2-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--E6DB13E1516947B7A8DC5741D58A7AB2--></AD_COLUMN>
 
+<!--E73D535A7F9D4494AF132A66AE861168--><AD_COLUMN>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_COLUMN_ID><![CDATA[E73D535A7F9D4494AF132A66AE861168]]></AD_COLUMN_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <NAME><![CDATA[EM_APRM_PaymentMethod]]></NAME>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <DESCRIPTION><![CDATA[Payment Method in Sales Invoice]]></DESCRIPTION>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <HELP><![CDATA[Payment Method in Sales Invoice]]></HELP>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <COLUMNNAME><![CDATA[EM_APRM_PaymentMethod]]></COLUMNNAME>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_TABLE_ID><![CDATA[C0233061EA504EFEAB0483E836BBAF31]]></AD_TABLE_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_REFERENCE_VALUE_ID><![CDATA[E664E415582A483DBBC91DEF256FB9E6]]></AD_REFERENCE_VALUE_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <SEQNO><![CDATA[300]]></SEQNO>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_ELEMENT_ID><![CDATA[2622EC9C32614ED692A415EC3F3DC3EF]]></AD_ELEMENT_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <SQLLOGIC><![CDATA[(select
+   case p.amount
+     when 0 then null
+     else p.fin_paymentmethod_id
+   end
+ from fin_payment_detail pd
+   join fin_payment p on p.fin_payment_id = pd.fin_payment_id
+ where pd.fin_payment_detail_id = fin_payment_detail_id)]]></SQLLOGIC>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--E73D535A7F9D4494AF132A66AE861168-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--E73D535A7F9D4494AF132A66AE861168--></AD_COLUMN>
+
 <!--E88F9871B4184489A5B188A589FB8543--><AD_COLUMN>
 <!--E88F9871B4184489A5B188A589FB8543-->  <AD_COLUMN_ID><![CDATA[E88F9871B4184489A5B188A589FB8543]]></AD_COLUMN_ID>
 <!--E88F9871B4184489A5B188A589FB8543-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -86,6 +86,20 @@
 <!--256AB5C3D6144B2C9884CF0FA4D81911-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--256AB5C3D6144B2C9884CF0FA4D81911--></AD_ELEMENT>
 
+<!--2622EC9C32614ED692A415EC3F3DC3EF--><AD_ELEMENT>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <AD_ELEMENT_ID><![CDATA[2622EC9C32614ED692A415EC3F3DC3EF]]></AD_ELEMENT_ID>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <COLUMNNAME><![CDATA[EM_APRM_PaymentMethod]]></COLUMNNAME>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <NAME><![CDATA[Payment Method]]></NAME>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <PRINTNAME><![CDATA[Payment Method]]></PRINTNAME>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <DESCRIPTION><![CDATA[Payment Method in Sales Invoice]]></DESCRIPTION>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <HELP><![CDATA[Payment Method in Sales Invoice]]></HELP>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--2622EC9C32614ED692A415EC3F3DC3EF-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--2622EC9C32614ED692A415EC3F3DC3EF--></AD_ELEMENT>
+
 <!--2C70D5BAFED340D68C564DA5C3F15A7E--><AD_ELEMENT>
 <!--2C70D5BAFED340D68C564DA5C3F15A7E-->  <AD_ELEMENT_ID><![CDATA[2C70D5BAFED340D68C564DA5C3F15A7E]]></AD_ELEMENT_ID>
 <!--2C70D5BAFED340D68C564DA5C3F15A7E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1364,6 +1378,20 @@
 <!--D51BEAD64B9C4D5FBC097873933ACEB3-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--D51BEAD64B9C4D5FBC097873933ACEB3--></AD_ELEMENT>
 
+<!--D62D89A819A840B3978E4434C9B66C86--><AD_ELEMENT>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <AD_ELEMENT_ID><![CDATA[D62D89A819A840B3978E4434C9B66C86]]></AD_ELEMENT_ID>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <COLUMNNAME><![CDATA[EM_APRM_FinancialAccount]]></COLUMNNAME>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <NAME><![CDATA[Financial Account]]></NAME>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <PRINTNAME><![CDATA[Financial Account]]></PRINTNAME>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <DESCRIPTION><![CDATA[Financial Account in sales invoice details]]></DESCRIPTION>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <HELP><![CDATA[Financial Account in sales invoice details]]></HELP>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--D62D89A819A840B3978E4434C9B66C86-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--D62D89A819A840B3978E4434C9B66C86--></AD_ELEMENT>
+
 <!--D85187ABF8434C39A9A11EE8EFCF3DDE--><AD_ELEMENT>
 <!--D85187ABF8434C39A9A11EE8EFCF3DDE-->  <AD_ELEMENT_ID><![CDATA[D85187ABF8434C39A9A11EE8EFCF3DDE]]></AD_ELEMENT_ID>
 <!--D85187ABF8434C39A9A11EE8EFCF3DDE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -14001,6 +14001,35 @@
 <!--A19EFBCD4CEE48ADA318EB734806CFC5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--A19EFBCD4CEE48ADA318EB734806CFC5--></AD_FIELD>
 
+<!--A27C0C1F043945BBAC61B8B8CB79098D--><AD_FIELD>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_FIELD_ID><![CDATA[A27C0C1F043945BBAC61B8B8CB79098D]]></AD_FIELD_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <NAME><![CDATA[Financial Account]]></NAME>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <DESCRIPTION><![CDATA[Financial Account in sales invoice details]]></DESCRIPTION>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <HELP><![CDATA[Financial Account in sales invoice details]]></HELP>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_TAB_ID><![CDATA[F6C2283A21314407BBBB23FF14B85ED4]]></AD_TAB_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_COLUMN_ID><![CDATA[03EBACA2EF974E3F9E58A6FE8EF8AECB]]></AD_COLUMN_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <SEQNO><![CDATA[205]]></SEQNO>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <GRID_SEQNO><![CDATA[8]]></GRID_SEQNO>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--A27C0C1F043945BBAC61B8B8CB79098D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--A27C0C1F043945BBAC61B8B8CB79098D--></AD_FIELD>
+
 <!--A28B0A82995D87F5E040007F010067A0--><AD_FIELD>
 <!--A28B0A82995D87F5E040007F010067A0-->  <AD_FIELD_ID><![CDATA[A28B0A82995D87F5E040007F010067A0]]></AD_FIELD_ID>
 <!--A28B0A82995D87F5E040007F010067A0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -15541,6 +15570,35 @@
 <!--A95A4F99B6CA47D48D8E430B5E6EF85B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--A95A4F99B6CA47D48D8E430B5E6EF85B--></AD_FIELD>
 
+<!--A9FFD31F45874125989D273B69D76419--><AD_FIELD>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_FIELD_ID><![CDATA[A9FFD31F45874125989D273B69D76419]]></AD_FIELD_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A9FFD31F45874125989D273B69D76419-->  <NAME><![CDATA[Payment Method]]></NAME>
+<!--A9FFD31F45874125989D273B69D76419-->  <DESCRIPTION><![CDATA[Payment Method in Sales Invoice]]></DESCRIPTION>
+<!--A9FFD31F45874125989D273B69D76419-->  <HELP><![CDATA[Payment Method in Sales Invoice]]></HELP>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_TAB_ID><![CDATA[F6C2283A21314407BBBB23FF14B85ED4]]></AD_TAB_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_COLUMN_ID><![CDATA[E73D535A7F9D4494AF132A66AE861168]]></AD_COLUMN_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--A9FFD31F45874125989D273B69D76419-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--A9FFD31F45874125989D273B69D76419-->  <SEQNO><![CDATA[185]]></SEQNO>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A9FFD31F45874125989D273B69D76419-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--A9FFD31F45874125989D273B69D76419-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--A9FFD31F45874125989D273B69D76419-->  <GRID_SEQNO><![CDATA[4]]></GRID_SEQNO>
+<!--A9FFD31F45874125989D273B69D76419-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--A9FFD31F45874125989D273B69D76419-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--A9FFD31F45874125989D273B69D76419-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--A9FFD31F45874125989D273B69D76419-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--A9FFD31F45874125989D273B69D76419--></AD_FIELD>
+
 <!--AA2A1A994B4B430EB0E4B1592A07D4EC--><AD_FIELD>
 <!--AA2A1A994B4B430EB0E4B1592A07D4EC-->  <AD_FIELD_ID><![CDATA[AA2A1A994B4B430EB0E4B1592A07D4EC]]></AD_FIELD_ID>
 <!--AA2A1A994B4B430EB0E4B1592A07D4EC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -17460,17 +17518,16 @@
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <AD_COLUMN_ID><![CDATA[7DC34559B3F1B45BE040007F0100784A]]></AD_COLUMN_ID>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <PROPERTY><![CDATA[paymentDetails.finPayment.paymentMethod]]></PROPERTY>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
-<!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <SEQNO><![CDATA[180]]></SEQNO>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--B712FAD6A5C843A6A8204FDFB4435580-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B712FAD6A5C843A6A8204FDFB4435580-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--B712FAD6A5C843A6A8204FDFB4435580-->  <GRID_SEQNO><![CDATA[4]]></GRID_SEQNO>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--B712FAD6A5C843A6A8204FDFB4435580-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
@@ -21040,17 +21097,16 @@
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <AD_COLUMN_ID><![CDATA[03276FB53CC54CC1829E0AA6EC0F2EE6]]></AD_COLUMN_ID>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <PROPERTY><![CDATA[paymentDetails.finPayment.account]]></PROPERTY>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
-<!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <SEQNO><![CDATA[200]]></SEQNO>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <GRID_SEQNO><![CDATA[8]]></GRID_SEQNO>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--E8276CA9F9DA475CA56ABE47A470ABB2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -337,6 +337,18 @@
 <!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--C20E5E22588E40E5B8CC6D80ED3015C5--></AD_REFERENCE>
 
+<!--C4A74AE591F04D9A9CB859CC67F61340--><AD_REFERENCE>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <AD_REFERENCE_ID><![CDATA[C4A74AE591F04D9A9CB859CC67F61340]]></AD_REFERENCE_ID>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <NAME><![CDATA[Financial Transaction Selector]]></NAME>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--C4A74AE591F04D9A9CB859CC67F61340-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--C4A74AE591F04D9A9CB859CC67F61340--></AD_REFERENCE>
+
 <!--D9B6068A6D3E4B7487470E7D2F033A54--><AD_REFERENCE>
 <!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_REFERENCE_ID><![CDATA[D9B6068A6D3E4B7487470E7D2F033A54]]></AD_REFERENCE_ID>
 <!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -169,7 +169,7 @@
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <COLUMNNAME><![CDATA[dateAcct]]></COLUMNNAME>
-<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--0F44A3B0971F47A1B509A50377BEB383-->  <DEFAULTVALUE><![CDATA[OB.getSession().getAttribute('#DATE')]]></DEFAULTVALUE>
@@ -738,7 +738,7 @@
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <SEQNO><![CDATA[10]]></SEQNO>
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <COLUMNNAME><![CDATA[statementDate]]></COLUMNNAME>
-<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--65AFBD9140014688A842ACF5ECF9E5A1-->  <DEFAULTVALUE><![CDATA[OB.getSession().getAttribute('#DATE')]]></DEFAULTVALUE>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -99,6 +99,21 @@
 <!--7811D4DBBB734D5ABB5DCC0CFDA21B88-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--7811D4DBBB734D5ABB5DCC0CFDA21B88--></OBUISEL_SELECTOR>
 
+<!--80D03C83D251489F984B488FA5B0B75F--><OBUISEL_SELECTOR>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <OBUISEL_SELECTOR_ID><![CDATA[80D03C83D251489F984B488FA5B0B75F]]></OBUISEL_SELECTOR_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <NAME><![CDATA[Financial Transaction Selector]]></NAME>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <AD_REFERENCE_ID><![CDATA[C4A74AE591F04D9A9CB859CC67F61340]]></AD_REFERENCE_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <AD_TABLE_ID><![CDATA[4D8C3B3C31D1410DA046140C9F024D17]]></AD_TABLE_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
+<!--80D03C83D251489F984B488FA5B0B75F-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--80D03C83D251489F984B488FA5B0B75F--></OBUISEL_SELECTOR>
+
 <!--9FAD469CE4414A25974CF45C0AD22D35--><OBUISEL_SELECTOR>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <OBUISEL_SELECTOR_ID><![CDATA[9FAD469CE4414A25974CF45C0AD22D35]]></OBUISEL_SELECTOR_ID>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsHandler.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsHandler.java	Mon Aug 29 09:04:15 2016 +0200
@@ -22,15 +22,21 @@
 import java.util.Date;
 import java.util.Map;
 
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
 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.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.process.FIN_TransactionProcess;
+import org.openbravo.base.exception.OBException;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
@@ -42,6 +48,9 @@
   private static final Logger log = Logger.getLogger(AddMultiplePaymentsHandler.class);
   private static final SimpleDateFormat jsDateFormat = JsonUtils.createDateFormat();
   private static final String ACTION_PROCESS_TRANSACTION = "P";
+  @Inject
+  @Any
+  private Instance<AddMultiplePaymentsProcessAfterProcessHook> afterHooks;
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String data) {
@@ -65,6 +74,14 @@
         final JSONObject paymentJS = selectedPayments.getJSONObject(i);
         createAndProcessTransactionFromPayment(paymentJS, statementDate, dateAcct, strAccountId);
       }
+      OBError oberror = new OBError();
+      for (AddMultiplePaymentsProcessAfterProcessHook hook : afterHooks) {
+        oberror = hook.executeHook(jsonData, oberror);
+        if (oberror != null && "Error".equals(oberror.getType())) {
+          throw new OBException(
+              "Error Adding multiple payments to financial account. Error in Hook");
+        }
+      }
       // Success Message
       return getSuccessMessage(String.format(
           OBMessageUtils.messageBD("APRM_MULTIPLE_TRANSACTIONS_ADDED"), selectedPaymentsLength));
@@ -97,7 +114,6 @@
       final FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
       FIN_FinancialAccount account = OBDal.getInstance().get(FIN_FinancialAccount.class,
           strAccountId);
-
       if (payment != null) {
         final FIN_FinaccTransaction transaction = TransactionsDao.createFinAccTransaction(payment);
         transaction.setTransactionDate(transactionDate);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsProcessAfterProcessHook.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,28 @@
+/*
+ *************************************************************************
+ * 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) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.erpCommon.utility.OBError;
+
+public abstract class AddMultiplePaymentsProcessAfterProcessHook {
+
+  public abstract OBError executeHook(JSONObject data, OBError myMessage);
+
+}
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Mon Aug 29 09:04:15 2016 +0200
@@ -87,16 +87,10 @@
       // retrieve standard params
       final String recordID = (String) bundle.getParams().get("Fin_Payment_ID");
       final FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, recordID);
-      final Boolean isPosOrder;
-      if (bundle.getParams().get("isPOSOrder") == null) {
-        isPosOrder = false;
-      } else {
-        isPosOrder = bundle.getParams().get("isPOSOrder").equals("Y");
-      }
       final String paymentDate = (String) bundle.getParams().get("paymentdate");
       final boolean doFlush = bundle.getParams().get("doFlush") != null ? (Boolean) bundle
           .getParams().get("doFlush") : true;
-      processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom,
+      processPayment(payment, strAction, paymentDate, comingFrom,
           selectedCreditLineIds, doFlush);
       bundle.setResult(msg);
     } catch (Exception e) {
@@ -110,15 +104,20 @@
   }
 
   // ProcessPayment without a return type
+  public static void doProcessPayment(FIN_Payment payment, String strAction, String paymentDate,
+      String comingFrom) throws OBException {
+    FIN_PaymentProcess fpp = WeldUtils.getInstanceFromStaticBeanManager(FIN_PaymentProcess.class);
+    fpp.processPayment(payment, strAction, paymentDate, comingFrom, null, true);
+  }
+
+  @Deprecated
   public static void doProcessPayment(FIN_Payment payment, String strAction, Boolean isPosOrder,
       String paymentDate, String comingFrom) throws OBException {
-    FIN_PaymentProcess fpp = WeldUtils.getInstanceFromStaticBeanManager(FIN_PaymentProcess.class);
-    fpp.processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom, null, true);
+    doProcessPayment(payment, strAction, paymentDate, comingFrom);
   }
 
-  private void processPayment(FIN_Payment payment, String strAction, Boolean isPosOrder,
-      String paymentDate, String comingFrom, String selectedCreditLineIds, boolean doFlush)
-      throws OBException {
+  private void processPayment(FIN_Payment payment, String strAction, String paymentDate,
+      String comingFrom, String selectedCreditLineIds, boolean doFlush) throws OBException {
     dao = new AdvPaymentMngtDao();
     String msg = "";
     try {
@@ -258,36 +257,34 @@
               glitems.add(paymentDetail.getGLItem().getName());
           }
           // Set description
-          if (!isPosOrder) {
-            StringBuffer description = new StringBuffer();
+          StringBuffer description = new StringBuffer();
 
-            if (payment.getDescription() != null && !payment.getDescription().equals(""))
-              description.append(payment.getDescription()).append("\n");
-            if (!invoiceDocNos.isEmpty()) {
-              description.append(OBMessageUtils.messageBD("InvoiceDocumentno"));
-              description.append(": ").append(
-                  invoiceDocNos.toString().substring(1, invoiceDocNos.toString().length() - 1));
-              description.append("\n");
-            }
-            if (!orderDocNos.isEmpty()) {
-              description.append(OBMessageUtils.messageBD("OrderDocumentno"));
-              description.append(": ").append(
-                  orderDocNos.toString().substring(1, orderDocNos.toString().length() - 1));
-              description.append("\n");
-            }
-            if (!glitems.isEmpty()) {
-              description.append(OBMessageUtils.messageBD("APRM_GLItem"));
-              description.append(": ").append(
-                  glitems.toString().substring(1, glitems.toString().length() - 1));
-              description.append("\n");
-            }
-            if (!"".equals(strRefundCredit))
-              description.append(strRefundCredit).append("\n");
+          if (payment.getDescription() != null && !payment.getDescription().equals(""))
+            description.append(payment.getDescription()).append("\n");
+          if (!invoiceDocNos.isEmpty()) {
+            description.append(OBMessageUtils.messageBD("InvoiceDocumentno"));
+            description.append(": ").append(
+                invoiceDocNos.toString().substring(1, invoiceDocNos.toString().length() - 1));
+            description.append("\n");
+          }
+          if (!orderDocNos.isEmpty()) {
+            description.append(OBMessageUtils.messageBD("OrderDocumentno"));
+            description.append(": ").append(
+                orderDocNos.toString().substring(1, orderDocNos.toString().length() - 1));
+            description.append("\n");
+          }
+          if (!glitems.isEmpty()) {
+            description.append(OBMessageUtils.messageBD("APRM_GLItem"));
+            description.append(": ").append(
+                glitems.toString().substring(1, glitems.toString().length() - 1));
+            description.append("\n");
+          }
+          if (!"".equals(strRefundCredit))
+            description.append(strRefundCredit).append("\n");
 
-            String truncateDescription = (description.length() > 255) ? description
-                .substring(0, 251).concat("...").toString() : description.toString();
-            payment.setDescription(truncateDescription);
-          }
+          String truncateDescription = (description.length() > 255) ? description.substring(0, 251)
+              .concat("...").toString() : description.toString();
+          payment.setDescription(truncateDescription);
 
           if (paymentAmount.compareTo(payment.getAmount()) != 0) {
             payment.setUsedCredit(paymentAmount.subtract(payment.getAmount()));
@@ -323,9 +320,8 @@
             }
           }
           // Execution Process
-          if (!isPosOrder
-              && dao.isAutomatedExecutionPayment(payment.getAccount(), payment.getPaymentMethod(),
-                  payment.isReceipt())) {
+          if (dao.isAutomatedExecutionPayment(payment.getAccount(), payment.getPaymentMethod(),
+              payment.isReceipt())) {
             try {
               payment.setStatus("RPAE");
 
@@ -659,7 +655,7 @@
         String newStrAction = "P";
         FIN_PaymentProcess fpp = WeldUtils
             .getInstanceFromStaticBeanManager(FIN_PaymentProcess.class);
-        fpp.processPayment(reversedPayment, newStrAction, isPosOrder, paymentDate, comingFrom,
+        fpp.processPayment(reversedPayment, newStrAction, paymentDate, comingFrom,
             selectedCreditLineIds, true);
 
         return;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Mon Aug 29 09:04:15 2016 +0200
@@ -1693,4 +1693,68 @@
     finAccTransactionCriteria.setMaxResults(1);
     return (FIN_FinaccTransaction) finAccTransactionCriteria.uniqueResult();
   }
+
+  /**
+   * Get an active FinAccPaymentMethod related to paymentMethodId FIN_PaymentMethod and
+   * financialAccountId FIN_FinancialAccount, if exists. If paymentMethodId is null it will retrieve
+   * any FinAccPaymentMethod related to paymentMethodId FIN_PaymentMethod ordered by default field.
+   * FinAccPaymentMethod must have pay in/out active and must be compatible with currencyId Currency
+   * if currencyId is not null. If the organization parameter is not null the FinAccPaymentMethod
+   * must be in the organization tree.
+   */
+  public static FinAccPaymentMethod getFinancialAccountPaymentMethodByOrganization(
+      String paymentMethodId, String financialAccountId, boolean issotrx, String currencyId,
+      String organizationId) {
+    final OrganizationStructureProvider osp = OBContext.getOBContext()
+        .getOrganizationStructureProvider(OBContext.getOBContext().getCurrentClient().getId());
+    Set<String> orgTree = osp.getNaturalTree(organizationId);
+    StringBuffer where = new StringBuffer();
+    where.append(" select fapm.id from " + FinAccPaymentMethod.ENTITY_NAME + " as fapm");
+    where.append(" join fapm." + FinAccPaymentMethod.PROPERTY_ACCOUNT + " as fa");
+    where.append(" where fapm." + FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD + " = :paymentMethod");
+    where.append(" and fa." + FIN_FinancialAccount.PROPERTY_ACTIVE + " = true");
+    if (issotrx) {
+      where.append(" and fapm." + FinAccPaymentMethod.PROPERTY_PAYINALLOW + " = true");
+    } else {
+      where.append(" and fapm." + FinAccPaymentMethod.PROPERTY_PAYOUTALLOW + " = true");
+    }
+    if (!StringUtils.isEmpty(financialAccountId)) {
+      where.append(" and fapm." + FinAccPaymentMethod.PROPERTY_ACCOUNT + " = :financialAccount");
+    }
+    if (!StringUtils.isEmpty(currencyId)) {
+      where.append(" and (fa." + FIN_FinancialAccount.PROPERTY_CURRENCY + " = :currency");
+      if (issotrx) {
+        where.append(" or fapm." + FinAccPaymentMethod.PROPERTY_PAYINISMULTICURRENCY + " = true)");
+      } else {
+        where.append(" or fapm." + FinAccPaymentMethod.PROPERTY_PAYOUTISMULTICURRENCY + " = true)");
+      }
+    }
+    if (!StringUtils.isEmpty(organizationId)) {
+      where.append(" and (fa." + FIN_FinancialAccount.PROPERTY_ORGANIZATION
+          + ".id in (:organizationTree))");
+    }
+    where.append(" and fapm.active = true ");
+    where.append(" order by fapm." + FinAccPaymentMethod.PROPERTY_DEFAULT + " desc");
+
+    final Query qry = OBDal.getInstance().getSession().createQuery(where.toString());
+    qry.setParameter("paymentMethod",
+        OBDal.getInstance().get(FIN_PaymentMethod.class, paymentMethodId));
+    if (!StringUtils.isEmpty(financialAccountId)) {
+      qry.setParameter("financialAccount",
+          OBDal.getInstance().get(FIN_FinancialAccount.class, financialAccountId));
+    }
+    if (!StringUtils.isEmpty(currencyId)) {
+      qry.setParameter("currency", OBDal.getInstance().get(Currency.class, currencyId));
+    }
+    if (!StringUtils.isEmpty(currencyId)) {
+      qry.setParameterList("organizationTree", orgTree);
+    }
+    qry.setMaxResults(1);
+
+    final FinAccPaymentMethod finAccPaymentMethod = OBDal.getInstance().get(
+        FinAccPaymentMethod.class, qry.uniqueResult());
+
+    return finAccPaymentMethod;
+  }
+
 }
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -264,6 +264,30 @@
 <!--0EAD499E981341CABE550FE951B274F7-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--0EAD499E981341CABE550FE951B274F7--></AD_MESSAGE>
 
+<!--0ECD7FB92C694251B309D4E96F3F3129--><AD_MESSAGE>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <AD_MESSAGE_ID><![CDATA[0ECD7FB92C694251B309D4E96F3F3129]]></AD_MESSAGE_ID>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <VALUE><![CDATA[OBUIAPP_Calendar_nextButtonHoverText]]></VALUE>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <MSGTEXT><![CDATA[Next]]></MSGTEXT>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--0ECD7FB92C694251B309D4E96F3F3129-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--0ECD7FB92C694251B309D4E96F3F3129--></AD_MESSAGE>
+
+<!--1158BE5FE2F740DC9D3B28E9FB326D79--><AD_MESSAGE>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <AD_MESSAGE_ID><![CDATA[1158BE5FE2F740DC9D3B28E9FB326D79]]></AD_MESSAGE_ID>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventEndDateFieldTitle]]></VALUE>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <MSGTEXT><![CDATA[To]]></MSGTEXT>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--1158BE5FE2F740DC9D3B28E9FB326D79--></AD_MESSAGE>
+
 <!--1337DB6FF60E49C9921D29411DC77BD1--><AD_MESSAGE>
 <!--1337DB6FF60E49C9921D29411DC77BD1-->  <AD_MESSAGE_ID><![CDATA[1337DB6FF60E49C9921D29411DC77BD1]]></AD_MESSAGE_ID>
 <!--1337DB6FF60E49C9921D29411DC77BD1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -324,6 +348,30 @@
 <!--16EF30EF95D94CB2A93129015A363315-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--16EF30EF95D94CB2A93129015A363315--></AD_MESSAGE>
 
+<!--1992D30142A247FDA2F468AD7B4676E8--><AD_MESSAGE>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <AD_MESSAGE_ID><![CDATA[1992D30142A247FDA2F468AD7B4676E8]]></AD_MESSAGE_ID>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <VALUE><![CDATA[OBUIAPP_Calendar_detailsButtonTitle]]></VALUE>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <MSGTEXT><![CDATA[Edit Details]]></MSGTEXT>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--1992D30142A247FDA2F468AD7B4676E8-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--1992D30142A247FDA2F468AD7B4676E8--></AD_MESSAGE>
+
+<!--1A800E8EDF6742ADAB816BB29A76E85A--><AD_MESSAGE>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <AD_MESSAGE_ID><![CDATA[1A800E8EDF6742ADAB816BB29A76E85A]]></AD_MESSAGE_ID>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventDescriptionFieldTitle]]></VALUE>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <MSGTEXT><![CDATA[Description]]></MSGTEXT>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--1A800E8EDF6742ADAB816BB29A76E85A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--1A800E8EDF6742ADAB816BB29A76E85A--></AD_MESSAGE>
+
 <!--1B783EC678E644E385778D2D7D25A97B--><AD_MESSAGE>
 <!--1B783EC678E644E385778D2D7D25A97B-->  <AD_MESSAGE_ID><![CDATA[1B783EC678E644E385778D2D7D25A97B]]></AD_MESSAGE_ID>
 <!--1B783EC678E644E385778D2D7D25A97B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -797,6 +845,18 @@
 <!--5B1FB06A4EBA4654A9A93695434C72AE-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--5B1FB06A4EBA4654A9A93695434C72AE--></AD_MESSAGE>
 
+<!--5B6BB1B1B0E141DAB59A9497A2731F91--><AD_MESSAGE>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <AD_MESSAGE_ID><![CDATA[5B6BB1B1B0E141DAB59A9497A2731F91]]></AD_MESSAGE_ID>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventDurationFieldTitle]]></VALUE>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <MSGTEXT><![CDATA[Duration]]></MSGTEXT>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--5B6BB1B1B0E141DAB59A9497A2731F91--></AD_MESSAGE>
+
 <!--5C1ABC0CDF284B85A9D99E84993E1451--><AD_MESSAGE>
 <!--5C1ABC0CDF284B85A9D99E84993E1451-->  <AD_MESSAGE_ID><![CDATA[5C1ABC0CDF284B85A9D99E84993E1451]]></AD_MESSAGE_ID>
 <!--5C1ABC0CDF284B85A9D99E84993E1451-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -821,6 +881,18 @@
 <!--5DE5F76ED5B4497FACDC438893037484-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--5DE5F76ED5B4497FACDC438893037484--></AD_MESSAGE>
 
+<!--60924EA5030A4780ABF664B96BFAF6D4--><AD_MESSAGE>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <AD_MESSAGE_ID><![CDATA[60924EA5030A4780ABF664B96BFAF6D4]]></AD_MESSAGE_ID>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <VALUE><![CDATA[OBUIAPP_Calendar_timelineViewTitle]]></VALUE>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <MSGTEXT><![CDATA[Timeline]]></MSGTEXT>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--60924EA5030A4780ABF664B96BFAF6D4-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--60924EA5030A4780ABF664B96BFAF6D4--></AD_MESSAGE>
+
 <!--61D57958CEF64A7BA613DB200531AF36--><AD_MESSAGE>
 <!--61D57958CEF64A7BA613DB200531AF36-->  <AD_MESSAGE_ID><![CDATA[61D57958CEF64A7BA613DB200531AF36]]></AD_MESSAGE_ID>
 <!--61D57958CEF64A7BA613DB200531AF36-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -966,6 +1038,18 @@
 <!--6CFA4900AECA4A45B35FEE55EBA14D01-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--6CFA4900AECA4A45B35FEE55EBA14D01--></AD_MESSAGE>
 
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8--><AD_MESSAGE>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <AD_MESSAGE_ID><![CDATA[6ED8A7C3896C41CEA6B8F4A0353FADC8]]></AD_MESSAGE_ID>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventNameFieldTitle]]></VALUE>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <MSGTEXT><![CDATA[Event Name]]></MSGTEXT>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--6ED8A7C3896C41CEA6B8F4A0353FADC8--></AD_MESSAGE>
+
 <!--70F4036849EC4F6AA0DA887F7DC8A51E--><AD_MESSAGE>
 <!--70F4036849EC4F6AA0DA887F7DC8A51E-->  <AD_MESSAGE_ID><![CDATA[70F4036849EC4F6AA0DA887F7DC8A51E]]></AD_MESSAGE_ID>
 <!--70F4036849EC4F6AA0DA887F7DC8A51E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1051,6 +1135,18 @@
 <!--75E47FA30B8D438E9569B4C688E863EB-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--75E47FA30B8D438E9569B4C688E863EB--></AD_MESSAGE>
 
+<!--7618B9203CE045449E8BC8994FF8282A--><AD_MESSAGE>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <AD_MESSAGE_ID><![CDATA[7618B9203CE045449E8BC8994FF8282A]]></AD_MESSAGE_ID>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <VALUE><![CDATA[OBUIAPP_Calendar_cancelButtonTitle]]></VALUE>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <MSGTEXT><![CDATA[Cancel]]></MSGTEXT>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--7618B9203CE045449E8BC8994FF8282A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--7618B9203CE045449E8BC8994FF8282A--></AD_MESSAGE>
+
 <!--787E5B6A41DB42B7A79F9789C696FE79--><AD_MESSAGE>
 <!--787E5B6A41DB42B7A79F9789C696FE79-->  <AD_MESSAGE_ID><![CDATA[787E5B6A41DB42B7A79F9789C696FE79]]></AD_MESSAGE_ID>
 <!--787E5B6A41DB42B7A79F9789C696FE79-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1196,6 +1292,18 @@
 <!--8A04AE875EC045B48038ADBCD2F66D8A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--8A04AE875EC045B48038ADBCD2F66D8A--></AD_MESSAGE>
 
+<!--8DBDA187D1454A0693B8EACDE3F630BD--><AD_MESSAGE>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <AD_MESSAGE_ID><![CDATA[8DBDA187D1454A0693B8EACDE3F630BD]]></AD_MESSAGE_ID>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventSublaneFieldTitle]]></VALUE>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <MSGTEXT><![CDATA[Sublane]]></MSGTEXT>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--8DBDA187D1454A0693B8EACDE3F630BD-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--8DBDA187D1454A0693B8EACDE3F630BD--></AD_MESSAGE>
+
 <!--8ED6AE4FCFA9483EB97B9109BBDFADBD--><AD_MESSAGE>
 <!--8ED6AE4FCFA9483EB97B9109BBDFADBD-->  <AD_MESSAGE_ID><![CDATA[8ED6AE4FCFA9483EB97B9109BBDFADBD]]></AD_MESSAGE_ID>
 <!--8ED6AE4FCFA9483EB97B9109BBDFADBD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1220,6 +1328,18 @@
 <!--90842C50FEE14D7FB3F24DDBC10CE9EC-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--90842C50FEE14D7FB3F24DDBC10CE9EC--></AD_MESSAGE>
 
+<!--9184CFADEBD64B8BBD39C41DC2C15C32--><AD_MESSAGE>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <AD_MESSAGE_ID><![CDATA[9184CFADEBD64B8BBD39C41DC2C15C32]]></AD_MESSAGE_ID>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <VALUE><![CDATA[OBUIAPP_Calendar_saveButtonTitle]]></VALUE>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <MSGTEXT><![CDATA[Save Event]]></MSGTEXT>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--9184CFADEBD64B8BBD39C41DC2C15C32--></AD_MESSAGE>
+
 <!--927A12CB292E4551924935C9EA80B049--><AD_MESSAGE>
 <!--927A12CB292E4551924935C9EA80B049-->  <AD_MESSAGE_ID><![CDATA[927A12CB292E4551924935C9EA80B049]]></AD_MESSAGE_ID>
 <!--927A12CB292E4551924935C9EA80B049-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1328,6 +1448,18 @@
 <!--9C214BA9E4974711A3368FF034CE2B0E-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--9C214BA9E4974711A3368FF034CE2B0E--></AD_MESSAGE>
 
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59--><AD_MESSAGE>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <AD_MESSAGE_ID><![CDATA[9CC65BCDF6894DAEA9FADB3B56C03C59]]></AD_MESSAGE_ID>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <VALUE><![CDATA[OBUIAPP_Calendar_datePickerHoverText]]></VALUE>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <MSGTEXT><![CDATA[Choose a date]]></MSGTEXT>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--9CC65BCDF6894DAEA9FADB3B56C03C59--></AD_MESSAGE>
+
 <!--9DFDAA99FA614533B4042E6C02266BC7--><AD_MESSAGE>
 <!--9DFDAA99FA614533B4042E6C02266BC7-->  <AD_MESSAGE_ID><![CDATA[9DFDAA99FA614533B4042E6C02266BC7]]></AD_MESSAGE_ID>
 <!--9DFDAA99FA614533B4042E6C02266BC7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1412,6 +1544,18 @@
 <!--A62959A6990A43089EEBDF89CE8FCC48-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--A62959A6990A43089EEBDF89CE8FCC48--></AD_MESSAGE>
 
+<!--A82A981043AB43219B9E2061E86AC223--><AD_MESSAGE>
+<!--A82A981043AB43219B9E2061E86AC223-->  <AD_MESSAGE_ID><![CDATA[A82A981043AB43219B9E2061E86AC223]]></AD_MESSAGE_ID>
+<!--A82A981043AB43219B9E2061E86AC223-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A82A981043AB43219B9E2061E86AC223-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A82A981043AB43219B9E2061E86AC223-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A82A981043AB43219B9E2061E86AC223-->  <VALUE><![CDATA[OBUIAPP_Calendar_previousButtonHoverText]]></VALUE>
+<!--A82A981043AB43219B9E2061E86AC223-->  <MSGTEXT><![CDATA[Previous]]></MSGTEXT>
+<!--A82A981043AB43219B9E2061E86AC223-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--A82A981043AB43219B9E2061E86AC223-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--A82A981043AB43219B9E2061E86AC223-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--A82A981043AB43219B9E2061E86AC223--></AD_MESSAGE>
+
 <!--ABFDBB83F58841EA9545D9ED8637513B--><AD_MESSAGE>
 <!--ABFDBB83F58841EA9545D9ED8637513B-->  <AD_MESSAGE_ID><![CDATA[ABFDBB83F58841EA9545D9ED8637513B]]></AD_MESSAGE_ID>
 <!--ABFDBB83F58841EA9545D9ED8637513B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1557,6 +1701,18 @@
 <!--BCA6318A99B54DB5A27D319C6569316B-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--BCA6318A99B54DB5A27D319C6569316B--></AD_MESSAGE>
 
+<!--C042034C61E444BCADE56F818FCFD88A--><AD_MESSAGE>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <AD_MESSAGE_ID><![CDATA[C042034C61E444BCADE56F818FCFD88A]]></AD_MESSAGE_ID>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <VALUE><![CDATA[OBUIAPP_Calendar_invalidDateMessage]]></VALUE>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <MSGTEXT><![CDATA[From must be before To]]></MSGTEXT>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--C042034C61E444BCADE56F818FCFD88A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--C042034C61E444BCADE56F818FCFD88A--></AD_MESSAGE>
+
 <!--C2E68125A8E7418FA7CC0CC3779EAFD0--><AD_MESSAGE>
 <!--C2E68125A8E7418FA7CC0CC3779EAFD0-->  <AD_MESSAGE_ID><![CDATA[C2E68125A8E7418FA7CC0CC3779EAFD0]]></AD_MESSAGE_ID>
 <!--C2E68125A8E7418FA7CC0CC3779EAFD0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2025,6 +2181,18 @@
 <!--EE6743B612B74EF5A934923ED8405B07-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--EE6743B612B74EF5A934923ED8405B07--></AD_MESSAGE>
 
+<!--EE6D381030514D96AF7B81EA388C9DDD--><AD_MESSAGE>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <AD_MESSAGE_ID><![CDATA[EE6D381030514D96AF7B81EA388C9DDD]]></AD_MESSAGE_ID>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventLaneFieldTitle]]></VALUE>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <MSGTEXT><![CDATA[Lane]]></MSGTEXT>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--EE6D381030514D96AF7B81EA388C9DDD-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--EE6D381030514D96AF7B81EA388C9DDD--></AD_MESSAGE>
+
 <!--EE927849CF7D4247B9E8907A91DA2A79--><AD_MESSAGE>
 <!--EE927849CF7D4247B9E8907A91DA2A79-->  <AD_MESSAGE_ID><![CDATA[EE927849CF7D4247B9E8907A91DA2A79]]></AD_MESSAGE_ID>
 <!--EE927849CF7D4247B9E8907A91DA2A79-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2074,6 +2242,30 @@
 <!--F6836B6ADBBD43EBB08126F0E1482CD1-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--F6836B6ADBBD43EBB08126F0E1482CD1--></AD_MESSAGE>
 
+<!--F7FD570AFE23408E8C97A42B0FF591C0--><AD_MESSAGE>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <AD_MESSAGE_ID><![CDATA[F7FD570AFE23408E8C97A42B0FF591C0]]></AD_MESSAGE_ID>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <VALUE><![CDATA[OBUIAPP_Calendar_addEventButtonHoverText]]></VALUE>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <MSGTEXT><![CDATA[Add an event]]></MSGTEXT>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--F7FD570AFE23408E8C97A42B0FF591C0-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--F7FD570AFE23408E8C97A42B0FF591C0--></AD_MESSAGE>
+
+<!--F892B8B5D16848C7ADE8633C14218CAF--><AD_MESSAGE>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <AD_MESSAGE_ID><![CDATA[F892B8B5D16848C7ADE8633C14218CAF]]></AD_MESSAGE_ID>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <VALUE><![CDATA[OBUIAPP_Calendar_eventStartDateFieldTitle]]></VALUE>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <MSGTEXT><![CDATA[From]]></MSGTEXT>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--F892B8B5D16848C7ADE8633C14218CAF-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--F892B8B5D16848C7ADE8633C14218CAF--></AD_MESSAGE>
+
 <!--FAF1675F98A248C39469E132D1B0E2DE--><AD_MESSAGE>
 <!--FAF1675F98A248C39469E132D1B0E2DE-->  <AD_MESSAGE_ID><![CDATA[FAF1675F98A248C39469E132D1B0E2DE]]></AD_MESSAGE_ID>
 <!--FAF1675F98A248C39469E132D1B0E2DE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2086,6 +2278,18 @@
 <!--FAF1675F98A248C39469E132D1B0E2DE-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--FAF1675F98A248C39469E132D1B0E2DE--></AD_MESSAGE>
 
+<!--FB42B1902BBC4F2A8ECAAC0584773F08--><AD_MESSAGE>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <AD_MESSAGE_ID><![CDATA[FB42B1902BBC4F2A8ECAAC0584773F08]]></AD_MESSAGE_ID>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <VALUE><![CDATA[OBUIAPP_Timeout]]></VALUE>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <MSGTEXT><![CDATA[Timeout]]></MSGTEXT>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--FB42B1902BBC4F2A8ECAAC0584773F08--></AD_MESSAGE>
+
 <!--FBA2F11416C4413F8E2D554119461964--><AD_MESSAGE>
 <!--FBA2F11416C4413F8E2D554119461964-->  <AD_MESSAGE_ID><![CDATA[FBA2F11416C4413F8E2D554119461964]]></AD_MESSAGE_ID>
 <!--FBA2F11416C4413F8E2D554119461964-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java	Mon Aug 29 09:04:15 2016 +0200
@@ -477,6 +477,9 @@
     globalResources.add(createStaticResource("web/js/productCharacteristicsProcess.js", true));
     globalResources.add(createStaticResource("web/js/recalculatePermissionsProcess.js", true));
     globalResources.add(createStaticResource("web/js/validateCostingRuleProcess.js", true));
+    globalResources.add(createStaticResource("web/js/cancelAndReplaceSalesOrderProcess.js", false));
+    globalResources.add(createStaticResource("web/js/confirmCancelAndReplaceSalesOrderProcess.js",
+        false));
     globalResources.add(createStaticResource("web/js/checkAvailableCredit.js", true));
 
     // Product Services
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013-2015 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -58,13 +58,30 @@
 
 
 isc.OBCalendar.addProperties({
+  timelineViewTitle: OB.I18N.getLabel('OBUIAPP_Calendar_timelineViewTitle'),
+  eventNameFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventNameFieldTitle'),
+  eventStartDateFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventStartDateFieldTitle'),
+  eventEndDateFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventEndDateFieldTitle'),
+  eventDescriptionFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventDescriptionFieldTitle'),
+  eventLaneFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventLaneFieldTitle'),
+  eventSublaneFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventSublaneFieldTitle'),
+  eventDurationFieldTitle: OB.I18N.getLabel('OBUIAPP_Calendar_eventDurationFieldTitle'),
+  saveButtonTitle: OB.I18N.getLabel('OBUIAPP_Calendar_saveButtonTitle'),
+  detailsButtonTitle: OB.I18N.getLabel('OBUIAPP_Calendar_detailsButtonTitle'),
+  cancelButtonTitle: OB.I18N.getLabel('OBUIAPP_Calendar_cancelButtonTitle'),
+  previousButtonHoverText: OB.I18N.getLabel('OBUIAPP_Calendar_previousButtonHoverText'),
+  nextButtonHoverText: OB.I18N.getLabel('OBUIAPP_Calendar_nextButtonHoverText'),
+  addEventButtonHoverText: OB.I18N.getLabel('OBUIAPP_Calendar_addEventButtonHoverText'),
+  datePickerHoverText: OB.I18N.getLabel('OBUIAPP_Calendar_datePickerHoverText'),
+  invalidDateMessage: OB.I18N.getLabel('OBUIAPP_Calendar_invalidDateMessage'),
+
   autoFetchData: true,
   mainViewConstructor: isc.OBCalendarTabSet,
   useEventCanvasRolloverControls: false,
   eventDialogConstructor: isc.OBCalendar_EventDialogBridge,
   eventsAdaptationRequired: true,
   initWidget: function () {
-    var calendar = this,
+    var timeLabels, calendar = this,
         multiCalendar = this.multiCalendar;
 
     if (!this.eventIdField) {
@@ -187,6 +204,12 @@
               calendar.OBEventEditor.closeClick();
             }
           }
+          if (typeof calendar.customFinishLoad === 'function') {
+            window.setTimeout(function () {
+              calendar.customFinishLoad();
+            }, 500);
+          }
+
           return this.Super('transformResponse', arguments);
         },
 
@@ -239,6 +262,20 @@
       });
     }
 
+    if (OB.Utilities.getTimeFormatDefinition().timeFormatter.indexOf('24Hour') !== -1) {
+      this.timeFormatter = 'toShortPadded24HourTime';
+    } else {
+      this.timeFormatter = 'toShortPaddedTime';
+    }
+
+    timeLabels = OB.I18N.getLabel('OBUIAPP_TimeUnits');
+    if (timeLabels) {
+      timeLabels = timeLabels.split(',');
+      this.dayViewTitle = timeLabels[16];
+      this.weekViewTitle = timeLabels[10];
+      this.monthViewTitle = timeLabels[6];
+    }
+
     this.Super('initWidget', arguments);
     this.controlsBar.reorderMember(4, 1); // Moves the 'next' button to the second position
     this.controlsBar.reorderMember(2, 4); // Moves the 'displayed date' to last position
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -385,6 +385,7 @@
   defaultLayoutAlign: 'center',
   filter: null,
   dateChooser: null,
+  button: null,
   legend: null,
   getFilterValueMap: function () {
     var filterObj = {},
@@ -467,7 +468,7 @@
         height: 8
       });
     }
-    button = isc.OBFormButton.create({
+    this.button = isc.OBFormButton.create({
       width: 180,
       title: this.multiCalendar.addEventButtonName,
       click: function () {
@@ -516,7 +517,7 @@
     this.legend.updateMembers(leftControls.getLegendValueMap());
     this.addMembers([this.filter]);
     if (this.multiCalendar.canCreateEvents) {
-      this.addMembers([button]);
+      this.addMembers([this.button]);
     }
     this.addMembers([this.dateChooser, this.customFiltersContainer, label, this.legend]);
   }
@@ -671,7 +672,8 @@
       me.drawComponents();
     };
     OB.RemoteCallManager.call(this.calendarProps.calendarDataActionHandler, {
-      action: this.calendarProps.calendarDataActionHandler_Action
+      action: this.calendarProps.calendarDataActionHandler_Action,
+      reservationType: this.calendarProps.reservationType
     }, {}, callback);
   },
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Mon Aug 29 09:04:15 2016 +0200
@@ -532,8 +532,8 @@
 
   for (i = 0; i < length; i++) {
     hash = hashes[i].split('=');
-    if (hash[i] && hash[i].contains('#')) {
-      hash[i] = hash[i].substring(0, hash[i].indexOf('#'));
+    if (hash[1] && hash[1].contains('#')) {
+      hash[1] = hash[1].substring(0, hash[1].indexOf('#'));
     }
     vars[hash[0]] = hash[1];
   }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2013 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -478,14 +478,15 @@
     //
     restoreState: function (newState, data) {
 
-      var viewId, tabSet = OB.MainView.TabSet,
-          tabsLength, i, tabObject, hasChanged = false,
+      var viewId, tabSet, tabsLength, i, tabObject, hasChanged = false,
           stateData, requestViewsRestoreState;
 
-      if (vmgr.inStateHandling) {
+      if (vmgr.inStateHandling || !OB.MainView) {
         return;
       }
 
+      tabSet = OB.MainView.TabSet;
+
       vmgr.inStateHandling = true;
 
       // create an empty layout
@@ -608,8 +609,10 @@
     },
 
     createAddStartTab: function () {
-      var error, historyId = isc.History.getCurrentHistoryId();
-      if (historyId) {
+      var error, historyId = isc.History.getCurrentHistoryId(),
+          urlParams = OB.Utilities.getUrlParameters();
+
+      if (historyId && !urlParams.urlMode) {
         try {
           OB.Layout.HistoryManager.restoreHistory(historyId, isc.History.getHistoryData(historyId));
           return;
@@ -618,30 +621,32 @@
         }
       }
 
-      // todo: this call in a way assumes that there is a myob module installed
-      // it is nicer to somehow set the page to load in a different way
-      // this can be done if an smartclient problem has been solved
-      // see this forum post:
-      // http://forums.smartclient.com/showthread.php?p=53077
-      var viewId = 'OBMyOpenbravoImplementation';
-      var viewParams = {
-        tabTitle: OB.I18N.getLabel('OBUIAPP_MyOpenbravo'),
-        myOB: true,
-        canClose: false
-      };
-      // check if there is already a start page, only open it if not
-      var viewTabId = this.views.getViewTabID(viewId, viewParams);
-      if (!viewTabId) {
-        this.openView(viewId, viewParams, null);
+      if (OB && OB.MainView && OB.MainView.TabSet) {
+        // todo: this call in a way assumes that there is a myob module installed
+        // it is nicer to somehow set the page to load in a different way
+        // this can be done if an smartclient problem has been solved
+        // see this forum post:
+        // http://forums.smartclient.com/showthread.php?p=53077
+        var viewId = 'OBMyOpenbravoImplementation';
+        var viewParams = {
+          tabTitle: OB.I18N.getLabel('OBUIAPP_MyOpenbravo'),
+          myOB: true,
+          canClose: false
+        };
+        // check if there is already a start page, only open it if not
+        var viewTabId = this.views.getViewTabID(viewId, viewParams);
+        if (!viewTabId) {
+          this.openView(viewId, viewParams, null);
+        }
       }
 
       // check if a tabId was passed as a url param
       // only do this if there is no other history
-      if (!historyId) {
-        var urlParams = OB.Utilities.getUrlParameters();
-        if (urlParams.tabId) {
-          OB.Utilities.openDirectTab(urlParams.tabId, urlParams.recordId, urlParams.command);
-        }
+      if (!historyId && urlParams.tabId) {
+        OB.Utilities.openDirectTab(urlParams.tabId, urlParams.recordId, urlParams.command);
+      }
+      if (urlParams.urlMode && OB.UrlModes[urlParams.urlMode]) {
+        OB.UrlModes[urlParams.urlMode].action(urlParams);
       }
     }
   };
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -24,6 +24,18 @@
 <!--03D018ABB0414D18A1B60782C0DD1389-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--03D018ABB0414D18A1B60782C0DD1389--></AD_MESSAGE>
 
+<!--046915CEE05D4573AF787D442628C453--><AD_MESSAGE>
+<!--046915CEE05D4573AF787D442628C453-->  <AD_MESSAGE_ID><![CDATA[046915CEE05D4573AF787D442628C453]]></AD_MESSAGE_ID>
+<!--046915CEE05D4573AF787D442628C453-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--046915CEE05D4573AF787D442628C453-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--046915CEE05D4573AF787D442628C453-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--046915CEE05D4573AF787D442628C453-->  <VALUE><![CDATA[OBKMO_ContactSystemAdmin]]></VALUE>
+<!--046915CEE05D4573AF787D442628C453-->  <MSGTEXT><![CDATA[Please contact your System Administrator.]]></MSGTEXT>
+<!--046915CEE05D4573AF787D442628C453-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--046915CEE05D4573AF787D442628C453-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--046915CEE05D4573AF787D442628C453-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--046915CEE05D4573AF787D442628C453--></AD_MESSAGE>
+
 <!--06E9344CB05A46F0BFEF458B0407002C--><AD_MESSAGE>
 <!--06E9344CB05A46F0BFEF458B0407002C-->  <AD_MESSAGE_ID><![CDATA[06E9344CB05A46F0BFEF458B0407002C]]></AD_MESSAGE_ID>
 <!--06E9344CB05A46F0BFEF458B0407002C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -420,6 +432,30 @@
 <!--E3D1B923F8E04C779E7D21999B43D709-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--E3D1B923F8E04C779E7D21999B43D709--></AD_MESSAGE>
 
+<!--E42923564BAD4EE2853E19DA0729E742--><AD_MESSAGE>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <AD_MESSAGE_ID><![CDATA[E42923564BAD4EE2853E19DA0729E742]]></AD_MESSAGE_ID>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <VALUE><![CDATA[OBKMO_ProblemLoadingWidget]]></VALUE>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <MSGTEXT><![CDATA[There has been a problem loading the widget with ID '%0'.]]></MSGTEXT>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--E42923564BAD4EE2853E19DA0729E742-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--E42923564BAD4EE2853E19DA0729E742--></AD_MESSAGE>
+
+<!--E67521112A4C4E25AD44125E51E55D9E--><AD_MESSAGE>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <AD_MESSAGE_ID><![CDATA[E67521112A4C4E25AD44125E51E55D9E]]></AD_MESSAGE_ID>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <VALUE><![CDATA[OBKMO_WidgetNotAvailableUserRole]]></VALUE>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <MSGTEXT><![CDATA[The widget is not available for the user '%0' with role '%1'.]]></MSGTEXT>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--E67521112A4C4E25AD44125E51E55D9E-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--E67521112A4C4E25AD44125E51E55D9E--></AD_MESSAGE>
+
 <!--F074D98ECE654C8A9D8D9B39AA81CFD3--><AD_MESSAGE>
 <!--F074D98ECE654C8A9D8D9B39AA81CFD3-->  <AD_MESSAGE_ID><![CDATA[F074D98ECE654C8A9D8D9B39AA81CFD3]]></AD_MESSAGE_ID>
 <!--F074D98ECE654C8A9D8D9B39AA81CFD3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,6 +29,11 @@
     if (!this.calendarProps.isMultiCalendar && this.parameters.legendId) {
       this.calendarProps.legendId = this.parameters.legendId;
     }
+
+    // If there are parameters passed standalone (for example: widget loaded directly from url with "&restoredDefaultViewName=week"), add them too to the calendarProps
+    isc.addProperties(this.calendarProps, this.parameters);
+    delete this.calendarProps.calendarProps;
+
     calendarProps = this.calendarProps;
 
     if (!calendarProps) {
@@ -64,7 +69,18 @@
   },
 
   refresh: function () {
-    this.members[1].members[0].members[0].initComponents();
+    var widget = null;
+    if (this.members[1]) {
+      widget = this.members[1].members[0].members[0];
+    } else if (this.members[0]) {
+      widget = this.members[0].members[0].members[0];
+    }
+    if (widget) {
+      if (widget.calendar.currentEventEditor) {
+        widget.calendar.currentEventEditor.hide();
+      }
+      widget.initComponents();
+    }
   },
 
   maximize: function () {
@@ -102,7 +118,7 @@
         canDelete: false
       }));
       this.addPortlet(widgetInstance);
-    } else {
+    } else if (OB.MainView) {
       //If the instance doesn't exist, just close the tab
       for (i = 0; i < OB.MainView.TabSet.tabs.length; i++) {
         if (OB.MainView.TabSet.tabs[i].title === 'OBCalendarWidgetView') {
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -417,8 +417,10 @@
 
 
   initWidget: function (args) {
-    this.createLeftColumnLayout();
-    this.createPortalLayout();
+    if (this.drawItems !== false) {
+      this.createLeftColumnLayout();
+      this.createPortalLayout();
+    }
 
     this.Super('initWidget', args);
 
@@ -431,6 +433,8 @@
       this.portalLayout.members[1].colNum = 1;
       this.portalLayout.sendEvents = true;
       this.reloadWidgets();
+    } else if (this.drawItems === false && OB.Application.licenseType !== 'C') {
+      this.reloadWidgets();
     }
   },
 
@@ -597,24 +601,34 @@
     }
   },
 
-  // ** {{{ OBMyOpenbravo.addWidget(widgetProperties) }}} **
+  // ** {{{ OBMyOpenbravo.createWidgetInstance(widgetProperties) }}} **
   //
   // Will check if the widget class is already present, if so then
-  // it is instantiated. If not then the widgetClass is loaded from the
-  // server and when loaded, the instance is created.
+  // its instance is returned. If not then the widgetClass is loaded from the
+  // server and when loaded, the instance is returned.
   //
   // Parameters:
   // * {{{widgetProperties}}}: properties used to create an instance of the widget
   // like the widgetClassName, height and title 
-  addWidget: function (widgetProperties) {
+  // * {{{callback}}}: callback function to execute if the widget is not loaded yet
+  createWidgetInstance: function (widgetProperties, callback) {
     var i, widgetInstance;
 
+    if (widgetProperties.widgetClassId && !widgetProperties.widgetClassName) {
+      for (i = 0; i < this.availableWidgetClasses.length; i++) {
+        if (this.availableWidgetClasses[i].widgetClassId === widgetProperties.widgetClassId) {
+          widgetProperties.widgetClassName = this.availableWidgetClasses[i].widgetClassName;
+          break;
+        }
+      }
+    }
+
     // if not there yet load it
-    if (!isc.ClassFactory.getClass(widgetProperties.widgetClassName)) {
+    if (!isc.ClassFactory.getClass(widgetProperties.widgetClassName) && typeof callback === 'function') {
       var rpcMgr = isc.RPCManager;
       var reqObj = {
         data: isc.JSONEncoder.create({}).encode(widgetProperties),
-        callback: this.widgetLoadCallback,
+        callback: callback,
         evalResult: true,
         clientContext: {
           widgetManager: this,
@@ -635,24 +649,39 @@
           if (!localWidgetProperties.aboutFieldDefinitions) {
             localWidgetProperties.aboutFieldDefinitions = this.availableWidgetClasses[i].aboutFieldDefinitions;
           }
-          if (!localWidgetProperties.parameters) {
-            localWidgetProperties.parameters = isc.addProperties({}, widgetProperties.parameters);
-          }
+          localWidgetProperties.parameters = isc.addProperties({}, this.availableWidgetClasses[i].parameters, widgetProperties.parameters);
           break;
         }
       }
       widgetInstance = isc.ClassFactory.newInstance(widgetProperties.widgetClassName, localWidgetProperties);
-      widgetInstance.widgetManager = this;
-      this.portalLayout.addPortlet(widgetInstance, localWidgetProperties.colNum, localWidgetProperties.rowNum);
+      if (widgetInstance) {
+        widgetInstance.widgetManager = this;
+      }
+      return widgetInstance;
     }
   },
 
-  // ** {{{ OBMyOpenbravo.widgetLoadCallback(rpcResponse, data, rpcRequest) }}} **
+
+  // ** {{{ OBMyOpenbravo.addWidget(widgetProperties) }}} **
+  //
+  // Will add to the Workspace the widget defined in the
+  // widgetProperties parameter.
+  //
+  // Parameters:
+  // * {{{widgetProperties}}}: properties used to add the widget to the Workspace
+  addWidget: function (widgetProperties) {
+    if (this.portalLayout) {
+      var widgetInstance = this.createWidgetInstance(widgetProperties, this.addWidgetLoadCallback);
+      this.portalLayout.addPortlet(widgetInstance, widgetInstance.colNum, widgetInstance.rowNum);
+    }
+  },
+
+  // ** {{{ OBMyOpenbravo.addWidgetLoadCallback(rpcResponse, data, rpcRequest) }}} **
   //
   // Is called when the widget class has been loaded from the backend, method
   // will call the addWidget method again (as now the class is loaded).
   //
-  widgetLoadCallback: function (rpcResponse, data, rpcRequest) {
+  addWidgetLoadCallback: function (rpcResponse, data, rpcRequest) {
     var widgetProperties = rpcRequest.clientContext.widgetProperties;
     var widgetManager = rpcRequest.clientContext.widgetManager;
 
@@ -708,7 +737,9 @@
       }
 
       this.isReloading = false;
-      this.portalLayout.sendEvents = !this.adminMode;
+      if (this.portalLayout) {
+        this.portalLayout.sendEvents = !this.adminMode;
+      }
 
       this.notifyEvent('WIDGET_MOVED');
     }
@@ -789,9 +820,12 @@
   // The widgets cache is refreshed before sending the event notification to the backend
   //
   updateWidgetsCache: function (eventType, responseWidgets) {
-    var columns = this.portalLayout.getMembers(),
+    var columns = [],
         i, j, k, newWidget, col, rows, row, widget, newObj;
 
+    if (this.portalLayout) {
+      columns = this.portalLayout.getMembers();
+    }
     this.widgets = []; // clear cache
     if (eventType === 'RELOAD_WIDGETS' && isc.isAn.Array(responseWidgets)) {
       this.widgets = responseWidgets.duplicate();
@@ -902,7 +936,9 @@
         levelLabel, levelValueLabel;
 
     this.adminMode = true;
-    this.portalLayout.sendEvents = false;
+    if (this.portalLayout) {
+      this.portalLayout.sendEvents = false;
+    }
     this.adminLevel = level.getValue();
     this.adminLevelValue = levelValue.getValue ? levelValue.getValue() : '';
 
@@ -944,7 +980,9 @@
 
     this.reloadWidgets();
 
-    this.portalLayout.sendEvents = true;
+    if (this.portalLayout) {
+      this.portalLayout.sendEvents = true;
+    }
   },
 
   reloadWidgets: function () {
@@ -953,10 +991,12 @@
       return;
     }
 
-    this.portalLayout.sendEvents = false;
+    if (this.portalLayout) {
+      this.portalLayout.sendEvents = false;
+      this.portalLayout.getMembers()[0].removeAllRows();
+      this.portalLayout.getMembers()[1].removeAllRows();
+    }
     this.isReloading = true;
-    this.portalLayout.getMembers()[0].removeAllRows();
-    this.portalLayout.getMembers()[1].removeAllRows();
     this.notifyEvent('RELOAD_WIDGETS');
   }
 });
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js	Fri Aug 26 09:49:28 2016 +0200
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js	Mon Aug 29 09:04:15 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2015 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -522,4 +522,94 @@
     }
     this.switchMode();
   }
-});
\ No newline at end of file
+});
+
+
+OB.UrlModes = OB.UrlModes || {};
+OB.UrlModes.OBKMOWidget = OB.UrlModes.OBKMOWidget || {};
+
+OB.UrlModes.OBKMOWidget.customLayout = true;
+OB.UrlModes.OBKMOWidget.action = function (urlParams) {
+  var widgetClassId, inWidgetInFormMode, renderWidget;
+
+  widgetClassId = urlParams.widgetClassId;
+  delete urlParams.widgetClassId;
+
+  if (urlParams.inWidgetInFormMode === null || typeof urlParams.inWidgetInFormMode === 'undefined' || urlParams.inWidgetInFormMode === 'true' || urlParams.inWidgetInFormMode === true) {
+    inWidgetInFormMode = true;
+    isc.OBWidget.addProperties({
+      edgeSize: 0,
+      edgeTop: 0,
+      edgeBottom: 0,
+      edgeOffsetTop: 0,
+      edgeOffsetRight: 0,
+      edgeOffsetBottom: 0,
+      edgeOffsetLeft: 0
+    });
+  } else {
+    inWidgetInFormMode = false;
+  }
+  delete urlParams.inWidgetInFormMode;
+
+  var widgetProperties = {
+    widgetClassId: widgetClassId,
+    bodyColor: 'white',
+    inWidgetInFormMode: inWidgetInFormMode,
+    parameters: urlParams
+  };
+  var layout = isc.Layout.create({
+    width: '100%',
+    height: '100%',
+    members: []
+  });
+  OB.Layout.addMember(layout);
+  if (OB && !OB.MyOB) {
+    isc.OBMyOpenbravo.create({
+      drawItems: false
+    });
+  }
+  renderWidget = function (count) {
+    var showErrorMsg = function (text) {
+        isc.warn(text, function () {
+          return true;
+        }, {
+          icon: '[SKINIMG]Dialog/error.png',
+          title: OB.I18N.getLabel('OBUIAPP_Error')
+        });
+        };
+    var callback = function (rpcResponse, data, rpcRequest) {
+        widgetProperties = rpcRequest.clientContext.widgetProperties;
+        if (!isc.ClassFactory.getClass(widgetProperties.widgetClassName)) {
+          showErrorMsg(OB.I18N.getLabel('OBKMO_ProblemLoadingWidget', [widgetProperties.widgetClassId]) + '<br />' + OB.I18N.getLabel('OBKMO_WidgetNotAvailableUserRole', [OB.User.userName, OB.User.roleName]) + '<br />' + OB.I18N.getLabel('OBKMO_ContactSystemAdmin'));
+          return;
+        }
+        renderWidget(count + 1);
+        };
+    if (!count) {
+      count = 0;
+    } else if (count >= 150) {
+      showErrorMsg(OB.I18N.getLabel('OBKMO_ProblemLoadingWidget', [widgetProperties.widgetClassId]) + '<br />' + OB.I18N.getLabel('OBUIAPP_Timeout') + '<br />' + OB.I18N.getLabel('OBKMO_ContactSystemAdmin'));
+      return;
+    }
+
+    if (OB && OB.MyOB && OB.MyOB.createWidgetInstance) {
+      if (!OB.MyOB.availableWidgetClasses || OB.MyOB.availableWidgetClasses.length === 0) {
+        OB.MyOB.notifyEvent('RELOAD_WIDGETS');
+      } else {
+        var widgetInstance = OB.MyOB.createWidgetInstance(widgetProperties, callback);
+        if (widgetInstance) {
+          layout.addMember(widgetInstance);
+          return true;
+        } else {
+          showErrorMsg(OB.I18N.getLabel('OBKMO_ProblemLoadingWidget', [widgetProperties.widgetClassId]) + '<br />' + OB.I18N.getLabel('OBKMO_WidgetNotAvailableUserRole', [OB.User.userName, OB.User.roleName]) + '<br />' + OB.I18N.getLabel('OBKMO_ContactSystemAdmin'));
+          return;
+        }
+      }
+    }
+    setTimeout(function () {
+      renderWidget(count + 1);
+    }, 100);
+    return;
+  };
+  renderWidget();
+};
\ No newline at end of file
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -100,6 +100,7 @@
   END_PROCESSING BOOLEAN:=FALSE;
   v_CBPartner_ID VARCHAR2(32);
   rowcount NUMBER;
+  v_stockqty NUMBER;
 
   v_CumDiscount NUMBER;
   v_OldCumDiscount NUMBER;
@@ -322,6 +323,36 @@
       RAISE_APPLICATION_ERROR(-20000, '@CannotUseGenericProduct@ ' || v_productName);
     END IF;
 
+    /*Locked and Discontinued Products*/
+    IF (v_IsSOTrx = 'Y' AND v_DocAction='CO') THEN
+	    FOR Cur_line IN
+	      (SELECT SUM(ol.qtyordered) AS qtyordered, ol.ad_org_id, ol.m_product_id, ol.c_uom_id, COALESCE(ol.m_attributesetinstance_id, '0') AS m_attributesetinstance_id, COALESCE(ol.m_product_uom_id, '0') AS m_product_uom_id, p.islocked, p.issalediscontinued, p.name, p.isstocked, p.producttype
+	       FROM c_orderline ol JOIN m_product p ON ol.m_product_id = p.m_product_id
+	       WHERE ol.c_order_id = v_Record_ID 
+	       GROUP BY ol.ad_org_id, ol.m_product_id, ol.c_uom_id, COALESCE(ol.m_attributesetinstance_id, '0'), COALESCE(ol.m_product_uom_id, '0'), p.islocked, p.issalediscontinued, p.name, p.isstocked, p.producttype
+	      )
+	    LOOP
+          IF (Cur_line.isstocked = 'Y' AND Cur_line.producttype = 'I') THEN
+		    IF (Cur_line.islocked='Y') THEN
+			  RAISE_APPLICATION_ERROR(-20000, '@CannotUseLockedProduct@ ' || Cur_line.name);
+		    ELSIF (Cur_line.issalediscontinued='Y') THEN
+			  SELECT COALESCE(SUM(sd.qtyonhand-sd.reservedqty), 0) INTO v_stockqty
+			  FROM m_storage_detail sd
+			  JOIN m_locator loc on loc.m_locator_id = sd.m_locator_id
+			  WHERE sd.m_product_id = Cur_line.m_product_id
+              AND sd.c_uom_id = Cur_line.c_uom_id
+              AND COALESCE(sd.m_attributesetinstance_id, '0') = Cur_line.m_attributesetinstance_id
+              AND COALESCE(sd.m_product_uom_id, '0') = Cur_line.m_product_uom_id
+			  AND loc.m_warehouse_id IN (SELECT m_warehouse_id FROM AD_Org_Warehouse WHERE ad_org_id = v_Org_ID);
+
+			  IF (Cur_line.qtyordered > v_stockqty) THEN
+                RAISE_APPLICATION_ERROR(-20000, '@CannotUseDiscontinuedProduct@ ' || Cur_line.name || '. @ProductDiscontinuedNoStock@' || '(' || v_stockqty || ').');
+			  END IF;
+		    END IF;
+          END IF;
+	    END LOOP;
+    END IF;
+
     /** 
     * Quotations
     */
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -520,7 +520,7 @@
             (SELECT *
             FROM M_INOUTLINE
             WHERE M_InOut_ID=Cur_InOut.M_InOut_ID
-              AND IsActive='Y'  FOR UPDATE
+              AND IsActive='Y' ORDER BY line FOR UPDATE
             )
           LOOP
             -- Incomming or Outgoing :1:2
--- a/src-db/database/model/functions/M_MOVEMENT_POST.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/functions/M_MOVEMENT_POST.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -4,6 +4,9 @@
       <parameter name="pinstance_id" type="VARCHAR" mode="in">
         <default/>
       </parameter>
+      <parameter name="p_movement_id" type="VARCHAR" mode="in">
+        <default><![CDATA[NULL]]></default>
+      </parameter>
       <body><![CDATA[/*************************************************************************
   * The contents of this file are subject to the Compiere Public
   * License 1.1 ("License"); You may not use this file except in
@@ -56,30 +59,37 @@
     END_PROCESS BOOLEAN:=false;
     v_productname m_product.name%TYPE;
   BEGIN
+  IF (pinstance_id IS NOT NULL) THEN
     --  Update AD_PInstance
     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
-    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
-      v_Record_ID:=Cur_Parameter.Record_ID;
-      v_p_User:=Cur_Parameter.AD_User_ID;
-    END LOOP; -- Get Parameter
+	  IF (pinstance_id IS NOT NULL) THEN
+	    -- 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
+	      v_Record_ID:=Cur_Parameter.Record_ID;
+	      v_p_User:=Cur_Parameter.AD_User_ID;
+	    END LOOP; -- Get Parameter
+    ELSE
+	    v_Record_ID:=p_movement_id;
+      SELECT createdby INTO v_p_User FROM m_movement WHERE m_movement_id = v_Record_ID ;
+	  END IF;
     DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
     -- Reading Movement
     SELECT MovementDate,
@@ -337,9 +347,13 @@
     v_ResultStr:='UnLockingMovement';
     UPDATE M_Movement  SET Processing='N'  WHERE M_Movement_ID=v_Record_ID;
 
+    IF(pinstance_id IS NOT NULL) THEN
     --  Update AD_PInstance
-    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
-    AD_UPDATE_PINSTANCE(PInstance_ID, v_p_User, 'N', v_Result, v_Message) ;
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
+      AD_UPDATE_PINSTANCE(PInstance_ID, v_p_User, 'N', v_Result, v_Message) ;
+    ELSE
+      DBMS_OUTPUT.PUT_LINE('--<<M_MovementPost finished>>') ;
+    END IF ;
     RETURN;
   END; --BODY
 EXCEPTION
@@ -349,7 +363,9 @@
   ROLLBACK;
   UPDATE M_Movement  SET Processing='N',Updated=now(),UpdatedBy=v_p_User  WHERE M_Movement_ID=v_Record_ID;
   -- Commented by cromero 19102006 COMMIT;
-  AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  IF(pinstance_id IS NOT NULL) THEN
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  END IF ;
   RETURN;
 END M_MOVEMENT_POST
 ]]></body>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_MOVEMENT_POST0.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_MOVEMENT_POST0">
+    <function name="M_MOVEMENT_POST0" type="NULL">
+      <parameter name="pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+  * The contents of this file are subject to the Compiere Public
+  * License 1.1 ("License"); You may not use this file except in
+  * compliance with the License. You may obtain a copy of the License in
+  * the legal folder of your Openbravo installation.
+  * 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  Compiere  ERP &  Business Solution
+  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
+  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+  * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+  * All Rights Reserved.
+  * Contributor(s): Openbravo SLU
+  * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+  *
+  * Specifically, this derivative work is based upon the following Compiere
+  * file and version.
+  *************************************************************************
+  * $Id: C_Invoice_Post0.sql,v 1.2 2002/10/21 04:49:46 jjanke Exp $
+  ***
+  * Title:  Post single Invoice
+  *************************************************************************/
+BEGIN
+  M_MOVEMENT_POST(pinstance_id, NULL);
+END M_MOVEMENT_POST0
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/functions/M_RESERVATION_CONSUMPTION.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/functions/M_RESERVATION_CONSUMPTION.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -34,7 +34,7 @@
 * 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-2013 Openbravo SLU
+* All portions are Copyright (C) 2012-2016 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -52,9 +52,9 @@
   v_this_sd_reserved    NUMBER;
   v_qtytorelease        NUMBER;
   v_attr_description    VARCHAR2(255);
-  v_product_value       VARCHAR2(40);
-  v_locator_value       VARCHAR2(40);
-  v_uom_value           VARCHAR2(3);
+  v_product_value       M_PRODUCT.value%type;
+  v_locator_value       M_LOCATOR.value%type;
+  v_uom_value           C_UOM.uomsymbol%type;
 
   TYPE RECORD IS REF CURSOR;
   cur_reserved_stock    RECORD;
--- a/src-db/database/model/functions/M_RESERVE_STOCK_AUTO.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/functions/M_RESERVE_STOCK_AUTO.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -86,6 +86,7 @@
   END; -- End Call M_GET_STOCK
   
   v_pendingqty := v_pendingtoreserveqty;
+  
   FOR cur_stock IN (
     SELECT sp.quantity, sp.m_storage_detail_id, w.isallocated
     FROM m_stock_proposed sp
--- a/src-db/database/model/tables/C_BPARTNER.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/tables/C_BPARTNER.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -377,6 +377,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="BIRTHPLACE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="BIRTHDAY" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_LANGUAGE" name="AD_LANGUAGE_C_BUSPARTNER">
         <reference local="AD_LANGUAGE" foreign="AD_LANGUAGE"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_ORDER.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/tables/C_ORDER.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -341,6 +341,30 @@
         <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>
+      <column name="CANCELLEDORDER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="REPLACEDORDER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISCANCELLED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault><![CDATA['N']]></onCreateDefault>
+      </column>
+      <column name="REPLACEMENTORDER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" 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>
@@ -401,6 +425,9 @@
       <foreign-key foreignTable="C_RETURN_REASON" name="C_ORDER_C_RETURN_REASON">
         <reference local="C_RETURN_REASON_ID" foreign="C_RETURN_REASON_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ORDER" name="C_ORDER_CANCELLEDORDER">
+        <reference local="CANCELLEDORDER_ID" foreign="C_ORDER_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="C_ORDER_DROPSHIP_BPARTNER">
         <reference local="DROPSHIP_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
@@ -428,6 +455,12 @@
       <foreign-key foreignTable="C_REJECT_REASON" name="C_ORDER_REJECT_REASON">
         <reference local="C_REJECT_REASON_ID" foreign="C_REJECT_REASON_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ORDER" name="C_ORDER_REPLACEDORDER">
+        <reference local="REPLACEDORDER_ID" foreign="C_ORDER_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="C_ORDER" name="C_ORDER_REPLACEMENTORDER">
+        <reference local="REPLACEMENTORDER_ID" foreign="C_ORDER_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_USER" name="C_ORDER_SALESREP">
         <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
       </foreign-key>
@@ -446,6 +479,9 @@
       <index name="C_ORDER_C_RETURN_REASON" unique="false">
         <index-column name="C_RETURN_REASON_ID"/>
       </index>
+      <index name="C_ORDER_CANCELLEDORDER_ID" unique="false">
+        <index-column name="CANCELLEDORDER_ID"/>
+      </index>
       <index name="C_ORDER_CLIENT_ORG_DATE_DOCNO" unique="false">
         <index-column name="AD_CLIENT_ID"/>
         <index-column name="AD_ORG_ID"/>
@@ -466,10 +502,17 @@
       <index name="C_ORDER_POSTED" unique="false">
         <index-column name="POSTED"/>
       </index>
+      <index name="C_ORDER_REPLACEDORDER_ID" unique="false">
+        <index-column name="REPLACEDORDER_ID"/>
+      </index>
+      <index name="C_ORDER_REPLACEMENTORDER_ID" unique="false">
+        <index-column name="REPLACEMENTORDER_ID"/>
+      </index>
       <index name="C_ORDER_UPDATED" unique="false">
         <index-column name="UPDATED"/>
       </index>
       <check name="C_ORDER_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+      <check name="C_ORDER_ISCANCELANDREPLA_CHECK"><![CDATA[ISCANCELLED IN ('Y', 'N')]]></check>
       <check name="C_ORDER_ISCASHVAT_CH"><![CDATA[ISCASHVAT IN ('Y', 'N')]]></check>
       <check name="C_ORDER_ISDELIVERED_CHECK"><![CDATA[ISDELIVERED IN ('Y', 'N')]]></check>
       <check name="C_ORDER_ISDISCOUNTPRINTED_CHK"><![CDATA[ISDISCOUNTPRINTED IN ('Y', 'N')]]></check>
--- a/src-db/database/model/tables/C_ORDERLINE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/tables/C_ORDERLINE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -269,6 +269,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="REPLACEDORDERLINE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <column name="PRINT_DESCRIPTION" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
@@ -350,6 +354,9 @@
       <foreign-key foreignTable="C_ORDERLINE" name="C_ORDERLINE_QUOTATION">
         <reference local="QUOTATIONLINE_ID" foreign="C_ORDERLINE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ORDERLINE" name="C_ORDERLINE_REPLACEDORDERLINE">
+        <reference local="REPLACEDORDERLINE_ID" foreign="C_ORDERLINE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="S_RESOURCEASSIGNMENT" name="C_ORDERLINE_S_RESOURCEASSIGNME">
         <reference local="S_RESOURCEASSIGNMENT_ID" foreign="S_RESOURCEASSIGNMENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_PRODUCT.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/tables/M_PRODUCT.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -405,6 +405,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="ISLOCKED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="ISSALEDISCONTINUED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_MPRODUCT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
@@ -507,6 +515,7 @@
       <check name="M_PROD_LINKEDTOPRODUCT_CHECK"><![CDATA[ISLINKEDTOPRODUCT IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ATSETVALTYPE_CHK"><![CDATA[M_ATTRIBUTESETINSTANCE_ID IS NULL OR ATTRSETVALUETYPE IS NOT NULL]]></check>
       <check name="M_PRODUCT_DISCONTINUED_CHECK"><![CDATA[DISCONTINUED IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_DISCSTOCKED_CHK"><![CDATA[NOT (ISSALEDISCONTINUED = 'Y' AND (ISSTOCKED = 'N' OR PRODUCTTYPE <> 'I'))]]></check>
       <check name="M_PRODUCT_ENFORCE_ATTRIBUT_CHK"><![CDATA[ENFORCE_ATTRIBUTE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISBOM_CHECK"><![CDATA[ISBOM IN ('Y', 'N')]]></check>
@@ -514,14 +523,17 @@
       <check name="M_PRODUCT_ISEXPDEFERRED_CHK"><![CDATA[ISDEFERREDEXPENSE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISGENERIC"><![CDATA[ISGENERIC IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISINVOICEPRINTDE_CHK"><![CDATA[ISINVOICEPRINTDETAILS IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_ISLOCKED_CHK"><![CDATA[ISLOCKED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISPICKLISTPRINTD_CHK"><![CDATA[ISPICKLISTPRINTDETAILS IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISPURCHASED_CHECK"><![CDATA[ISPURCHASED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISQTYVAR_CHECK"><![CDATA[ISQUANTITYVARIABLE IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISREVDEFCOMPLETE_CHK"><![CDATA[ISDEFERREDREVENUE = 'N' OR ISDEFERREDREVENUE = 'Y' AND REVPLANTYPE IS NOT NULL AND DEFAULTPERIOD IS NOT NULL AND PERIODNUMBER IS NOT NULL]]></check>
       <check name="M_PRODUCT_ISREVDEFERRED_CHK"><![CDATA[ISDEFERREDREVENUE IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_ISSALESDISC_CHK"><![CDATA[ISSALEDISCONTINUED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISSOLD_CHECK"><![CDATA[ISSOLD IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISSTOCKED_CHECK"><![CDATA[ISSTOCKED IN ('Y', 'N')]]></check>
       <check name="M_PRODUCT_ISVERIFIED_CHECK"><![CDATA[ISVERIFIED IN ('Y', 'N')]]></check>
+      <check name="M_PRODUCT_LOCKEDPRODTYPE_CHK"><![CDATA[NOT (ISLOCKED = 'Y' AND PRODUCTTYPE <> 'I')]]></check>
       <check name="M_PRODUCT_PERIODNUMBER_CHK"><![CDATA[ISDEFERREDREVENUE = 'Y' AND PERIODNUMBER > 0 OR ISDEFERREDREVENUE = 'N']]></check>
       <check name="M_PRODUCT_PERIODNUMEXP_CHK"><![CDATA[ISDEFERREDEXPENSE = 'Y' AND PERIODNUMBER_EXP > 0 OR ISDEFERREDEXPENSE = 'N']]></check>
       <check name="M_PRODUCT_PRICERULEBASED_CHECK"><![CDATA[ISPRICERULEBASED IN ('Y', 'N')]]></check>
--- a/src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW C_INVOICE_CANDIDATE_V">
-    <view name="C_INVOICE_CANDIDATE_V"><![CDATA[SELECT sq.ad_client_id, sq.ad_org_id, sq.c_bpartner_id, sq.c_order_id, sq.documentno, sq.dateordered, sq.c_doctype_id, sq.amountlines, sq.amountlinesgross, sq.notinvoicedlines, round(sq.notinvoicedlinesgross, c.stdprecision) AS notinvoicedlinesgross, sq.term, sq.pendinglines, round(sq.pendinglinesgross, c.stdprecision) AS pendinglinesgross, sq.qtyordered, sq.qtydelivered FROM (SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, o.grandtotal AS amountlinesgross, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision)) AS notinvoicedlines, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision) * (1 + t.rate / 100)) AS notinvoicedlinesgross, o.invoicerule AS term, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision)) AS pendinglines, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision) * (1 + t.rate / 100)) AS pendinglinesgross, sum(abs(l.qtyordered)) AS qtyordered, sum(abs(l.qtydelivered)) AS qtydelivered, o.m_pricelist_id, c_1.c_currency_id FROM c_order o JOIN m_pricelist p_1 ON o.m_pricelist_id = p_1.m_pricelist_id JOIN c_currency c_1 ON p_1.c_currency_id = c_1.c_currency_id JOIN c_orderline l ON o.c_order_id = l.c_order_id JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id JOIN c_tax t ON t.c_tax_id = l.c_tax_id LEFT JOIN c_invoiceschedule si ON bp.c_invoiceschedule_id = si.c_invoiceschedule_id WHERE (o.docstatus IN ('CO', 'CL', 'IP')) AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id FROM c_doctype WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB', 'WR')))) AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' OR o.invoicerule = 'S' AND (si.invoicefrequency IS NULL OR si.invoicefrequency = 'D' OR si.invoicefrequency = 'W' OR si.invoicefrequency = 'T' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1) OR trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff + 14) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday + 14) OR si.invoicefrequency = 'M' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1))) AND (abs(l.qtyordered - l.qtyinvoiced) <> 0 OR abs(l.qtydelivered - l.qtyinvoiced) <> 0) GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines, o.grandtotal, o.invoicerule, o.m_pricelist_id, c_1.c_currency_id) sq JOIN m_pricelist p ON sq.m_pricelist_id = p.m_pricelist_id JOIN c_currency c ON sq.c_currency_id = c.c_currency_id]]></view>
+    <view name="C_INVOICE_CANDIDATE_V"><![CDATA[SELECT sq.ad_client_id, sq.ad_org_id, sq.c_bpartner_id, sq.c_order_id, sq.documentno, sq.dateordered, sq.c_doctype_id, sq.amountlines, sq.amountlinesgross, sq.notinvoicedlines, round(sq.notinvoicedlinesgross, c.stdprecision) AS notinvoicedlinesgross, sq.term, sq.pendinglines, round(sq.pendinglinesgross, c.stdprecision) AS pendinglinesgross, sq.qtyordered, sq.qtydelivered FROM (SELECT o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines AS amountlines, o.grandtotal AS amountlinesgross, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision)) AS notinvoicedlines, sum(round((l.qtyordered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision) * (1 + t.rate / 100)) AS notinvoicedlinesgross, o.invoicerule AS term, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision)) AS pendinglines, sum(round((l.qtydelivered - l.qtyinvoiced) * l.priceactual, c_1.stdprecision) * (1 + t.rate / 100)) AS pendinglinesgross, sum(abs(l.qtyordered)) AS qtyordered, sum(abs(l.qtydelivered)) AS qtydelivered, o.m_pricelist_id, c_1.c_currency_id FROM c_order o JOIN m_pricelist p_1 ON o.m_pricelist_id = p_1.m_pricelist_id JOIN c_currency c_1 ON p_1.c_currency_id = c_1.c_currency_id JOIN c_orderline l ON o.c_order_id = l.c_order_id JOIN c_bpartner bp ON o.c_bpartner_id = bp.c_bpartner_id JOIN c_tax t ON t.c_tax_id = l.c_tax_id LEFT JOIN c_invoiceschedule si ON bp.c_invoiceschedule_id = si.c_invoiceschedule_id WHERE (o.docstatus IN ('CO', 'CL', 'IP')) AND (o.c_doctype_id IN (SELECT c_doctype.c_doctype_id FROM c_doctype WHERE c_doctype.docbasetype = 'SOO' AND (c_doctype.docsubtypeso NOT IN ('ON', 'OB')))) AND (o.invoicerule = 'I' OR o.invoicerule = 'O' OR o.invoicerule = 'N' OR o.invoicerule = 'D' OR o.invoicerule = 'S' AND (si.invoicefrequency IS NULL OR si.invoicefrequency = 'D' OR si.invoicefrequency = 'W' OR si.invoicefrequency = 'T' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1) OR trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff + 14) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday + 14) OR si.invoicefrequency = 'M' AND trunc(o.dateordered) <= (TRUNC(now(), 'MM') + si.invoicedaycutoff - 1) AND trunc(now()) >= (TRUNC(o.dateordered, 'MM') + si.invoiceday - 1))) AND (abs(l.qtyordered - l.qtyinvoiced) <> 0 OR abs(l.qtydelivered - l.qtyinvoiced) <> 0) GROUP BY o.ad_client_id, o.ad_org_id, o.c_bpartner_id, o.c_order_id, o.documentno, o.dateordered, o.c_doctype_id, o.totallines, o.grandtotal, o.invoicerule, o.m_pricelist_id, c_1.c_currency_id) sq JOIN m_pricelist p ON sq.m_pricelist_id = p.m_pricelist_id JOIN c_currency c ON sq.c_currency_id = c.c_currency_id]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_DETAIL_V">
-    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, psi.fin_payment_schedule_id AS fin_payment_sched_inv_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, p.fin_paymentmethod_id, p.fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id, p.status FROM fin_payment p LEFT JOIN fin_financial_account fa ON p.fin_financial_account_id = fa.fin_financial_account_id, fin_payment_detail pd JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id LEFT JOIN c_glitem gli ON pd.c_glitem_id = gli.c_glitem_id WHERE p.fin_payment_id = pd.fin_payment_id]]></view>
+    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, psi.fin_payment_schedule_id AS fin_payment_sched_inv_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, CASE p.amount WHEN 0 THEN NULL ELSE p.fin_paymentmethod_id END AS fin_paymentmethod_id, CASE p.amount WHEN 0 THEN NULL ELSE p.fin_financial_account_id END AS fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id, p.status FROM fin_payment p LEFT JOIN fin_financial_account fa ON p.fin_financial_account_id = fa.fin_financial_account_id, fin_payment_detail pd JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id LEFT JOIN fin_payment_schedule psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_schedule_id LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id LEFT JOIN fin_payment_schedule pso ON psd.fin_payment_schedule_order = pso.fin_payment_schedule_id LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id LEFT JOIN c_glitem gli ON pd.c_glitem_id = gli.c_glitem_id WHERE p.fin_payment_id = pd.fin_payment_id]]></view>
   </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -247002,6 +247002,44 @@
 <!--0FA23D0D90E34E8790627C9928566EE3-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--0FA23D0D90E34E8790627C9928566EE3--></AD_COLUMN>
 
+<!--1040A945DD4048AD8D43449847A6EB11--><AD_COLUMN>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_COLUMN_ID><![CDATA[1040A945DD4048AD8D43449847A6EB11]]></AD_COLUMN_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <NAME><![CDATA[Birth Day]]></NAME>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <DESCRIPTION><![CDATA[An anniversary of birth for a business partner.]]></DESCRIPTION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <HELP><![CDATA[Birthday or Anniversary day]]></HELP>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <COLUMNNAME><![CDATA[Birthday]]></COLUMNNAME>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_TABLE_ID><![CDATA[291]]></AD_TABLE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <SEQNO><![CDATA[620]]></SEQNO>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_ELEMENT_ID><![CDATA[1891]]></AD_ELEMENT_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <POSITION><![CDATA[96]]></POSITION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--1040A945DD4048AD8D43449847A6EB11--></AD_COLUMN>
+
 <!--1050C23BA102443A86AB2AF85D8F098D--><AD_COLUMN>
 <!--1050C23BA102443A86AB2AF85D8F098D-->  <AD_COLUMN_ID><![CDATA[1050C23BA102443A86AB2AF85D8F098D]]></AD_COLUMN_ID>
 <!--1050C23BA102443A86AB2AF85D8F098D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -247768,6 +247806,45 @@
 <!--129A714A729241E2ABB54C374A4031BD-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--129A714A729241E2ABB54C374A4031BD--></AD_COLUMN>
 
+<!--129F2530A63B4C7CA9AF17996732E6A4--><AD_COLUMN>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_COLUMN_ID><![CDATA[129F2530A63B4C7CA9AF17996732E6A4]]></AD_COLUMN_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <NAME><![CDATA[Cancelledorder]]></NAME>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <DESCRIPTION><![CDATA[Link to the order that has been cancelled]]></DESCRIPTION>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <HELP><![CDATA[Link to the order that has been cancelled]]></HELP>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <COLUMNNAME><![CDATA[Cancelledorder_id]]></COLUMNNAME>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_REFERENCE_VALUE_ID><![CDATA[290]]></AD_REFERENCE_VALUE_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <SEQNO><![CDATA[720]]></SEQNO>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_ELEMENT_ID><![CDATA[EB7F6DD0A85D48AD84ED48CF6D2C3776]]></AD_ELEMENT_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <POSITION><![CDATA[97]]></POSITION>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--129F2530A63B4C7CA9AF17996732E6A4--></AD_COLUMN>
+
 <!--12ABCD6B91A348CBB09D4629CA6E707A--><AD_COLUMN>
 <!--12ABCD6B91A348CBB09D4629CA6E707A-->  <AD_COLUMN_ID><![CDATA[12ABCD6B91A348CBB09D4629CA6E707A]]></AD_COLUMN_ID>
 <!--12ABCD6B91A348CBB09D4629CA6E707A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -248273,6 +248350,43 @@
 <!--141F54DBCEDE4F18BC55A8B30220745E-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--141F54DBCEDE4F18BC55A8B30220745E--></AD_COLUMN>
 
+<!--144504467AAF4239AE435F3D867341AB--><AD_COLUMN>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_COLUMN_ID><![CDATA[144504467AAF4239AE435F3D867341AB]]></AD_COLUMN_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--144504467AAF4239AE435F3D867341AB-->  <NAME><![CDATA[Islocked]]></NAME>
+<!--144504467AAF4239AE435F3D867341AB-->  <COLUMNNAME><![CDATA[Islocked]]></COLUMNNAME>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--144504467AAF4239AE435F3D867341AB-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--144504467AAF4239AE435F3D867341AB-->  <SEQNO><![CDATA[830]]></SEQNO>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_ELEMENT_ID><![CDATA[0DC2A64ABEB34DA5A7180687B56197F4]]></AD_ELEMENT_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--144504467AAF4239AE435F3D867341AB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--144504467AAF4239AE435F3D867341AB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--144504467AAF4239AE435F3D867341AB-->  <POSITION><![CDATA[126]]></POSITION>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--144504467AAF4239AE435F3D867341AB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--144504467AAF4239AE435F3D867341AB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--144504467AAF4239AE435F3D867341AB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--144504467AAF4239AE435F3D867341AB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--144504467AAF4239AE435F3D867341AB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--144504467AAF4239AE435F3D867341AB-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--144504467AAF4239AE435F3D867341AB--></AD_COLUMN>
+
 <!--14561DD2B91C4C2191931AC7C8C49579--><AD_COLUMN>
 <!--14561DD2B91C4C2191931AC7C8C49579-->  <AD_COLUMN_ID><![CDATA[14561DD2B91C4C2191931AC7C8C49579]]></AD_COLUMN_ID>
 <!--14561DD2B91C4C2191931AC7C8C49579-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -266055,6 +266169,45 @@
 <!--51C9656E43E6464FB6AA62A1E40B0411-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--51C9656E43E6464FB6AA62A1E40B0411--></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-->  <DESCRIPTION><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></DESCRIPTION>
+<!--51E299D6B5824EC480B524E1ED726985-->  <HELP><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></HELP>
+<!--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-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--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>
@@ -268370,6 +268523,7 @@
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--53B4B47E0B204E20B8C0F57A27662FEF-->  <POSITION><![CDATA[93]]></POSITION>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -276090,6 +276244,42 @@
 <!--57D0B86A8D514F4EB2265B6A683D936A-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--57D0B86A8D514F4EB2265B6A683D936A--></AD_COLUMN>
 
+<!--57E9885AC7E14F158A4CF1F818874AA1--><AD_COLUMN>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_COLUMN_ID><![CDATA[57E9885AC7E14F158A4CF1F818874AA1]]></AD_COLUMN_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <COLUMNNAME><![CDATA[Birthplace]]></COLUMNNAME>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_TABLE_ID><![CDATA[291]]></AD_TABLE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <SEQNO><![CDATA[610]]></SEQNO>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_ELEMENT_ID><![CDATA[F26D3514DBA84CF2897C720093BF6BEC]]></AD_ELEMENT_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <POSITION><![CDATA[95]]></POSITION>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--57E9885AC7E14F158A4CF1F818874AA1--></AD_COLUMN>
+
 <!--57F9A2F8FA9341139A285AA0B81F0E76--><AD_COLUMN>
 <!--57F9A2F8FA9341139A285AA0B81F0E76-->  <AD_COLUMN_ID><![CDATA[57F9A2F8FA9341139A285AA0B81F0E76]]></AD_COLUMN_ID>
 <!--57F9A2F8FA9341139A285AA0B81F0E76-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -304336,7 +304526,7 @@
 <!--7DC34559B3F7B45BE040007F0100784A-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--7DC34559B3F7B45BE040007F0100784A-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--7DC34559B3F7B45BE040007F0100784A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--7DC34559B3F7B45BE040007F0100784A-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--7DC34559B3F7B45BE040007F0100784A-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
 <!--7DC34559B3F7B45BE040007F0100784A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
 <!--7DC34559B3F7B45BE040007F0100784A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--7DC34559B3F7B45BE040007F0100784A-->  <SEQNO><![CDATA[180]]></SEQNO>
@@ -307479,7 +307669,7 @@
 <!--7FF2234748F2844FE040007F01003861-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--7FF2234748F2844FE040007F01003861-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--7FF2234748F2844FE040007F01003861-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--7FF2234748F2844FE040007F01003861-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--7FF2234748F2844FE040007F01003861-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
 <!--7FF2234748F2844FE040007F01003861-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
 <!--7FF2234748F2844FE040007F01003861-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--7FF2234748F2844FE040007F01003861-->  <SEQNO><![CDATA[300]]></SEQNO>
@@ -330268,7 +330458,7 @@
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--984876F99CCF4C9CA94FD365FD79F834-->  <POSITION><![CDATA[95]]></POSITION>
+<!--984876F99CCF4C9CA94FD365FD79F834-->  <POSITION><![CDATA[94]]></POSITION>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -331084,6 +331274,45 @@
 <!--9ACB466C69F848F4AE2DB1393D780160-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--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-->  <DESCRIPTION><![CDATA[Button that creates a temporal duplicated order]]></DESCRIPTION>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <HELP><![CDATA[Button that creates a temporal duplicated order]]></HELP>
+<!--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-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--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>
@@ -333214,10 +333443,9 @@
 <!--9E82E728716246B393C40D2CDCA0133A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--9E82E728716246B393C40D2CDCA0133A-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--9E82E728716246B393C40D2CDCA0133A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
-<!--9E82E728716246B393C40D2CDCA0133A-->  <SQLLOGIC><![CDATA[(coalesce((select case when sum(abs(ol.qtyordered))  = 0 then 0 else 
-round(coalesce(sum(abs(ol.qtydelivered)), 0)/sum(abs(ol.qtyordered)) * 100, 0)  end 
- from c_orderline ol where ol.c_order_id=c_order_id and ol.c_order_discount_id is null
- ),0))]]></SQLLOGIC>
+<!--9E82E728716246B393C40D2CDCA0133A-->  <SQLLOGIC><![CDATA[(coalesce((select case when sum(abs(ol.qtyordered)) = 0 or iscancelled = 'Y' or cancelledorder_id is not null then 0 else 
+round(coalesce(sum(abs(ol.qtydelivered)), 0)/sum(abs(ol.qtyordered)) * 100, 0) end 
+from c_orderline ol where ol.c_order_id=c_order_id and ol.c_order_discount_id is null),0))]]></SQLLOGIC>
 <!--9E82E728716246B393C40D2CDCA0133A-->  <ALLOWSORTING><![CDATA[N]]></ALLOWSORTING>
 <!--9E82E728716246B393C40D2CDCA0133A-->  <ALLOWFILTERING><![CDATA[N]]></ALLOWFILTERING>
 <!--9E82E728716246B393C40D2CDCA0133A-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
@@ -334186,6 +334414,43 @@
 <!--A07A72989B5011DDBDC300014A62838F-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--A07A72989B5011DDBDC300014A62838F--></AD_COLUMN>
 
+<!--A07BE141EA8F449C8BE288276E0D6D56--><AD_COLUMN>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_COLUMN_ID><![CDATA[A07BE141EA8F449C8BE288276E0D6D56]]></AD_COLUMN_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <NAME><![CDATA[Issalediscontinued]]></NAME>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <COLUMNNAME><![CDATA[Issalediscontinued]]></COLUMNNAME>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <SEQNO><![CDATA[840]]></SEQNO>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_ELEMENT_ID><![CDATA[ED2C3271AF604A288963A04AB5BB078C]]></AD_ELEMENT_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <POSITION><![CDATA[111]]></POSITION>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--A07BE141EA8F449C8BE288276E0D6D56-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--A07BE141EA8F449C8BE288276E0D6D56--></AD_COLUMN>
+
 <!--A0895BE15FC84F7CA2BD4D6B51D8BFD1--><AD_COLUMN>
 <!--A0895BE15FC84F7CA2BD4D6B51D8BFD1-->  <AD_COLUMN_ID><![CDATA[A0895BE15FC84F7CA2BD4D6B51D8BFD1]]></AD_COLUMN_ID>
 <!--A0895BE15FC84F7CA2BD4D6B51D8BFD1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -344131,7 +344396,7 @@
 <!--B5B203AE8D674B8DABC6669419815CA7-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--B5B203AE8D674B8DABC6669419815CA7-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--B5B203AE8D674B8DABC6669419815CA7-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
-<!--B5B203AE8D674B8DABC6669419815CA7-->  <SQLLOGIC><![CDATA[(coalesce((select case when sum(abs(ol.qtyordered)) = 0 then 0 else 
+<!--B5B203AE8D674B8DABC6669419815CA7-->  <SQLLOGIC><![CDATA[(coalesce((select case when sum(abs(ol.qtyordered)) = 0 or iscancelled = 'Y' or cancelledorder_id is not null then 0 else 
 round(coalesce(sum(abs(ol.qtyinvoiced)), 0)/sum(abs(ol.qtyordered)) * 100, 0)  end 
 from c_orderline ol   where ol.c_order_id=c_order_id and  ol.c_order_discount_id is null), 0))]]></SQLLOGIC>
 <!--B5B203AE8D674B8DABC6669419815CA7-->  <ALLOWSORTING><![CDATA[N]]></ALLOWSORTING>
@@ -352735,6 +353000,45 @@
 <!--C6F25057A96548A493E665727DDF7A46-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--C6F25057A96548A493E665727DDF7A46--></AD_COLUMN>
 
+<!--C724ECE5B05848489719C64111425FDB--><AD_COLUMN>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_COLUMN_ID><![CDATA[C724ECE5B05848489719C64111425FDB]]></AD_COLUMN_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C724ECE5B05848489719C64111425FDB-->  <NAME><![CDATA[Replacedorderline]]></NAME>
+<!--C724ECE5B05848489719C64111425FDB-->  <DESCRIPTION><![CDATA[Link to the Order that has been replaced]]></DESCRIPTION>
+<!--C724ECE5B05848489719C64111425FDB-->  <HELP><![CDATA[Link to the Order that has been replaced]]></HELP>
+<!--C724ECE5B05848489719C64111425FDB-->  <COLUMNNAME><![CDATA[Replacedorderline_id]]></COLUMNNAME>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_TABLE_ID><![CDATA[260]]></AD_TABLE_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_REFERENCE_VALUE_ID><![CDATA[271]]></AD_REFERENCE_VALUE_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--C724ECE5B05848489719C64111425FDB-->  <SEQNO><![CDATA[214]]></SEQNO>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_ELEMENT_ID><![CDATA[BE7014D21A43412CA94D17540B8D4692]]></AD_ELEMENT_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--C724ECE5B05848489719C64111425FDB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--C724ECE5B05848489719C64111425FDB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C724ECE5B05848489719C64111425FDB-->  <POSITION><![CDATA[68]]></POSITION>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--C724ECE5B05848489719C64111425FDB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--C724ECE5B05848489719C64111425FDB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--C724ECE5B05848489719C64111425FDB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--C724ECE5B05848489719C64111425FDB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--C724ECE5B05848489719C64111425FDB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--C724ECE5B05848489719C64111425FDB-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--C724ECE5B05848489719C64111425FDB--></AD_COLUMN>
+
 <!--C73593CD83514760916EBC58EEB5EB41--><AD_COLUMN>
 <!--C73593CD83514760916EBC58EEB5EB41-->  <AD_COLUMN_ID><![CDATA[C73593CD83514760916EBC58EEB5EB41]]></AD_COLUMN_ID>
 <!--C73593CD83514760916EBC58EEB5EB41-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -355661,6 +355965,45 @@
 <!--CB2739BEE006A0E9E040007F010023A5-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--CB2739BEE006A0E9E040007F010023A5--></AD_COLUMN>
 
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB--><AD_COLUMN>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_COLUMN_ID><![CDATA[CB3A64CFC2B8471E91DBBF12A663D0FB]]></AD_COLUMN_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <NAME><![CDATA[Replacedorder]]></NAME>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <DESCRIPTION><![CDATA[Link to the order that has been replaced]]></DESCRIPTION>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <HELP><![CDATA[Link to the order that has been replaced]]></HELP>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <COLUMNNAME><![CDATA[Replacedorder_id]]></COLUMNNAME>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_REFERENCE_VALUE_ID><![CDATA[290]]></AD_REFERENCE_VALUE_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <SEQNO><![CDATA[730]]></SEQNO>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_ELEMENT_ID><![CDATA[2627023DF29E469E89105888E791393B]]></AD_ELEMENT_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <POSITION><![CDATA[98]]></POSITION>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB--></AD_COLUMN>
+
 <!--CB3B154781F840CCA73D6656027F5595--><AD_COLUMN>
 <!--CB3B154781F840CCA73D6656027F5595-->  <AD_COLUMN_ID><![CDATA[CB3B154781F840CCA73D6656027F5595]]></AD_COLUMN_ID>
 <!--CB3B154781F840CCA73D6656027F5595-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -369696,6 +370039,45 @@
 <!--E59D4BB7F1C342619CB4131FE4888FFA-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--E59D4BB7F1C342619CB4131FE4888FFA--></AD_COLUMN>
 
+<!--E61022D568524DD78F02815F50092DB8--><AD_COLUMN>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_COLUMN_ID><![CDATA[E61022D568524DD78F02815F50092DB8]]></AD_COLUMN_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E61022D568524DD78F02815F50092DB8-->  <NAME><![CDATA[Replacementorder_ID]]></NAME>
+<!--E61022D568524DD78F02815F50092DB8-->  <DESCRIPTION><![CDATA[Link to the replacement order]]></DESCRIPTION>
+<!--E61022D568524DD78F02815F50092DB8-->  <HELP><![CDATA[Link to the replacement order]]></HELP>
+<!--E61022D568524DD78F02815F50092DB8-->  <COLUMNNAME><![CDATA[Replacementorder_ID]]></COLUMNNAME>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_REFERENCE_VALUE_ID><![CDATA[290]]></AD_REFERENCE_VALUE_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E61022D568524DD78F02815F50092DB8-->  <SEQNO><![CDATA[750]]></SEQNO>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_ELEMENT_ID><![CDATA[06D885749834459BABA740AA25636ECA]]></AD_ELEMENT_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E61022D568524DD78F02815F50092DB8-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E61022D568524DD78F02815F50092DB8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E61022D568524DD78F02815F50092DB8-->  <POSITION><![CDATA[103]]></POSITION>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E61022D568524DD78F02815F50092DB8-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E61022D568524DD78F02815F50092DB8-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E61022D568524DD78F02815F50092DB8-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E61022D568524DD78F02815F50092DB8-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--E61022D568524DD78F02815F50092DB8-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--E61022D568524DD78F02815F50092DB8-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--E61022D568524DD78F02815F50092DB8--></AD_COLUMN>
+
 <!--E631C21ED303AC60E040007F01002676--><AD_COLUMN>
 <!--E631C21ED303AC60E040007F01002676-->  <AD_COLUMN_ID><![CDATA[E631C21ED303AC60E040007F01002676]]></AD_COLUMN_ID>
 <!--E631C21ED303AC60E040007F01002676-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -373969,6 +374351,45 @@
 <!--F52B56FE91C64CB2B5AC43E52C1C763E-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--F52B56FE91C64CB2B5AC43E52C1C763E--></AD_COLUMN>
 
+<!--F54BEAEAA4C04BDD9DC1448954589ED0--><AD_COLUMN>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_COLUMN_ID><![CDATA[F54BEAEAA4C04BDD9DC1448954589ED0]]></AD_COLUMN_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <NAME><![CDATA[Iscancelled]]></NAME>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <DESCRIPTION><![CDATA[The Sales Order has been cancelled or cancelled and replaced.]]></DESCRIPTION>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <HELP><![CDATA[The Sales Order has been cancelled and cancelled and replaced. A new Cancellation Sales Order has been created in Closed Status and if it is replaced also a new Sales Order in Book Status has been created replacing the original one.]]></HELP>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <COLUMNNAME><![CDATA[Iscancelled]]></COLUMNNAME>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_TABLE_ID><![CDATA[259]]></AD_TABLE_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <SEQNO><![CDATA[740]]></SEQNO>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_ELEMENT_ID><![CDATA[5BD4AC040C044BB1A5817915C0961F35]]></AD_ELEMENT_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <POSITION><![CDATA[101]]></POSITION>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0--></AD_COLUMN>
+
 <!--F55387BA03C14531AA6A20E0AF799E1B--><AD_COLUMN>
 <!--F55387BA03C14531AA6A20E0AF799E1B-->  <AD_COLUMN_ID><![CDATA[F55387BA03C14531AA6A20E0AF799E1B]]></AD_COLUMN_ID>
 <!--F55387BA03C14531AA6A20E0AF799E1B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -21118,6 +21118,20 @@
 <!--06982089ED1442FAA0E2626D2228CF4E-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--06982089ED1442FAA0E2626D2228CF4E--></AD_ELEMENT>
 
+<!--06D885749834459BABA740AA25636ECA--><AD_ELEMENT>
+<!--06D885749834459BABA740AA25636ECA-->  <AD_ELEMENT_ID><![CDATA[06D885749834459BABA740AA25636ECA]]></AD_ELEMENT_ID>
+<!--06D885749834459BABA740AA25636ECA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--06D885749834459BABA740AA25636ECA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--06D885749834459BABA740AA25636ECA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--06D885749834459BABA740AA25636ECA-->  <COLUMNNAME><![CDATA[Replacementorder_ID]]></COLUMNNAME>
+<!--06D885749834459BABA740AA25636ECA-->  <NAME><![CDATA[Replacement Order]]></NAME>
+<!--06D885749834459BABA740AA25636ECA-->  <PRINTNAME><![CDATA[Replacement Order]]></PRINTNAME>
+<!--06D885749834459BABA740AA25636ECA-->  <DESCRIPTION><![CDATA[Link to the replacement order]]></DESCRIPTION>
+<!--06D885749834459BABA740AA25636ECA-->  <HELP><![CDATA[Link to the replacement order]]></HELP>
+<!--06D885749834459BABA740AA25636ECA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--06D885749834459BABA740AA25636ECA-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--06D885749834459BABA740AA25636ECA--></AD_ELEMENT>
+
 <!--073EB11474B542B5AA579581C8741C53--><AD_ELEMENT>
 <!--073EB11474B542B5AA579581C8741C53-->  <AD_ELEMENT_ID><![CDATA[073EB11474B542B5AA579581C8741C53]]></AD_ELEMENT_ID>
 <!--073EB11474B542B5AA579581C8741C53-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21282,6 +21296,18 @@
 <!--0D1F9C2D797C49A7AA476A3047DC075A-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--0D1F9C2D797C49A7AA476A3047DC075A--></AD_ELEMENT>
 
+<!--0DC2A64ABEB34DA5A7180687B56197F4--><AD_ELEMENT>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <AD_ELEMENT_ID><![CDATA[0DC2A64ABEB34DA5A7180687B56197F4]]></AD_ELEMENT_ID>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <COLUMNNAME><![CDATA[Islocked]]></COLUMNNAME>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <NAME><![CDATA[Is Locked]]></NAME>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <PRINTNAME><![CDATA[Is Locked]]></PRINTNAME>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0DC2A64ABEB34DA5A7180687B56197F4-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--0DC2A64ABEB34DA5A7180687B56197F4--></AD_ELEMENT>
+
 <!--0DCA4840773E45198061B6F1E5F22841--><AD_ELEMENT>
 <!--0DCA4840773E45198061B6F1E5F22841-->  <AD_ELEMENT_ID><![CDATA[0DCA4840773E45198061B6F1E5F22841]]></AD_ELEMENT_ID>
 <!--0DCA4840773E45198061B6F1E5F22841-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21429,6 +21455,20 @@
 <!--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-->  <DESCRIPTION><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></DESCRIPTION>
+<!--11F2729B6B6B452F854E4A3BA8EA732B-->  <HELP><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></HELP>
+<!--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>
@@ -22013,6 +22053,20 @@
 <!--24DF09C68AD04D86963F5DE05B759600-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--24DF09C68AD04D86963F5DE05B759600--></AD_ELEMENT>
 
+<!--2627023DF29E469E89105888E791393B--><AD_ELEMENT>
+<!--2627023DF29E469E89105888E791393B-->  <AD_ELEMENT_ID><![CDATA[2627023DF29E469E89105888E791393B]]></AD_ELEMENT_ID>
+<!--2627023DF29E469E89105888E791393B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2627023DF29E469E89105888E791393B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2627023DF29E469E89105888E791393B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2627023DF29E469E89105888E791393B-->  <COLUMNNAME><![CDATA[Replacedorder_id]]></COLUMNNAME>
+<!--2627023DF29E469E89105888E791393B-->  <NAME><![CDATA[Replaced Order]]></NAME>
+<!--2627023DF29E469E89105888E791393B-->  <PRINTNAME><![CDATA[Replaced Order]]></PRINTNAME>
+<!--2627023DF29E469E89105888E791393B-->  <DESCRIPTION><![CDATA[Link to the order that has been replaced]]></DESCRIPTION>
+<!--2627023DF29E469E89105888E791393B-->  <HELP><![CDATA[Link to the order that has been replaced]]></HELP>
+<!--2627023DF29E469E89105888E791393B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2627023DF29E469E89105888E791393B-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--2627023DF29E469E89105888E791393B--></AD_ELEMENT>
+
 <!--267A3D0068D048C2991366C96CB19590--><AD_ELEMENT>
 <!--267A3D0068D048C2991366C96CB19590-->  <AD_ELEMENT_ID><![CDATA[267A3D0068D048C2991366C96CB19590]]></AD_ELEMENT_ID>
 <!--267A3D0068D048C2991366C96CB19590-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -25598,6 +25652,20 @@
 <!--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-->  <DESCRIPTION><![CDATA[Button that creates a temporal duplicated order]]></DESCRIPTION>
+<!--5AF7D5DB814D4907B10F78961BE9EFA8-->  <HELP><![CDATA[Button that creates a temporal duplicated order]]></HELP>
+<!--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>
@@ -25654,6 +25722,20 @@
 <!--5BCA37B278504F459215615AABC0BF2C-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--5BCA37B278504F459215615AABC0BF2C--></AD_ELEMENT>
 
+<!--5BD4AC040C044BB1A5817915C0961F35--><AD_ELEMENT>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <AD_ELEMENT_ID><![CDATA[5BD4AC040C044BB1A5817915C0961F35]]></AD_ELEMENT_ID>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <COLUMNNAME><![CDATA[Iscancelled]]></COLUMNNAME>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <NAME><![CDATA[Is Cancelled]]></NAME>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <PRINTNAME><![CDATA[Is Cancelled]]></PRINTNAME>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <DESCRIPTION><![CDATA[The Sales Order has been cancelled or cancelled and replaced.]]></DESCRIPTION>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <HELP><![CDATA[The Sales Order has been cancelled and cancelled and replaced. A new Cancellation Sales Order has been created in Closed Status and if it is replaced also a new Sales Order in Book Status has been created replacing the original one.]]></HELP>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--5BD4AC040C044BB1A5817915C0961F35-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--5BD4AC040C044BB1A5817915C0961F35--></AD_ELEMENT>
+
 <!--5BE187236833538BE040007F010169BF--><AD_ELEMENT>
 <!--5BE187236833538BE040007F010169BF-->  <AD_ELEMENT_ID><![CDATA[5BE187236833538BE040007F010169BF]]></AD_ELEMENT_ID>
 <!--5BE187236833538BE040007F010169BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -31845,6 +31927,20 @@
 <!--BDC51EB4B3284866A2919ED98022A14F-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--BDC51EB4B3284866A2919ED98022A14F--></AD_ELEMENT>
 
+<!--BE7014D21A43412CA94D17540B8D4692--><AD_ELEMENT>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <AD_ELEMENT_ID><![CDATA[BE7014D21A43412CA94D17540B8D4692]]></AD_ELEMENT_ID>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <COLUMNNAME><![CDATA[Replacedorderline_id]]></COLUMNNAME>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <NAME><![CDATA[Replaced Order Line]]></NAME>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <PRINTNAME><![CDATA[Replaced Order Line]]></PRINTNAME>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <DESCRIPTION><![CDATA[Link to the Order that has been replaced]]></DESCRIPTION>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <HELP><![CDATA[Link to the Order that has been replaced]]></HELP>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BE7014D21A43412CA94D17540B8D4692-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--BE7014D21A43412CA94D17540B8D4692--></AD_ELEMENT>
+
 <!--BEADA4ABFE544524B69FEC20E82F2D95--><AD_ELEMENT>
 <!--BEADA4ABFE544524B69FEC20E82F2D95-->  <AD_ELEMENT_ID><![CDATA[BEADA4ABFE544524B69FEC20E82F2D95]]></AD_ELEMENT_ID>
 <!--BEADA4ABFE544524B69FEC20E82F2D95-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -34049,6 +34145,20 @@
 <!--EB58AFE2D52942FEA4B7DA407282DC1D-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--EB58AFE2D52942FEA4B7DA407282DC1D--></AD_ELEMENT>
 
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776--><AD_ELEMENT>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <AD_ELEMENT_ID><![CDATA[EB7F6DD0A85D48AD84ED48CF6D2C3776]]></AD_ELEMENT_ID>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <COLUMNNAME><![CDATA[Cancelledorder_id]]></COLUMNNAME>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <NAME><![CDATA[Cancelled Order]]></NAME>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <PRINTNAME><![CDATA[Cancelled Order]]></PRINTNAME>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <DESCRIPTION><![CDATA[Link to the order that has been cancelled]]></DESCRIPTION>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <HELP><![CDATA[Link to the order that has been cancelled]]></HELP>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--EB7F6DD0A85D48AD84ED48CF6D2C3776--></AD_ELEMENT>
+
 <!--EBE913C1DDD84066A1D88C9903717DB9--><AD_ELEMENT>
 <!--EBE913C1DDD84066A1D88C9903717DB9-->  <AD_ELEMENT_ID><![CDATA[EBE913C1DDD84066A1D88C9903717DB9]]></AD_ELEMENT_ID>
 <!--EBE913C1DDD84066A1D88C9903717DB9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -34089,6 +34199,20 @@
 <!--ECAC136184A746C39804BD71BC3C78DB-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--ECAC136184A746C39804BD71BC3C78DB--></AD_ELEMENT>
 
+<!--ED2C3271AF604A288963A04AB5BB078C--><AD_ELEMENT>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <AD_ELEMENT_ID><![CDATA[ED2C3271AF604A288963A04AB5BB078C]]></AD_ELEMENT_ID>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <COLUMNNAME><![CDATA[Issalediscontinued]]></COLUMNNAME>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <NAME><![CDATA[Is Discontinued]]></NAME>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <PRINTNAME><![CDATA[Is Discontinued]]></PRINTNAME>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <DESCRIPTION><![CDATA[A statement mentioning that this product will no longer be available on the market.]]></DESCRIPTION>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <HELP><![CDATA[The Discontinued check box indicates a product that has been discontinued.]]></HELP>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ED2C3271AF604A288963A04AB5BB078C-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--ED2C3271AF604A288963A04AB5BB078C--></AD_ELEMENT>
+
 <!--ED51BE55711947E18F566818EC704CAB--><AD_ELEMENT>
 <!--ED51BE55711947E18F566818EC704CAB-->  <AD_ELEMENT_ID><![CDATA[ED51BE55711947E18F566818EC704CAB]]></AD_ELEMENT_ID>
 <!--ED51BE55711947E18F566818EC704CAB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -34261,6 +34385,18 @@
 <!--F2351D18492C42A6AE6F01F74831D617-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--F2351D18492C42A6AE6F01F74831D617--></AD_ELEMENT>
 
+<!--F26D3514DBA84CF2897C720093BF6BEC--><AD_ELEMENT>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_ELEMENT_ID><![CDATA[F26D3514DBA84CF2897C720093BF6BEC]]></AD_ELEMENT_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <COLUMNNAME><![CDATA[Birthplace]]></COLUMNNAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <PRINTNAME><![CDATA[Birth Place]]></PRINTNAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--F26D3514DBA84CF2897C720093BF6BEC--></AD_ELEMENT>
+
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004--><AD_ELEMENT>
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004-->  <AD_ELEMENT_ID><![CDATA[F2D48C18F40D4F1AB4EB9B42BDC76004]]></AD_ELEMENT_ID>
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -14412,7 +14412,7 @@
 <!--1083-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
 <!--1083-->  <AD_FIELDGROUP_ID><![CDATA[101]]></AD_FIELDGROUP_ID>
 <!--1083-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--1083-->  <DISPLAYLOGIC><![CDATA[@DocStatus@!'VO'&@DocStatus@!'CL']]></DISPLAYLOGIC>
+<!--1083-->  <DISPLAYLOGIC><![CDATA[@DocStatus@!'VO'&@DocStatus@!'CL'&@DocStatus@!'TMP']]></DISPLAYLOGIC>
 <!--1083-->  <DISPLAYLENGTH><![CDATA[23]]></DISPLAYLENGTH>
 <!--1083-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--1083-->  <SEQNO><![CDATA[336]]></SEQNO>
@@ -180061,6 +180061,34 @@
 <!--059F7231F8A246A585FD4E2E503FC1ED-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--059F7231F8A246A585FD4E2E503FC1ED--></AD_FIELD>
 
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9--><AD_FIELD>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_FIELD_ID><![CDATA[05E7C043CEC5432EBAFF1F3FD71A05E9]]></AD_FIELD_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <NAME><![CDATA[Is Cancelled]]></NAME>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <DESCRIPTION><![CDATA[The Sales Order has been cancelled or cancelled and replaced.]]></DESCRIPTION>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <HELP><![CDATA[The Sales Order has been cancelled and cancelled and replaced. A new Cancellation Sales Order has been created in Closed Status and if it is replaced also a new Sales Order in Book Status has been created replacing the original one.]]></HELP>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_COLUMN_ID><![CDATA[F54BEAEAA4C04BDD9DC1448954589ED0]]></AD_COLUMN_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <SEQNO><![CDATA[135]]></SEQNO>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--05E7C043CEC5432EBAFF1F3FD71A05E9--></AD_FIELD>
+
 <!--06005FA0890493DAE050007F01006246--><AD_FIELD>
 <!--06005FA0890493DAE050007F01006246-->  <AD_FIELD_ID><![CDATA[06005FA0890493DAE050007F01006246]]></AD_FIELD_ID>
 <!--06005FA0890493DAE050007F01006246-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -202207,6 +202235,35 @@
 <!--3C0B7FD069C24F40AB9CA1F21DB182F4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--3C0B7FD069C24F40AB9CA1F21DB182F4--></AD_FIELD>
 
+<!--3C2B8257EC414EFBB6BA098C8400D28A--><AD_FIELD>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_FIELD_ID><![CDATA[3C2B8257EC414EFBB6BA098C8400D28A]]></AD_FIELD_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <NAME><![CDATA[Cancelled Order]]></NAME>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <DESCRIPTION><![CDATA[Link to the order that has been cancelled]]></DESCRIPTION>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <HELP><![CDATA[Link to the order that has been cancelled]]></HELP>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_COLUMN_ID><![CDATA[129F2530A63B4C7CA9AF17996732E6A4]]></AD_COLUMN_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <DISPLAYLOGIC><![CDATA[@Cancelledorder_id@!'']]></DISPLAYLOGIC>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <SEQNO><![CDATA[125]]></SEQNO>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--3C2B8257EC414EFBB6BA098C8400D28A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--3C2B8257EC414EFBB6BA098C8400D28A--></AD_FIELD>
+
 <!--3C42EE919FD647FEAD42BA89899FCB0F--><AD_FIELD>
 <!--3C42EE919FD647FEAD42BA89899FCB0F-->  <AD_FIELD_ID><![CDATA[3C42EE919FD647FEAD42BA89899FCB0F]]></AD_FIELD_ID>
 <!--3C42EE919FD647FEAD42BA89899FCB0F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -202433,6 +202490,35 @@
 <!--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-->  <DESCRIPTION><![CDATA[Button that creates a temporal duplicated order]]></DESCRIPTION>
+<!--3C9B97CD980A4D809BDE5B9FDC3E0E73-->  <HELP><![CDATA[Button that creates a temporal duplicated order]]></HELP>
+<!--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'&@Cancelledorder_id@=''&@Iscancelled@='N']]></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>
@@ -232609,6 +232695,35 @@
 <!--70AEECD6D8A8479792ACAD28B2937C57-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--70AEECD6D8A8479792ACAD28B2937C57--></AD_FIELD>
 
+<!--70B30B77B3F347D6A4CCE368FF95426B--><AD_FIELD>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_FIELD_ID><![CDATA[70B30B77B3F347D6A4CCE368FF95426B]]></AD_FIELD_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <NAME><![CDATA[Replacement Order]]></NAME>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <DESCRIPTION><![CDATA[Link to the replacement order]]></DESCRIPTION>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <HELP><![CDATA[Link to the replacement order]]></HELP>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_COLUMN_ID><![CDATA[E61022D568524DD78F02815F50092DB8]]></AD_COLUMN_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <DISPLAYLOGIC><![CDATA[@Replacementorder_ID@!'']]></DISPLAYLOGIC>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <SEQNO><![CDATA[135]]></SEQNO>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--70B30B77B3F347D6A4CCE368FF95426B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--70B30B77B3F347D6A4CCE368FF95426B--></AD_FIELD>
+
 <!--70BC8DA302454124BFE119D7641B50D8--><AD_FIELD>
 <!--70BC8DA302454124BFE119D7641B50D8-->  <AD_FIELD_ID><![CDATA[70BC8DA302454124BFE119D7641B50D8]]></AD_FIELD_ID>
 <!--70BC8DA302454124BFE119D7641B50D8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -235403,6 +235518,35 @@
 <!--75D3E53684774A14B665838D7CCC33A7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--75D3E53684774A14B665838D7CCC33A7--></AD_FIELD>
 
+<!--75E4E471100E45848F478AF51CDAA9CD--><AD_FIELD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_FIELD_ID><![CDATA[75E4E471100E45848F478AF51CDAA9CD]]></AD_FIELD_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <NAME><![CDATA[Birthday]]></NAME>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <DESCRIPTION><![CDATA[An anniversary of birth for a business partner.]]></DESCRIPTION>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <HELP><![CDATA[Birthday or Anniversary day]]></HELP>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_TAB_ID><![CDATA[223]]></AD_TAB_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_COLUMN_ID><![CDATA[1040A945DD4048AD8D43449847A6EB11]]></AD_COLUMN_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <SEQNO><![CDATA[250]]></SEQNO>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <GRID_SEQNO><![CDATA[140]]></GRID_SEQNO>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--75E4E471100E45848F478AF51CDAA9CD--></AD_FIELD>
+
 <!--7642953AF81F461AB6A96DA9E7F674E6--><AD_FIELD>
 <!--7642953AF81F461AB6A96DA9E7F674E6-->  <AD_FIELD_ID><![CDATA[7642953AF81F461AB6A96DA9E7F674E6]]></AD_FIELD_ID>
 <!--7642953AF81F461AB6A96DA9E7F674E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -259627,6 +259771,33 @@
 <!--9BAC7BA6402349F8A61278B294455995-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--9BAC7BA6402349F8A61278B294455995--></AD_FIELD>
 
+<!--9BB870215141401B985071094B6E1F44--><AD_FIELD>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_FIELD_ID><![CDATA[9BB870215141401B985071094B6E1F44]]></AD_FIELD_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9BB870215141401B985071094B6E1F44-->  <NAME><![CDATA[Is Discontinued]]></NAME>
+<!--9BB870215141401B985071094B6E1F44-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_TAB_ID><![CDATA[180]]></AD_TAB_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_COLUMN_ID><![CDATA[A07BE141EA8F449C8BE288276E0D6D56]]></AD_COLUMN_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--9BB870215141401B985071094B6E1F44-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--9BB870215141401B985071094B6E1F44-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='Y']]></DISPLAYLOGIC>
+<!--9BB870215141401B985071094B6E1F44-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--9BB870215141401B985071094B6E1F44-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--9BB870215141401B985071094B6E1F44-->  <SEQNO><![CDATA[680]]></SEQNO>
+<!--9BB870215141401B985071094B6E1F44-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--9BB870215141401B985071094B6E1F44-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--9BB870215141401B985071094B6E1F44-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9BB870215141401B985071094B6E1F44-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--9BB870215141401B985071094B6E1F44-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--9BB870215141401B985071094B6E1F44-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9BB870215141401B985071094B6E1F44-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--9BB870215141401B985071094B6E1F44-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--9BB870215141401B985071094B6E1F44-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--9BB870215141401B985071094B6E1F44-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--9BB870215141401B985071094B6E1F44--></AD_FIELD>
+
 <!--9BD9B98ED54E43F7B357097799E9A2C6--><AD_FIELD>
 <!--9BD9B98ED54E43F7B357097799E9A2C6-->  <AD_FIELD_ID><![CDATA[9BD9B98ED54E43F7B357097799E9A2C6]]></AD_FIELD_ID>
 <!--9BD9B98ED54E43F7B357097799E9A2C6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -266620,6 +266791,33 @@
 <!--ADDA9474A23F4C0182BB3BE4EAA6B87C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--ADDA9474A23F4C0182BB3BE4EAA6B87C--></AD_FIELD>
 
+<!--ADE41D125D2143F49177E058C42B3883--><AD_FIELD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_FIELD_ID><![CDATA[ADE41D125D2143F49177E058C42B3883]]></AD_FIELD_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_TAB_ID><![CDATA[223]]></AD_TAB_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_COLUMN_ID><![CDATA[57E9885AC7E14F158A4CF1F818874AA1]]></AD_COLUMN_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADE41D125D2143F49177E058C42B3883-->  <SEQNO><![CDATA[260]]></SEQNO>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <GRID_SEQNO><![CDATA[150]]></GRID_SEQNO>
+<!--ADE41D125D2143F49177E058C42B3883-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADE41D125D2143F49177E058C42B3883-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADE41D125D2143F49177E058C42B3883-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--ADE41D125D2143F49177E058C42B3883--></AD_FIELD>
+
 <!--ADEA0D5288604FF88E1D4CBD393D1758--><AD_FIELD>
 <!--ADEA0D5288604FF88E1D4CBD393D1758-->  <AD_FIELD_ID><![CDATA[ADEA0D5288604FF88E1D4CBD393D1758]]></AD_FIELD_ID>
 <!--ADEA0D5288604FF88E1D4CBD393D1758-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -292674,6 +292872,33 @@
 <!--D165BBBE0F3E4EE9BDE264D5E8FE6903-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D165BBBE0F3E4EE9BDE264D5E8FE6903--></AD_FIELD>
 
+<!--D16604DCA24A428C9C40F67BD116B234--><AD_FIELD>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_FIELD_ID><![CDATA[D16604DCA24A428C9C40F67BD116B234]]></AD_FIELD_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <NAME><![CDATA[Is Locked]]></NAME>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_TAB_ID><![CDATA[180]]></AD_TAB_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_COLUMN_ID><![CDATA[144504467AAF4239AE435F3D867341AB]]></AD_COLUMN_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <DISPLAYLOGIC><![CDATA[@ProductType@='I']]></DISPLAYLOGIC>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <SEQNO><![CDATA[670]]></SEQNO>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D16604DCA24A428C9C40F67BD116B234-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D16604DCA24A428C9C40F67BD116B234--></AD_FIELD>
+
 <!--D16BDA21D4824DF7BC9760FD5B24455B--><AD_FIELD>
 <!--D16BDA21D4824DF7BC9760FD5B24455B-->  <AD_FIELD_ID><![CDATA[D16BDA21D4824DF7BC9760FD5B24455B]]></AD_FIELD_ID>
 <!--D16BDA21D4824DF7BC9760FD5B24455B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -300631,6 +300856,35 @@
 <!--E021828CBBA74A29B77D98B771B9A81D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E021828CBBA74A29B77D98B771B9A81D--></AD_FIELD>
 
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6--><AD_FIELD>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_FIELD_ID><![CDATA[E03B2279B7F54EE1BDCDCD21D2AFF7F6]]></AD_FIELD_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <NAME><![CDATA[Replaced Order Line]]></NAME>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <DESCRIPTION><![CDATA[Link to the Order that has been replaced]]></DESCRIPTION>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <HELP><![CDATA[Link to the Order that has been replaced]]></HELP>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_COLUMN_ID><![CDATA[C724ECE5B05848489719C64111425FDB]]></AD_COLUMN_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <DISPLAYLOGIC><![CDATA[@Replacedorderline_id@!'']]></DISPLAYLOGIC>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <SEQNO><![CDATA[111]]></SEQNO>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E03B2279B7F54EE1BDCDCD21D2AFF7F6--></AD_FIELD>
+
 <!--E04D2AFD798A471F86057AE158BF854F--><AD_FIELD>
 <!--E04D2AFD798A471F86057AE158BF854F-->  <AD_FIELD_ID><![CDATA[E04D2AFD798A471F86057AE158BF854F]]></AD_FIELD_ID>
 <!--E04D2AFD798A471F86057AE158BF854F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -303274,6 +303528,35 @@
 <!--E71F2C217A324DE397F8527BFB2513C3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E71F2C217A324DE397F8527BFB2513C3--></AD_FIELD>
 
+<!--E7336543F2EA4658A48B719F833D43B6--><AD_FIELD>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_FIELD_ID><![CDATA[E7336543F2EA4658A48B719F833D43B6]]></AD_FIELD_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <NAME><![CDATA[Replaced Order]]></NAME>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <DESCRIPTION><![CDATA[Link to the order that has been replaced]]></DESCRIPTION>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <HELP><![CDATA[Link to the order that has been replaced]]></HELP>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_COLUMN_ID><![CDATA[CB3A64CFC2B8471E91DBBF12A663D0FB]]></AD_COLUMN_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <DISPLAYLOGIC><![CDATA[@Replacedorder_id@!'']]></DISPLAYLOGIC>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E7336543F2EA4658A48B719F833D43B6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E7336543F2EA4658A48B719F833D43B6--></AD_FIELD>
+
 <!--E73474C229524EFEA43AB9F6462E49A8--><AD_FIELD>
 <!--E73474C229524EFEA43AB9F6462E49A8-->  <AD_FIELD_ID><![CDATA[E73474C229524EFEA43AB9F6462E49A8]]></AD_FIELD_ID>
 <!--E73474C229524EFEA43AB9F6462E49A8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -306947,6 +307230,35 @@
 <!--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-->  <DESCRIPTION><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></DESCRIPTION>
+<!--F0BF2E4561024D30B93AC7B471DBF5D7-->  <HELP><![CDATA[Button that confirms the temporal Order by closing it and creates a cancelled order]]></HELP>
+<!--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_MESSAGE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -17495,6 +17495,18 @@
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--234443E5BAB34ABC892AFDE05F9C229D--></AD_MESSAGE>
 
+<!--238EDDD594F24F06BCFC6F8F81506369--><AD_MESSAGE>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <AD_MESSAGE_ID><![CDATA[238EDDD594F24F06BCFC6F8F81506369]]></AD_MESSAGE_ID>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <VALUE><![CDATA[CannotUseDiscontinuedProduct]]></VALUE>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <MSGTEXT><![CDATA[It is not possible to sell the product]]></MSGTEXT>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--238EDDD594F24F06BCFC6F8F81506369-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--238EDDD594F24F06BCFC6F8F81506369--></AD_MESSAGE>
+
 <!--239B36AC9A144464861B1E76C83A07E9--><AD_MESSAGE>
 <!--239B36AC9A144464861B1E76C83A07E9-->  <AD_MESSAGE_ID><![CDATA[239B36AC9A144464861B1E76C83A07E9]]></AD_MESSAGE_ID>
 <!--239B36AC9A144464861B1E76C83A07E9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18307,6 +18319,18 @@
 <!--338EF3E59A594EFC807843510BDEAF46-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--338EF3E59A594EFC807843510BDEAF46--></AD_MESSAGE>
 
+<!--33D53B7E00874B2E8DF895D25394C213--><AD_MESSAGE>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <AD_MESSAGE_ID><![CDATA[33D53B7E00874B2E8DF895D25394C213]]></AD_MESSAGE_ID>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <VALUE><![CDATA[OrderCreatedInTemporalStatus]]></VALUE>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <MSGTEXT><![CDATA[New replacing order created in Temporal status:]]></MSGTEXT>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--33D53B7E00874B2E8DF895D25394C213-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--33D53B7E00874B2E8DF895D25394C213--></AD_MESSAGE>
+
 <!--33ED747B6F0B4F27B0000B5F1818F8BB--><AD_MESSAGE>
 <!--33ED747B6F0B4F27B0000B5F1818F8BB-->  <AD_MESSAGE_ID><![CDATA[33ED747B6F0B4F27B0000B5F1818F8BB]]></AD_MESSAGE_ID>
 <!--33ED747B6F0B4F27B0000B5F1818F8BB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21349,6 +21373,18 @@
 <!--74560B0C1A2C42DABDEFE33B6AEB3B86-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--74560B0C1A2C42DABDEFE33B6AEB3B86--></AD_MESSAGE>
 
+<!--74616D8D53E1422C8250ADAA48CE0436--><AD_MESSAGE>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <AD_MESSAGE_ID><![CDATA[74616D8D53E1422C8250ADAA48CE0436]]></AD_MESSAGE_ID>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <VALUE><![CDATA[m_product_lockedprodtype_chk]]></VALUE>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <MSGTEXT><![CDATA[You have checked Is Locked(This field should be hidden now). You must also select item as product type.]]></MSGTEXT>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--74616D8D53E1422C8250ADAA48CE0436-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--74616D8D53E1422C8250ADAA48CE0436--></AD_MESSAGE>
+
 <!--7483DF96F3C34BB38C67B66BFAC79404--><AD_MESSAGE>
 <!--7483DF96F3C34BB38C67B66BFAC79404-->  <AD_MESSAGE_ID><![CDATA[7483DF96F3C34BB38C67B66BFAC79404]]></AD_MESSAGE_ID>
 <!--7483DF96F3C34BB38C67B66BFAC79404-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -22215,6 +22251,18 @@
 <!--86C6EA2CC6C80848E040007F0101395B-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--86C6EA2CC6C80848E040007F0101395B--></AD_MESSAGE>
 
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045--><AD_MESSAGE>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <AD_MESSAGE_ID><![CDATA[86CE6F5472AC4CC3A3AB1E1B0FAE3045]]></AD_MESSAGE_ID>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <VALUE><![CDATA[ProductDiscontinuedNoStock]]></VALUE>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <MSGTEXT><![CDATA[This product is discontinued and there is not enough stock available ]]></MSGTEXT>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--86CE6F5472AC4CC3A3AB1E1B0FAE3045--></AD_MESSAGE>
+
 <!--873B575159384E1CAB008991116622BF--><AD_MESSAGE>
 <!--873B575159384E1CAB008991116622BF-->  <AD_MESSAGE_ID><![CDATA[873B575159384E1CAB008991116622BF]]></AD_MESSAGE_ID>
 <!--873B575159384E1CAB008991116622BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -24833,6 +24881,18 @@
 <!--BF73CD95240B43239E7C8F7BD83E03D5-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--BF73CD95240B43239E7C8F7BD83E03D5--></AD_MESSAGE>
 
+<!--BF9E1FB735AF4B139AD186B69147AF93--><AD_MESSAGE>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <AD_MESSAGE_ID><![CDATA[BF9E1FB735AF4B139AD186B69147AF93]]></AD_MESSAGE_ID>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <VALUE><![CDATA[m_product_discstocked_chk]]></VALUE>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <MSGTEXT><![CDATA[You have checked Is Discontinued(This field should be hidden now). You must also check Stocked(It could also be hidden if the product type is not Item) and the product type must be Item.]]></MSGTEXT>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BF9E1FB735AF4B139AD186B69147AF93-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--BF9E1FB735AF4B139AD186B69147AF93--></AD_MESSAGE>
+
 <!--BFB1B3D4C3994CD78DA498EF0DC1E00C--><AD_MESSAGE>
 <!--BFB1B3D4C3994CD78DA498EF0DC1E00C-->  <AD_MESSAGE_ID><![CDATA[BFB1B3D4C3994CD78DA498EF0DC1E00C]]></AD_MESSAGE_ID>
 <!--BFB1B3D4C3994CD78DA498EF0DC1E00C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -25905,6 +25965,18 @@
 <!--D65C94634D5F43689B97009352C44322-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--D65C94634D5F43689B97009352C44322--></AD_MESSAGE>
 
+<!--D65DD460608A487DB560B9EE0670CE31--><AD_MESSAGE>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <AD_MESSAGE_ID><![CDATA[D65DD460608A487DB560B9EE0670CE31]]></AD_MESSAGE_ID>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <VALUE><![CDATA[OrderInTemporalStatus]]></VALUE>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <MSGTEXT><![CDATA[Order in Temporal Status]]></MSGTEXT>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D65DD460608A487DB560B9EE0670CE31-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--D65DD460608A487DB560B9EE0670CE31--></AD_MESSAGE>
+
 <!--D668C08F61EE4DCBA55E383321D3676E--><AD_MESSAGE>
 <!--D668C08F61EE4DCBA55E383321D3676E-->  <AD_MESSAGE_ID><![CDATA[D668C08F61EE4DCBA55E383321D3676E]]></AD_MESSAGE_ID>
 <!--D668C08F61EE4DCBA55E383321D3676E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -26073,6 +26145,18 @@
 <!--D84A9308B4674840AB3D78817A6A884D-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--D84A9308B4674840AB3D78817A6A884D--></AD_MESSAGE>
 
+<!--D8572076F54540029247226D6B4D115C--><AD_MESSAGE>
+<!--D8572076F54540029247226D6B4D115C-->  <AD_MESSAGE_ID><![CDATA[D8572076F54540029247226D6B4D115C]]></AD_MESSAGE_ID>
+<!--D8572076F54540029247226D6B4D115C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D8572076F54540029247226D6B4D115C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D8572076F54540029247226D6B4D115C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D8572076F54540029247226D6B4D115C-->  <VALUE><![CDATA[IsCancelled]]></VALUE>
+<!--D8572076F54540029247226D6B4D115C-->  <MSGTEXT><![CDATA[has been already Cancelled]]></MSGTEXT>
+<!--D8572076F54540029247226D6B4D115C-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D8572076F54540029247226D6B4D115C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D8572076F54540029247226D6B4D115C-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--D8572076F54540029247226D6B4D115C--></AD_MESSAGE>
+
 <!--D9912E810888475ABB8DFF416196FB5E--><AD_MESSAGE>
 <!--D9912E810888475ABB8DFF416196FB5E-->  <AD_MESSAGE_ID><![CDATA[D9912E810888475ABB8DFF416196FB5E]]></AD_MESSAGE_ID>
 <!--D9912E810888475ABB8DFF416196FB5E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -27076,6 +27160,18 @@
 <!--EE9607236B3A4C2A9703BF97A73927E1-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--EE9607236B3A4C2A9703BF97A73927E1--></AD_MESSAGE>
 
+<!--EEC39B15885B4D1387F25EFBC6205CE8--><AD_MESSAGE>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <AD_MESSAGE_ID><![CDATA[EEC39B15885B4D1387F25EFBC6205CE8]]></AD_MESSAGE_ID>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <VALUE><![CDATA[CannotUseLockedProduct]]></VALUE>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <MSGTEXT><![CDATA[It is not possible to sell the locked product]]></MSGTEXT>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EEC39B15885B4D1387F25EFBC6205CE8-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--EEC39B15885B4D1387F25EFBC6205CE8--></AD_MESSAGE>
+
 <!--EF6ECE31E8474A289803BC07D3774F17--><AD_MESSAGE>
 <!--EF6ECE31E8474A289803BC07D3774F17-->  <AD_MESSAGE_ID><![CDATA[EF6ECE31E8474A289803BC07D3774F17]]></AD_MESSAGE_ID>
 <!--EF6ECE31E8474A289803BC07D3774F17-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -506,7 +506,7 @@
 <!--122-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--122-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--122-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--122-->  <VALUE><![CDATA[M_Movement_Post]]></VALUE>
+<!--122-->  <VALUE><![CDATA[M_Movement_Post0]]></VALUE>
 <!--122-->  <NAME><![CDATA[Process Movements]]></NAME>
 <!--122-->  <DESCRIPTION><![CDATA[Process Inventory Movements]]></DESCRIPTION>
 <!--122-->  <HELP><![CDATA[Process Inventory Movements will update inventory quantities based on the defined movements between warehouses or locations.]]></HELP>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -9202,6 +9202,17 @@
 <!--474F41E63A2B4EE6B1321CCB24C14929-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--474F41E63A2B4EE6B1321CCB24C14929--></AD_REF_LIST>
 
+<!--478C8DC8C5644D3A822FD49063F5E316--><AD_REF_LIST>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <AD_REF_LIST_ID><![CDATA[478C8DC8C5644D3A822FD49063F5E316]]></AD_REF_LIST_ID>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <VALUE><![CDATA[CancelAndReplaceAssociateShipmentToNewTicket]]></VALUE>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <NAME><![CDATA[Cancel and Replace - Associate shipment lines to new ticket]]></NAME>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--478C8DC8C5644D3A822FD49063F5E316-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--478C8DC8C5644D3A822FD49063F5E316--></AD_REF_LIST>
+
 <!--47C166E5CA224A808DB986AF06BF8427--><AD_REF_LIST>
 <!--47C166E5CA224A808DB986AF06BF8427-->  <AD_REF_LIST_ID><![CDATA[47C166E5CA224A808DB986AF06BF8427]]></AD_REF_LIST_ID>
 <!--47C166E5CA224A808DB986AF06BF8427-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -11927,6 +11938,17 @@
 <!--C51B76C267CA4E098F5558F3E0BAC2C2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C51B76C267CA4E098F5558F3E0BAC2C2--></AD_REF_LIST>
 
+<!--C5834B6433874B9683A1DDB595843ADA--><AD_REF_LIST>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <AD_REF_LIST_ID><![CDATA[C5834B6433874B9683A1DDB595843ADA]]></AD_REF_LIST_ID>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <VALUE><![CDATA[VariantChDescUpdate]]></VALUE>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <NAME><![CDATA[Variant Characteristic description update]]></NAME>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <AD_REFERENCE_ID><![CDATA[11F86B630ECB4A57B28927193F8AB99D]]></AD_REFERENCE_ID>
+<!--C5834B6433874B9683A1DDB595843ADA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C5834B6433874B9683A1DDB595843ADA--></AD_REF_LIST>
+
 <!--C6756C85CF3F4AFBB78DFB994952548A--><AD_REF_LIST>
 <!--C6756C85CF3F4AFBB78DFB994952548A-->  <AD_REF_LIST_ID><![CDATA[C6756C85CF3F4AFBB78DFB994952548A]]></AD_REF_LIST_ID>
 <!--C6756C85CF3F4AFBB78DFB994952548A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12383,6 +12405,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>
+
 <!--DA98D956E0BF4DCA887932756C327D73--><AD_REF_LIST>
 <!--DA98D956E0BF4DCA887932756C327D73-->  <AD_REF_LIST_ID><![CDATA[DA98D956E0BF4DCA887932756C327D73]]></AD_REF_LIST_ID>
 <!--DA98D956E0BF4DCA887932756C327D73-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12762,6 +12795,17 @@
 <!--ED26F0D8296E46BCA9A0571BEA07C66E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--ED26F0D8296E46BCA9A0571BEA07C66E--></AD_REF_LIST>
 
+<!--EE5C654083D04EA0B1BFC90A30CF0908--><AD_REF_LIST>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <AD_REF_LIST_ID><![CDATA[EE5C654083D04EA0B1BFC90A30CF0908]]></AD_REF_LIST_ID>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <VALUE><![CDATA[CancelAndReplaceCreateNetShipment]]></VALUE>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <NAME><![CDATA[Create netting shipment on Cancel and Replace]]></NAME>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--EE5C654083D04EA0B1BFC90A30CF0908-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EE5C654083D04EA0B1BFC90A30CF0908--></AD_REF_LIST>
+
 <!--EF551A190C59463988B5D970FA2F7289--><AD_REF_LIST>
 <!--EF551A190C59463988B5D970FA2F7289-->  <AD_REF_LIST_ID><![CDATA[EF551A190C59463988B5D970FA2F7289]]></AD_REF_LIST_ID>
 <!--EF551A190C59463988B5D970FA2F7289-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -733,7 +733,7 @@
 <!--52118BF1A21B4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A21B4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A21B4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A21B4D84E040007F01005FEC-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--52118BF1A21B4D84E040007F01005FEC-->  <SEQNO><![CDATA[130]]></SEQNO>
 <!--52118BF1A21B4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A21C4D84E040007F01005FEC--><AD_TREENODE>
@@ -898,7 +898,7 @@
 <!--52118BF1A22D4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A22D4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A22D4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A22D4D84E040007F01005FEC-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--52118BF1A22D4D84E040007F01005FEC-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--52118BF1A22D4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A2324D84E040007F01005FEC--><AD_TREENODE>
@@ -1294,7 +1294,7 @@
 <!--52118BF1A2634D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A2634D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A2634D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A2634D84E040007F01005FEC-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--52118BF1A2634D84E040007F01005FEC-->  <SEQNO><![CDATA[150]]></SEQNO>
 <!--52118BF1A2634D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A2644D84E040007F01005FEC--><AD_TREENODE>
@@ -3439,7 +3439,7 @@
 <!--52118BF1A3614D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A3614D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A3614D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A3614D84E040007F01005FEC-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--52118BF1A3614D84E040007F01005FEC-->  <SEQNO><![CDATA[190]]></SEQNO>
 <!--52118BF1A3614D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A3624D84E040007F01005FEC--><AD_TREENODE>
@@ -3681,7 +3681,7 @@
 <!--52118BF1A3784D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A3784D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A3784D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A3784D84E040007F01005FEC-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--52118BF1A3784D84E040007F01005FEC-->  <SEQNO><![CDATA[200]]></SEQNO>
 <!--52118BF1A3784D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A3794D84E040007F01005FEC--><AD_TREENODE>
@@ -3834,7 +3834,7 @@
 <!--52118BF1A5C94D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A5C94D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A5C94D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A5C94D84E040007F01005FEC-->  <SEQNO><![CDATA[170]]></SEQNO>
+<!--52118BF1A5C94D84E040007F01005FEC-->  <SEQNO><![CDATA[180]]></SEQNO>
 <!--52118BF1A5C94D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A5CA4D84E040007F01005FEC--><AD_TREENODE>
@@ -3856,7 +3856,7 @@
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A5CB4D84E040007F01005FEC-->  <SEQNO><![CDATA[150]]></SEQNO>
+<!--52118BF1A5CB4D84E040007F01005FEC-->  <SEQNO><![CDATA[160]]></SEQNO>
 <!--52118BF1A5CB4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A5CC4D84E040007F01005FEC--><AD_TREENODE>
--- a/src-db/database/sourcedata/M_OFFER_TYPE.xml	Fri Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/M_OFFER_TYPE.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -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 Aug 26 09:49:28 2016 +0200
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Mon Aug 29 09:04:15 2016 +0200
@@ -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[OB.ConfirmCancelAndReplaceSalesOrder.confirmCancelAndReplaceSalesOrder]]></CLASSNAME>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0C2AFAEFB67B4CB8A1429195EB119A49-->  <UIPATTERN><![CDATA[M]]></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>
@@ -415,6 +433,25 @@
 <!--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-->  <HELP><![CDATA[This process action will open a copy of the current row in edit mode. After changing the desired values press Confirm Candel And Replace 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.]]></HELP>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <CLASSNAME><![CDATA[OB.CancelAndReplaceSalesOrder.cancelAndReplaceSalesOrder]]></CLASSNAME>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A2FAF49712D1445ABE750315CE1B473A-->  <UIPATTERN><![CDATA[M]]></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>
--- a/src/index.jsp	Fri Aug 26 09:49:28 2016 +0200
+++ b/src/index.jsp	Mon Aug 29 09:04:15 2016 +0200
@@ -249,7 +249,16 @@
   OBContext.restorePreviousMode();
 }
 %>
-  OB.Layout.initialize();
+  var urlParams, customLayout = false;
+  if (OB.Utilities && OB.Utilities.getUrlParameters() && OB.Utilities.getUrlParameters()) {
+    urlParams = OB.Utilities.getUrlParameters();
+  }
+  if (urlParams && urlParams.urlMode && OB.UrlModes && OB.UrlModes[urlParams.urlMode] && OB.UrlModes[urlParams.urlMode].customLayout) {
+    customLayout = true;
+  }
+  if (!customLayout) {
+    OB.Layout.initialize();
+  }
   OB.Layout.draw();
   OB.Layout.ViewManager.createAddStartTab();
   // get rid of the loading stuff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/CancelAndReplaceSalesOrder.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,150 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.common.actionhandler;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.businessUtility.CancelAndReplaceUtils;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.common.order.Order;
+import org.openbravo.model.common.order.OrderLine;
+import org.openbravo.service.db.DbUtility;
+
+public class CancelAndReplaceSalesOrder extends BaseActionHandler {
+  private static final Logger log = Logger.getLogger(CancelAndReplaceSalesOrder.class);
+
+  @Override
+  protected JSONObject execute(Map<String, Object> parameters, String content) {
+
+    // Declare json to be returned
+    JSONObject result = new JSONObject();
+    JSONObject openDirectTab = new JSONObject();
+    JSONObject showMsgInProcessView = new JSONObject();
+    JSONObject showMsgInView = new JSONObject();
+    try {
+
+      // Get request parameters
+      JSONObject request = new JSONObject(content);
+      String oldOrderId = request.getString("inpcOrderId");
+      String tabId = request.getString("inpTabId");
+
+      // Get new Order
+      Order oldOrder = OBDal.getInstance().get(Order.class, oldOrderId);
+
+      // Create new Order header
+      Order newOrder = (Order) DalUtil.copy(oldOrder, false, true);
+      // Change order values
+      newOrder.setProcessed(false);
+      newOrder.setPosted("N");
+      newOrder.setDocumentStatus("TMP");
+      newOrder.setDocumentAction("CO");
+      newOrder.setGrandTotalAmount(BigDecimal.ZERO);
+      newOrder.setSummedLineAmount(BigDecimal.ZERO);
+      Date today = new Date();
+      newOrder.setOrderDate(today);
+      String newDocumentNo = CancelAndReplaceUtils.getNextCancelDocNo(oldOrder.getDocumentNo());
+      newOrder.setDocumentNo(newDocumentNo);
+      newOrder.setReplacedorder(oldOrder);
+      OBDal.getInstance().save(newOrder);
+
+      // Create new Order lines
+      List<OrderLine> oldOrderLineList = oldOrder.getOrderLineList();
+      for (OrderLine oldOrderLine : oldOrderLineList) {
+        OrderLine newOrderLine = (OrderLine) DalUtil.copy(oldOrderLine, false, true);
+        newOrderLine.setDeliveredQuantity(BigDecimal.ZERO);
+        newOrderLine.setReservedQuantity(BigDecimal.ZERO);
+        newOrderLine.setInvoicedQuantity(BigDecimal.ZERO);
+        newOrderLine.setSalesOrder(newOrder);
+        newOrderLine.setReplacedorderline(oldOrderLine);
+        OBDal.getInstance().save(newOrderLine);
+      }
+
+      // Get new Order id
+      String newOrderId = newOrder.getId();
+
+      // Execute process and prepare an array with actions to be executed after execution
+      JSONArray actions = new JSONArray();
+
+      // Message in tab from where the process is executed
+      showMsgInProcessView.put("msgType", "success");
+      showMsgInProcessView.put("msgTitle", OBMessageUtils.messageBD("Success"));
+      showMsgInProcessView.put("msgText", OBMessageUtils.messageBD("OrderCreatedInTemporalStatus")
+          + " " + newDocumentNo);
+      showMsgInProcessView.put("wait", true);
+
+      JSONObject showMsgInProcessViewAction = new JSONObject();
+      showMsgInProcessViewAction.put("showMsgInProcessView", showMsgInProcessView);
+
+      actions.put(showMsgInProcessViewAction);
+
+      // New record info
+      openDirectTab.put("tabId", tabId);
+      openDirectTab.put("recordId", newOrderId);
+      openDirectTab.put("wait", true);
+
+      JSONObject openDirectTabAction = new JSONObject();
+      openDirectTabAction.put("openDirectTab", openDirectTab);
+
+      actions.put(openDirectTabAction);
+
+      // result.put("openDirectTab", openDirectTab);
+
+      // Message of the new opened tab
+      showMsgInView.put("msgType", "success");
+      showMsgInView.put("msgTitle", OBMessageUtils.messageBD("Success"));
+      showMsgInView.put("msgText", OBMessageUtils.messageBD("OrderInTemporalStatus"));
+
+      JSONObject showMsgInViewAction = new JSONObject();
+      showMsgInViewAction.put("showMsgInView", showMsgInView);
+
+      actions.put(showMsgInViewAction);
+
+      result.put("responseActions", actions);
+
+      // result.put("showMsgInView", showMsgInView);
+
+    } catch (Exception e) {
+      log.error("Error in process", e);
+      try {
+        OBDal.getInstance().getConnection().rollback();
+        result = new JSONObject();
+        JSONObject errorMessage = new JSONObject();
+        errorMessage.put("severity", "error");
+        errorMessage.put("title", OBMessageUtils.messageBD("Error"));
+        errorMessage.put("text", e.getMessage());
+        result.put("message", errorMessage);
+      } catch (Exception e2) {
+        throw new OBException(e2);
+      }
+      Throwable e3 = DbUtility.getUnderlyingSQLException(e);
+      throw new OBException(e3);
+    }
+    return result;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/ConfirmCancelAndReplaceSalesOrder.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,62 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.common.actionhandler;
+
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.businessUtility.CancelAndReplaceUtils;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+
+public class ConfirmCancelAndReplaceSalesOrder extends BaseActionHandler {
+
+  @Override
+  protected JSONObject execute(Map<String, Object> parameters, String content) throws OBException {
+    JSONObject result = new JSONObject();
+    try {
+
+      // Get request parameters
+      JSONObject request = new JSONObject(content);
+      String newOrderId = request.getString("inpcOrderId");
+
+      CancelAndReplaceUtils.cancelAndReplaceOrder(newOrderId, null, false);
+
+      JSONObject resultMessage = new JSONObject();
+      resultMessage.put("severity", "success");
+      resultMessage.put("title", OBMessageUtils.messageBD("Success"));
+      result.put("message", resultMessage);
+
+    } catch (Exception e1) {
+      try {
+        OBDal.getInstance().getConnection().rollback();
+        JSONObject resultMessage = new JSONObject();
+        resultMessage.put("severity", "error");
+        resultMessage.put("title", OBMessageUtils.messageBD("Error"));
+        resultMessage.put("text", OBMessageUtils.translateError(e1.getMessage()).getMessage());
+        result.put("message", resultMessage);
+      } catch (Exception e2) {
+        throw new OBException(e2);
+      }
+    }
+    return result;
+  }
+}
--- a/src/org/openbravo/common/actionhandler/SetNewBPCurrency.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/src/org/openbravo/common/actionhandler/SetNewBPCurrency.java	Mon Aug 29 09:04:15 2016 +0200
@@ -167,7 +167,7 @@
             OBDal.getInstance().save(payment1);
             OBDal.getInstance().save(paymentDetail1);
             OBDal.getInstance().save(paymentScheduleDetail1);
-            FIN_PaymentProcess.doProcessPayment(payment1, "D", false, null, null);
+            FIN_PaymentProcess.doProcessPayment(payment1, "D", null, null);
 
             // Modify description of original credit payment
             String paymentCreditDesc = paymentCredit.getDescription()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceOrderHook.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,19 @@
+/*
+ ************************************************************************************
+ * Copyright (C) 2016 Openbravo S.L.U.
+ * Licensed under the Openbravo Commercial License version 1.0
+ * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
+ * or in the legal folder of this module distribution.
+ ************************************************************************************
+ */
+
+package org.openbravo.erpCommon.businessUtility;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.model.common.order.Order;
+
+public abstract class CancelAndReplaceOrderHook {
+
+  public abstract void exec(Boolean replaceOrder, Boolean triggersDisabled, Order oldOrder,
+      Order newOrder, Order inverseOrder, JSONObject jsonorder) throws Exception;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceOrderHookCaller.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,38 @@
+/*
+ ************************************************************************************
+ * Copyright (C) 2016 Openbravo S.L.U.
+ * Licensed under the Openbravo Commercial License version 1.0
+ * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
+ * or in the legal folder of this module distribution.
+ ************************************************************************************
+ */
+package org.openbravo.erpCommon.businessUtility;
+
+import java.util.Iterator;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.model.common.order.Order;
+
+public class CancelAndReplaceOrderHookCaller {
+  @Inject
+  @Any
+  private Instance<CancelAndReplaceOrderHook> cancelAndReplaceOrderHookProcesses;
+
+  public void executeHook(boolean replaceOrder, boolean triggersDisabled, Order oldOrder,
+      Order newOrder, Order inverseOrder, JSONObject jsonorder) throws Exception {
+    executeHooks(replaceOrder, triggersDisabled, oldOrder, newOrder, inverseOrder, jsonorder);
+  }
+
+  protected void executeHooks(boolean replaceOrder, boolean triggersDisabled, Order oldOrder,
+      Order newOrder, Order inverseOrder, JSONObject jsonorder) throws Exception {
+    for (Iterator<CancelAndReplaceOrderHook> processIterator = cancelAndReplaceOrderHookProcesses
+        .iterator(); processIterator.hasNext();) {
+      CancelAndReplaceOrderHook process = processIterator.next();
+      process.exec(replaceOrder, triggersDisabled, oldOrder, newOrder, inverseOrder, jsonorder);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,1073 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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) 2015-2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.erpCommon.businessUtility;
+
+import java.math.BigDecimal;
+import java.sql.CallableStatement;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.Query;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
+import org.openbravo.advpaymentmngt.process.FIN_PaymentProcess;
+import org.openbravo.advpaymentmngt.utility.FIN_Utility;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.kernel.RequestContext;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.core.TriggerHandler;
+import org.openbravo.dal.security.OrganizationStructureProvider;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.ad_forms.AcctServer;
+import org.openbravo.erpCommon.utility.PropertyException;
+import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.materialmgmt.ReservationUtils;
+import org.openbravo.model.ad.access.OrderLineTax;
+import org.openbravo.model.ad.datamodel.Table;
+import org.openbravo.model.common.enterprise.DocumentType;
+import org.openbravo.model.common.enterprise.Locator;
+import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.order.Order;
+import org.openbravo.model.common.order.OrderLine;
+import org.openbravo.model.common.order.OrderLineOffer;
+import org.openbravo.model.common.order.OrderTax;
+import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
+import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentDetail;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
+import org.openbravo.model.materialmgmt.onhandquantity.Reservation;
+import org.openbravo.model.materialmgmt.onhandquantity.ReservationStock;
+import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
+import org.openbravo.model.materialmgmt.transaction.ShipmentInOut;
+import org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine;
+import org.openbravo.service.db.CallStoredProcedure;
+import org.openbravo.service.db.DalConnectionProvider;
+import org.openbravo.service.db.DbUtility;
+
+public class CancelAndReplaceUtils {
+  private static Logger log4j = Logger.getLogger(CancelAndReplaceUtils.class);
+  private static Date today = null;
+  private static final BigDecimal NEGATIVE_ONE = new BigDecimal(-1);
+  private static final String CREATE_NETTING_SHIPMENT = "CancelAndReplaceCreateNetShipment";
+  private static final String ASSOCIATE_SHIPMENT_TO_REPLACE_TICKET = "CancelAndReplaceAssociateShipmentToNewTicket";
+  private static OrganizationStructureProvider osp = null;
+
+  public static void cancelOrder(String newOrderId, JSONObject jsonorder,
+      boolean useOrderDocumentNoForRelatedDocs) {
+    cancelAndReplaceOrder(newOrderId, jsonorder, useOrderDocumentNoForRelatedDocs, false);
+  }
+
+  public static void cancelAndReplaceOrder(String newOrderId, JSONObject jsonorder,
+      boolean useOrderDocumentNoForRelatedDocs) {
+    cancelAndReplaceOrder(newOrderId, jsonorder, useOrderDocumentNoForRelatedDocs, true);
+  }
+
+  /**
+   * Process that cancels an existing order and creates another one inverse of the original. If it
+   * is indicated a new order is created with received modifications that replaces the original one.
+   * 
+   * This process will create a netting goods shipment to leave the original order and the inverse
+   * order completely delivered, and if anything is delivered was delivered in the original order it
+   * will be delivered so in the new one.
+   * 
+   * The same behavior of shipments will be implemented with payments.
+   * 
+   * @param orderId
+   *          Order Id of the new order or of the old order, depending on replaceOrder boolean.
+   * @param jsonorder
+   *          JSON Object of the order coming from Web POS
+   * @param useOrderDocumentNoForRelatedDocs
+   *          OBPOS_UseOrderDocumentNoForRelatedDocs preference from Web POS.
+   * @param replaceOrder
+   *          If replaceOrder == true, the original order will be cancelled and replaced with a new
+   *          one, if == false, it will only be cancelled
+   * @return
+   */
+  protected static void cancelAndReplaceOrder(String orderId, JSONObject jsonorder,
+      boolean useOrderDocumentNoForRelatedDocs, boolean replaceOrder) {
+    ScrollableResults orderLines = null;
+    try {
+
+      boolean triggersDisabled = false;
+      if (jsonorder != null && replaceOrder) {
+        triggersDisabled = true;
+      }
+
+      Order newOrder = null;
+      Order oldOrder = null;
+
+      // If replaceOrder == true, the original order will be cancelled and replaced with a new one,
+      // if == false, it will only be cancelled
+      if (replaceOrder) {
+        // Get new Order
+        newOrder = OBDal.getInstance().get(Order.class, orderId);
+        // Get old Order
+        oldOrder = newOrder.getReplacedorder();
+      } else {
+        // Get old Order
+        oldOrder = OBDal.getInstance().get(Order.class, orderId);
+      }
+
+      // Added check in case Cancel and Replace button is hit more than once
+      if (jsonorder == null && oldOrder.isCancelled()) {
+        throw new OBException("@APRM_Order@ " + oldOrder.getDocumentNo() + " @IsCancelled@");
+      }
+
+      today = new Date();
+
+      osp = OBContext.getOBContext().getOrganizationStructureProvider(
+          oldOrder.getOrganization().getClient().getId());
+
+      // Release old reservations
+      releaseOldReservations(oldOrder);
+
+      // Get documentNo for the inverse Order Header coming from jsonorder, if exists
+      String negativeDocNo = jsonorder != null && jsonorder.has("negativeDocNo") ? jsonorder
+          .getString("negativeDocNo") : null;
+
+      // Create inverse Order header
+      Order inverseOrder = createOrder(oldOrder, negativeDocNo, triggersDisabled);
+
+      // Define netting goods shipment and its lines
+      ShipmentInOut nettingGoodsShipment = null;
+      ShipmentInOutLine newGoodsShipmentLine1 = null;
+
+      // Iterate old order lines
+      orderLines = getOrderLineList(oldOrder);
+      long lineNoCounter = 1;
+      while (orderLines.next()) {
+        OrderLine oldOrderLine = (OrderLine) orderLines.get(0);
+
+        // Create inverse Order line
+        OrderLine inverseOrderLine = createOrderLine(oldOrderLine, inverseOrder, replaceOrder,
+            triggersDisabled);
+
+        // Get Shipment lines of old order line
+        OBCriteria<ShipmentInOutLine> goodsShipmentLineCriteria = OBDal.getInstance()
+            .createCriteria(ShipmentInOutLine.class);
+        goodsShipmentLineCriteria.add(Restrictions.eq(ShipmentInOutLine.PROPERTY_SALESORDERLINE,
+            oldOrderLine));
+        goodsShipmentLineCriteria.addOrderBy(ShipmentInOutLine.PROPERTY_UPDATED, true);
+        List<ShipmentInOutLine> goodsShipmentLineList = goodsShipmentLineCriteria.list();
+
+        // check "Don't create netting shipment in Cancel and Replace" preference value
+        boolean createNettingGoodsShipment = false;
+        try {
+          createNettingGoodsShipment = ("Y").equals(Preferences.getPreferenceValue(
+              CancelAndReplaceUtils.CREATE_NETTING_SHIPMENT, true, oldOrder.getClient(),
+              oldOrder.getOrganization(), OBContext.getOBContext().getUser(), null, null));
+        } catch (PropertyException e1) {
+          createNettingGoodsShipment = false;
+        }
+        boolean associateShipmentToNewReceipt = false;
+        try {
+          associateShipmentToNewReceipt = ("Y").equals(Preferences.getPreferenceValue(
+              CancelAndReplaceUtils.ASSOCIATE_SHIPMENT_TO_REPLACE_TICKET, true,
+              oldOrder.getClient(), oldOrder.getOrganization(), OBContext.getOBContext().getUser(),
+              null, null));
+        } catch (PropertyException e1) {
+          associateShipmentToNewReceipt = false;
+        }
+
+        if (createNettingGoodsShipment && inverseOrderLine != null) {
+          // Create Netting goods shipment Header
+          if (nettingGoodsShipment == null) {
+            nettingGoodsShipment = createShipment(oldOrder, goodsShipmentLineList);
+          }
+
+          // Stock manipulation
+          org.openbravo.database.ConnectionProvider cp = new DalConnectionProvider(false);
+          CallableStatement updateStockStatement = cp.getConnection().prepareCall(
+              "{call M_UPDATE_INVENTORY (?,?,?,?,?,?,?,?,?,?,?,?,?)}");
+
+          // Create Netting goods shipment Line for the old order line
+          BigDecimal movementQty = oldOrderLine.getOrderedQuantity().subtract(
+              oldOrderLine.getDeliveredQuantity());
+          BigDecimal oldOrderLineDeliveredQty = oldOrderLine.getDeliveredQuantity();
+          oldOrderLine.setDeliveredQuantity(BigDecimal.ZERO);
+          OBDal.getInstance().save(oldOrderLine);
+          OBDal.getInstance().flush();
+          if (movementQty.compareTo(BigDecimal.ZERO) != 0) {
+            newGoodsShipmentLine1 = createShipmentLine(nettingGoodsShipment,
+                goodsShipmentLineList.size() > 0 ? goodsShipmentLineList.get(0) : null,
+                oldOrderLine, lineNoCounter++, movementQty, updateStockStatement, triggersDisabled);
+          }
+          // Create Netting goods shipment Line for the inverse order line
+          movementQty = inverseOrderLine.getOrderedQuantity().subtract(
+              inverseOrderLine.getDeliveredQuantity());
+          if (movementQty.compareTo(BigDecimal.ZERO) != 0) {
+            createShipmentLine(nettingGoodsShipment, newGoodsShipmentLine1, inverseOrderLine,
+                lineNoCounter++, movementQty, updateStockStatement, triggersDisabled);
+          }
+
+          if (replaceOrder) {
+            // Get the the new order line that replaces the old order line, should be only one
+            OBCriteria<OrderLine> olc = OBDal.getInstance().createCriteria(OrderLine.class);
+            olc.add(Restrictions.eq(OrderLine.PROPERTY_REPLACEDORDERLINE, oldOrderLine));
+            olc.add(Restrictions.eq(OrderLine.PROPERTY_SALESORDER, newOrder));
+            olc.setMaxResults(1);
+            OrderLine newOrderLine = (OrderLine) olc.uniqueResult();
+            if (newOrderLine != null) {
+              // Create Netting goods shipment Line for the new order line
+              movementQty = oldOrderLineDeliveredQty;
+              BigDecimal newOrderLineDeliveredQty = newOrderLine.getDeliveredQuantity();
+              newOrderLine.setDeliveredQuantity(BigDecimal.ZERO);
+              OBDal.getInstance().save(newOrderLine);
+              OBDal.getInstance().flush();
+              if (movementQty.compareTo(BigDecimal.ZERO) != 0) {
+                createShipmentLine(nettingGoodsShipment, newGoodsShipmentLine1, newOrderLine,
+                    lineNoCounter++, movementQty, updateStockStatement, triggersDisabled);
+              }
+              if (newOrderLineDeliveredQty == null
+                  || newOrderLineDeliveredQty.compareTo(BigDecimal.ZERO) == 0) {
+                // Set new order line delivered quantity to old order line ordered quantity, this
+                // case
+                // coming from Backend (nothing is delivered)
+                newOrderLine.setDeliveredQuantity(movementQty);
+              } else {
+                // Set new order line delivered quantity to previous delivery quantity, this case
+                // coming from Web POS (everything is delivered)
+                newOrderLine.setDeliveredQuantity(newOrderLineDeliveredQty);
+              }
+              OBDal.getInstance().save(newOrderLine);
+            }
+          }
+        } else if (associateShipmentToNewReceipt) {
+          OBDal.getInstance().flush();
+          for (ShipmentInOutLine shipmentLine : goodsShipmentLineList) {
+            OBCriteria<OrderLine> olc = OBDal.getInstance().createCriteria(OrderLine.class);
+            olc.add(Restrictions.eq(OrderLine.PROPERTY_REPLACEDORDERLINE, oldOrderLine));
+            olc.add(Restrictions.eq(OrderLine.PROPERTY_SALESORDER, newOrder));
+            olc.setMaxResults(1);
+            OrderLine newOrderLine = (OrderLine) olc.uniqueResult();
+            if (newOrderLine != null) {
+              shipmentLine.setSalesOrderLine(newOrderLine);
+            }
+          }
+        }
+
+        // Set old order delivered quantity to the ordered quantity
+        oldOrderLine.setDeliveredQuantity(oldOrderLine.getOrderedQuantity());
+        OBDal.getInstance().save(oldOrderLine);
+
+        // Set inverse order delivered quantity to ordered quantity
+        if (inverseOrderLine != null) {
+          inverseOrderLine.setDeliveredQuantity(inverseOrderLine.getOrderedQuantity());
+          OBDal.getInstance().save(inverseOrderLine);
+        }
+      }
+      if (nettingGoodsShipment != null) {
+        processShipment(nettingGoodsShipment);
+      }
+
+      // Close inverse order
+      inverseOrder.setDocumentStatus("CL");
+      inverseOrder.setDocumentAction("--");
+      inverseOrder.setProcessed(true);
+      inverseOrder.setProcessNow(false);
+      OBDal.getInstance().save(inverseOrder);
+
+      // Close original order
+      oldOrder.setDocumentStatus("CL");
+      oldOrder.setDocumentAction("--");
+      oldOrder.setReplacementorder(newOrder);
+      oldOrder.setCancelled(true);
+      oldOrder.setProcessed(true);
+      oldOrder.setProcessNow(false);
+      OBDal.getInstance().save(oldOrder);
+
+      // Complete new order and generate good shipment and sales invoice
+      if (!triggersDisabled && replaceOrder) {
+        newOrder.setDocumentStatus("DR");
+        OBDal.getInstance().save(newOrder);
+        callCOrderPost(newOrder);
+
+      }
+      // Create new reservations
+      createNewReservations(newOrder);
+
+      OBDal.getInstance().flush();
+
+      // Payment Creation
+      // Get the payment schedule detail of the oldOrder
+      createPayments(oldOrder, newOrder, inverseOrder, jsonorder, useOrderDocumentNoForRelatedDocs,
+          replaceOrder, triggersDisabled);
+
+      // Calling Cancelandreplaceorderhook
+      WeldUtils.getInstanceFromStaticBeanManager(CancelAndReplaceOrderHookCaller.class)
+          .executeHook(replaceOrder, triggersDisabled, oldOrder, newOrder, inverseOrder, jsonorder);
+
+    } catch (Exception e1) {
+      try {
+        OBDal.getInstance().getConnection().rollback();
+      } catch (Exception e2) {
+        throw new OBException(e2);
+      }
+      Throwable e3 = DbUtility.getUnderlyingSQLException(e1);
+      log4j.error("Error executing Cancel and Replace", e1);
+      throw new OBException(e3.getMessage());
+    } finally {
+      if (orderLines != null) {
+        orderLines.close();
+      }
+    }
+  }
+
+  protected static void callCOrderPost(Order order) throws OBException {
+    final List<Object> parameters = new ArrayList<Object>();
+    parameters.add(null);
+    parameters.add(order.getId());
+    final String procedureName = "c_order_post1";
+    CallStoredProcedure.getInstance().call(procedureName, parameters, null, true, false);
+  }
+
+  private static Order createOrder(Order oldOrder, String documentNo, boolean triggersDisabled)
+      throws JSONException {
+    Order inverseOrder = (Order) DalUtil.copy(oldOrder, false, true);
+    // Change order values
+    inverseOrder.setCreatedBy(OBContext.getOBContext().getUser());
+    inverseOrder.setPosted("N");
+    inverseOrder.setProcessed(false);
+    inverseOrder.setDocumentStatus("DR");
+    inverseOrder.setDocumentAction("CO");
+    if (triggersDisabled) {
+      inverseOrder.setGrandTotalAmount(oldOrder.getGrandTotalAmount().negate());
+      inverseOrder.setSummedLineAmount(oldOrder.getSummedLineAmount().negate());
+    } else {
+      inverseOrder.setGrandTotalAmount(BigDecimal.ZERO);
+      inverseOrder.setSummedLineAmount(BigDecimal.ZERO);
+    }
+    inverseOrder.setOrderDate(DateUtils.truncate(new Date(), Calendar.DATE));
+    inverseOrder.setCreationDate(today);
+    inverseOrder.setUpdated(today);
+    inverseOrder.setScheduledDeliveryDate(today);
+    String newDocumentNo = documentNo;
+    if (newDocumentNo == null) {
+      newDocumentNo = oldOrder.getDocumentNo() + "*R*";
+    }
+    inverseOrder.setDocumentNo(newDocumentNo);
+    inverseOrder.setCancelledorder(oldOrder);
+    OBDal.getInstance().save(inverseOrder);
+
+    // Copy old order taxes to inverse, it is done when is executed from Web POS because triggers
+    // are disabled
+    if (triggersDisabled) {
+      createOrderTaxes(oldOrder, inverseOrder);
+    }
+
+    return inverseOrder;
+  }
+
+  protected static void createOrderTaxes(Order oldOrder, Order inverseOrder) {
+    for (OrderTax orderTax : oldOrder.getOrderTaxList()) {
+      OrderTax inverseOrderTax = (OrderTax) DalUtil.copy(orderTax, false, true);
+      BigDecimal inverseTaxAmount = orderTax.getTaxAmount().negate();
+      BigDecimal inverseTaxableAmount = orderTax.getTaxableAmount().negate();
+      inverseOrderTax.setTaxAmount(inverseTaxAmount);
+      inverseOrderTax.setTaxableAmount(inverseTaxableAmount);
+      inverseOrderTax.setSalesOrder(inverseOrder);
+      inverseOrder.getOrderTaxList().add(inverseOrderTax);
+      OBDal.getInstance().save(inverseOrderTax);
+    }
+    OBDal.getInstance().flush();
+  }
+
+  protected static OrderLine createOrderLine(OrderLine oldOrderLine, Order inverseOrder,
+      boolean replaceOrder, boolean triggersDisabled) {
+    if (!replaceOrder
+        && oldOrderLine.getDeliveredQuantity().compareTo(oldOrderLine.getOrderedQuantity()) == 0) {
+      return null;
+    }
+    OrderLine inverseOrderLine = (OrderLine) DalUtil.copy(oldOrderLine, false, true);
+    inverseOrderLine.setSalesOrder(inverseOrder);
+    if (!replaceOrder && oldOrderLine.getDeliveredQuantity().compareTo(BigDecimal.ZERO) == 1) {
+      BigDecimal inverseOrderedQuantity = oldOrderLine.getOrderedQuantity()
+          .subtract(oldOrderLine.getDeliveredQuantity()).negate();
+      inverseOrderLine.setOrderedQuantity(inverseOrderedQuantity);
+    } else {
+      inverseOrderLine.setOrderedQuantity(inverseOrderLine.getOrderedQuantity().negate());
+    }
+    if (triggersDisabled) {
+      inverseOrderLine.setLineGrossAmount(oldOrderLine.getLineGrossAmount().negate());
+      inverseOrderLine.setLineNetAmount(oldOrderLine.getLineNetAmount().negate());
+    }
+    // Set inverse order delivered quantity zero
+    inverseOrderLine.setDeliveredQuantity(BigDecimal.ZERO);
+    inverseOrderLine.setReservedQuantity(BigDecimal.ZERO);
+
+    inverseOrder.getOrderLineList().add(inverseOrderLine);
+    OBDal.getInstance().save(inverseOrderLine);
+
+    // Copy the discounts of the original line
+    creteOrderLineDiscounts(oldOrderLine, inverseOrderLine, inverseOrder);
+    // Copy old order taxes to inverse, it is done when is executed from Web POS because triggers
+    // are disabled
+    if (triggersDisabled) {
+      createOrderLineTaxes(oldOrderLine, inverseOrderLine, inverseOrder);
+    }
+
+    return inverseOrderLine;
+  }
+
+  protected static void creteOrderLineDiscounts(OrderLine oldOrderLine, OrderLine inverseOrderLine,
+      Order inverseOrder) {
+    for (OrderLineOffer orderLineOffer : oldOrderLine.getOrderLineOfferList()) {
+      final OrderLineOffer inverseOrderLineOffer = (OrderLineOffer) DalUtil.copy(orderLineOffer,
+          false, true);
+      inverseOrderLineOffer.setBaseGrossUnitPrice(inverseOrderLineOffer.getBaseGrossUnitPrice()
+          .negate());
+      inverseOrderLineOffer.setDisplayedTotalAmount(inverseOrderLineOffer.getDisplayedTotalAmount()
+          .negate());
+      inverseOrderLineOffer.setPriceAdjustmentAmt(inverseOrderLineOffer.getPriceAdjustmentAmt()
+          .negate());
+      inverseOrderLineOffer.setTotalAmount(inverseOrderLineOffer.getTotalAmount().negate());
+      inverseOrderLineOffer.setSalesOrderLine(inverseOrderLine);
+      OBDal.getInstance().save(inverseOrderLineOffer);
+    }
+    OBDal.getInstance().flush();
+  }
+
+  protected static void createOrderLineTaxes(OrderLine oldOrderLine, OrderLine inverseOrderLine,
+      Order inverseOrder) {
+    for (OrderLineTax orderLineTax : oldOrderLine.getOrderLineTaxList()) {
+      final OrderLineTax inverseOrderLineTax = (OrderLineTax) DalUtil.copy(orderLineTax, false,
+          true);
+      BigDecimal inverseTaxAmount = orderLineTax.getTaxAmount().negate();
+      BigDecimal inverseTaxableAmount = orderLineTax.getTaxableAmount().negate();
+      inverseOrderLineTax.setTaxAmount(inverseTaxAmount);
+      inverseOrderLineTax.setTaxableAmount(inverseTaxableAmount);
+      inverseOrderLineTax.setSalesOrder(inverseOrder);
+      inverseOrderLineTax.setSalesOrderLine(inverseOrderLine);
+      inverseOrderLine.getOrderLineTaxList().add(inverseOrderLineTax);
+      inverseOrder.getOrderLineTaxList().add(inverseOrderLineTax);
+      OBDal.getInstance().save(inverseOrderLineTax);
+    }
+    OBDal.getInstance().flush();
+  }
+
+  protected static ShipmentInOut createShipment(Order oldOrder,
+      List<ShipmentInOutLine> goodsShipmentLineList) {
+    ShipmentInOut nettingGoodsShipment = null;
+    // if (goodsShipmentLineList != null && goodsShipmentLineList.size() == 0) {
+    if (goodsShipmentLineList.size() == 0) {
+      // Create new Shipment
+      nettingGoodsShipment = OBProvider.getInstance().get(ShipmentInOut.class);
+      nettingGoodsShipment.setOrganization(oldOrder.getOrganization());
+      // Set Document Type
+      OBCriteria<DocumentType> goodsShipmentDocumentTypeCriteria = OBDal.getInstance()
+          .createCriteria(DocumentType.class);
+      OBCriteria<Table> goodsShipmentTableCriteria = OBDal.getInstance()
+          .createCriteria(Table.class);
+      goodsShipmentTableCriteria.add(Restrictions.eq(Table.PROPERTY_DBTABLENAME,
+          ShipmentInOut.TABLE_NAME));
+      List<Table> goodsShipmentTableList = goodsShipmentTableCriteria.list();
+      if (goodsShipmentTableList.size() != 1) {
+        throw new OBException("Only one table named M_InOut can exists");
+      }
+      Table goodsShipmentTable = goodsShipmentTableList.get(0);
+      goodsShipmentDocumentTypeCriteria.add(Restrictions.eq(DocumentType.PROPERTY_TABLE,
+          goodsShipmentTable));
+      goodsShipmentDocumentTypeCriteria.add(Restrictions.eq(DocumentType.PROPERTY_SALESTRANSACTION,
+          true));
+      List<String> parentOrganizationIdList = osp.getParentList(oldOrder.getOrganization().getId(),
+          true);
+      goodsShipmentDocumentTypeCriteria.add(Restrictions.in(DocumentType.PROPERTY_ORGANIZATION
+          + ".id", parentOrganizationIdList));
+      goodsShipmentDocumentTypeCriteria.add(Restrictions.eq(DocumentType.PROPERTY_ACTIVE, true));
+      goodsShipmentDocumentTypeCriteria.addOrderBy(DocumentType.PROPERTY_DEFAULT, false);
+      List<DocumentType> goodsShipmentDocumentTypeList = goodsShipmentDocumentTypeCriteria.list();
+      if (goodsShipmentDocumentTypeList.size() == 0) {
+        throw new OBException("No document type found for the new shipment");
+      }
+      DocumentType goodsShipmentDocumentType = goodsShipmentDocumentTypeList.get(0);
+      nettingGoodsShipment.setDocumentType(goodsShipmentDocumentType);
+      nettingGoodsShipment.setWarehouse(oldOrder.getWarehouse());
+      nettingGoodsShipment.setBusinessPartner(oldOrder.getBusinessPartner());
+      if (oldOrder.getPartnerAddress() == null) {
+        throw new OBException("The business partner location can not be null");
+      }
+      nettingGoodsShipment.setPartnerAddress(oldOrder.getPartnerAddress());
+    } else {
+      nettingGoodsShipment = (ShipmentInOut) DalUtil.copy(goodsShipmentLineList.get(0)
+          .getShipmentReceipt(), false, true);
+    }
+    nettingGoodsShipment.setMovementDate(today);
+    nettingGoodsShipment.setAccountingDate(today);
+    nettingGoodsShipment.setSalesOrder(null);
+    nettingGoodsShipment.setPosted("N");
+    nettingGoodsShipment.setProcessed(false);
+    nettingGoodsShipment.setDocumentStatus("DR");
+    nettingGoodsShipment.setDocumentAction("CO");
+    nettingGoodsShipment.setMovementType("C-");
+    nettingGoodsShipment.setProcessGoodsJava("--");
+    String nettingGoodsShipmentDocumentNo = FIN_Utility.getDocumentNo(
+        nettingGoodsShipment.getDocumentType(), ShipmentInOut.TABLE_NAME);
+    nettingGoodsShipment.setDocumentNo(nettingGoodsShipmentDocumentNo);
+    OBDal.getInstance().save(nettingGoodsShipment);
+    return nettingGoodsShipment;
+  }
+
+  protected static ShipmentInOutLine createShipmentLine(ShipmentInOut nettingGoodsShipment,
+      ShipmentInOutLine nettingGoodsShipmentLine, OrderLine orderLine, long lineNoCounter,
+      BigDecimal movementQty, CallableStatement updateStockStatement, boolean triggersDisabled) {
+    ShipmentInOutLine newGoodsShipmentLine = null;
+    if (nettingGoodsShipmentLine == null) {
+      newGoodsShipmentLine = OBProvider.getInstance().get(ShipmentInOutLine.class);
+      newGoodsShipmentLine.setOrganization(orderLine.getOrganization());
+      newGoodsShipmentLine.setProduct(orderLine.getProduct());
+      newGoodsShipmentLine.setUOM(orderLine.getUOM());
+      // Get first storage bin
+      Locator locator1 = nettingGoodsShipment.getWarehouse().getLocatorList().get(0);
+      newGoodsShipmentLine.setStorageBin(locator1);
+    } else {
+      newGoodsShipmentLine = (ShipmentInOutLine) DalUtil
+          .copy(nettingGoodsShipmentLine, false, true);
+    }
+    newGoodsShipmentLine.setLineNo(10 * lineNoCounter);
+    newGoodsShipmentLine.setSalesOrderLine(orderLine);
+    newGoodsShipmentLine.setShipmentReceipt(nettingGoodsShipment);
+    newGoodsShipmentLine.setMovementQuantity(movementQty);
+
+    // Create Material Transaction record
+    createMTransaction(newGoodsShipmentLine, updateStockStatement, triggersDisabled);
+
+    OBDal.getInstance().save(newGoodsShipmentLine);
+    return newGoodsShipmentLine;
+  }
+
+  protected static void releaseOldReservations(Order oldOrder) {
+    ScrollableResults oldOrderLines = null;
+    try {
+      // Iterate old order lines
+      oldOrderLines = getOrderLineList(oldOrder);
+      while (oldOrderLines.next()) {
+        OrderLine oldOrderLine = (OrderLine) oldOrderLines.get(0);
+        OBCriteria<Reservation> reservationCriteria = OBDal.getInstance().createCriteria(
+            Reservation.class);
+        reservationCriteria.add(Restrictions.eq(Reservation.PROPERTY_SALESORDERLINE, oldOrderLine));
+        reservationCriteria.setMaxResults(1);
+        Reservation reservation = (Reservation) reservationCriteria.uniqueResult();
+        if (reservation != null) {
+          releaseReservation(reservation);
+          OBDal.getInstance().save(reservation);
+        }
+      }
+    } catch (Exception e) {
+      log4j.error("Error in CancelAndReplaceUtils.releaseOldReservations", e);
+      throw new OBException(e.getMessage(), e);
+    } finally {
+      if (oldOrderLines != null) {
+        oldOrderLines.close();
+      }
+    }
+  }
+
+  // Release a reservation
+  protected static void releaseReservation(Reservation reservation) {
+    final StringBuilder hqlReservations = new StringBuilder();
+    hqlReservations.append(" update " + ReservationStock.ENTITY_NAME + " as rs set rs."
+        + ReservationStock.PROPERTY_RELEASED + " = rs." + ReservationStock.PROPERTY_QUANTITY);
+    hqlReservations.append(" where rs." + ReservationStock.PROPERTY_RESERVATION + "."
+        + Reservation.PROPERTY_ID + " = :reservationId");
+    Query updateTransactions = OBDal.getInstance().getSession()
+        .createQuery(hqlReservations.toString());
+    updateTransactions.setParameter("reservationId", reservation.getId());
+    updateTransactions.executeUpdate();
+
+    OBDal.getInstance().flush();
+  }
+
+  protected static void createNewReservations(Order newOrder) {
+    ScrollableResults newOrderLines = null;
+    try {
+      // Iterate old order lines
+      newOrderLines = getOrderLineList(newOrder);
+      while (newOrderLines.next()) {
+        OrderLine newOrderLine = (OrderLine) newOrderLines.get(0);
+        if (newOrderLine.getDeliveredQuantity() != null) {
+          if (newOrderLine.getOrderedQuantity().subtract(newOrderLine.getDeliveredQuantity())
+              .compareTo(BigDecimal.ZERO) == 0) {
+            continue;
+          }
+        }
+        OBCriteria<Reservation> reservationCriteria = OBDal.getInstance().createCriteria(
+            Reservation.class);
+        reservationCriteria.add(Restrictions.eq(Reservation.PROPERTY_SALESORDERLINE,
+            newOrderLine.getReplacedorderline()));
+        reservationCriteria.setMaxResults(1);
+        Reservation reservation = (Reservation) reservationCriteria.uniqueResult();
+        if (reservation != null) {
+          ReservationUtils.createReserveFromSalesOrderLine(newOrderLine, true);
+        }
+      }
+    } catch (Exception e) {
+      log4j.error("Error in CancelAndReplaceUtils.createNewReservations", e);
+      throw new OBException(e.getMessage(), e);
+    } finally {
+      if (newOrderLines != null) {
+        newOrderLines.close();
+      }
+    }
+  }
+
+  protected static ScrollableResults getOrderLineList(Order order) {
+    OBCriteria<OrderLine> orderLinesCriteria = OBDal.getInstance().createCriteria(OrderLine.class);
+    orderLinesCriteria.add(Restrictions.eq(OrderLine.PROPERTY_SALESORDER, order));
+
+    ScrollableResults orderLines = orderLinesCriteria.scroll(ScrollMode.FORWARD_ONLY);
+    return orderLines;
+  }
+
+  protected static void createMTransaction(ShipmentInOutLine line,
+      CallableStatement updateStockStatement, boolean triggersDisabled) {
+    if (line.getProduct().getProductType().equals("I") && line.getProduct().isStocked()) {
+      // Stock is changed only for stocked products of type "Item"
+      MaterialTransaction transaction = OBProvider.getInstance().get(MaterialTransaction.class);
+      transaction.setOrganization(line.getOrganization());
+      transaction.setMovementType(line.getShipmentReceipt().getMovementType());
+      transaction.setProduct(line.getProduct());
+      transaction.setStorageBin(line.getStorageBin());
+      transaction.setOrderUOM(line.getOrderUOM());
+      transaction.setUOM(line.getUOM());
+      transaction.setOrderQuantity(line.getOrderQuantity());
+      transaction.setMovementQuantity(line.getMovementQuantity().multiply(NEGATIVE_ONE));
+      transaction.setMovementDate(line.getShipmentReceipt().getMovementDate());
+      transaction.setGoodsShipmentLine(line);
+      transaction.setAttributeSetValue(line.getAttributeSetValue());
+
+      // Execute M_UPDATE_INVENTORY stored procedure, it is done when is executed from Web POS
+      // because triggers are disabled
+      if (triggersDisabled) {
+        updateInventory(transaction, updateStockStatement);
+      }
+
+      OBDal.getInstance().save(transaction);
+    }
+  }
+
+  protected static void updateInventory(MaterialTransaction transaction,
+      CallableStatement updateStockStatement) {
+    try {
+      // client
+      updateStockStatement.setString(1, OBContext.getOBContext().getCurrentClient().getId());
+      // org
+      updateStockStatement.setString(2, OBContext.getOBContext().getCurrentOrganization().getId());
+      // user
+      updateStockStatement.setString(3, OBContext.getOBContext().getUser().getId());
+      // product
+      updateStockStatement.setString(4, transaction.getProduct().getId());
+      // locator
+      updateStockStatement.setString(5, transaction.getStorageBin().getId());
+      // attributesetinstance
+      updateStockStatement.setString(6, transaction.getAttributeSetValue() != null ? transaction
+          .getAttributeSetValue().getId() : null);
+      // uom
+      updateStockStatement.setString(7, transaction.getUOM().getId());
+      // product uom
+      updateStockStatement.setString(8, null);
+      // p_qty
+      updateStockStatement.setBigDecimal(9,
+          transaction.getMovementQuantity() != null ? transaction.getMovementQuantity() : null);
+      // p_qtyorder
+      updateStockStatement.setBigDecimal(10,
+          transaction.getOrderQuantity() != null ? transaction.getOrderQuantity() : null);
+      // p_dateLastInventory --- **
+      updateStockStatement.setDate(11, null);
+      // p_preqty
+      updateStockStatement.setBigDecimal(12, BigDecimal.ZERO);
+      // p_preqtyorder
+      updateStockStatement.setBigDecimal(13, transaction.getOrderQuantity() != null ? transaction
+          .getOrderQuantity().multiply(NEGATIVE_ONE) : null);
+
+      updateStockStatement.execute();
+
+    } catch (Exception e) {
+      log4j.error("Error in CancelAndReplaceUtils.updateInventory", e);
+      throw new OBException(e.getMessage(), e);
+    }
+  }
+
+  protected static void processShipment(ShipmentInOut shipment) {
+    if (shipment.isProcessed()) {
+      shipment.setPosted("N");
+      shipment.setProcessed(false);
+      shipment.setDocumentStatus("DR");
+      shipment.setDocumentAction("CO");
+    } else {
+      shipment.setPosted("Y");
+      shipment.setProcessed(true);
+      shipment.setDocumentStatus("CO");
+      shipment.setDocumentAction("--");
+    }
+    OBDal.getInstance().save(shipment);
+    OBDal.getInstance().flush();
+  }
+
+  protected static void createPayments(Order oldOrder, Order newOrder, Order inverseOrder,
+      JSONObject jsonorder, boolean useOrderDocumentNoForRelatedDocs, boolean replaceOrder,
+      boolean triggersDisabled) {
+    try {
+      FIN_PaymentSchedule paymentSchedule;
+      OBCriteria<FIN_PaymentSchedule> paymentScheduleCriteria = OBDal.getInstance().createCriteria(
+          FIN_PaymentSchedule.class);
+      paymentScheduleCriteria.add(Restrictions.eq(FIN_PaymentSchedule.PROPERTY_ORDER, oldOrder));
+      paymentScheduleCriteria.setMaxResults(1);
+      paymentSchedule = (FIN_PaymentSchedule) paymentScheduleCriteria.uniqueResult();
+      if (paymentSchedule != null) {
+        FIN_Payment newPayment = null;
+
+        // Get paid amount on original order
+        final String countHql = "select coalesce(sum(pd." + FIN_PaymentDetail.PROPERTY_AMOUNT
+            + "), 0) as amount from " + FIN_PaymentScheduleDetail.ENTITY_NAME + " as psd join psd."
+            + FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS + " as pd where psd."
+            + FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE + ".id =:paymentScheduleId";
+        final Query qry = OBDal.getInstance().getSession().createQuery(countHql);
+        qry.setParameter("paymentScheduleId", paymentSchedule.getId());
+        qry.setMaxResults(1);
+        BigDecimal paidAmount = (BigDecimal) qry.uniqueResult();
+        BigDecimal outstandingAmount = paymentSchedule.getAmount().subtract(paidAmount);
+        BigDecimal negativeAmount = BigDecimal.ZERO;
+
+        if (replaceOrder) {
+          boolean createPayments = true;
+          // Pay fully inverse order in C&R.
+          negativeAmount = paymentSchedule.getAmount().negate();
+          if (!triggersDisabled) {
+            // Only for BackEnd WorkFlow
+            // Get the payment schedule of the new order to check the outstanding amount, could
+            // have been automatically paid on C_ORDER_POST if is automatically invoiced and the
+            // payment method of the financial account is configured as 'Automatic Receipt'
+            FIN_PaymentSchedule paymentScheduleNewOrder = null;
+            OBCriteria<FIN_PaymentSchedule> paymentScheduleCriteriaNewOrder = OBDal.getInstance()
+                .createCriteria(FIN_PaymentSchedule.class);
+            paymentScheduleCriteriaNewOrder.add(Restrictions.eq(FIN_PaymentSchedule.PROPERTY_ORDER,
+                newOrder));
+            paymentScheduleCriteriaNewOrder.setMaxResults(1);
+            paymentScheduleNewOrder = (FIN_PaymentSchedule) paymentScheduleCriteriaNewOrder
+                .uniqueResult();
+            if (paymentScheduleNewOrder.getOutstandingAmount().compareTo(BigDecimal.ZERO) == 0) {
+              createPayments = false;
+            }
+          }
+
+          newPayment = payOriginalAndInverseOrder(jsonorder, oldOrder, inverseOrder, newPayment,
+              outstandingAmount, negativeAmount, useOrderDocumentNoForRelatedDocs,
+              triggersDisabled, replaceOrder);
+
+          // Pay of the new order the amount already paid in original order
+          if (createPayments && paidAmount.compareTo(BigDecimal.ZERO) != 0) {
+            newPayment = createPayment(newPayment, newOrder, null, paidAmount, null, null, null);
+            String description = newPayment.getDescription() + ": " + newOrder.getDocumentNo();
+            newPayment.setDescription(description);
+          }
+        } else {
+          // To only cancel a layaway two payments must be added to fully pay the old order and add
+          // the same quantity in negative to the inverse order
+          if (jsonorder.getJSONArray("payments").length() > 0) {
+            WeldUtils.getInstanceFromStaticBeanManager(CancelLayawayPaymentsHookCaller.class)
+                .executeHook(jsonorder, inverseOrder);
+
+            // In a cancel layaway the gross value of the jsonorder was the amount to
+            // return to the customer, not the amount of the ticket. In this case the amount and
+            // outstanding needs to be fixed as are created in a wrong way.
+            OBCriteria<FIN_PaymentSchedule> newPaymentScheduleList = OBDal.getInstance()
+                .createCriteria(FIN_PaymentSchedule.class);
+            newPaymentScheduleList.add(Restrictions.eq(FIN_PaymentSchedule.PROPERTY_ORDER,
+                inverseOrder));
+            newPaymentScheduleList.setMaxResults(1);
+            FIN_PaymentSchedule newPaymentSchedule = (FIN_PaymentSchedule) newPaymentScheduleList
+                .uniqueResult();
+            newPaymentSchedule.setAmount(paymentSchedule.getAmount().negate());
+            newPaymentSchedule.setOutstandingAmount(newPaymentSchedule.getAmount().subtract(
+                newPaymentSchedule.getPaidAmount()));
+            OBDal.getInstance().save(newPaymentSchedule);
+          }
+
+          negativeAmount = outstandingAmount.negate();
+          if (outstandingAmount.compareTo(BigDecimal.ZERO) != 0) {
+            newPayment = payOriginalAndInverseOrder(jsonorder, oldOrder, inverseOrder, newPayment,
+                outstandingAmount, negativeAmount, useOrderDocumentNoForRelatedDocs,
+                triggersDisabled, replaceOrder);
+          }
+        }
+
+        // Call to processPayment in order to process it
+        if (triggersDisabled && replaceOrder) {
+          TriggerHandler.getInstance().enable();
+        }
+        if (newPayment != null) {
+          FIN_PaymentProcess.doProcessPayment(newPayment, "P", true, null, null);
+        }
+        if (triggersDisabled && replaceOrder) {
+          TriggerHandler.getInstance().disable();
+        }
+
+      } else {
+        throw new OBException("There is no payment plan for the order: " + oldOrder.getId());
+      }
+
+    } catch (Exception e1) {
+      log4j.error("Error in CancelAndReplaceUtils.createPayments", e1);
+      try {
+        OBDal.getInstance().getConnection().rollback();
+      } catch (Exception e2) {
+        throw new OBException(e2);
+      }
+      Throwable e3 = DbUtility.getUnderlyingSQLException(e1);
+      throw new OBException(e3);
+    }
+  }
+
+  // Pay original order and inverse order.
+  private static FIN_Payment payOriginalAndInverseOrder(JSONObject jsonorder, Order oldOrder,
+      Order inverseOrder, FIN_Payment newPayment, BigDecimal outstandingAmount,
+      BigDecimal negativeAmount, boolean useOrderDocumentNoForRelatedDocs,
+      boolean triggersDisabled, boolean replaceOrder) throws Exception {
+    FIN_Payment _newPayment = newPayment;
+    String paymentDocumentNo = null;
+    FIN_PaymentMethod paymentPaymentMethod = null;
+    FIN_FinancialAccount financialAccount = null;
+    if (jsonorder != null) {
+      paymentPaymentMethod = (FIN_PaymentMethod) jsonorder.getJSONObject("defaultPaymentType").get(
+          "paymentMethod");
+      financialAccount = (FIN_FinancialAccount) jsonorder.getJSONObject("defaultPaymentType").get(
+          "financialAccount");
+    } else {
+      paymentPaymentMethod = oldOrder.getPaymentMethod();
+      // Find a financial account belong the organization tree
+      if (oldOrder.getBusinessPartner().getAccount() != null
+          && FIN_Utility.getFinancialAccountPaymentMethod(paymentPaymentMethod.getId(), oldOrder
+              .getBusinessPartner().getAccount().getId(), true, oldOrder.getCurrency().getId()) != null
+          && osp.isInNaturalTree(oldOrder.getBusinessPartner().getAccount().getOrganization(),
+              OBDal.getInstance().get(Organization.class, oldOrder.getOrganization().getId()))) {
+        financialAccount = oldOrder.getBusinessPartner().getAccount();
+      } else {
+        financialAccount = FIN_Utility.getFinancialAccountPaymentMethodByOrganization(
+            paymentPaymentMethod.getId(), null, true, oldOrder.getCurrency().getId(),
+            oldOrder.getOrganization().getId()).getAccount();
+      }
+    }
+
+    final DocumentType paymentDocumentType = FIN_Utility.getDocumentType(
+        oldOrder.getOrganization(), AcctServer.DOCTYPE_ARReceipt);
+    if (paymentDocumentType == null) {
+      throw new OBException("No document type found for the new payment");
+    }
+
+    paymentDocumentNo = getPaymentDocumentNo(useOrderDocumentNoForRelatedDocs, oldOrder,
+        paymentDocumentType);
+
+    // Get Payment Description
+    String description = getPaymentDescription();
+    description += ": " + inverseOrder.getDocumentNo();
+
+    // Duplicate payment with negative amount
+    _newPayment = createPayment(_newPayment, inverseOrder, paymentPaymentMethod, negativeAmount,
+        paymentDocumentType, financialAccount, paymentDocumentNo);
+
+    // Duplicate payment with positive amount
+    _newPayment = createPayment(_newPayment, oldOrder, paymentPaymentMethod, outstandingAmount,
+        paymentDocumentType, financialAccount, paymentDocumentNo);
+    description += ": " + oldOrder.getDocumentNo() + "\n";
+
+    // Set amount and used credit to zero
+    _newPayment.setAmount(BigDecimal.ZERO);
+    _newPayment.setUsedCredit(BigDecimal.ZERO);
+    _newPayment.setDescription(description);
+    return _newPayment;
+  }
+
+  protected static FIN_Payment createPayment(FIN_Payment payment, Order order,
+      FIN_PaymentMethod paymentPaymentMethod, BigDecimal amount, DocumentType paymentDocumentType,
+      FIN_FinancialAccount financialAccount, String paymentDocumentNo) throws Exception {
+    FIN_Payment newPayment = payment;
+
+    // Get the payment schedule of the order
+    FIN_PaymentSchedule paymentSchedule = null;
+    OBCriteria<FIN_PaymentSchedule> paymentScheduleCriteria = OBDal.getInstance().createCriteria(
+        FIN_PaymentSchedule.class);
+    paymentScheduleCriteria.add(Restrictions.eq(FIN_PaymentSchedule.PROPERTY_ORDER, order));
+    paymentScheduleCriteria.setMaxResults(1);
+    paymentSchedule = (FIN_PaymentSchedule) paymentScheduleCriteria.uniqueResult();
+    if (paymentSchedule == null) {
+      // Create a Payment Schedule if the order hasn't got
+      paymentSchedule = OBProvider.getInstance().get(FIN_PaymentSchedule.class);
+      paymentSchedule.setClient(order.getClient());
+      paymentSchedule.setOrganization(order.getOrganization());
+      paymentSchedule.setCurrency(order.getCurrency());
+      paymentSchedule.setOrder(order);
+      paymentSchedule.setFinPaymentmethod(order.getBusinessPartner().getPaymentMethod());
+      paymentSchedule.setAmount(amount);
+      paymentSchedule.setOutstandingAmount(amount);
+      paymentSchedule.setDueDate(order.getOrderDate());
+      paymentSchedule.setExpectedDate(order.getOrderDate());
+      if (ModelProvider.getInstance().getEntity(FIN_PaymentSchedule.class)
+          .hasProperty("origDueDate")) {
+        // This property is checked and set this way to force compatibility with both MP13, MP14
+        // and
+        // later releases of Openbravo. This property is mandatory and must be set. Check issue
+        paymentSchedule.set("origDueDate", paymentSchedule.getDueDate());
+      }
+      paymentSchedule.setFINPaymentPriority(order.getFINPaymentPriority());
+      OBDal.getInstance().save(paymentSchedule);
+    }
+
+    // Get the payment schedule detail of the order
+    OBCriteria<FIN_PaymentScheduleDetail> paymentScheduleDetailCriteria = OBDal.getInstance()
+        .createCriteria(FIN_PaymentScheduleDetail.class);
+    paymentScheduleDetailCriteria.add(Restrictions.eq(
+        FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE, paymentSchedule));
+    // There should be only one with null paymentDetails
+    paymentScheduleDetailCriteria.add(Restrictions
+        .isNull(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS));
+    paymentScheduleDetailCriteria.setMaxResults(1);
+    List<FIN_PaymentScheduleDetail> paymentScheduleDetailList = paymentScheduleDetailCriteria
+        .list();
+    if (paymentScheduleDetailList.size() != 0) {
+      HashMap<String, BigDecimal> paymentScheduleDetailAmount = new HashMap<String, BigDecimal>();
+      String paymentScheduleDetailId = paymentScheduleDetailList.get(0).getId();
+      paymentScheduleDetailAmount.put(paymentScheduleDetailId, amount);
+
+      if (payment == null) {
+        // Call to savePayment in order to create a new payment in
+        newPayment = FIN_AddPayment.savePayment(payment, true, paymentDocumentType,
+            paymentDocumentNo, order.getBusinessPartner(), paymentPaymentMethod, financialAccount,
+            amount.toPlainString(), order.getOrderDate(), order.getOrganization(), null,
+            paymentScheduleDetailList, paymentScheduleDetailAmount, false, false,
+            order.getCurrency(), BigDecimal.ZERO, BigDecimal.ZERO);
+      }
+      // Create a new line
+      else {
+        FIN_AddPayment.updatePaymentDetail(paymentScheduleDetailList.get(0), newPayment, amount,
+            false);
+      }
+
+    } else {
+      // Two possibilities
+      // 1.- All the payments have been created
+      // 2.- The payment was created trough Web POS and therefore a payment schedule detail with
+      // null payment detail is missing
+      // Lets assume that in this point the payment was created trough Web POS
+      // Create missing payment schedule detail
+      FIN_PaymentScheduleDetail paymentScheduleDetail = OBProvider.getInstance().get(
+          FIN_PaymentScheduleDetail.class);
+      paymentScheduleDetail.setOrganization(order.getOrganization());
+      paymentScheduleDetail.setOrderPaymentSchedule(paymentSchedule);
+      OBDal.getInstance().save(paymentScheduleDetail);
+      paymentScheduleDetailList.add(paymentScheduleDetail);
+
+      // Continue with the payment
+      HashMap<String, BigDecimal> paymentScheduleDetailAmount = new HashMap<String, BigDecimal>();
+      String paymentScheduleDetailId = paymentScheduleDetail.getId();
+      paymentScheduleDetailAmount.put(paymentScheduleDetailId, amount);
+      if (payment == null) {
+        // Call to savePayment in order to create a new payment in
+        newPayment = FIN_AddPayment.savePayment(payment, true, paymentDocumentType,
+            paymentDocumentNo, order.getBusinessPartner(), paymentPaymentMethod, financialAccount,
+            amount.toPlainString(), order.getOrderDate(), order.getOrganization(), null,
+            paymentScheduleDetailList, paymentScheduleDetailAmount, false, false,
+            order.getCurrency(), BigDecimal.ZERO, BigDecimal.ZERO);
+      }
+      // Create a new line
+      else {
+        FIN_AddPayment.updatePaymentDetail(paymentScheduleDetail, newPayment, amount, false);
+      }
+    }
+    return newPayment;
+  }
+
+  protected static String getPaymentDescription() {
+    String language = RequestContext.get().getVariablesSecureApp().getLanguage();
+    String paymentDescription = Utility.messageBD(new DalConnectionProvider(false),
+        "OrderDocumentno", language);
+    return paymentDescription;
+  }
+
+  protected static String getDocumentNo(Entity entity, DocumentType doctypeTarget,
+      DocumentType doctype) {
+    return Utility.getDocumentNo(OBDal.getInstance().getConnection(false),
+        new DalConnectionProvider(false), RequestContext.get().getVariablesSecureApp(), "", entity
+            .getTableName(), doctypeTarget == null ? "" : doctypeTarget.getId(),
+        doctype == null ? "" : doctype.getId(), false, true);
+  }
+
+  protected static String getPaymentDocumentNo(boolean useOrderDocumentNoForRelatedDocs,
+      Order order, DocumentType paymentDocumentType) {
+    String paymentDocumentNo = null;
+    // Get Payment DocumentNo
+    Entity paymentEntity = ModelProvider.getInstance().getEntity(FIN_Payment.class);
+
+    if (useOrderDocumentNoForRelatedDocs) {
+      paymentDocumentNo = order.getDocumentNo();
+    } else {
+      paymentDocumentNo = getDocumentNo(paymentEntity, null, paymentDocumentType);
+    }
+    return paymentDocumentNo;
+  }
+
+  /**
+   * Process that generates a document number for an order which cancels another order.
+   * 
+   * @param documentNo
+   *          Document number of the cancelled order.
+   * @return The new document number for the order which cancels the old order.
+   */
+  public static String getNextCancelDocNo(String documentNo) {
+    String newDocNo = "";
+    String[] splittedDocNo = documentNo.split("-");
+    if (splittedDocNo.length > 1) {
+      int nextNumber;
+      try {
+        nextNumber = Integer.parseInt(splittedDocNo[splittedDocNo.length - 1]) + 1;
+        for (int i = 0; i < splittedDocNo.length; i++) {
+          if (i == 0) {
+            newDocNo = splittedDocNo[i] + "-";
+          } else if (i < splittedDocNo.length - 1) {
+            newDocNo += splittedDocNo[i] + "-";
+          } else {
+            newDocNo += nextNumber;
+          }
+        }
+      } catch (NumberFormatException nfe) {
+        newDocNo = documentNo + "-1";
+      }
+    } else {
+      newDocNo = documentNo + "-1";
+    }
+    return newDocNo;
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelLayawayPaymentsHook.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,27 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+
+package org.openbravo.erpCommon.businessUtility;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.model.common.order.Order;
+
+public interface CancelLayawayPaymentsHook {
+  public void exec(JSONObject jsonorder, Order inverseOrder) throws Exception;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelLayawayPaymentsHookCaller.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,52 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+
+package org.openbravo.erpCommon.businessUtility;
+
+import java.util.Iterator;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.model.common.order.Order;
+
+public class CancelLayawayPaymentsHookCaller {
+
+  @Inject
+  @Any
+  private Instance<CancelLayawayPaymentsHook> cancelLayawayPaymentsHook;
+
+  public void executeHook(JSONObject jsonorder, Order inverseOrder) throws Exception {
+    executeHooks(cancelLayawayPaymentsHook, jsonorder, inverseOrder);
+  }
+
+  private void executeHooks(Instance<? extends Object> hooks, JSONObject jsonorder,
+      Order inverseOrder) throws Exception {
+
+    for (Iterator<? extends Object> procIter = hooks.iterator(); procIter.hasNext();) {
+      Object proc = procIter.next();
+      if (proc instanceof CancelLayawayPaymentsHook) {
+        ((CancelLayawayPaymentsHook) proc).exec(jsonorder, inverseOrder);
+      }
+    }
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/event/FINPaymentEventHandler.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,67 @@
+package org.openbravo.event;
+
+import java.math.BigDecimal;
+
+import javax.enterprise.event.Observes;
+
+import org.apache.log4j.Logger;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
+import org.openbravo.client.kernel.event.EntityDeleteEvent;
+import org.openbravo.client.kernel.event.EntityNewEvent;
+import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
+import org.openbravo.client.kernel.event.EntityUpdateEvent;
+import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+
+public class FINPaymentEventHandler extends EntityPersistenceEventObserver {
+  private static Entity[] entities = { ModelProvider.getInstance().getEntity(
+      FIN_Payment.ENTITY_NAME) };
+  protected Logger logger = Logger.getLogger(this.getClass());
+
+  @Override
+  protected Entity[] getObservedEntities() {
+    return entities;
+  }
+
+  public void onUpdate(@Observes EntityUpdateEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+    FIN_Payment payment = (FIN_Payment) event.getTargetInstance();
+    if (payment.getAmount().compareTo(BigDecimal.ZERO) == 0) {
+      final Entity paymentEntity = ModelProvider.getInstance().getEntity(FIN_Payment.ENTITY_NAME);
+      final Property paymentDocumentNoProperty = paymentEntity
+          .getProperty(FIN_Payment.PROPERTY_DOCUMENTNO);
+      event.setCurrentState(paymentDocumentNoProperty, payment.getDocumentNo() + "*R*");
+    } else {
+      int index = payment.getDocumentNo().indexOf("*R*");
+      if (index > 0) {
+        final Entity paymentEntity = ModelProvider.getInstance().getEntity(FIN_Payment.ENTITY_NAME);
+        final Property paymentDocumentNoProperty = paymentEntity
+            .getProperty(FIN_Payment.PROPERTY_DOCUMENTNO);
+        event.setCurrentState(paymentDocumentNoProperty,
+            payment.getDocumentNo().substring(0, index - 1));
+      }
+    }
+  }
+
+  public void onSave(@Observes EntityNewEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+    FIN_Payment payment = (FIN_Payment) event.getTargetInstance();
+    if (payment.getAmount().compareTo(BigDecimal.ZERO) == 0) {
+      final Entity paymentEntity = ModelProvider.getInstance().getEntity(FIN_Payment.ENTITY_NAME);
+      final Property paymentDocumentNoProperty = paymentEntity
+          .getProperty(FIN_Payment.PROPERTY_DOCUMENTNO);
+      event.setCurrentState(paymentDocumentNoProperty, payment.getDocumentNo() + "*R*");
+    }
+  }
+
+  public void onDelete(@Observes EntityDeleteEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/event/ProductCharacteristicValueEventHandler.java	Fri Aug 26 09:49:28 2016 +0200
+++ b/src/org/openbravo/event/ProductCharacteristicValueEventHandler.java	Mon Aug 29 09:04:15 2016 +0200
@@ -18,35 +18,36 @@
  */
 package org.openbravo.event;
 
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 
 import javax.enterprise.event.Observes;
+import javax.inject.Inject;
 
 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.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
-import org.openbravo.base.secureApp.VariablesSecureApp;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.client.kernel.event.EntityDeleteEvent;
 import org.openbravo.client.kernel.event.EntityNewEvent;
 import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
 import org.openbravo.client.kernel.event.EntityUpdateEvent;
 import org.openbravo.client.kernel.event.TransactionBeginEvent;
 import org.openbravo.client.kernel.event.TransactionCompletedEvent;
-import org.openbravo.dal.core.OBContext;
-import org.openbravo.materialmgmt.VariantChDescUpdateProcess;
+import org.openbravo.dal.core.SessionHandler;
+import org.openbravo.erpCommon.utility.SequenceIdData;
 import org.openbravo.model.common.plm.ProductCharacteristicValue;
-import org.openbravo.scheduling.OBScheduler;
-import org.openbravo.scheduling.ProcessBundle;
-import org.openbravo.service.db.DalConnectionProvider;
+import org.openbravo.service.importprocess.ImportEntryManager;
 
 public class ProductCharacteristicValueEventHandler extends EntityPersistenceEventObserver {
   protected Logger logger = Logger.getLogger(this.getClass());
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       ProductCharacteristicValue.ENTITY_NAME) };
   private static ThreadLocal<Set<String>> prodchvalueUpdated = new ThreadLocal<Set<String>>();
+  @Inject
+  ImportEntryManager importEntryManager;
 
   @Override
   protected Entity[] getObservedEntities() {
@@ -88,36 +89,18 @@
     if (productList == null || productList.isEmpty() || event.getTransaction().wasRolledBack()) {
       return;
     }
+    SessionHandler.deleteSessionHandler();
+    JSONArray productIds = new JSONArray();
+    for (String productId : productList) {
+      productIds.put(productId);
+    }
+    JSONObject entryJson = new JSONObject();
     try {
-      VariablesSecureApp vars = null;
-      try {
-        if (RequestContext.get().getRequest() == null) {
-          vars = new VariablesSecureApp(OBContext.getOBContext().getUser().getId(), OBContext
-              .getOBContext().getCurrentClient().getId(), OBContext.getOBContext()
-              .getCurrentOrganization().getId(), OBContext.getOBContext().getRole().getId(),
-              OBContext.getOBContext().getLanguage().getLanguage());
-        } else {
-          vars = RequestContext.get().getVariablesSecureApp();
-        }
-      } catch (Exception e) {
-        vars = new VariablesSecureApp(OBContext.getOBContext().getUser().getId(), OBContext
-            .getOBContext().getCurrentClient().getId(), OBContext.getOBContext()
-            .getCurrentOrganization().getId(), OBContext.getOBContext().getRole().getId(),
-            OBContext.getOBContext().getLanguage().getLanguage());
-      }
-
-      for (String strProductId : productList) {
-        ProcessBundle pb = new ProcessBundle(VariantChDescUpdateProcess.AD_PROCESS_ID, vars)
-            .init(new DalConnectionProvider(false));
-        HashMap<String, Object> parameters = new HashMap<String, Object>();
-        parameters.put("mProductId", strProductId);
-        parameters.put("mChValueId", null);
-        pb.setParams(parameters);
-        OBScheduler.getInstance().schedule(pb);
-      }
-    } catch (Exception e) {
-      logger.error("Error executing process", e);
+      entryJson.put("productIds", productIds);
+    } catch (JSONException ignore) {
     }
+    importEntryManager.createImportEntry(SequenceIdData.getUUID(), "VariantChDescUpdate",
+        entryJson.toString());
   }
 
   private void addProductToList(ProductCharacteristicValue pchv) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/materialmgmt/VariantChDescUpdateProcessor.java	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,83 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.materialmgmt;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.core.SessionHandler;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.service.importprocess.ImportEntry;
+import org.openbravo.service.importprocess.ImportEntryManager;
+import org.openbravo.service.importprocess.ImportEntryManager.ImportEntryQualifier;
+import org.openbravo.service.importprocess.ImportEntryProcessor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ImportEntryQualifier(entity = "VariantChDescUpdate")
+@ApplicationScoped
+public class VariantChDescUpdateProcessor extends ImportEntryProcessor {
+  private static final Logger log = LoggerFactory.getLogger(VariantChDescUpdateProcess.class);
+
+  @Override
+  protected ImportEntryProcessRunnable createImportEntryProcessRunnable() {
+    return WeldUtils.getInstanceFromStaticBeanManager(VariantChDescUpdateRunnable.class);
+  }
+
+  @Override
+  protected boolean canHandleImportEntry(ImportEntry importEntryInformation) {
+    return "VariantChDescUpdate".equals(importEntryInformation.getTypeofdata());
+  }
+
+  @Override
+  protected String getProcessSelectionKey(ImportEntry importEntry) {
+    return importEntry.getTypeofdata();
+  }
+
+  protected static class VariantChDescUpdateRunnable extends ImportEntryProcessRunnable {
+
+    @Override
+    protected void processEntry(ImportEntry importEntry) throws Exception {
+      OBContext.setAdminMode(true);
+      try {
+        JSONObject jsonInfo = new JSONObject(importEntry.getJsonInfo());
+        JSONArray productIds = jsonInfo.getJSONArray("productIds");
+        for (int i = 0; i < productIds.length(); i++) {
+          VariantChDescUpdateProcess process = WeldUtils
+              .getInstanceFromStaticBeanManager(VariantChDescUpdateProcess.class);
+          try {
+            process.update(productIds.getString(i), null);
+          } catch (Exception e) {
+            log.error("Error updating product ch description", e);
+          }
+        }
+
+        ImportEntryManager.getInstance().setImportEntryProcessed(importEntry.getId());
+        if (SessionHandler.isSessionHandlerPresent()) {
+          OBDal.getInstance().commitAndClose();
+        }
+      } finally {
+        OBContext.restorePreviousMode();
+      }
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/js/cancelAndReplaceSalesOrderProcess.js	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,45 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+OB = OB || {};
+
+OB.CancelAndReplaceSalesOrder = OB.CancelAndReplaceSalesOrder || {};
+
+OB.CancelAndReplaceSalesOrder = {
+  execute: function (params, view) {
+    var selection = params.button.contextView.viewGrid.getSelectedRecords(),
+        tabId = view.view.tabId,
+        callback;
+
+    callback = function (rpcResponse, result, rpcRequest) {
+      result.responseActions._processView = params.button.view;
+      OB.Utilities.Action.executeJSON(result.responseActions, null, null, params.button.view);
+      params.button.closeProcessPopup();
+    };
+    
+    OB.RemoteCallManager.call('org.openbravo.common.actionhandler.CancelAndReplaceSalesOrder', {
+      inpcOrderId: selection[0].id,
+      inpTabId: tabId
+    }, {}, callback);
+  },
+
+  cancelAndReplaceSalesOrder: function (params, view) {
+    OB.CancelAndReplaceSalesOrder.execute(params, view);
+  }
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/js/confirmCancelAndReplaceSalesOrderProcess.js	Mon Aug 29 09:04:15 2016 +0200
@@ -0,0 +1,41 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+OB = OB || {};
+
+OB.ConfirmCancelAndReplaceSalesOrder = {
+  execute: function (params, view) {
+    var selection = params.button.contextView.viewGrid.getSelectedRecords(),
+        callback;
+
+    callback = function (rpcResponse, data, rpcRequest) {
+      // close process to refresh the selected record
+      params.button.closeProcessPopup();
+      view.view.messageBar.setMessage(data.message.severity, data.message.title, data.message.text);
+    };
+
+    OB.RemoteCallManager.call('org.openbravo.common.actionhandler.ConfirmCancelAndReplaceSalesOrder', {
+    	inpcOrderId: selection[0].id
+    }, {}, callback);
+  },
+
+  confirmCancelAndReplaceSalesOrder: function (params, view) {
+    OB.ConfirmCancelAndReplaceSalesOrder.execute(params, view);
+  }
+};
\ No newline at end of file