[costadj] cost adjustment accounting process
authorMiguel A. Alsasua <miguel.alsasua@openbravo.com>
Thu, 07 Aug 2014 13:41:14 +0200
changeset 24775 6423532636f0
parent 24774 b966a5e502ff
child 24776 a2c5dc028197
[costadj] cost adjustment accounting process
src-db/database/model/tables/M_COSTADJUSTMENT.xml
src-db/database/model/tables/M_COSTADJUSTMENTLINE.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_WINDOW.xml
src/org/openbravo/costing/CostAdjustmentUtils.java
src/org/openbravo/costing/CostingServer.java
src/org/openbravo/erpCommon/ad_forms/AcctServer.java
src/org/openbravo/erpCommon/ad_forms/DocCostAdjustment.java
src/org/openbravo/erpCommon/ad_forms/DocCostAdjustmentTemplate.java
src/org/openbravo/erpCommon/ad_forms/DocCostAdjustment_data.xsql
src/org/openbravo/erpCommon/ad_forms/DocLineCostAdjustment_data.xsql
src/org/openbravo/erpCommon/ad_forms/DocLine_CostAdjustment.java
--- a/src-db/database/model/tables/M_COSTADJUSTMENT.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/model/tables/M_COSTADJUSTMENT.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -69,6 +69,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="POSTED" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="PROCESSING" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="M_COSTADJUSTMENT" name="M_COSTADJUSTMENT_CANCEL">
         <reference local="M_COSTADJUSTMENT_CANCEL" foreign="M_COSTADJUSTMENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_COSTADJUSTMENTLINE.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/model/tables/M_COSTADJUSTMENTLINE.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -69,6 +69,17 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="LINE" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="C_CURRENCY" name="C_COSTADJLINE_C_CURRENCY">
+        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="M_COSTADJUSTMENTLINE" name="M_COSTADJLINE_PARENTLINE">
         <reference local="PARENT_COSTADJUSTMENTLINE_ID" foreign="M_COSTADJUSTMENTLINE_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -226286,6 +226286,43 @@
 <!--1DAF96CF43C447AD86E3EFBD2034C5C1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--1DAF96CF43C447AD86E3EFBD2034C5C1--></AD_COLUMN>
 
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E--><AD_COLUMN>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_COLUMN_ID><![CDATA[1DBE6B9DC91B4DA68CA5B2BD3360183E]]></AD_COLUMN_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <NAME><![CDATA[Line No.]]></NAME>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <DESCRIPTION><![CDATA[A line stating the position of this request in the document.]]></DESCRIPTION>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <HELP><![CDATA[Indicates the unique line for a document.  It will also control the display order of the lines within a document.]]></HELP>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <COLUMNNAME><![CDATA[Line]]></COLUMNNAME>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_TABLE_ID><![CDATA[34E79323CEC847C2A9ED2C8430AC73D1]]></AD_TABLE_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_REFERENCE_ID><![CDATA[11]]></AD_REFERENCE_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <FIELDLENGTH><![CDATA[12]]></FIELDLENGTH>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <DEFAULTVALUE><![CDATA[@SQL=SELECT COALESCE(MAX(LINE),0)+10 AS DefaultValue FROM M_COSTADJUSTMENTLINE WHERE M_COSTADJUSTMENT_ID=@M_CostAdjustment_ID@]]></DEFAULTVALUE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <READONLYLOGIC><![CDATA[@Processed@='Y']]></READONLYLOGIC>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_ELEMENT_ID><![CDATA[439]]></AD_ELEMENT_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <POSITION><![CDATA[18]]></POSITION>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1DBE6B9DC91B4DA68CA5B2BD3360183E--></AD_COLUMN>
+
 <!--1DD04C788771495A9C1A9FF0742319D9--><AD_COLUMN>
 <!--1DD04C788771495A9C1A9FF0742319D9-->  <AD_COLUMN_ID><![CDATA[1DD04C788771495A9C1A9FF0742319D9]]></AD_COLUMN_ID>
 <!--1DD04C788771495A9C1A9FF0742319D9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -259496,6 +259533,41 @@
 <!--688D207B4C354868A9D84CBDA5349A0A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--688D207B4C354868A9D84CBDA5349A0A--></AD_COLUMN>
 
+<!--68CC47B1AD4F45F68002BF9241C633DC--><AD_COLUMN>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_COLUMN_ID><![CDATA[68CC47B1AD4F45F68002BF9241C633DC]]></AD_COLUMN_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <NAME><![CDATA[C_Currency_ID]]></NAME>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <COLUMNNAME><![CDATA[C_Currency_ID]]></COLUMNNAME>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_TABLE_ID><![CDATA[34E79323CEC847C2A9ED2C8430AC73D1]]></AD_TABLE_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_ELEMENT_ID><![CDATA[193]]></AD_ELEMENT_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <POSITION><![CDATA[19]]></POSITION>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--68CC47B1AD4F45F68002BF9241C633DC-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--68CC47B1AD4F45F68002BF9241C633DC--></AD_COLUMN>
+
 <!--68EDEBA79CC84895BBE4EEFE1E4F2C84--><AD_COLUMN>
 <!--68EDEBA79CC84895BBE4EEFE1E4F2C84-->  <AD_COLUMN_ID><![CDATA[68EDEBA79CC84895BBE4EEFE1E4F2C84]]></AD_COLUMN_ID>
 <!--68EDEBA79CC84895BBE4EEFE1E4F2C84-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -260274,6 +260346,43 @@
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--6BDD5BBDFE613D4BE040007F01013540--></AD_COLUMN>
 
+<!--6BF8015BCEC54410A71A367BA8F3C488--><AD_COLUMN>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_COLUMN_ID><![CDATA[6BF8015BCEC54410A71A367BA8F3C488]]></AD_COLUMN_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <NAME><![CDATA[Posted]]></NAME>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <DESCRIPTION><![CDATA[An accounting status button that indicates if the transaction has already been posted to the general ledger or not.]]></DESCRIPTION>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <HELP><![CDATA[An accounting status button that indicates if the transaction has already been posted to the general ledger or not. When doing the accounting manually this button can be used to post or unpost the transaction from the general ledger by hand.]]></HELP>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <COLUMNNAME><![CDATA[Posted]]></COLUMNNAME>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_TABLE_ID><![CDATA[D022B92163074E5E82449C8E0B5AFDF6]]></AD_TABLE_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_REFERENCE_VALUE_ID><![CDATA[234]]></AD_REFERENCE_VALUE_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_ELEMENT_ID><![CDATA[1308]]></AD_ELEMENT_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <POSITION><![CDATA[19]]></POSITION>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--6BF8015BCEC54410A71A367BA8F3C488-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--6BF8015BCEC54410A71A367BA8F3C488--></AD_COLUMN>
+
 <!--6C095E9D39CD4A31BC29FB37853B9044--><AD_COLUMN>
 <!--6C095E9D39CD4A31BC29FB37853B9044-->  <AD_COLUMN_ID><![CDATA[6C095E9D39CD4A31BC29FB37853B9044]]></AD_COLUMN_ID>
 <!--6C095E9D39CD4A31BC29FB37853B9044-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -269470,6 +269579,41 @@
 <!--7B51E0A4E08D4FC6B5C342557B9BD2AF-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--7B51E0A4E08D4FC6B5C342557B9BD2AF--></AD_COLUMN>
 
+<!--7B5FF2DCA47B4F578B58C59519FC36C9--><AD_COLUMN>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_COLUMN_ID><![CDATA[7B5FF2DCA47B4F578B58C59519FC36C9]]></AD_COLUMN_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <NAME><![CDATA[Processing]]></NAME>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <DESCRIPTION><![CDATA[A request to process the respective document or task.]]></DESCRIPTION>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <HELP><![CDATA[When this field is set as 'Y' a process is being performed on this record.]]></HELP>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <COLUMNNAME><![CDATA[Processing]]></COLUMNNAME>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_TABLE_ID><![CDATA[D022B92163074E5E82449C8E0B5AFDF6]]></AD_TABLE_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_ELEMENT_ID><![CDATA[524]]></AD_ELEMENT_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <POSITION><![CDATA[20]]></POSITION>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--7B5FF2DCA47B4F578B58C59519FC36C9--></AD_COLUMN>
+
 <!--7B6DC5B81399482CA1ED626F6488027A--><AD_COLUMN>
 <!--7B6DC5B81399482CA1ED626F6488027A-->  <AD_COLUMN_ID><![CDATA[7B6DC5B81399482CA1ED626F6488027A]]></AD_COLUMN_ID>
 <!--7B6DC5B81399482CA1ED626F6488027A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -285929,7 +286073,7 @@
 <!--897D5525C69D4C689786011DB69EC06B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--897D5525C69D4C689786011DB69EC06B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--897D5525C69D4C689786011DB69EC06B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--897D5525C69D4C689786011DB69EC06B-->  <POSITION><![CDATA[16]]></POSITION>
+<!--897D5525C69D4C689786011DB69EC06B-->  <POSITION><![CDATA[17]]></POSITION>
 <!--897D5525C69D4C689786011DB69EC06B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--897D5525C69D4C689786011DB69EC06B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--897D5525C69D4C689786011DB69EC06B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -304103,7 +304247,7 @@
 <!--B566146610A44D008F04DB7EDAE35365-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--B566146610A44D008F04DB7EDAE35365-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--B566146610A44D008F04DB7EDAE35365-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--B566146610A44D008F04DB7EDAE35365-->  <POSITION><![CDATA[17]]></POSITION>
+<!--B566146610A44D008F04DB7EDAE35365-->  <POSITION><![CDATA[16]]></POSITION>
 <!--B566146610A44D008F04DB7EDAE35365-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--B566146610A44D008F04DB7EDAE35365-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--B566146610A44D008F04DB7EDAE35365-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -201141,6 +201141,33 @@
 <!--537C71BB04004A20916787D665752EC7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--537C71BB04004A20916787D665752EC7--></AD_FIELD>
 
+<!--538233CDF4CE4DDC9F3F51B489BCCE34--><AD_FIELD>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_FIELD_ID><![CDATA[538233CDF4CE4DDC9F3F51B489BCCE34]]></AD_FIELD_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <NAME><![CDATA[Process Now]]></NAME>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <DESCRIPTION><![CDATA[A request to process the respective document or task.]]></DESCRIPTION>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <HELP><![CDATA[When this field is set as 'Y' a process is being performed on this record.]]></HELP>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_TAB_ID><![CDATA[45A6D51BFBB74C079AC559A4240A296D]]></AD_TAB_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_COLUMN_ID><![CDATA[7B5FF2DCA47B4F578B58C59519FC36C9]]></AD_COLUMN_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--538233CDF4CE4DDC9F3F51B489BCCE34--></AD_FIELD>
+
 <!--5392B9EB93884EAF85FDFBE3F8B60412--><AD_FIELD>
 <!--5392B9EB93884EAF85FDFBE3F8B60412-->  <AD_FIELD_ID><![CDATA[5392B9EB93884EAF85FDFBE3F8B60412]]></AD_FIELD_ID>
 <!--5392B9EB93884EAF85FDFBE3F8B60412-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -220630,6 +220657,34 @@
 <!--74D4BA92436A4C7CB11F85B246214486-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--74D4BA92436A4C7CB11F85B246214486--></AD_FIELD>
 
+<!--7519B39699A045E4BCBD1ED6CB74D333--><AD_FIELD>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_FIELD_ID><![CDATA[7519B39699A045E4BCBD1ED6CB74D333]]></AD_FIELD_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <NAME><![CDATA[Posted]]></NAME>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <DESCRIPTION><![CDATA[An accounting status button that indicates if the transaction has already been posted to the general ledger or not.]]></DESCRIPTION>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <HELP><![CDATA[An accounting status button that indicates if the transaction has already been posted to the general ledger or not. When doing the accounting manually this button can be used to post or unpost the transaction from the general ledger by hand.]]></HELP>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_TAB_ID><![CDATA[45A6D51BFBB74C079AC559A4240A296D]]></AD_TAB_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_COLUMN_ID><![CDATA[6BF8015BCEC54410A71A367BA8F3C488]]></AD_COLUMN_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7519B39699A045E4BCBD1ED6CB74D333-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7519B39699A045E4BCBD1ED6CB74D333--></AD_FIELD>
+
 <!--7526828ADF604AFC9E1BD0DACDCA1F5B--><AD_FIELD>
 <!--7526828ADF604AFC9E1BD0DACDCA1F5B-->  <AD_FIELD_ID><![CDATA[7526828ADF604AFC9E1BD0DACDCA1F5B]]></AD_FIELD_ID>
 <!--7526828ADF604AFC9E1BD0DACDCA1F5B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -263289,6 +263344,34 @@
 <!--C5038F12762C44079749F3E117F14A44-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C5038F12762C44079749F3E117F14A44--></AD_FIELD>
 
+<!--C5078B25170747C9BFECD5C8B7D1CBA1--><AD_FIELD>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_FIELD_ID><![CDATA[C5078B25170747C9BFECD5C8B7D1CBA1]]></AD_FIELD_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <NAME><![CDATA[Line No.]]></NAME>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <DESCRIPTION><![CDATA[A line stating the position of this request in the document.]]></DESCRIPTION>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <HELP><![CDATA[Indicates the unique line for a document.  It will also control the display order of the lines within a document.]]></HELP>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_TAB_ID><![CDATA[06DCB72BB6D24F82BCDA5FFF8EA0425C]]></AD_TAB_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_COLUMN_ID><![CDATA[1DBE6B9DC91B4DA68CA5B2BD3360183E]]></AD_COLUMN_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C5078B25170747C9BFECD5C8B7D1CBA1--></AD_FIELD>
+
 <!--C5116A0D29494E20B74E16BB6F8D1577--><AD_FIELD>
 <!--C5116A0D29494E20B74E16BB6F8D1577-->  <AD_FIELD_ID><![CDATA[C5116A0D29494E20B74E16BB6F8D1577]]></AD_FIELD_ID>
 <!--C5116A0D29494E20B74E16BB6F8D1577-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -275211,6 +275294,34 @@
 <!--DC012143C3B747B3B529102E8F465F2B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--DC012143C3B747B3B529102E8F465F2B--></AD_FIELD>
 
+<!--DC15BA923FA04952BD912C6717D58A92--><AD_FIELD>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_FIELD_ID><![CDATA[DC15BA923FA04952BD912C6717D58A92]]></AD_FIELD_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <NAME><![CDATA[Currency]]></NAME>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_TAB_ID><![CDATA[06DCB72BB6D24F82BCDA5FFF8EA0425C]]></AD_TAB_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_COLUMN_ID><![CDATA[68CC47B1AD4F45F68002BF9241C633DC]]></AD_COLUMN_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--DC15BA923FA04952BD912C6717D58A92-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--DC15BA923FA04952BD912C6717D58A92--></AD_FIELD>
+
 <!--DC46B1240A274702AB400BD545BA0568--><AD_FIELD>
 <!--DC46B1240A274702AB400BD545BA0568-->  <AD_FIELD_ID><![CDATA[DC46B1240A274702AB400BD545BA0568]]></AD_FIELD_ID>
 <!--DC46B1240A274702AB400BD545BA0568-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -285419,7 +285530,7 @@
 <!--FD0D66CE5B77096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B77096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--FD0D66CE5B77096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B77096DE040007F010024B1-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--FD0D66CE5B77096DE040007F010024B1-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--FD0D66CE5B77096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B77096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B77096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285446,7 +285557,7 @@
 <!--FD0D66CE5B78096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B78096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
 <!--FD0D66CE5B78096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B78096DE040007F010024B1-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--FD0D66CE5B78096DE040007F010024B1-->  <SEQNO><![CDATA[70]]></SEQNO>
 <!--FD0D66CE5B78096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B78096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B78096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285473,7 +285584,7 @@
 <!--FD0D66CE5B79096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B79096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
 <!--FD0D66CE5B79096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B79096DE040007F010024B1-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--FD0D66CE5B79096DE040007F010024B1-->  <SEQNO><![CDATA[30]]></SEQNO>
 <!--FD0D66CE5B79096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B79096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B79096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285500,7 +285611,7 @@
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B7A096DE040007F010024B1-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--FD0D66CE5B7A096DE040007F010024B1-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B7A096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285527,7 +285638,7 @@
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B7B096DE040007F010024B1-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--FD0D66CE5B7B096DE040007F010024B1-->  <SEQNO><![CDATA[80]]></SEQNO>
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B7B096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285555,7 +285666,7 @@
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD0D66CE5B7C096DE040007F010024B1-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--FD0D66CE5B7C096DE040007F010024B1-->  <SEQNO><![CDATA[90]]></SEQNO>
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD0D66CE5B7C096DE040007F010024B1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -285637,7 +285748,7 @@
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--FD4BD9AA640D7B3AE040007F01005BA7-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--FD4BD9AA640D7B3AE040007F01005BA7-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--FD4BD9AA640D7B3AE040007F01005BA7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -11540,6 +11540,8 @@
 <!--D022B92163074E5E82449C8E0B5AFDF6-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--D022B92163074E5E82449C8E0B5AFDF6-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--D022B92163074E5E82449C8E0B5AFDF6-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1EF4B84E040007F01006125]]></AD_PACKAGE_ID>
+<!--D022B92163074E5E82449C8E0B5AFDF6-->  <ACCTDATE_COLUMN_ID><![CDATA[FD0CA136DD379858E040007F01001C35]]></ACCTDATE_COLUMN_ID>
+<!--D022B92163074E5E82449C8E0B5AFDF6-->  <ACCTCLASSNAME><![CDATA[org.openbravo.erpCommon.ad_forms.DocCostAdjustment]]></ACCTCLASSNAME>
 <!--D022B92163074E5E82449C8E0B5AFDF6-->  <DATAORIGINTYPE><![CDATA[Table]]></DATAORIGINTYPE>
 <!--D022B92163074E5E82449C8E0B5AFDF6-->  <ISTREE><![CDATA[N]]></ISTREE>
 <!--D022B92163074E5E82449C8E0B5AFDF6--></AD_TABLE>
--- a/src-db/database/sourcedata/AD_WINDOW.xml	Wed Aug 06 14:55:21 2014 +0200
+++ b/src-db/database/sourcedata/AD_WINDOW.xml	Thu Aug 07 13:41:14 2014 +0200
@@ -2673,7 +2673,7 @@
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <NAME><![CDATA[Cost Adjustment]]></NAME>
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <HELP><![CDATA[Window where the Cost Adjustment generated by any of the adjustment processes can be reviewed.]]></HELP>
-<!--1688A758BDA04C88A5C1D370EB979C53-->  <WINDOWTYPE><![CDATA[M]]></WINDOWTYPE>
+<!--1688A758BDA04C88A5C1D370EB979C53-->  <WINDOWTYPE><![CDATA[T]]></WINDOWTYPE>
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <ISSOTRX><![CDATA[Y]]></ISSOTRX>
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <PROCESSING><![CDATA[N]]></PROCESSING>
 <!--1688A758BDA04C88A5C1D370EB979C53-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
--- a/src/org/openbravo/costing/CostAdjustmentUtils.java	Wed Aug 06 14:55:21 2014 +0200
+++ b/src/org/openbravo/costing/CostAdjustmentUtils.java	Thu Aug 07 13:41:14 2014 +0200
@@ -89,10 +89,12 @@
     costAdjustmentLine.setOrganization(transaction.getOrganization());
     costAdjustmentLine.setCostAdjustment(costAdjustmentHeader);
     costAdjustmentLine.setAdjustmentAmount(costAdjusted);
+    costAdjustmentLine.setCurrency(transaction.getCurrency());
     costAdjustmentLine.setInventoryTransaction(transaction);
     costAdjustmentLine.setSource(isSource);
     costAdjustmentLine.setTransactionDate(transactionDate);
     costAdjustmentLine.setAccountingDate(accountingDate);
+    costAdjustmentLine.setLineNo(getNewLineNo(costAdjustmentHeader));
 
     OBDal.getInstance().save(costAdjustmentLine);
 
@@ -146,4 +148,19 @@
 
     return res != null;
   }
+
+  private static Long getNewLineNo(CostAdjustment cadj) {
+    StringBuffer where = new StringBuffer();
+    where.append(" as cal");
+    where.append(" where cal." + CostAdjustmentLine.PROPERTY_COSTADJUSTMENT + " = :costAdjustment");
+    where.append(" order by cal." + CostAdjustmentLine.PROPERTY_LINENO + " desc");
+    OBQuery<CostAdjustmentLine> calQry = OBDal.getInstance().createQuery(CostAdjustmentLine.class,
+        where.toString());
+    calQry.setNamedParameter("costAdjustment", cadj);
+    if (calQry.count() > 0) {
+      CostAdjustmentLine cal = calQry.list().get(0);
+      return cal.getLineNo() + 10L;
+    }
+    return 10L;
+  }
 }
--- a/src/org/openbravo/costing/CostingServer.java	Wed Aug 06 14:55:21 2014 +0200
+++ b/src/org/openbravo/costing/CostingServer.java	Thu Aug 07 13:41:14 2014 +0200
@@ -348,7 +348,7 @@
     /**
      * Given a Material Management transaction returns its type.
      */
-    static TrxType getTrxType(MaterialTransaction transaction) {
+    public static TrxType getTrxType(MaterialTransaction transaction) {
       if (transaction.getGoodsShipmentLine() != null) {
         // Receipt / Shipment
         org.openbravo.model.materialmgmt.transaction.ShipmentInOut inout = transaction
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Wed Aug 06 14:55:21 2014 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Thu Aug 07 13:41:14 2014 +0200
@@ -275,6 +275,8 @@
   public static final String DOCTYPE_Reconciliation = "REC";
   // FinBankStatement
   public static final String DOCTYPE_FinBankStatement = "BST";
+  // CostAdjustment
+  public static final String DOCTYPE_CostAdjustment = "CAD";
 
   /*************************************************************************/
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocCostAdjustment.java	Thu Aug 07 13:41:14 2014 +0200
@@ -0,0 +1,399 @@
+/*
+ ******************************************************************************
+ * The contents of this file are subject to the   Compiere License  Version 1.1
+ * ("License"); You may not use this file except in compliance with the License
+ * You may obtain a copy of the License at http://www.compiere.org/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                  Compiere  ERP & CRM  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-2014 Openbravo S.L.U.
+ ******************************************************************************
+ */
+package org.openbravo.erpCommon.ad_forms;
+
+import java.math.BigDecimal;
+import java.sql.Connection;
+import java.util.ArrayList;
+
+import javax.servlet.ServletException;
+
+import org.apache.log4j.Logger;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.data.FieldProvider;
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.erpCommon.utility.SequenceIdData;
+import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
+import org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine;
+import org.openbravo.model.procurement.ReceiptInvoiceMatch;
+
+public class DocCostAdjustment extends AcctServer {
+
+  private static final long serialVersionUID = 1L;
+  static Logger log4jDocCostAdjustment = Logger.getLogger(DocCostAdjustment.class);
+
+  /** AD_Table_ID */
+  private String SeqNo = "0";
+
+  /**
+   * Constructor
+   * 
+   * @param AD_Client_ID
+   *          AD_Client_ID
+   */
+  public DocCostAdjustment(String AD_Client_ID, String AD_Org_ID,
+      ConnectionProvider connectionProvider) {
+    super(AD_Client_ID, AD_Org_ID, connectionProvider);
+  }
+
+  public void loadObjectFieldProvider(ConnectionProvider conn, @SuppressWarnings("hiding")
+  String AD_Client_ID, String Id) throws ServletException {
+    setObjectFieldProvider(DocCostAdjustmentData.selectRegistro(conn, AD_Client_ID, Id));
+  }
+
+  /**
+   * Load Document Details
+   * 
+   * @return true if loadDocumentType was set
+   */
+  public boolean loadDocumentDetails(FieldProvider[] data, ConnectionProvider conn) {
+    C_Currency_ID = NO_CURRENCY;
+
+    // TODO: SACAR CURRENCY
+    DocumentType = AcctServer.DOCTYPE_CostAdjustment;
+    log4jDocCostAdjustment.debug("loadDocumentDetails - C_Currency_ID : " + C_Currency_ID);
+    DateDoc = data[0].getField("DateTrx");
+    loadDocumentType(); // lines require doc type
+    // Contained Objects
+    p_lines = loadLines(conn);
+    return true;
+  } // loadDocumentDetails
+
+  /**
+   * Load Invoice Line
+   * 
+   * @return DocLine Array
+   */
+  private DocLine[] loadLines(ConnectionProvider conn) {
+    ArrayList<Object> list = new ArrayList<Object>();
+
+    DocLineCostAdjustmentData[] data = null;
+    try {
+      data = DocLineCostAdjustmentData.select(conn, Record_ID);
+      for (int i = 0; i < data.length; i++) {
+        String Line_ID = data[i].mCostadjustmentlineId;
+        DocLine_CostAdjustment docLine = new DocLine_CostAdjustment(DocumentType, Record_ID,
+            Line_ID);
+        docLine.loadAttributes(data[i], this);
+        docLine.setTrxType(data[i].mTransactionId);
+        docLine.m_C_Currency_ID = data[i].cCurrencyId;
+        docLine.setWarehouseId(data[i].mWarehouseId);
+        docLine.m_DateAcct = data[i].dateacct;
+        // -- Source Amounts
+        String amt = data[i].adjustmentAmount;
+        docLine.setAmount(amt);
+        list.add(docLine);
+      }
+    } catch (ServletException e) {
+      log4jDocCostAdjustment.warn(e);
+    }
+    // Return Array
+    DocLine[] dl = new DocLine[list.size()];
+    list.toArray(dl);
+    return dl;
+  } // loadLines
+
+  /**
+   * Get Balance
+   * 
+   * @return Zero (always balanced)
+   */
+  public BigDecimal getBalance() {
+    BigDecimal retValue = ZERO;
+    return retValue;
+  } // getBalance
+
+  /**
+   * Create Facts (the accounting logic) for MMS, MMR.
+   * 
+   * <pre>
+   *  Shipment
+   *      CoGS            DR
+   *      Inventory               CR
+   *  Shipment of Project Issue
+   *      CoGS            DR
+   *      Project                 CR
+   *  Receipt
+   *      Inventory       DR
+   *      NotInvoicedReceipt      CR
+   * </pre>
+   * 
+   * @param as
+   *          accounting schema
+   * @return Fact
+   */
+  public Fact createFact(AcctSchema as, ConnectionProvider conn, Connection con,
+      VariablesSecureApp vars) throws ServletException {
+    // Select specific definition
+    String strClassname = AcctServerData
+        .selectTemplateDoc(conn, as.m_C_AcctSchema_ID, DocumentType);
+    if (strClassname.equals(""))
+      strClassname = AcctServerData.selectTemplate(conn, as.m_C_AcctSchema_ID, AD_Table_ID);
+    if (!strClassname.equals("")) {
+      try {
+        DocCostAdjustmentTemplate newTemplate = (DocCostAdjustmentTemplate) Class.forName(
+            strClassname).newInstance();
+        return newTemplate.createFact(this, as, conn, con, vars);
+      } catch (Exception e) {
+        log4j.error("Error while creating new instance for DocCostAdjustmentTemplate - " + e);
+      }
+    }
+    C_Currency_ID = as.getC_Currency_ID();
+    // create Fact Header
+    Fact fact = new Fact(this, as, Fact.POST_Actual);
+    String Fact_Acct_Group_ID = SequenceIdData.getUUID();
+    boolean isNegativeAmount;
+    String amtDebit = "0";
+    String amtCredit = "0";
+    // Lines
+    for (int i = 0; p_lines != null && i < p_lines.length; i++) {
+      DocLine_CostAdjustment line = (DocLine_CostAdjustment) p_lines[i];
+      String transactionType = line.getTransactionType();
+
+      BigDecimal amount = new BigDecimal(line.getAmount());
+      isNegativeAmount = false;
+      if (amount.signum() < 0) {
+        isNegativeAmount = true;
+      }
+
+      ProductInfo p = new ProductInfo(line.m_M_Product_ID, conn);
+
+      log4jDocCostAdjustment.debug("antes del creteline, line.getAmount(): " + line.getAmount()
+          + " - TransactionType: " + transactionType);
+      if (transactionType.equals(DocLine_CostAdjustment.TRXTYPE_SHIPMENT)) {
+        // Cogs DR
+        // Inventory Asset CR
+        log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account - "
+            + p.getAccount(ProductInfo.ACCTTYPE_P_Cogs, as, conn).C_ValidCombination_ID);
+        if (line.isTransactionNegative()) {
+
+        }
+        if (isNegativeAmount) {
+          amtDebit = "";
+          amtCredit = amount.toString();
+        } else {
+          amtDebit = amount.toString();
+          amtCredit = "";
+        }
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Cogs, as, conn),
+            line.m_C_Currency_ID, amtDebit, amtCredit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn),
+            line.m_C_Currency_ID, amtCredit, amtDebit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+      } else if (transactionType.equals(DocLine_CostAdjustment.TRXTYPE_RECEIPT)) {
+        // Inventory Asset DR
+        // Product Exp CR
+        log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account - "
+            + p.getAccount(ProductInfo.ACCTTYPE_P_Expense, as, conn).C_ValidCombination_ID);
+        if (isNegativeAmount) {
+          amtDebit = amount.toString();
+          amtCredit = "";
+        } else {
+          amtDebit = "";
+          amtCredit = amount.toString();
+        }
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Expense, as, conn),
+            line.m_C_Currency_ID, amtDebit, amtCredit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn),
+            line.m_C_Currency_ID, amtCredit, amtDebit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+      } else if (transactionType.equals(DocLine_CostAdjustment.TRXTYPE_INVENTORY)) {
+        // Inventory Asset DR
+        // Inventory Adjustment CR
+        M_Warehouse_ID = line.getWarehouseId();
+        log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account - "
+            + getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn).C_ValidCombination_ID);
+        if (isNegativeAmount) {
+          amtDebit = amount.toString();
+          amtCredit = "";
+        } else {
+          amtDebit = "";
+          amtCredit = amount.toString();
+        }
+        fact.createLine(line, getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn),
+            line.m_C_Currency_ID, amtDebit, amtCredit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn),
+            line.m_C_Currency_ID, amtCredit, amtDebit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+      } else if (transactionType.equals(DocLine_CostAdjustment.TRXTYPE_INTERNALMOVEMENTFROM)) {
+        // Inventory Asset DR
+        // Inventory Adjustment CR
+        M_Warehouse_ID = line.getWarehouseId();
+        log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account - "
+            + getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn).C_ValidCombination_ID);
+        if (isNegativeAmount) {
+          amtDebit = amount.toString();
+          amtCredit = "";
+        } else {
+          amtDebit = "";
+          amtCredit = amount.toString();
+        }
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn),
+            line.m_C_Currency_ID, amtDebit, amtCredit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+
+        fact.createLine(line, getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn),
+            line.m_C_Currency_ID, amtCredit, amtDebit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+      } else if (transactionType.equals(DocLine_CostAdjustment.TRXTYPE_INTERNALMOVEMENTTO)) {
+        // Inventory Asset DR
+        // Inventory Adjustment CR
+        M_Warehouse_ID = line.getWarehouseId();
+        log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account - "
+            + getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn).C_ValidCombination_ID);
+        if (isNegativeAmount) {
+          amtDebit = amount.toString();
+          amtCredit = "";
+        } else {
+          amtDebit = "";
+          amtCredit = amount.toString();
+        }
+        fact.createLine(line, getAccount(AcctServer.ACCTTYPE_InvDifferences, as, conn),
+            line.m_C_Currency_ID, amtDebit, amtCredit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+        fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn),
+            line.m_C_Currency_ID, amtCredit, amtDebit, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
+            DocumentType, line.m_DateAcct, null, conn);
+      }
+    } // lines
+
+    // Cash Asset
+    log4jDocCostAdjustment.debug("********** DocCostAdjustment - factAcct - account2 - "
+        + getAccount(AcctServer.ACCTTYPE_CashAsset, as, conn).C_ValidCombination_ID);
+    SeqNo = "0";
+    return fact;
+  } // createFact
+
+  /**
+   * @return the log4jDocCostAdjustment
+   */
+  public static Logger getlog4jDocCostAdjustment() {
+    return log4jDocCostAdjustment;
+  }
+
+  /**
+   * @param log4jDocCostAdjustment
+   *          the log4jDocCostAdjustment to set
+   */
+  public static void setlog4jDocCostAdjustment(Logger log4jDocCostAdjustment) {
+    DocCostAdjustment.log4jDocCostAdjustment = log4jDocCostAdjustment;
+  }
+
+  /**
+   * @return the seqNo
+   */
+  public String getSeqNo() {
+    return SeqNo;
+  }
+
+  /**
+   * @param seqNo
+   *          the seqNo to set
+   */
+  public void setSeqNo(String seqNo) {
+    SeqNo = seqNo;
+  }
+
+  /**
+   * @return the serialVersionUID
+   */
+  public static long getSerialVersionUID() {
+    return serialVersionUID;
+  }
+
+  public String nextSeqNo(String oldSeqNo) {
+    log4jDocCostAdjustment.debug("DocMatchInv - oldSeqNo = " + oldSeqNo);
+    BigDecimal seqNo = new BigDecimal(oldSeqNo);
+    SeqNo = (seqNo.add(new BigDecimal("10"))).toString();
+    log4jDocCostAdjustment.debug("DocMatchInv - nextSeqNo = " + SeqNo);
+    return SeqNo;
+  }
+
+  /**
+   * Get Document Confirmation
+   * 
+   * not used
+   */
+  public boolean getDocumentConfirmation(ConnectionProvider conn, String strRecordId) {
+    return true;
+  }
+
+  /**
+   * Update Product Info. - Costing (PriceLastInv) - PO (PriceLastInv)
+   * 
+   * @param C_AcctSchema_ID
+   *          accounting schema
+   */
+  public void updateProductInfo(String C_AcctSchema_ID, ConnectionProvider conn, Connection con) {
+    log4jDocCostAdjustment.debug("updateProductInfo - C_Invoice_ID=" + this.Record_ID);
+
+    /**
+     * @todo Last.. would need to compare document/last updated date would need to maintain
+     *       LastPriceUpdateDate on _PO and _Costing
+     */
+
+    // update Product PO info
+    // should only be once, but here for every AcctSchema
+    // ignores multiple lines with same product - just uses first
+    int no = 0;
+    try {
+      no = DocInvoiceData.updateProductPO(con, conn, Record_ID);
+      log4jDocCostAdjustment.debug("M_Product_PO - Updated=" + no);
+
+    } catch (ServletException e) {
+      log4jDocCostAdjustment.warn(e);
+    }
+  } // updateProductInfo
+
+  private MaterialTransaction getTransaction(String matchInvId) {
+    OBContext.setAdminMode(false);
+    MaterialTransaction transaction;
+    if (OBDal.getInstance().get(ReceiptInvoiceMatch.class, matchInvId).getGoodsShipmentLine()
+        .getMaterialMgmtMaterialTransactionList().size() == 0) {
+      return null;
+    }
+    try {
+      transaction = OBDal.getInstance().get(ReceiptInvoiceMatch.class, matchInvId)
+          .getGoodsShipmentLine().getMaterialMgmtMaterialTransactionList().get(0);
+    } finally {
+
+      OBContext.restorePreviousMode();
+    }
+    return transaction;
+  }
+
+  private ShipmentInOutLine getShipmentLine(String matchInvId) {
+    OBContext.setAdminMode(false);
+    ShipmentInOutLine shipmentLine;
+    try {
+      shipmentLine = OBDal.getInstance().get(ReceiptInvoiceMatch.class, matchInvId)
+          .getGoodsShipmentLine();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return shipmentLine;
+  }
+
+  public String getServletInfo() {
+    return "Servlet for the accounting";
+  } // end of getServletInfo() method
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocCostAdjustmentTemplate.java	Thu Aug 07 13:41:14 2014 +0200
@@ -0,0 +1,62 @@
+/*
+ ******************************************************************************
+ * The contents of this file are subject to the   Compiere License  Version 1.1
+ * ("License"); You may not use this file except in compliance with the License
+ * You may obtain a copy of the License at http://www.compiere.org/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                  Compiere  ERP & CRM  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-2014 Openbravo S.L.U.
+ ******************************************************************************
+ */
+package org.openbravo.erpCommon.ad_forms;
+
+import java.sql.Connection;
+
+import javax.servlet.ServletException;
+
+import org.apache.log4j.Logger;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.database.ConnectionProvider;
+
+public abstract class DocCostAdjustmentTemplate {
+  private static final long serialVersionUID = 1L;
+  static Logger log4jDocCostAdjustment = Logger.getLogger(DocCostAdjustment.class);
+
+  /**
+   * Constructor
+   */
+  public DocCostAdjustmentTemplate() {
+  }
+
+  /**
+   * Create Facts (the accounting logic) for MMS, MMR.
+   * 
+   * <pre>
+   *  Shipment
+   *      CoGS            DR
+   *      Inventory               CR
+   *  Shipment of Project Issue
+   *      CoGS            DR
+   *      Project                 CR
+   *  Receipt
+   *      Inventory       DR
+   *      NotInvoicedReceipt      CR
+   * </pre>
+   * 
+   * @param as
+   *          accounting schema
+   * @return Fact
+   */
+  public abstract Fact createFact(DocCostAdjustment docCostAdjustment, AcctSchema as,
+      ConnectionProvider conn, Connection con, VariablesSecureApp vars) throws ServletException;
+
+  public String getServletInfo() {
+    return "Servlet for the accounting";
+  } // end of getServletInfo() method
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocCostAdjustment_data.xsql	Thu Aug 07 13:41:14 2014 +0200
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ******************************************************************************
+ * The contents of this file are subject to the   Compiere License  Version 1.1
+ * ("License"); You may not use this file except in compliance with the License
+ * You may obtain a copy of the License at http://www.compiere.org/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                  Compiere  ERP & CRM  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-2013 Openbravo S.L.U.
+ ******************************************************************************
+-->
+
+<SqlClass name="DocCostAdjustmentData" package="org.openbravo.erpCommon.ad_forms">
+  <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT '' AS M_COSTADJUSTMENT_ID, '' AS AD_CLIENT_ID, '' AS AD_ORG_ID, '' AS ISACTIVE,
+          '' AS CREATED, '' AS CREATEDBY, '' AS UPDATED, '' AS UPDATEDBY, '' AS DATETRX, '' AS PROCESSING,
+          '' AS PROCESSED, '' AS POSTED, '' AS DATEACCT, '' AS DATEDOC
+        FROM DUAL
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="selectRegistro" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+    <![CDATA[
+        SELECT CA.M_COSTADJUSTMENT_ID, CA.AD_CLIENT_ID, CA.AD_ORG_ID, CA.ISACTIVE, CA.CREATED, CA.CREATEDBY, CA.UPDATED,        
+        CA.UPDATEDBY, CA.REFERENCEDATE AS DATETRX, CA.PROCESSING,        
+        CA.PROCESSED, CA.POSTED, CA.REFERENCEDATE AS DATEACCT, CA.REFERENCEDATE AS DATEDOC
+        FROM M_COSTADJUSTMENT CA      
+        WHERE CA.AD_Client_ID=?
+        AND CA.M_COSTADJUSTMENT_ID=?
+    ]]>
+    </Sql>
+    <Parameter name="client"/>
+    <Parameter name="id"/>
+    </SqlMethod>
+   </SqlClass>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocLineCostAdjustment_data.xsql	Thu Aug 07 13:41:14 2014 +0200
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ******************************************************************************
+ * The contents of this file are subject to the   Compiere License  Version 1.1
+ * ("License"); You may not use this file except in compliance with the License
+ * You may obtain a copy of the License at http://www.compiere.org/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                  Compiere  ERP & CRM  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-2010 Openbravo S.L.U.
+ ******************************************************************************
+-->
+
+
+
+
+
+<SqlClass name="DocLineCostAdjustmentData" package="org.openbravo.erpCommon.ad_forms">
+  <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT CAL.M_COSTADJUSTMENTLINE_ID, CAL.AD_Client_ID, CAL.AD_Org_ID,
+        CAL.M_COSTADJUSTMENT_ID, CAL.M_TRANSACTION_ID, CAL.TRANSACTIONDATE, CAL.ADJUSTMENT_AMOUNT, 
+        CAL.ISSOURCE, CAL.NEEDSPOSTING, CAL.DATEACCT, CAL.ISRELATEDTRXADJUSTED, CAL.PARENT_COSTADJUSTMENTLINE_ID,
+        T.M_PRODUCT_ID, L.M_WAREHOUSE_ID, CAL.C_CURRENCY_ID
+        FROM M_COSTADJUSTMENTLINE CAL, M_TRANSACTION T, M_LOCATOR L
+        WHERE CAL.M_TRANSACTION_ID = T.M_TRANSACTION_ID
+        AND T.M_LOCATOR_ID = L.M_LOCATOR_ID
+        AND CAL.M_COSTADJUSTMENT_ID = ?
+        AND CAL.IsActive='Y'
+        ORDER BY CAL.LINE ASC
+     ]]>
+     </Sql>
+     <Parameter name="Cost_Adjustment_ID"/>
+   </SqlMethod>
+   </SqlClass>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocLine_CostAdjustment.java	Thu Aug 07 13:41:14 2014 +0200
@@ -0,0 +1,215 @@
+/*
+ ******************************************************************************
+ * The contents of this file are subject to the   Compiere License  Version 1.1
+ * ("License"); You may not use this file except in compliance with the License
+ * You may obtain a copy of the License at http://www.compiere.org/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                  Compiere  ERP & CRM  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-2012 Openbravo S.L.U.
+ ******************************************************************************
+ */
+package org.openbravo.erpCommon.ad_forms;
+
+import java.math.BigDecimal;
+
+import javax.servlet.ServletException;
+
+import org.apache.log4j.Logger;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.costing.CostingServer;
+import org.openbravo.costing.CostingServer.TrxType;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
+
+public class DocLine_CostAdjustment extends DocLine {
+  static Logger log4jDocLine_CostAdjustment = Logger.getLogger(DocLine_CostAdjustment.class);
+
+  public DocLine_CostAdjustment(String DocumentType, String TrxHeader_ID, String TrxLine_ID) {
+    super(DocumentType, TrxHeader_ID, TrxLine_ID);
+  }
+
+  /** Transaction Type */
+  private String transactionType;
+  private TrxType trxType;
+  private String trxAmt;
+  private boolean transactionNegative;
+  private String warehouseId;
+
+  public static final String TRXTYPE_SHIPMENT = "SMT";
+  public static final String TRXTYPE_RECEIPT = "RCT";
+  public static final String TRXTYPE_INVENTORY = "INV";
+  public static final String TRXTYPE_INTERNALMOVEMENTFROM = "INTMOVF";
+  public static final String TRXTYPE_INTERNALMOVEMENTTO = "INTMOVT";
+  public static final String TRXTYPE_INTERNALCONSUMPTION = "INTCONS";
+  public static final String TRXTYPE_BOM = "BOM";
+  public static final String TRXTYPE_MANUFACTURING = "MAN";
+
+  public void setTrxType(String transactionId) {
+    MaterialTransaction transaction = OBDal.getInstance().get(MaterialTransaction.class,
+        transactionId);
+    TrxType trxTypeLocal = TrxType.getTrxType(transaction);
+    setTransactionType(trxTypeLocal);
+    this.trxType = trxTypeLocal;
+  }
+
+  public CostingServer.TrxType getTrxType() {
+    return trxType;
+  }
+
+  public void setTransactionType(TrxType trxType) {
+    switch (trxType) {
+    case Shipment:
+      transactionType = TRXTYPE_SHIPMENT;
+      transactionNegative = false;
+    case ShipmentReturn:
+      transactionType = TRXTYPE_SHIPMENT;
+      transactionNegative = true;
+    case ShipmentVoid:
+      transactionType = TRXTYPE_SHIPMENT;
+      transactionNegative = true;
+    case ShipmentNegative:
+      transactionType = TRXTYPE_SHIPMENT;
+      transactionNegative = true;
+    case Receipt:
+      transactionType = TRXTYPE_RECEIPT;
+      transactionNegative = false;
+    case ReceiptReturn:
+      transactionType = TRXTYPE_RECEIPT;
+      transactionNegative = true;
+    case ReceiptVoid:
+      transactionType = TRXTYPE_RECEIPT;
+      transactionNegative = true;
+    case ReceiptNegative:
+      transactionType = TRXTYPE_RECEIPT;
+      transactionNegative = true;
+    case InventoryDecrease:
+      transactionType = TRXTYPE_INVENTORY;
+      transactionNegative = true;
+    case InventoryIncrease:
+      transactionType = TRXTYPE_INVENTORY;
+      transactionNegative = false;
+    case IntMovementFrom:
+      transactionType = TRXTYPE_INTERNALMOVEMENTFROM;
+      transactionNegative = true;
+    case IntMovementTo:
+      transactionType = TRXTYPE_INTERNALMOVEMENTTO;
+      transactionNegative = false;
+    case InternalCons:
+      transactionType = TRXTYPE_INTERNALCONSUMPTION;
+      transactionNegative = false;
+    case InternalConsNegative:
+      transactionType = TRXTYPE_INTERNALCONSUMPTION;
+      transactionNegative = true;
+    case InternalConsVoid:
+      transactionType = TRXTYPE_INTERNALCONSUMPTION;
+      transactionNegative = true;
+    case BOMPart:
+      transactionType = TRXTYPE_BOM;
+      transactionNegative = false;
+    case BOMProduct:
+      transactionType = TRXTYPE_BOM;
+      transactionNegative = false;
+    case ManufacturingConsumed:
+      transactionType = TRXTYPE_MANUFACTURING;
+      transactionNegative = true;
+    case ManufacturingProduced:
+      transactionType = TRXTYPE_MANUFACTURING;
+      transactionNegative = false;
+    case Unknown:
+      throw new OBException("@UnknownTrxType@: " + trxType);
+    default:
+      throw new OBException("@UnknownTrxType@: " + trxType);
+    }
+  }
+
+  public String getTransactionType() {
+    return transactionType;
+  }
+
+  public void setAmount(String amt) {
+    trxAmt = amt;
+  } // setAmounts
+
+  public String getAmount() {
+    return trxAmt;
+  } // setAmounts
+
+  public void setWarehouseId(String warehouse) {
+    warehouseId = warehouse;
+  } // setAmounts
+
+  public String getWarehouseId() {
+    return warehouseId;
+  } // setAmounts
+
+  public boolean isTransactionNegative() {
+    return transactionNegative;
+  } // setAmounts
+
+  /**
+   * Line Account from Product (or Charge).
+   * 
+   * @param AcctType
+   *          see ProoductInfo.ACCTTYPE_* (0..3)
+   * @param as
+   *          Accounting schema
+   * @return Requested Product Account
+   */
+  public Account getAccount(String AcctType, AcctSchema as, ConnectionProvider conn) {
+    // Charge Account
+    if (m_M_Product_ID.equals("") && !m_C_Charge_ID.equals("")) {
+      BigDecimal amt = new BigDecimal(-1); // Revenue (-)
+      if (p_DocumentType.indexOf("AP") != -1)
+        amt = new BigDecimal(+1); // Expense (+)
+      Account acct = getChargeAccount(as, amt, conn);
+      if (acct != null)
+        return acct;
+    }
+    // GL Item directly from Invoice Line
+    else if (m_M_Product_ID.equals("") && !m_C_Glitem_ID.equals("")) {
+      try {
+        DocLineInvoiceData[] data = null;
+        data = DocLineInvoiceData.selectGlitem(conn, m_C_Glitem_ID, as.getC_AcctSchema_ID());
+        String Account_ID = "";
+        if (data == null || data.length == 0)
+          return null;
+        if (data.length > 0) {
+          switch (Integer.parseInt(AcctType)) {
+          case 1:
+            // It is similar to ProductInfo.ACCTTYPE_P_Revenue
+            Account_ID = data[0].glitemCreditAcct;
+            break;
+          case 2:
+            // It is similar to ProductInfo.ACCTTYPE_P_Expense
+            Account_ID = data[0].glitemDebitAcct;
+            break;
+          }
+        }
+        // No account
+        if (Account_ID.equals("")) {
+          log4jDocLine_CostAdjustment.warn("getAccount - NO account for m_C_Glitem_ID="
+              + m_C_Glitem_ID);
+          return null;
+        }
+        // Return Account
+        return Account.getAccount(conn, Account_ID);
+
+      } catch (ServletException e) {
+        log4jDocLine_CostAdjustment.warn(e);
+      }
+    }
+    // Product Account
+    return p_productInfo.getAccount(AcctType, as, conn);
+  } // getAccount
+
+  public String getServletInfo() {
+    return "Servlet for the accounting";
+  } // end of getServletInfo() method
+}