[costAdj]adapt match landed cost to multicurrency
authorMiguel A. Alsasua <miguel.alsasua@openbravo.com>
Thu, 11 Sep 2014 16:31:31 +0200
changeset 24880 0f496c17e6b7
parent 24879 0eb683752677
child 24881 3059d19a5d5a
[costAdj]adapt match landed cost to multicurrency
src-db/database/model/tables/M_LC_MATCHED.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java
--- a/src-db/database/model/tables/M_LC_MATCHED.xml	Wed Sep 10 23:58:35 2014 +0200
+++ b/src-db/database/model/tables/M_LC_MATCHED.xml	Thu Sep 11 16:31:31 2014 +0200
@@ -45,6 +45,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="AMT_INVOICE_CURRENCY" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="M_LC_MATCHED_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Sep 10 23:58:35 2014 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 11 16:31:31 2014 +0200
@@ -335884,6 +335884,39 @@
 <!--F55387BA03C14531AA6A20E0AF799E1B-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--F55387BA03C14531AA6A20E0AF799E1B--></AD_COLUMN>
 
+<!--F560CFE5C0A74268A72D1D08C6C02BB0--><AD_COLUMN>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_COLUMN_ID><![CDATA[F560CFE5C0A74268A72D1D08C6C02BB0]]></AD_COLUMN_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <NAME><![CDATA[Amount In Invoice Currency]]></NAME>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <COLUMNNAME><![CDATA[AMT_Invoice_Currency]]></COLUMNNAME>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_TABLE_ID><![CDATA[EF0201D90F30499EBFAF53D0FC7452DB]]></AD_TABLE_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_REFERENCE_ID><![CDATA[12]]></AD_REFERENCE_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <FIELDLENGTH><![CDATA[2]]></FIELDLENGTH>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_ELEMENT_ID><![CDATA[2CF2E095B566460280ABCE2E5543AC87]]></AD_ELEMENT_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <POSITION><![CDATA[12]]></POSITION>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--F560CFE5C0A74268A72D1D08C6C02BB0--></AD_COLUMN>
+
 <!--F576879F0F224D458765D4DAEF868FAA--><AD_COLUMN>
 <!--F576879F0F224D458765D4DAEF868FAA-->  <AD_COLUMN_ID><![CDATA[F576879F0F224D458765D4DAEF868FAA]]></AD_COLUMN_ID>
 <!--F576879F0F224D458765D4DAEF868FAA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -337167,6 +337200,37 @@
 <!--FA79CDB1F47E4A6A922A63332B70D2C4-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--FA79CDB1F47E4A6A922A63332B70D2C4--></AD_COLUMN>
 
+<!--FA7AD5872991477D854C10A71B80F177--><AD_COLUMN>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_COLUMN_ID><![CDATA[FA7AD5872991477D854C10A71B80F177]]></AD_COLUMN_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FA7AD5872991477D854C10A71B80F177-->  <NAME><![CDATA[Currency]]></NAME>
+<!--FA7AD5872991477D854C10A71B80F177-->  <COLUMNNAME><![CDATA[currency]]></COLUMNNAME>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_TABLE_ID><![CDATA[B2960E2BDCCD4F7599A2433F2681847F]]></AD_TABLE_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <FIELDLENGTH><![CDATA[3]]></FIELDLENGTH>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--FA7AD5872991477D854C10A71B80F177-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--FA7AD5872991477D854C10A71B80F177-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--FA7AD5872991477D854C10A71B80F177-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--FA7AD5872991477D854C10A71B80F177-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--FA7AD5872991477D854C10A71B80F177-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--FA7AD5872991477D854C10A71B80F177-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--FA7AD5872991477D854C10A71B80F177--></AD_COLUMN>
+
 <!--FA97E4729C204EC9BEA6A38D9661FDBB--><AD_COLUMN>
 <!--FA97E4729C204EC9BEA6A38D9661FDBB-->  <AD_COLUMN_ID><![CDATA[FA97E4729C204EC9BEA6A38D9661FDBB]]></AD_COLUMN_ID>
 <!--FA97E4729C204EC9BEA6A38D9661FDBB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Sep 10 23:58:35 2014 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Sep 11 16:31:31 2014 +0200
@@ -21810,6 +21810,18 @@
 <!--29ADAE46594E4364B62CB72C8D029D6F-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--29ADAE46594E4364B62CB72C8D029D6F--></AD_ELEMENT>
 
+<!--2CF2E095B566460280ABCE2E5543AC87--><AD_ELEMENT>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <AD_ELEMENT_ID><![CDATA[2CF2E095B566460280ABCE2E5543AC87]]></AD_ELEMENT_ID>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <COLUMNNAME><![CDATA[AMT_Invoice_Currency]]></COLUMNNAME>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <NAME><![CDATA[Amount In Invoice Currency]]></NAME>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <PRINTNAME><![CDATA[Amount In Invoice Currency]]></PRINTNAME>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2CF2E095B566460280ABCE2E5543AC87-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--2CF2E095B566460280ABCE2E5543AC87--></AD_ELEMENT>
+
 <!--2D2C066AA9964E058D08DF9AF169773D--><AD_ELEMENT>
 <!--2D2C066AA9964E058D08DF9AF169773D-->  <AD_ELEMENT_ID><![CDATA[2D2C066AA9964E058D08DF9AF169773D]]></AD_ELEMENT_ID>
 <!--2D2C066AA9964E058D08DF9AF169773D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Sep 10 23:58:35 2014 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 11 16:31:31 2014 +0200
@@ -177880,7 +177880,7 @@
 <!--0203C2BF22362AE9E050007F01002C80-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0203C2BF22362AE9E050007F01002C80-->  <DISPLAYLENGTH><![CDATA[5]]></DISPLAYLENGTH>
 <!--0203C2BF22362AE9E050007F01002C80-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--0203C2BF22362AE9E050007F01002C80-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--0203C2BF22362AE9E050007F01002C80-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--0203C2BF22362AE9E050007F01002C80-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0203C2BF22362AE9E050007F01002C80-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0203C2BF22362AE9E050007F01002C80-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -177933,7 +177933,7 @@
 <!--0203C2BF22382AE9E050007F01002C80-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0203C2BF22382AE9E050007F01002C80-->  <DISPLAYLENGTH><![CDATA[150]]></DISPLAYLENGTH>
 <!--0203C2BF22382AE9E050007F01002C80-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--0203C2BF22382AE9E050007F01002C80-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--0203C2BF22382AE9E050007F01002C80-->  <SEQNO><![CDATA[100]]></SEQNO>
 <!--0203C2BF22382AE9E050007F01002C80-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0203C2BF22382AE9E050007F01002C80-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0203C2BF22382AE9E050007F01002C80-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -177959,7 +177959,7 @@
 <!--0203C2BF22392AE9E050007F01002C80-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0203C2BF22392AE9E050007F01002C80-->  <DISPLAYLENGTH><![CDATA[150]]></DISPLAYLENGTH>
 <!--0203C2BF22392AE9E050007F01002C80-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--0203C2BF22392AE9E050007F01002C80-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--0203C2BF22392AE9E050007F01002C80-->  <SEQNO><![CDATA[120]]></SEQNO>
 <!--0203C2BF22392AE9E050007F01002C80-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0203C2BF22392AE9E050007F01002C80-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0203C2BF22392AE9E050007F01002C80-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -177985,7 +177985,7 @@
 <!--0203C2BF223A2AE9E050007F01002C80-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0203C2BF223A2AE9E050007F01002C80-->  <DISPLAYLENGTH><![CDATA[150]]></DISPLAYLENGTH>
 <!--0203C2BF223A2AE9E050007F01002C80-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--0203C2BF223A2AE9E050007F01002C80-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--0203C2BF223A2AE9E050007F01002C80-->  <SEQNO><![CDATA[90]]></SEQNO>
 <!--0203C2BF223A2AE9E050007F01002C80-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0203C2BF223A2AE9E050007F01002C80-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0203C2BF223A2AE9E050007F01002C80-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -178011,7 +178011,7 @@
 <!--0203C2BF223B2AE9E050007F01002C80-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0203C2BF223B2AE9E050007F01002C80-->  <DISPLAYLENGTH><![CDATA[5]]></DISPLAYLENGTH>
 <!--0203C2BF223B2AE9E050007F01002C80-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--0203C2BF223B2AE9E050007F01002C80-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--0203C2BF223B2AE9E050007F01002C80-->  <SEQNO><![CDATA[70]]></SEQNO>
 <!--0203C2BF223B2AE9E050007F01002C80-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0203C2BF223B2AE9E050007F01002C80-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0203C2BF223B2AE9E050007F01002C80-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -178116,7 +178116,7 @@
 <!--02138BD028B3719BE050007F01001709-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--02138BD028B3719BE050007F01001709-->  <DISPLAYLENGTH><![CDATA[5]]></DISPLAYLENGTH>
 <!--02138BD028B3719BE050007F01001709-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--02138BD028B3719BE050007F01001709-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--02138BD028B3719BE050007F01001709-->  <SEQNO><![CDATA[130]]></SEQNO>
 <!--02138BD028B3719BE050007F01001709-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--02138BD028B3719BE050007F01001709-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--02138BD028B3719BE050007F01001709-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -178143,7 +178143,7 @@
 <!--02138BD7992C668FE050007F01007E3C-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--02138BD7992C668FE050007F01007E3C-->  <DISPLAYLENGTH><![CDATA[5]]></DISPLAYLENGTH>
 <!--02138BD7992C668FE050007F01007E3C-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--02138BD7992C668FE050007F01007E3C-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--02138BD7992C668FE050007F01007E3C-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--02138BD7992C668FE050007F01007E3C-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--02138BD7992C668FE050007F01007E3C-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--02138BD7992C668FE050007F01007E3C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -178636,7 +178636,7 @@
 <!--0241124B69964D37E050007F01006C6E-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--0241124B69964D37E050007F01006C6E-->  <DISPLAYLENGTH><![CDATA[5]]></DISPLAYLENGTH>
 <!--0241124B69964D37E050007F01006C6E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--0241124B69964D37E050007F01006C6E-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--0241124B69964D37E050007F01006C6E-->  <SEQNO><![CDATA[150]]></SEQNO>
 <!--0241124B69964D37E050007F01006C6E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--0241124B69964D37E050007F01006C6E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--0241124B69964D37E050007F01006C6E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -290908,6 +290908,32 @@
 <!--F6B0FF595FCE492AACAC34D7D10F5BE4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F6B0FF595FCE492AACAC34D7D10F5BE4--></AD_FIELD>
 
+<!--F736AE2E6981418E9DD5532AAA0F0AF5--><AD_FIELD>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_FIELD_ID><![CDATA[F736AE2E6981418E9DD5532AAA0F0AF5]]></AD_FIELD_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <NAME><![CDATA[Currency]]></NAME>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_TAB_ID><![CDATA[217EB72E1AA44DD5955AF03386A48660]]></AD_TAB_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_COLUMN_ID><![CDATA[FA7AD5872991477D854C10A71B80F177]]></AD_COLUMN_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F736AE2E6981418E9DD5532AAA0F0AF5--></AD_FIELD>
+
 <!--F7422E9AD10144C787EF4AB1033AB446--><AD_FIELD>
 <!--F7422E9AD10144C787EF4AB1033AB446-->  <AD_FIELD_ID><![CDATA[F7422E9AD10144C787EF4AB1033AB446]]></AD_FIELD_ID>
 <!--F7422E9AD10144C787EF4AB1033AB446-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Wed Sep 10 23:58:35 2014 +0200
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Thu Sep 11 16:31:31 2014 +0200
@@ -11378,7 +11378,7 @@
       join lcra.goodsShipmentLine as iol
       where lcra.landedCostCost = lcc)
   ) as products,
-  lcm.amount as amttomatch,
+  lcm.amountInInvoiceCurrency as amttomatch,
   (select sum(otherlcm.amount)
    from LandedCostMatched as otherlcm
    where otherlcm.landedCostCost = lcc
@@ -11398,7 +11398,8 @@
   lcc.id as m_lc_cost_id,
   lc.documentNo as documentNo,
   lcc.lineNo as line,
-  case when 1=1 then false else true end as processMatching
+  case when 1=1 then false else true end as processMatching, 
+  lcc.currency.iSOCode as currency
 from LandedCostCost as lcc
   join lcc.landedCost as lc
   join lcc.landedCostType as lct
@@ -11407,7 +11408,7 @@
 where (lcc.isMatchingAdjusted = false or lcm is not null)
   and @additional_filters@
   and @insertion_point_0@
-group by  coalesce(lcm.id, lcc.id), lcc, lct.name, lcc.amount, lcm.amount, case when lcm is not null then true else false end, lc.referenceDate, lcc.matched, lcc.isMatchingAdjusted, lcm.id, lcc.id, il, lc.documentNo, lcc.lineNo]]></HQLQUERY>
+group by  coalesce(lcm.id, lcc.id), lcc, lct.name, lcc.amount, lcc.currency.iSOCode, lcm.amount, case when lcm is not null then true else false end, lc.referenceDate, lcc.matched, lcc.isMatchingAdjusted, lcm.id, lcc.id, il, lc.documentNo, lcc.lineNo, lcm.amountInInvoiceCurrency]]></HQLQUERY>
 <!--B2960E2BDCCD4F7599A2433F2681847F-->  <ENTITY_ALIAS><![CDATA[lcc]]></ENTITY_ALIAS>
 <!--B2960E2BDCCD4F7599A2433F2681847F--></AD_TABLE>
 
--- a/src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java	Wed Sep 10 23:58:35 2014 +0200
+++ b/src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java	Thu Sep 11 16:31:31 2014 +0200
@@ -31,6 +31,7 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.financial.FinancialUtils;
 import org.openbravo.model.common.invoice.InvoiceLine;
 import org.openbravo.model.materialmgmt.cost.LCMatched;
 import org.openbravo.model.materialmgmt.cost.LandedCostCost;
@@ -97,11 +98,13 @@
       boolean isMatched = line.getBoolean("matched");
       boolean processMatching = line.getBoolean("processMatching");
       LCMatched match = null;
+      LandedCostCost lcc = (LandedCostCost) OBDal.getInstance().getProxy(
+          LandedCostCost.ENTITY_NAME, strLCCostId);
+
       if (strLCMatchedId.isEmpty()) {
         // Create new match record
         match = OBProvider.getInstance().get(LCMatched.class);
-        match.setLandedCostCost((LandedCostCost) OBDal.getInstance().getProxy(
-            LandedCostCost.ENTITY_NAME, strLCCostId));
+        match.setLandedCostCost(lcc);
         match.setInvoiceLine(il);
         match.setAmount(BigDecimal.ZERO);
       } else {
@@ -113,8 +116,14 @@
         continue;
       }
 
-      final BigDecimal amount = new BigDecimal(line.getString("matchedAmt"));
+      BigDecimal amount = new BigDecimal(line.getString("matchedAmt"));
       if (amount.compareTo(match.getAmount()) != 0) {
+        match.setAmountInInvoiceCurrency(amount);
+        if (lcc.getCurrency() != il.getInvoice().getCurrency()) {
+          amount = FinancialUtils.getConvertedAmount(amount, il.getInvoice().getCurrency(),
+              lcc.getCurrency(), lcc.getAccountingDate(), lcc.getOrganization(),
+              FinancialUtils.PRECISION_STANDARD);
+        }
         match.setAmount(amount);
         OBDal.getInstance().save(match);
       }