Exchange rate callout
authorSalvador Zapata <salvador.zapata@openbravo.com>
Fri, 24 Jun 2011 16:33:21 +0200
changeset 13326 ecd741920f59
parent 13325 c2d21db7bb30
child 13327 354aa0b865ad
Exchange rate callout
src-db/database/model/triggers/C_CONVERSION_RATE_DOCUMENT_TRG.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/C_CONVERSION_RATE_DOCUMENT_TRG.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER C_CONVERSION_RATE_DOCUMENT_TRG">
+    <trigger name="C_CONVERSION_RATE_DOCUMENT_TRG" table="C_CONVERSION_RATE_DOCUMENT" fires="before" insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+
+
+
+
+
+    /*************************************************************************
+    * The contents of this file are subject to the Openbravo  Public  License
+    * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+    * Version 1.1  with a permitted attribution clause; you may not  use this
+    * file except in compliance with the License. You  may  obtain  a copy of
+    * the License at http://www.openbravo.com/legal/license.html
+    * Software distributed under the License  is  distributed  on  an "AS IS"
+    * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+    * License for the specific  language  governing  rights  and  limitations
+    * under the License.
+    * The Original Code is Openbravo ERP.
+    * The Initial Developer of the Original Code is Openbravo SLU
+    * All portions are Copyright (C) 2001-2008 Openbravo SLU
+    * All Rights Reserved.
+    * Contributor(s):  ______________________________________.
+    ************************************************************************/
+    /*************************************************************************
+    * Title: Check in deleting, invoice not processed
+    ************************************************************************/
+   v_Posted VARCHAR2(32) ;
+        
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+
+    -- If invoice is posted, CRUD is not allowed
+    IF INSERTING OR UPDATING OR DELETING
+    THEN
+	IF :NEW.C_INVOICE_ID IS NOT NULL THEN
+		SELECT POSTED INTO v_Posted 
+		FROM C_INVOICE
+		WHERE C_INVOICE_ID = :NEW.C_INVOICE_ID;
+	END IF;
+
+	IF :NEW.FIN_PAYMENT_ID IS NOT NULL THEN
+		SELECT POSTED INTO v_Posted 
+		FROM FIN_PAYMENT
+		WHERE FIN_PAYMENT_ID = :NEW.FIN_PAYMENT_ID;
+	END IF;
+
+	IF :NEW.aprm_finacc_transaction_v_id IS NOT NULL THEN
+		SELECT POSTED INTO v_Posted 
+		FROM aprm_finacc_transaction_v
+		WHERE aprm_finacc_transaction_v_id = :NEW.aprm_finacc_transaction_v_id;
+	END IF;
+
+	IF(v_Posted='Y')
+		THEN  RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted');
+	END IF;
+    END IF;
+    
+    
+END C_CONVERSION_RATE_DOCUMENT_TRG
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -207842,6 +207842,7 @@
 <!--05A12278486748828E4DC33428752E72-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--05A12278486748828E4DC33428752E72-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--05A12278486748828E4DC33428752E72-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--05A12278486748828E4DC33428752E72-->  <AD_CALLOUT_ID><![CDATA[FF80818130BD09B60130BD15FF1C000F]]></AD_CALLOUT_ID>
 <!--05A12278486748828E4DC33428752E72-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--05A12278486748828E4DC33428752E72-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--05A12278486748828E4DC33428752E72-->  <POSITION><![CDATA[15]]></POSITION>
@@ -260119,7 +260120,7 @@
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <HELP><![CDATA[The Rate indicates the percentage to be multiplied by the source to arrive at the tax or exchange amount.]]></HELP>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <COLUMNNAME><![CDATA[Rate]]></COLUMNNAME>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <AD_TABLE_ID><![CDATA[FF808181308EA42301308FB5F7BC0049]]></AD_TABLE_ID>
-<!--D982E3A4B4B7495689D960E855F9DFD5-->  <AD_REFERENCE_ID><![CDATA[12]]></AD_REFERENCE_ID>
+<!--D982E3A4B4B7495689D960E855F9DFD5-->  <AD_REFERENCE_ID><![CDATA[800019]]></AD_REFERENCE_ID>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <FIELDLENGTH><![CDATA[10]]></FIELDLENGTH>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <ISPARENT><![CDATA[N]]></ISPARENT>
@@ -260134,6 +260135,7 @@
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--D982E3A4B4B7495689D960E855F9DFD5-->  <AD_CALLOUT_ID><![CDATA[FF80818130BD09B60130BD15FF1C000F]]></AD_CALLOUT_ID>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--D982E3A4B4B7495689D960E855F9DFD5-->  <POSITION><![CDATA[14]]></POSITION>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -175835,7 +175835,6 @@
 <!--614E8E9E9AD64CABA515EC12FA070725-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--614E8E9E9AD64CABA515EC12FA070725-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--614E8E9E9AD64CABA515EC12FA070725-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--614E8E9E9AD64CABA515EC12FA070725-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--614E8E9E9AD64CABA515EC12FA070725--></AD_FIELD>
 
 <!--616CFC5A610449CF90CADDC3E7D4590E--><AD_FIELD>
@@ -176698,7 +176697,6 @@
 <!--6CF54A4998744CA19E2FCE10D5328C99-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--6CF54A4998744CA19E2FCE10D5328C99-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--6CF54A4998744CA19E2FCE10D5328C99-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--6CF54A4998744CA19E2FCE10D5328C99-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--6CF54A4998744CA19E2FCE10D5328C99--></AD_FIELD>
 
 <!--6D01F50C63E847DA8F9C706911BCB052--><AD_FIELD>
@@ -176750,7 +176748,6 @@
 <!--6D432683602F4B8D8B7ED8F19CE8C76F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--6D432683602F4B8D8B7ED8F19CE8C76F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--6D432683602F4B8D8B7ED8F19CE8C76F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--6D432683602F4B8D8B7ED8F19CE8C76F-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--6D432683602F4B8D8B7ED8F19CE8C76F--></AD_FIELD>
 
 <!--6D7F683367699D7AE040007F01015A4A--><AD_FIELD>
@@ -178212,7 +178209,6 @@
 <!--7780736243144700A3F20D69B8D8B3EF-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--7780736243144700A3F20D69B8D8B3EF-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--7780736243144700A3F20D69B8D8B3EF-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--7780736243144700A3F20D69B8D8B3EF-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--7780736243144700A3F20D69B8D8B3EF--></AD_FIELD>
 
 <!--781A06642FD511DE882C001D09C4A2FE--><AD_FIELD>
@@ -188510,7 +188506,6 @@
 <!--9B6EF14BCA764FBC81B1B96BBF2998DD-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--9B6EF14BCA764FBC81B1B96BBF2998DD-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--9B6EF14BCA764FBC81B1B96BBF2998DD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--9B6EF14BCA764FBC81B1B96BBF2998DD-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--9B6EF14BCA764FBC81B1B96BBF2998DD--></AD_FIELD>
 
 <!--9D12BC3E180746FEA5FCEAB09414E4D4--><AD_FIELD>
@@ -190173,7 +190168,6 @@
 <!--B8C947608F1D4EA18BB86E4CA41B3A51-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--B8C947608F1D4EA18BB86E4CA41B3A51-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--B8C947608F1D4EA18BB86E4CA41B3A51-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--B8C947608F1D4EA18BB86E4CA41B3A51-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--B8C947608F1D4EA18BB86E4CA41B3A51--></AD_FIELD>
 
 <!--B8CD44FF19E3491DB14C0383FFF23428--><AD_FIELD>
@@ -190700,7 +190694,6 @@
 <!--C29FFBD81441464C9060F1DDB22A31BE-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--C29FFBD81441464C9060F1DDB22A31BE-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--C29FFBD81441464C9060F1DDB22A31BE-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--C29FFBD81441464C9060F1DDB22A31BE-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--C29FFBD81441464C9060F1DDB22A31BE--></AD_FIELD>
 
 <!--C394D7D344EB41E8B83A76E9404D40F3--><AD_FIELD>
@@ -190805,7 +190798,6 @@
 <!--C77A73D75FAB4CCC9F7833FC182E243E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--C77A73D75FAB4CCC9F7833FC182E243E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--C77A73D75FAB4CCC9F7833FC182E243E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--C77A73D75FAB4CCC9F7833FC182E243E-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--C77A73D75FAB4CCC9F7833FC182E243E--></AD_FIELD>
 
 <!--C85A38D3DA84411189BA447A9049C778--><AD_FIELD>
@@ -191725,7 +191717,6 @@
 <!--DE1AFDFEC9D44B0899DBC6C64491B56B-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--DE1AFDFEC9D44B0899DBC6C64491B56B-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--DE1AFDFEC9D44B0899DBC6C64491B56B-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--DE1AFDFEC9D44B0899DBC6C64491B56B-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--DE1AFDFEC9D44B0899DBC6C64491B56B--></AD_FIELD>
 
 <!--DEE00C6BC60A4CC89307447A1549E2DC--><AD_FIELD>
@@ -192566,7 +192557,6 @@
 <!--F823B2CD61844A2EA3FDC4B64C63DA58-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--F823B2CD61844A2EA3FDC4B64C63DA58-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--F823B2CD61844A2EA3FDC4B64C63DA58-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--F823B2CD61844A2EA3FDC4B64C63DA58-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--F823B2CD61844A2EA3FDC4B64C63DA58--></AD_FIELD>
 
 <!--F8A7E19BEA2A4E6792E81EB12A644DDE--><AD_FIELD>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -3615,6 +3615,18 @@
 <!--6AE5F2D3163C178BE040007F010174B7-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--6AE5F2D3163C178BE040007F010174B7--></AD_MODEL_OBJECT>
 
+<!--6DAAF7531ABD453383873AA790B1967A--><AD_MODEL_OBJECT>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <AD_MODEL_OBJECT_ID><![CDATA[6DAAF7531ABD453383873AA790B1967A]]></AD_MODEL_OBJECT_ID>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <ACTION><![CDATA[C]]></ACTION>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SE_CalculateExchangeRate]]></CLASSNAME>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <AD_CALLOUT_ID><![CDATA[FF80818130BD09B60130BD15FF1C000F]]></AD_CALLOUT_ID>
+<!--6DAAF7531ABD453383873AA790B1967A-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--6DAAF7531ABD453383873AA790B1967A--></AD_MODEL_OBJECT>
+
 <!--7AEA3C790893370FE040007F01013A5F--><AD_MODEL_OBJECT>
 <!--7AEA3C790893370FE040007F01013A5F-->  <AD_MODEL_OBJECT_ID><![CDATA[7AEA3C790893370FE040007F01013A5F]]></AD_MODEL_OBJECT_ID>
 <!--7AEA3C790893370FE040007F01013A5F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -4300,6 +4300,16 @@
 <!--F171914D8B8A47D3A8492ABB85CE87D6-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--F171914D8B8A47D3A8492ABB85CE87D6--></AD_MODEL_OBJECT_MAPPING>
 
+<!--F4C04EC868E9420CB92D63070279833D--><AD_MODEL_OBJECT_MAPPING>
+<!--F4C04EC868E9420CB92D63070279833D-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F4C04EC868E9420CB92D63070279833D]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--F4C04EC868E9420CB92D63070279833D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F4C04EC868E9420CB92D63070279833D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F4C04EC868E9420CB92D63070279833D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F4C04EC868E9420CB92D63070279833D-->  <AD_MODEL_OBJECT_ID><![CDATA[6DAAF7531ABD453383873AA790B1967A]]></AD_MODEL_OBJECT_ID>
+<!--F4C04EC868E9420CB92D63070279833D-->  <MAPPINGNAME><![CDATA[/ad_callouts/SE_CalculateExchangeRate.html]]></MAPPINGNAME>
+<!--F4C04EC868E9420CB92D63070279833D-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--F4C04EC868E9420CB92D63070279833D--></AD_MODEL_OBJECT_MAPPING>
+
 <!--F5BCD7FB0FA74F3DB30B4376FC021BA7--><AD_MODEL_OBJECT_MAPPING>
 <!--F5BCD7FB0FA74F3DB30B4376FC021BA7-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F5BCD7FB0FA74F3DB30B4376FC021BA7]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--F5BCD7FB0FA74F3DB30B4376FC021BA7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_TAB.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -12218,7 +12218,6 @@
 <!--FF808181308EA4230130901AB2C60090-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181308EA4230130901AB2C60090-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--FF808181308EA4230130901AB2C60090-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
-<!--FF808181308EA4230130901AB2C60090-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--FF808181308EA4230130901AB2C60090--></AD_TAB>
 
 <!--FF808181308EA4230130901D313D00A5--><AD_TAB>
@@ -12244,7 +12243,6 @@
 <!--FF808181308EA4230130901D313D00A5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181308EA4230130901D313D00A5-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--FF808181308EA4230130901D313D00A5-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
-<!--FF808181308EA4230130901D313D00A5-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--FF808181308EA4230130901D313D00A5--></AD_TAB>
 
 <!--FF808181309036230130905A9AAC0025--><AD_TAB>
@@ -12270,7 +12268,6 @@
 <!--FF808181309036230130905A9AAC0025-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181309036230130905A9AAC0025-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--FF808181309036230130905A9AAC0025-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
-<!--FF808181309036230130905A9AAC0025-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--FF808181309036230130905A9AAC0025--></AD_TAB>
 
 <!--FF808181309036230130905C67210034--><AD_TAB>
@@ -12296,7 +12293,6 @@
 <!--FF808181309036230130905C67210034-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181309036230130905C67210034-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--FF808181309036230130905C67210034-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
-<!--FF808181309036230130905C67210034-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--FF808181309036230130905C67210034--></AD_TAB>
 
 <!--FF808181309036230130905FCB450044--><AD_TAB>
@@ -12322,7 +12318,6 @@
 <!--FF808181309036230130905FCB450044-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181309036230130905FCB450044-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--FF808181309036230130905FCB450044-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
-<!--FF808181309036230130905FCB450044-->  <EM_OBGSE_SHOW><![CDATA[N]]></EM_OBGSE_SHOW>
 <!--FF808181309036230130905FCB450044--></AD_TAB>
 
 </data>
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml	Fri Jun 24 16:31:50 2011 +0200
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml	Fri Jun 24 16:33:21 2011 +0200
@@ -1779,7 +1779,7 @@
 <!--FF8081813092D5DC013092DD70AD000C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8081813092D5DC013092DD70AD000C-->  <NAME><![CDATA[Document currency]]></NAME>
 <!--FF8081813092D5DC013092DD70AD000C-->  <TYPE><![CDATA[S]]></TYPE>
-<!--FF8081813092D5DC013092DD70AD000C-->  <CODE><![CDATA[C_Currency.C_Currency_id in (SELECT C_Currency_ID FROM C_Invoice WHERE C_Invoice_ID =@C_Invoice_ID@)  or C_Currency.C_Currency_id in (SELECT C_Currency_ID FROM aprm_finacc_transaction_v WHERE aprm_finacc_transaction_v_id=@APRM_Finacc_Transaction_V_ID@)]]></CODE>
+<!--FF8081813092D5DC013092DD70AD000C-->  <CODE><![CDATA[C_Currency.C_Currency_id in (SELECT C_Currency_ID FROM C_Invoice WHERE C_Invoice_ID =@C_Invoice_ID@)  or C_Currency.C_Currency_id in (SELECT C_Currency_ID FROM aprm_finacc_transaction_v WHERE aprm_finacc_transaction_v_id=@APRM_Finacc_Transaction_V_ID@) or C_Currency.C_Currency_id in (SELECT C_Currency_ID FROM FIN_Payment WHERE FIN_Payment_ID = @FIN_Payment_ID@)]]></CODE>
 <!--FF8081813092D5DC013092DD70AD000C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF8081813092D5DC013092DD70AD000C--></AD_VAL_RULE>