Fixes bug 25683: trigger performance improvement
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Fri, 07 Feb 2014 12:31:59 +0100
changeset 21927 b4367a3c856c
parent 21926 8d694f6a34a3
child 21928 553e45dab0ea
Fixes bug 25683: trigger performance improvement
modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_BANKSTATEMENT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_BNKSTM_LINE_CHECK_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_AUXILIARINPUT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MENU.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TREENODE.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
src-db/database/model/tables/FACT_ACCT.xml
src-db/database/model/triggers/C_ORDER_TRG.xml
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_BANKSTATEMENT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_BANKSTATEMENT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -5,5 +5,9 @@
         <default><![CDATA[P]]></default>
         <onCreateDefault/>
       </column>
+      <column name="EM_APRM_PROCESS_BS_FORCE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[P]]></default>
+        <onCreateDefault/>
+      </column>
     </table>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -17,5 +17,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="EM_APRM_MATCHTRANS_FORCE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
     </table>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_BNKSTM_LINE_CHECK_TRG.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_BNKSTM_LINE_CHECK_TRG.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -62,6 +62,26 @@
   IF((DELETING OR INSERTING) AND v_Processed='Y') THEN
 	RAISE_APPLICATION_ERROR(-20000, '@20501@');
   END IF;
+  IF(DELETING AND :OLD.FIN_FINACC_TRANSACTION_ID IS NOT NULL) THEN
+	RAISE_APPLICATION_ERROR(-20000, '@APRM_BSTLine_Matched@');
+  END IF;
+  IF (UPDATING) THEN
+  	IF (:OLD.FIN_FINACC_TRANSACTION_ID IS NOT NULL) THEN
+    	    IF(((COALESCE(:OLD.AD_ORG_ID, '0') <> COALESCE(:NEW.AD_ORG_ID, '0'))
+      OR(COALESCE(:OLD.ISACTIVE, '0') <> COALESCE(:NEW.ISACTIVE, '0'))
+      OR(COALESCE(:OLD.FIN_BANKSTATEMENT_ID, '0') <> COALESCE(:NEW.FIN_BANKSTATEMENT_ID, '0'))
+      OR(COALESCE(:OLD.LINE, 0) <> COALESCE(:NEW.LINE, 0))
+      OR(COALESCE(:OLD.BPARTNERNAME, '0') <> COALESCE(:NEW.BPARTNERNAME, '0'))
+      OR(COALESCE(:OLD.DATETRX, v_DateNull) <> COALESCE(:NEW.DATETRX, v_DateNull))
+      OR(COALESCE(:OLD.CRAMOUNT, 0) <> COALESCE(:NEW.CRAMOUNT, 0))
+      OR(COALESCE(:OLD.DRAMOUNT, 0) <> COALESCE(:NEW.DRAMOUNT, 0))
+      OR(COALESCE(:OLD.REFERENCENO, '0') <> COALESCE(:NEW.REFERENCENO, '0'))
+      )) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@APRM_BSTLine_Matched@');
+    END IF;
+
+  	END IF;
+  END IF;
 END APRM_FIN_BNKSTM_LINE_CHECK_TRG
 ]]></body>
     </trigger>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -34,8 +34,6 @@
       OR(COALESCE(:OLD.C_DOCTYPE_ID, '0') <> COALESCE(:NEW.C_DOCTYPE_ID, '0'))
       OR(COALESCE(:OLD.DATETO, v_DateNull) <> COALESCE(:NEW.DATETO, v_DateNull))
       OR(COALESCE(:OLD.STATEMENTDATE, v_DateNull) <> COALESCE(:NEW.STATEMENTDATE, v_DateNull))
-      OR(COALESCE(:OLD.ENDINGBALANCE, 0) <> COALESCE(:NEW.ENDINGBALANCE, 0))
-      OR(COALESCE(:OLD.STARTINGBALANCE, 0) <> COALESCE(:NEW.STARTINGBALANCE, 0))
       OR(COALESCE(:OLD.DOCSTATUS, '0') <> COALESCE(:NEW.DOCSTATUS, '0')))) THEN
       RAISE_APPLICATION_ERROR(-20000, '@20501@');
     END IF;
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -44,6 +44,17 @@
 <!--9D630C9E4C734361BFB09B153EEE3BCB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--9D630C9E4C734361BFB09B153EEE3BCB--></AD_AUXILIARINPUT>
 
+<!--B1C25B989C164EDFB7F9B26CB799DDAA--><AD_AUXILIARINPUT>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <AD_AUXILIARINPUT_ID><![CDATA[B1C25B989C164EDFB7F9B26CB799DDAA]]></AD_AUXILIARINPUT_ID>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <AD_TAB_ID><![CDATA[C56E698100314ABBBBD3A89626CA551C]]></AD_TAB_ID>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <NAME><![CDATA[APRM_ISRECONCILED]]></NAME>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <CODE><![CDATA[@SQL=SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM FIN_BANKSTATEMENTLINE WHERE FIN_FINACC_TRANSACTION_ID IS NOT NULL AND FIN_BANKSTATEMENT_ID = @FIN_BankStatement_ID@) ]]></CODE>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--B1C25B989C164EDFB7F9B26CB799DDAA--></AD_AUXILIARINPUT>
+
 <!--D08EBACB459849488F49089EA28F96D9--><AD_AUXILIARINPUT>
 <!--D08EBACB459849488F49089EA28F96D9-->  <AD_AUXILIARINPUT_ID><![CDATA[D08EBACB459849488F49089EA28F96D9]]></AD_AUXILIARINPUT_ID>
 <!--D08EBACB459849488F49089EA28F96D9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -2466,6 +2466,42 @@
 <!--68C853FD393C4620A3947EC34C416B9A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--68C853FD393C4620A3947EC34C416B9A--></AD_COLUMN>
 
+<!--6B5C965B623748689A689838835C0AC2--><AD_COLUMN>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_COLUMN_ID><![CDATA[6B5C965B623748689A689838835C0AC2]]></AD_COLUMN_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6B5C965B623748689A689838835C0AC2-->  <NAME><![CDATA[EM_APRM_Process Bank Statement Force]]></NAME>
+<!--6B5C965B623748689A689838835C0AC2-->  <COLUMNNAME><![CDATA[EM_APRM_Process_BS_Force]]></COLUMNNAME>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_TABLE_ID><![CDATA[D4C23A17190649E7B78F55A05AF3438C]]></AD_TABLE_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_REFERENCE_VALUE_ID><![CDATA[EC75B6F5A9504DB6B3F3356EA85F15EE]]></AD_REFERENCE_VALUE_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--6B5C965B623748689A689838835C0AC2-->  <DEFAULTVALUE><![CDATA[P]]></DEFAULTVALUE>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--6B5C965B623748689A689838835C0AC2-->  <SEQNO><![CDATA[220]]></SEQNO>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_ELEMENT_ID><![CDATA[D42C1F18622F4773989190BB8C2C8436]]></AD_ELEMENT_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_PROCESS_ID><![CDATA[2DDE7D3618034C38A4462B7F3456C28D]]></AD_PROCESS_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--6B5C965B623748689A689838835C0AC2-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--6B5C965B623748689A689838835C0AC2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--6B5C965B623748689A689838835C0AC2-->  <POSITION><![CDATA[22]]></POSITION>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--6B5C965B623748689A689838835C0AC2-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--6B5C965B623748689A689838835C0AC2-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--6B5C965B623748689A689838835C0AC2-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--6B5C965B623748689A689838835C0AC2--></AD_COLUMN>
+
 <!--6BBCB749C7C640A08F573BF86D270171--><AD_COLUMN>
 <!--6BBCB749C7C640A08F573BF86D270171-->  <AD_COLUMN_ID><![CDATA[6BBCB749C7C640A08F573BF86D270171]]></AD_COLUMN_ID>
 <!--6BBCB749C7C640A08F573BF86D270171-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5377,6 +5413,40 @@
 <!--9D382AE31EFB4496B0A531A0FD72E73B-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--9D382AE31EFB4496B0A531A0FD72E73B--></AD_COLUMN>
 
+<!--9DC8500B414640E09BF61A3D14FE13D1--><AD_COLUMN>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_COLUMN_ID><![CDATA[9DC8500B414640E09BF61A3D14FE13D1]]></AD_COLUMN_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <NAME><![CDATA[EM_APRM_MatchTransactions_Force]]></NAME>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <COLUMNNAME><![CDATA[EM_APRM_MatchTrans_Force]]></COLUMNNAME>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_TABLE_ID><![CDATA[B129E53BC0E747879F7BA17F0AECEC32]]></AD_TABLE_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <SEQNO><![CDATA[450]]></SEQNO>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_ELEMENT_ID><![CDATA[F79620AE1CC041308045C23E661BD907]]></AD_ELEMENT_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_PROCESS_ID><![CDATA[19EEA22FCA464979B3ADAD3A967ADA52]]></AD_PROCESS_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <POSITION><![CDATA[39]]></POSITION>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--9DC8500B414640E09BF61A3D14FE13D1--></AD_COLUMN>
+
 <!--9DE9E45A80994A969AC623FA97A3C0E8--><AD_COLUMN>
 <!--9DE9E45A80994A969AC623FA97A3C0E8-->  <AD_COLUMN_ID><![CDATA[9DE9E45A80994A969AC623FA97A3C0E8]]></AD_COLUMN_ID>
 <!--9DE9E45A80994A969AC623FA97A3C0E8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5511,7 +5581,7 @@
 <!--A028C07508878CB9E040007F01007210-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A028C07508878CB9E040007F01007210-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A028C07508878CB9E040007F01007210-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A028C07508878CB9E040007F01007210-->  <POSITION><![CDATA[30]]></POSITION>
+<!--A028C07508878CB9E040007F01007210-->  <POSITION><![CDATA[35]]></POSITION>
 <!--A028C07508878CB9E040007F01007210-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A028C07508878CB9E040007F01007210-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A028C07508878CB9E040007F01007210-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -5545,7 +5615,7 @@
 <!--A04179EAC69DF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69DF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69DF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69DF848E040007F01004523-->  <POSITION><![CDATA[31]]></POSITION>
+<!--A04179EAC69DF848E040007F01004523-->  <POSITION><![CDATA[36]]></POSITION>
 <!--A04179EAC69DF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69DF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69DF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -5579,7 +5649,7 @@
 <!--A04179EAC69EF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69EF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69EF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69EF848E040007F01004523-->  <POSITION><![CDATA[32]]></POSITION>
+<!--A04179EAC69EF848E040007F01004523-->  <POSITION><![CDATA[37]]></POSITION>
 <!--A04179EAC69EF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69EF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69EF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -5614,7 +5684,7 @@
 <!--A04179EAC69FF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69FF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69FF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69FF848E040007F01004523-->  <POSITION><![CDATA[33]]></POSITION>
+<!--A04179EAC69FF848E040007F01004523-->  <POSITION><![CDATA[38]]></POSITION>
 <!--A04179EAC69FF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69FF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69FF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -677,6 +677,18 @@
 <!--D2AC3F75FCDC4BC187A1F492C46D68D1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--D2AC3F75FCDC4BC187A1F492C46D68D1--></AD_ELEMENT>
 
+<!--D42C1F18622F4773989190BB8C2C8436--><AD_ELEMENT>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <AD_ELEMENT_ID><![CDATA[D42C1F18622F4773989190BB8C2C8436]]></AD_ELEMENT_ID>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <COLUMNNAME><![CDATA[EM_APRM_Process_BS_Force]]></COLUMNNAME>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <NAME><![CDATA[EM_APRM_Process Bank Statement Force]]></NAME>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <PRINTNAME><![CDATA[EM_APRM_Process Bank Statement Force]]></PRINTNAME>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--D42C1F18622F4773989190BB8C2C8436-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--D42C1F18622F4773989190BB8C2C8436--></AD_ELEMENT>
+
 <!--DB85AA94D6DF4D7CB29CE7999B15F9C7--><AD_ELEMENT>
 <!--DB85AA94D6DF4D7CB29CE7999B15F9C7-->  <AD_ELEMENT_ID><![CDATA[DB85AA94D6DF4D7CB29CE7999B15F9C7]]></AD_ELEMENT_ID>
 <!--DB85AA94D6DF4D7CB29CE7999B15F9C7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -719,6 +731,18 @@
 <!--EDB9CF491555465382F828F48291A0C0-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--EDB9CF491555465382F828F48291A0C0--></AD_ELEMENT>
 
+<!--F79620AE1CC041308045C23E661BD907--><AD_ELEMENT>
+<!--F79620AE1CC041308045C23E661BD907-->  <AD_ELEMENT_ID><![CDATA[F79620AE1CC041308045C23E661BD907]]></AD_ELEMENT_ID>
+<!--F79620AE1CC041308045C23E661BD907-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F79620AE1CC041308045C23E661BD907-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F79620AE1CC041308045C23E661BD907-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F79620AE1CC041308045C23E661BD907-->  <COLUMNNAME><![CDATA[EM_APRM_MatchTrans_Force]]></COLUMNNAME>
+<!--F79620AE1CC041308045C23E661BD907-->  <NAME><![CDATA[EM_APRM_MatchTransactions_Force]]></NAME>
+<!--F79620AE1CC041308045C23E661BD907-->  <PRINTNAME><![CDATA[EM_APRM_MatchTransactions_Force]]></PRINTNAME>
+<!--F79620AE1CC041308045C23E661BD907-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--F79620AE1CC041308045C23E661BD907-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--F79620AE1CC041308045C23E661BD907--></AD_ELEMENT>
+
 <!--FC780C136EFA4D98B2435A9448FA44AD--><AD_ELEMENT>
 <!--FC780C136EFA4D98B2435A9448FA44AD-->  <AD_ELEMENT_ID><![CDATA[FC780C136EFA4D98B2435A9448FA44AD]]></AD_ELEMENT_ID>
 <!--FC780C136EFA4D98B2435A9448FA44AD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -5516,6 +5516,33 @@
 <!--56C9A3AC73DC456293EB5E18A7E88048-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--56C9A3AC73DC456293EB5E18A7E88048--></AD_FIELD>
 
+<!--573AAAA411BD4BB5B6A155A820199184--><AD_FIELD>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_FIELD_ID><![CDATA[573AAAA411BD4BB5B6A155A820199184]]></AD_FIELD_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <NAME><![CDATA[Bank Statement Process Force]]></NAME>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_TAB_ID><![CDATA[C56E698100314ABBBBD3A89626CA551C]]></AD_TAB_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_COLUMN_ID><![CDATA[6B5C965B623748689A689838835C0AC2]]></AD_COLUMN_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <DISPLAYLOGIC><![CDATA[@APRM_ISRECONCILED@!'']]></DISPLAYLOGIC>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--573AAAA411BD4BB5B6A155A820199184-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--573AAAA411BD4BB5B6A155A820199184--></AD_FIELD>
+
 <!--573C4BEE22054AAEA437A3EEA5A03E70--><AD_FIELD>
 <!--573C4BEE22054AAEA437A3EEA5A03E70-->  <AD_FIELD_ID><![CDATA[573C4BEE22054AAEA437A3EEA5A03E70]]></AD_FIELD_ID>
 <!--573C4BEE22054AAEA437A3EEA5A03E70-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12416,7 +12443,7 @@
 <!--A0417A0E9255CA28E040007F01003C18-->  <AD_COLUMN_ID><![CDATA[A04179EAC69DF848E040007F01004523]]></AD_COLUMN_ID>
 <!--A0417A0E9255CA28E040007F01003C18-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
 <!--A0417A0E9255CA28E040007F01003C18-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--A0417A0E9255CA28E040007F01003C18-->  <DISPLAYLOGIC><![CDATA[@Type@='B'&@FIN_Matching_Algorithm_ID@!'']]></DISPLAYLOGIC>
+<!--A0417A0E9255CA28E040007F01003C18-->  <DISPLAYLOGIC><![CDATA[@Type@='B'&@FIN_Matching_Algorithm_ID@!''&(@LASTRECON@=@DRAFTRECONCILIATION@|@DRAFTRECONCILIATION@='')]]></DISPLAYLOGIC>
 <!--A0417A0E9255CA28E040007F01003C18-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--A0417A0E9255CA28E040007F01003C18-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--A0417A0E9255CA28E040007F01003C18-->  <SEQNO><![CDATA[240]]></SEQNO>
@@ -12638,6 +12665,7 @@
 <!--A28B0A82995D87F5E040007F010067A0-->  <AD_COLUMN_ID><![CDATA[A28B0A82995C87F5E040007F010067A0]]></AD_COLUMN_ID>
 <!--A28B0A82995D87F5E040007F010067A0-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
 <!--A28B0A82995D87F5E040007F010067A0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--A28B0A82995D87F5E040007F010067A0-->  <DISPLAYLOGIC><![CDATA[@APRM_ISRECONCILED@='']]></DISPLAYLOGIC>
 <!--A28B0A82995D87F5E040007F010067A0-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--A28B0A82995D87F5E040007F010067A0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--A28B0A82995D87F5E040007F010067A0-->  <SEQNO><![CDATA[130]]></SEQNO>
@@ -15959,6 +15987,33 @@
 <!--B739AFFFB5CC4E1C847EB25ABE62A233-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--B739AFFFB5CC4E1C847EB25ABE62A233--></AD_FIELD>
 
+<!--B7C06E2CD9EC460FBA493804E274ACC7--><AD_FIELD>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_FIELD_ID><![CDATA[B7C06E2CD9EC460FBA493804E274ACC7]]></AD_FIELD_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <NAME><![CDATA[Match Statement Force]]></NAME>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_TAB_ID><![CDATA[2845D761A8394468BD3BA4710AA888D4]]></AD_TAB_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_COLUMN_ID><![CDATA[9DC8500B414640E09BF61A3D14FE13D1]]></AD_COLUMN_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <DISPLAYLOGIC><![CDATA[@Type@='B'&@FIN_Matching_Algorithm_ID@!''&(@LASTRECON@!@DRAFTRECONCILIATION@&@DRAFTRECONCILIATION@!'')]]></DISPLAYLOGIC>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <SEQNO><![CDATA[240]]></SEQNO>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--B7C06E2CD9EC460FBA493804E274ACC7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B7C06E2CD9EC460FBA493804E274ACC7--></AD_FIELD>
+
 <!--B8756B0E70554048BCC9F1727B8A5AA4--><AD_FIELD>
 <!--B8756B0E70554048BCC9F1727B8A5AA4-->  <AD_FIELD_ID><![CDATA[B8756B0E70554048BCC9F1727B8A5AA4]]></AD_FIELD_ID>
 <!--B8756B0E70554048BCC9F1727B8A5AA4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MENU.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MENU.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -13,6 +13,18 @@
 <!--125E6EAD650841F69E2601C78F558AA1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--125E6EAD650841F69E2601C78F558AA1--></AD_MENU>
 
+<!--47F0FD37150E4FC48AA2479ED7C7A241--><AD_MENU>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <AD_MENU_ID><![CDATA[47F0FD37150E4FC48AA2479ED7C7A241]]></AD_MENU_ID>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <NAME><![CDATA[Store Summary Report]]></NAME>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <ACTION><![CDATA[P]]></ACTION>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <AD_PROCESS_ID><![CDATA[E9EA93A1539F4AD78659198A49108E9C]]></AD_PROCESS_ID>
+<!--47F0FD37150E4FC48AA2479ED7C7A241-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--47F0FD37150E4FC48AA2479ED7C7A241--></AD_MENU>
+
 <!--57DA6BAE74334B5B81A0AD05256C1B34--><AD_MENU>
 <!--57DA6BAE74334B5B81A0AD05256C1B34-->  <AD_MENU_ID><![CDATA[57DA6BAE74334B5B81A0AD05256C1B34]]></AD_MENU_ID>
 <!--57DA6BAE74334B5B81A0AD05256C1B34-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -997,6 +997,18 @@
 <!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--CCA38D3048F04C1FA6F05AD56CF81B5D--></AD_MESSAGE>
 
+<!--D0F129E2F69F4D199DAE68813D2327A2--><AD_MESSAGE>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <AD_MESSAGE_ID><![CDATA[D0F129E2F69F4D199DAE68813D2327A2]]></AD_MESSAGE_ID>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <VALUE><![CDATA[APRM_BSTLine_Matched]]></VALUE>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <MSGTEXT><![CDATA[Bank Statement Line is already matched. It can not be modified nor deleted.]]></MSGTEXT>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--D0F129E2F69F4D199DAE68813D2327A2-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--D0F129E2F69F4D199DAE68813D2327A2--></AD_MESSAGE>
+
 <!--D2585EEAC94945C7B3CF79C209FD7650--><AD_MESSAGE>
 <!--D2585EEAC94945C7B3CF79C209FD7650-->  <AD_MESSAGE_ID><![CDATA[D2585EEAC94945C7B3CF79C209FD7650]]></AD_MESSAGE_ID>
 <!--D2585EEAC94945C7B3CF79C209FD7650-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -48,6 +48,30 @@
 <!--46A3E47C3F414E948988B487A85FC244-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--46A3E47C3F414E948988B487A85FC244--></AD_MODEL_OBJECT>
 
+<!--560040FB16CB46A0ABDED8047D25D4CD--><AD_MODEL_OBJECT>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <AD_MODEL_OBJECT_ID><![CDATA[560040FB16CB46A0ABDED8047D25D4CD]]></AD_MODEL_OBJECT_ID>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <ACTION><![CDATA[P]]></ACTION>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.process.FIN_BankStatementProcess]]></CLASSNAME>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <AD_PROCESS_ID><![CDATA[2DDE7D3618034C38A4462B7F3456C28D]]></AD_PROCESS_ID>
+<!--560040FB16CB46A0ABDED8047D25D4CD-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--560040FB16CB46A0ABDED8047D25D4CD--></AD_MODEL_OBJECT>
+
+<!--62CA7E15A1D94659808D715D1A6D65F9--><AD_MODEL_OBJECT>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <AD_MODEL_OBJECT_ID><![CDATA[62CA7E15A1D94659808D715D1A6D65F9]]></AD_MODEL_OBJECT_ID>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <ACTION><![CDATA[P]]></ACTION>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.ad_actionbutton.MatchTransaction]]></CLASSNAME>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <AD_PROCESS_ID><![CDATA[19EEA22FCA464979B3ADAD3A967ADA52]]></AD_PROCESS_ID>
+<!--62CA7E15A1D94659808D715D1A6D65F9-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--62CA7E15A1D94659808D715D1A6D65F9--></AD_MODEL_OBJECT>
+
 <!--668D8470721B430687DFE2F97A75751F--><AD_MODEL_OBJECT>
 <!--668D8470721B430687DFE2F97A75751F-->  <AD_MODEL_OBJECT_ID><![CDATA[668D8470721B430687DFE2F97A75751F]]></AD_MODEL_OBJECT_ID>
 <!--668D8470721B430687DFE2F97A75751F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -60,6 +60,16 @@
 <!--3C67B056A44F4D948570621D2DADA439-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
 <!--3C67B056A44F4D948570621D2DADA439--></AD_MODEL_OBJECT_MAPPING>
 
+<!--3FA22942DCD0451CAA0E924B30296B8B--><AD_MODEL_OBJECT_MAPPING>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[3FA22942DCD0451CAA0E924B30296B8B]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <AD_MODEL_OBJECT_ID><![CDATA[62CA7E15A1D94659808D715D1A6D65F9]]></AD_MODEL_OBJECT_ID>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <MAPPINGNAME><![CDATA[/org.openbravo.advpaymentmngt.ad_actionbutton/MatchTransaction.html]]></MAPPINGNAME>
+<!--3FA22942DCD0451CAA0E924B30296B8B-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--3FA22942DCD0451CAA0E924B30296B8B--></AD_MODEL_OBJECT_MAPPING>
+
 <!--58BB77DE57BB409FB8C66C528C826DBF--><AD_MODEL_OBJECT_MAPPING>
 <!--58BB77DE57BB409FB8C66C528C826DBF-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[58BB77DE57BB409FB8C66C528C826DBF]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--58BB77DE57BB409FB8C66C528C826DBF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -83,6 +83,26 @@
 <!--15C8708DFC464C2D91286E59624FDD18-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--15C8708DFC464C2D91286E59624FDD18--></AD_PROCESS>
 
+<!--19EEA22FCA464979B3ADAD3A967ADA52--><AD_PROCESS>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <AD_PROCESS_ID><![CDATA[19EEA22FCA464979B3ADAD3A967ADA52]]></AD_PROCESS_ID>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <VALUE><![CDATA[APRM_MatchTransaction Force]]></VALUE>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <NAME><![CDATA[Match Statement Force]]></NAME>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ACCESSLEVEL><![CDATA[7]]></ACCESSLEVEL>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--19EEA22FCA464979B3ADAD3A967ADA52--></AD_PROCESS>
+
 <!--29D17F515727436DBCE32BC6CA28382B--><AD_PROCESS>
 <!--29D17F515727436DBCE32BC6CA28382B-->  <AD_PROCESS_ID><![CDATA[29D17F515727436DBCE32BC6CA28382B]]></AD_PROCESS_ID>
 <!--29D17F515727436DBCE32BC6CA28382B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -103,6 +123,26 @@
 <!--29D17F515727436DBCE32BC6CA28382B-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--29D17F515727436DBCE32BC6CA28382B--></AD_PROCESS>
 
+<!--2DDE7D3618034C38A4462B7F3456C28D--><AD_PROCESS>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <AD_PROCESS_ID><![CDATA[2DDE7D3618034C38A4462B7F3456C28D]]></AD_PROCESS_ID>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <VALUE><![CDATA[BankStatementProcessForce]]></VALUE>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <NAME><![CDATA[Bank Statement Process Force]]></NAME>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--2DDE7D3618034C38A4462B7F3456C28D--></AD_PROCESS>
+
 <!--2EED9BC16DB34D2B80BA40A21564BECF--><AD_PROCESS>
 <!--2EED9BC16DB34D2B80BA40A21564BECF-->  <AD_PROCESS_ID><![CDATA[2EED9BC16DB34D2B80BA40A21564BECF]]></AD_PROCESS_ID>
 <!--2EED9BC16DB34D2B80BA40A21564BECF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -269,6 +309,48 @@
 <!--7AC7BE9024E448A0BB863C159DA762F9-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--7AC7BE9024E448A0BB863C159DA762F9--></AD_PROCESS>
 
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F--><AD_PROCESS>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <AD_PROCESS_ID><![CDATA[99B6BF9D733A4AA1BC5BDAD4ACAEFA2F]]></AD_PROCESS_ID>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <VALUE><![CDATA[RecordID2Filling]]></VALUE>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <NAME><![CDATA[RecordID2 Filling Process]]></NAME>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.process.RecordID2Filling]]></CLASSNAME>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISBACKGROUND><![CDATA[Y]]></ISBACKGROUND>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F-->  <PREVENTCONCURRENT><![CDATA[Y]]></PREVENTCONCURRENT>
+<!--99B6BF9D733A4AA1BC5BDAD4ACAEFA2F--></AD_PROCESS>
+
+<!--AA64E3BA23F24D4F8E6B06970500FC70--><AD_PROCESS>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <AD_PROCESS_ID><![CDATA[AA64E3BA23F24D4F8E6B06970500FC70]]></AD_PROCESS_ID>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <VALUE><![CDATA[Record ID2 Filling]]></VALUE>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <NAME><![CDATA[Record ID2 Filling]]></NAME>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.process.RecordID2Filling]]></CLASSNAME>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISBACKGROUND><![CDATA[Y]]></ISBACKGROUND>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--AA64E3BA23F24D4F8E6B06970500FC70--></AD_PROCESS>
+
 <!--B54318B49E984B9CB855AEFB1F474CD6--><AD_PROCESS>
 <!--B54318B49E984B9CB855AEFB1F474CD6-->  <AD_PROCESS_ID><![CDATA[B54318B49E984B9CB855AEFB1F474CD6]]></AD_PROCESS_ID>
 <!--B54318B49E984B9CB855AEFB1F474CD6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -270,6 +270,27 @@
 <!--A7B47A5637A74910ADC70CD66E6C6A29-->  <AD_ELEMENT_ID><![CDATA[210]]></AD_ELEMENT_ID>
 <!--A7B47A5637A74910ADC70CD66E6C6A29--></AD_PROCESS_PARA>
 
+<!--ADC43AD315004E2D8E2802E00C4F178B--><AD_PROCESS_PARA>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_PROCESS_PARA_ID><![CDATA[ADC43AD315004E2D8E2802E00C4F178B]]></AD_PROCESS_PARA_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <NAME><![CDATA[Action]]></NAME>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <DESCRIPTION><![CDATA[A drop down list box indicating the next step to take.]]></DESCRIPTION>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <HELP><![CDATA[The Action field indicates the Action to be performed for this element.]]></HELP>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_PROCESS_ID><![CDATA[2DDE7D3618034C38A4462B7F3456C28D]]></AD_PROCESS_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_REFERENCE_VALUE_ID><![CDATA[EC75B6F5A9504DB6B3F3356EA85F15EE]]></AD_REFERENCE_VALUE_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <COLUMNNAME><![CDATA[action]]></COLUMNNAME>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <DEFAULTVALUE><![CDATA[@EM_APRM_Process_BS@]]></DEFAULTVALUE>
+<!--ADC43AD315004E2D8E2802E00C4F178B-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
+<!--ADC43AD315004E2D8E2802E00C4F178B--></AD_PROCESS_PARA>
+
 <!--D04309BB0DA14B5789FB76C141ED464C--><AD_PROCESS_PARA>
 <!--D04309BB0DA14B5789FB76C141ED464C-->  <AD_PROCESS_PARA_ID><![CDATA[D04309BB0DA14B5789FB76C141ED464C]]></AD_PROCESS_PARA_ID>
 <!--D04309BB0DA14B5789FB76C141ED464C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TREENODE.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TREENODE.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -33,6 +33,17 @@
 <!--17343F20BFD54B3D84900698BBD51451-->  <SEQNO><![CDATA[80]]></SEQNO>
 <!--17343F20BFD54B3D84900698BBD51451--></AD_TREENODE>
 
+<!--3D26FA7567BE46758E76A9B66B1305B1--><AD_TREENODE>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <AD_TREENODE_ID><![CDATA[3D26FA7567BE46758E76A9B66B1305B1]]></AD_TREENODE_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <NODE_ID><![CDATA[47F0FD37150E4FC48AA2479ED7C7A241]]></NODE_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <PARENT_ID><![CDATA[800077]]></PARENT_ID>
+<!--3D26FA7567BE46758E76A9B66B1305B1-->  <SEQNO><![CDATA[155]]></SEQNO>
+<!--3D26FA7567BE46758E76A9B66B1305B1--></AD_TREENODE>
+
 <!--3FD746883F8840E1BED768193D141802--><AD_TREENODE>
 <!--3FD746883F8840E1BED768193D141802-->  <AD_TREENODE_ID><![CDATA[3FD746883F8840E1BED768193D141802]]></AD_TREENODE_ID>
 <!--3FD746883F8840E1BED768193D141802-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Fri Feb 07 12:31:59 2014 +0100
@@ -24,6 +24,7 @@
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -35,6 +36,7 @@
 
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.dao.MatchTransactionDao;
@@ -309,21 +311,17 @@
           strReconciliationId);
       FIN_FinancialAccount financialAccount = MatchTransactionDao.getObject(
           FIN_FinancialAccount.class, strFinancialAccountId);
-      FIN_Reconciliation lastReconciliation = TransactionsDao.getLastReconciliation(OBDal
-          .getInstance().get(FIN_FinancialAccount.class, strFinancialAccountId), "Y");
-      BigDecimal unreconciledInLastReconciliation = BigDecimal.ZERO;
-      if (lastReconciliation != null) {
-        unreconciledInLastReconciliation = MatchTransactionDao
-            .getLastReconciliationUnmatchedBalance(lastReconciliation);
+      if (MatchTransactionDao.islastreconciliation(reconciliation)) {
+        Date maxBSLDate = MatchTransactionDao.getBankStatementLineMaxDate(financialAccount);
+        reconciliation.setEndingDate(maxBSLDate);
+        reconciliation.setTransactionDate(maxBSLDate);
+      } else {
+        Date maxClearItemDate = getClearItemsMaxDate(reconciliation);
+        reconciliation.setEndingDate(maxClearItemDate);
+        reconciliation.setTransactionDate(maxClearItemDate);
       }
-      // This is needed to allow completing a reconciliation with unmatched bank statement lines
-      reconciliation.setEndingBalance(reconciliation.getStartingbalance()
-          .subtract(unreconciledInLastReconciliation)
-          .add(MatchTransactionDao.getReconciliationEndingBalance(reconciliation)));
-      reconciliation.setEndingDate(MatchTransactionDao
-          .getBankStatementLineMaxDate(financialAccount));
-      reconciliation.setTransactionDate(MatchTransactionDao
-          .getBankStatementLineMaxDate(financialAccount));
+      reconciliation.setEndingBalance(MatchTransactionDao.getEndingBalance(reconciliation));
+
       if (!process) {
         reconciliation.setProcessed(false);
         reconciliation.setDocumentStatus("DR");
@@ -349,6 +347,17 @@
     return true;
   }
 
+  private Date getClearItemsMaxDate(FIN_Reconciliation reconciliation) {
+    OBCriteria<FIN_ReconciliationLine_v> obc = OBDal.getInstance().createCriteria(
+        FIN_ReconciliationLine_v.class);
+    obc.setFilterOnReadableClients(false);
+    obc.setFilterOnReadableOrganization(false);
+    obc.add(Restrictions.eq(FIN_ReconciliationLine_v.PROPERTY_RECONCILIATION, reconciliation));
+    obc.addOrder(Order.desc(FIN_ReconciliationLine_v.PROPERTY_TRANSACTIONDATE));
+    obc.setMaxResults(1);
+    return ((FIN_ReconciliationLine_v) obc.uniqueResult()).getTransactionDate();
+  }
+
   private void printPage(HttpServletResponse response, VariablesSecureApp vars, String strOrgId,
       String strWindowId, String strTabId, String strPaymentTypeFilter,
       String strFinancialAccountId, String reconciliationId, String strShowCleared,
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Fri Feb 07 12:31:59 2014 +0100
@@ -26,6 +26,7 @@
 
 import javax.servlet.ServletException;
 
+import org.hibernate.criterion.Order;
 import org.hibernate.criterion.ProjectionList;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
@@ -148,7 +149,7 @@
           .getReconciliationLastAmount(financialAccount);
       OBDal.getInstance().save(newData);
       OBDal.getInstance().flush();
-      newData.setEndingBalance(startingBalance.add(getReconciliationEndingBalance(newData)));
+      newData.setEndingBalance(getEndingBalance(newData));
       newData.setStartingbalance(startingBalance != null ? startingBalance : BigDecimal.ZERO);
 
       OBDal.getInstance().save(newData);
@@ -163,8 +164,10 @@
   public static List<FIN_BankStatementLine> getMatchingBankStatementLines(
       String strFinancialAccountId, String strReconciliationId, String strPaymentTypeFilter,
       String strShowCleared) {
+    FIN_Reconciliation reconciliation = OBDal.getInstance().get(FIN_Reconciliation.class,
+        strReconciliationId);
+    boolean isLastReconciliation = islastreconciliation(reconciliation);
     final StringBuilder whereClause = new StringBuilder();
-
     whereClause.append(" as bsl ");
     whereClause.append(" left outer join bsl.financialAccountTransaction as fat");
     whereClause.append(" where bsl.").append(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT);
@@ -182,6 +185,10 @@
       whereClause.append("   or bsl.").append(FIN_BankStatementLine.PROPERTY_CRAMOUNT);
       whereClause.append(" = 0) ");
     }
+    if (!isLastReconciliation) {
+      whereClause.append(" and  bsl.").append(FIN_BankStatementLine.PROPERTY_TRANSACTIONDATE)
+          .append(" <= :endingdate");
+    }
     whereClause.append("   and (fat is null");
     whereClause.append("   or (fat.").append(FIN_FinaccTransaction.PROPERTY_RECONCILIATION);
     whereClause.append(".id = '").append(strReconciliationId).append("'");
@@ -196,8 +203,19 @@
     whereClause.append(", bsl.").append(FIN_BankStatementLine.PROPERTY_BPARTNERNAME);
     final OBQuery<FIN_BankStatementLine> obData = OBDal.getInstance().createQuery(
         FIN_BankStatementLine.class, whereClause.toString());
+    if (!isLastReconciliation) {
+      obData.setNamedParameter("endingdate",
+          OBDal.getInstance().get(FIN_Reconciliation.class, strReconciliationId).getEndingDate());
+    }
+    return obData.list();
+  }
 
-    return obData.list();
+  public static boolean islastreconciliation(FIN_Reconciliation reconciliation) {
+    if (MatchTransactionDao.getReconciliationListAfterDate(reconciliation).size() > 0) {
+      return false;
+    } else {
+      return true;
+    }
   }
 
   public static List<FIN_BankStatementLine> getUnMatchedBankStatementLines(
@@ -470,6 +488,7 @@
    *          Reconciliation.
    * @return Ending balance of an automatic reconciliation.
    */
+  @Deprecated
   public static BigDecimal getReconciliationEndingBalance(FIN_Reconciliation reconciliation) {
     BigDecimal total = BigDecimal.ZERO;
     OBContext.setAdminMode(true);
@@ -582,4 +601,83 @@
     }
     return reconciliations;
   }
+
+  public static BigDecimal getEndingBalance(FIN_Reconciliation reconciliation) {
+    OBContext.setAdminMode(false);
+    try {
+      BigDecimal endingBalance = reconciliation.getAccount().getInitialBalance();
+      endingBalance = endingBalance
+          .add(getBSLAmount(reconciliation, reconciliation.getEndingDate()));
+      return endingBalance;
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  private static BigDecimal getBSLAmount(FIN_Reconciliation reconciliation, Date date) {
+    BigDecimal total = BigDecimal.ZERO;
+    OBContext.setAdminMode(false);
+    try {
+      OBCriteria<FIN_BankStatementLine> obcBsl = OBDal.getInstance().createCriteria(
+          FIN_BankStatementLine.class);
+      obcBsl.createAlias(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT, "bs");
+      obcBsl.createAlias(FIN_BankStatementLine.PROPERTY_FINANCIALACCOUNTTRANSACTION, "tr",
+          OBCriteria.LEFT_JOIN);
+      obcBsl.add(Restrictions.eq("bs." + FIN_BankStatement.PROPERTY_ACCOUNT,
+          reconciliation.getAccount()));
+      obcBsl.add(Restrictions.eq("bs." + FIN_BankStatement.PROPERTY_PROCESSED, true));
+      obcBsl.add(Restrictions.le(FIN_BankStatementLine.PROPERTY_TRANSACTIONDATE, date));
+      ProjectionList projections = Projections.projectionList();
+      projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_CRAMOUNT));
+      projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
+      obcBsl.setProjection(projections);
+
+      @SuppressWarnings("rawtypes")
+      List o = obcBsl.list();
+      if (o != null && o.size() > 0) {
+        Object[] resultSet = (Object[]) o.get(0);
+        BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] : BigDecimal.ZERO;
+        BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] : BigDecimal.ZERO;
+        total = credit.subtract(debit);
+      }
+      o.clear();
+
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return total;
+  }
+
+  public static BigDecimal getStartingBalance(FIN_Reconciliation reconciliation) {
+    OBContext.setAdminMode(false);
+    try {
+      BigDecimal statingBalance = reconciliation.getAccount().getInitialBalance();
+      FIN_Reconciliation previousReconciliation = getPreviousReconciliation(reconciliation);
+      if (previousReconciliation != null) {
+        statingBalance = previousReconciliation.getEndingBalance();
+      }
+      return statingBalance;
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  private static FIN_Reconciliation getPreviousReconciliation(FIN_Reconciliation reconciliation) {
+    OBContext.setAdminMode(false);
+    try {
+      final OBCriteria<FIN_Reconciliation> obc = OBDal.getInstance().createCriteria(
+          FIN_Reconciliation.class);
+      obc.add(Restrictions.le(FIN_Reconciliation.PROPERTY_ENDINGDATE,
+          reconciliation.getEndingDate()));
+      obc.add(Restrictions.lt(FIN_Reconciliation.PROPERTY_CREATIONDATE,
+          reconciliation.getCreationDate()));
+      obc.add(Restrictions.eq(FIN_Reconciliation.PROPERTY_ACCOUNT, reconciliation.getAccount()));
+      obc.addOrder(Order.desc(FIN_Reconciliation.PROPERTY_ENDINGDATE));
+      obc.addOrder(Order.desc(FIN_Reconciliation.PROPERTY_CREATIONDATE));
+      obc.setMaxResults(1);
+      return (FIN_Reconciliation) obc.uniqueResult();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Fri Feb 07 12:31:59 2014 +0100
@@ -4,9 +4,13 @@
 import java.util.Date;
 import java.util.List;
 
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.advpaymentmngt.dao.MatchTransactionDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.database.ConnectionProvider;
@@ -38,6 +42,8 @@
       final VariablesSecureApp vars = bundle.getContext().toVars();
       final ConnectionProvider conProvider = bundle.getConnection();
       final String language = bundle.getContext().getLanguage();
+      final boolean isForceProcess = (Boolean) "2DDE7D3618034C38A4462B7F3456C28D".equals(bundle
+          .getProcessId());
 
       bankStatement.setProcessNow(true);
       OBDal.getInstance().save(bankStatement);
@@ -49,9 +55,9 @@
         // ***********************
 
         // Check all dates are after last reconciliation date or last transaction date of previous
-        // bank statements.
-        Date maxBSLDate = getMaxBSLDate(bankStatement.getAccount(), bankStatement);
-        if (maxBSLDate != null) {
+        // bank statements. Skip when force
+        Date maxBSLDate = getMaxBSLDate(bankStatement);
+        if (maxBSLDate != null && !isForceProcess) {
           for (FIN_BankStatementLine bsl : bankStatement.getFINBankStatementLineList()) {
             if (bsl.getTransactionDate().compareTo(maxBSLDate) <= 0) {
               if (!msg.getMessage().equals("")) {
@@ -70,14 +76,18 @@
             }
           }
         }
-
         if (msg.getType() != null && !msg.getType().toLowerCase().equals("warning")) {
           // Success
           bankStatement.setProcessed(true);
           bankStatement.setAPRMProcessBankStatement("R");
+          bankStatement.setAPRMProcessBankStatementForce("R");
           OBDal.getInstance().save(bankStatement);
           OBDal.getInstance().flush();
         }
+        if (isForceProcess) {
+          // Update affected Reconciliations
+          updateAffectedReconciliations(bankStatement);
+        }
       } else if (strAction.equals("R")) {
         // *************************
         // Reactivate Bank Statement
@@ -91,20 +101,23 @@
           bundle.setResult(msg);
           return;
         }
-        // Already Reconciled
-        for (FIN_BankStatementLine bsl : bankStatement.getFINBankStatementLineList()) {
-          if (bsl.getFinancialAccountTransaction() != null) {
-            msg.setType("Error");
-            msg.setTitle(Utility.messageBD(conProvider, "Error", language));
-            msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
-                "@APRM_BSLineReconciled@" + ": " + bsl.getLineNo().toString()));
-            bundle.setResult(msg);
-            return;
+        if (!isForceProcess) {
+          // Already Reconciled
+          for (FIN_BankStatementLine bsl : bankStatement.getFINBankStatementLineList()) {
+            if (bsl.getFinancialAccountTransaction() != null) {
+              msg.setType("Error");
+              msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+              msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
+                  "@APRM_BSLineReconciled@" + ": " + bsl.getLineNo().toString()));
+              bundle.setResult(msg);
+              return;
+            }
           }
         }
 
         bankStatement.setProcessed(false);
         bankStatement.setAPRMProcessBankStatement("P");
+        bankStatement.setAPRMProcessBankStatementForce("P");
         OBDal.getInstance().save(bankStatement);
         OBDal.getInstance().flush();
       }
@@ -126,7 +139,7 @@
 
   }
 
-  private Date getMaxBSLDate(FIN_FinancialAccount account, FIN_BankStatement bankstatement) {
+  private Date getMaxBSLDate(FIN_BankStatement bankstatement) {
     // Get last transaction date from previous bank statements
     final StringBuilder whereClause = new StringBuilder();
     List<Object> parameters = new ArrayList<Object>();
@@ -134,7 +147,7 @@
     whereClause.append(" where bsl.");
     whereClause.append(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT);
     whereClause.append("." + FIN_BankStatement.PROPERTY_ACCOUNT + " = ?");
-    parameters.add(account);
+    parameters.add(bankstatement.getAccount());
     whereClause.append(" and bsl." + FIN_BankStatementLine.PROPERTY_BANKSTATEMENT + " <> ?");
     parameters.add(bankstatement);
     whereClause.append(" and bsl.bankStatement.processed = 'Y'");
@@ -149,7 +162,7 @@
 
     // If no previous bank statement is found get the ending date of the last reconciliation
     FIN_Reconciliation rec = org.openbravo.advpaymentmngt.dao.TransactionsDao
-        .getLastReconciliation(account, "Y");
+        .getLastReconciliation(bankstatement.getAccount(), "Y");
     org.openbravo.dal.core.OBContext.setAdminMode(true);
     try {
       return (rec == null) ? null : rec.getEndingDate();
@@ -157,4 +170,63 @@
       org.openbravo.dal.core.OBContext.restorePreviousMode();
     }
   }
+
+  private Date getBankStatementLineMinDate(FIN_BankStatement bankStatement) {
+    OBContext.setAdminMode();
+    Date minDate = new Date();
+    try {
+      final OBCriteria<FIN_BankStatementLine> obc = OBDal.getInstance().createCriteria(
+          FIN_BankStatementLine.class);
+      obc.createAlias(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT, "bs");
+      obc.add(Restrictions.eq("bs." + FIN_BankStatement.PROPERTY_ID, bankStatement.getId()));
+      obc.addOrderBy(FIN_BankStatementLine.PROPERTY_TRANSACTIONDATE, true);
+      obc.setMaxResults(1);
+      final List<FIN_BankStatementLine> bst = obc.list();
+      if (bst.size() == 0)
+        return minDate;
+      minDate = bst.get(0).getTransactionDate();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return minDate;
+  }
+
+  private void updateAffectedReconciliations(FIN_BankStatement bankStatement) {
+    List<FIN_Reconciliation> affectedReconciliations = getAffectedReconciliations(
+        bankStatement.getAccount(), getBankStatementLineMinDate(bankStatement));
+    for (FIN_Reconciliation rec : affectedReconciliations) {
+      updateReconciliation(rec);
+    }
+
+  }
+
+  private List<FIN_Reconciliation> getAffectedReconciliations(FIN_FinancialAccount account,
+      Date bankStatementLineMinDate) {
+    OBContext.setAdminMode();
+    try {
+      final OBCriteria<FIN_Reconciliation> obc = OBDal.getInstance().createCriteria(
+          FIN_Reconciliation.class);
+      obc.add(Restrictions.eq(FIN_Reconciliation.PROPERTY_ACCOUNT, account));
+      obc.add(Restrictions.ge(FIN_Reconciliation.PROPERTY_ENDINGDATE, bankStatementLineMinDate));
+      obc.setMaxResults(1);
+      return obc.list();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  private void updateReconciliation(FIN_Reconciliation reconciliation) {
+    OBContext.setAdminMode(false);
+    try {
+      // This is needed to allow completing a reconciliation with unmatched bank statement lines
+      reconciliation.setStartingbalance(MatchTransactionDao.getStartingBalance(reconciliation));
+      reconciliation.setEndingBalance(MatchTransactionDao.getEndingBalance(reconciliation));
+      OBDal.getInstance().save(reconciliation);
+      OBDal.getInstance().flush();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return;
+  }
+
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Fri Feb 07 12:31:59 2014 +0100
@@ -23,6 +23,7 @@
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
+import org.openbravo.advpaymentmngt.dao.MatchTransactionDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
@@ -33,7 +34,6 @@
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
-import org.openbravo.model.financialmgmt.payment.FIN_BankStatement;
 import org.openbravo.model.financialmgmt.payment.FIN_Reconciliation;
 import org.openbravo.model.financialmgmt.payment.FIN_ReconciliationLine_v;
 import org.openbravo.scheduling.ProcessBundle;
@@ -98,6 +98,7 @@
             }
           }
         }
+        updateReconciliations(reconciliation);
         reconciliation.setProcessed(true);
         reconciliation.setAPRMProcessReconciliation("R");
         reconciliation.setAprmProcessRec("R");
@@ -119,14 +120,14 @@
           return;
         }
         // Transaction exists
-        if (!isLastReconciliation(reconciliation)) {
-          msg.setType("Error");
-          msg.setTitle(Utility.messageBD(conProvider, "Error", language));
-          msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
-              "@APRM_FutureReconciliationExists@"));
-          bundle.setResult(msg);
-          return;
-        }
+        // if (!isLastReconciliation(reconciliation)) {
+        // msg.setType("Error");
+        // msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+        // msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
+        // "@APRM_FutureReconciliationExists@"));
+        // bundle.setResult(msg);
+        // return;
+        // }
         reconciliation.setProcessed(false);
         OBDal.getInstance().save(reconciliation);
         OBDal.getInstance().flush();
@@ -153,39 +154,34 @@
     }
   }
 
-  private boolean isLastReconciliation(FIN_Reconciliation reconciliation) {
+  private void updateReconciliations(FIN_Reconciliation reconciliation) {
     final OBCriteria<FIN_Reconciliation> obc = OBDal.getInstance().createCriteria(
         FIN_Reconciliation.class);
     obc.add(Restrictions.ge(FIN_Reconciliation.PROPERTY_ENDINGDATE, reconciliation.getEndingDate()));
-    obc.add(Restrictions.gt(FIN_Reconciliation.PROPERTY_CREATIONDATE,
+    obc.add(Restrictions.ge(FIN_Reconciliation.PROPERTY_CREATIONDATE,
         reconciliation.getCreationDate()));
     obc.add(Restrictions.eq(FIN_Reconciliation.PROPERTY_ACCOUNT, reconciliation.getAccount()));
     obc.addOrder(Order.asc(FIN_Reconciliation.PROPERTY_ENDINGDATE));
     obc.addOrder(Order.asc(FIN_Reconciliation.PROPERTY_CREATIONDATE));
     final List<FIN_Reconciliation> reconciliations = obc.list();
-    if (reconciliations.size() == 0) {
-      return true;
-    } else if (reconciliations.size() == 1) {
-      if (reconciliations.get(0).isProcessed()) {
-        return false;
-      } else if (reconciliations.get(0).getFINReconciliationLineVList().size() == 0) {
-        FIN_Reconciliation reconciliationToDelete = OBDal.getInstance().get(
-            FIN_Reconciliation.class, reconciliations.get(0).getId());
-        for (FIN_BankStatement bst : reconciliationToDelete.getFINBankStatementList()) {
-          FIN_BankStatement bankstatement = OBDal.getInstance().get(FIN_BankStatement.class,
-              bst.getId());
-          bankstatement.setFINReconciliation(null);
-          OBDal.getInstance().save(bankstatement);
-          OBDal.getInstance().flush();
-        }
-        OBDal.getInstance().remove(reconciliationToDelete);
-        OBDal.getInstance().flush();
-        return true;
-      } else {
-        return false;
-      }
-    } else {
-      return false;
+    for (FIN_Reconciliation rec : reconciliations) {
+      updateReconciliation(rec);
     }
+    return;
   }
+
+  private void updateReconciliation(FIN_Reconciliation reconciliation) {
+    OBContext.setAdminMode(false);
+    try {
+      // This is needed to allow completing a reconciliation with unmatched bank statement lines
+      reconciliation.setStartingbalance(MatchTransactionDao.getStartingBalance(reconciliation));
+      reconciliation.setEndingBalance(MatchTransactionDao.getEndingBalance(reconciliation));
+      OBDal.getInstance().save(reconciliation);
+      OBDal.getInstance().flush();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return;
+  }
+
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Fri Feb 07 12:31:59 2014 +0100
@@ -36,6 +36,7 @@
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
+import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
@@ -158,6 +159,9 @@
 
     try {
       bankStatementLines = loadFile(file, bankStatement);
+    } catch (OBException e) {
+      OBDal.getInstance().rollbackAndClose();
+      return getOBError(conn, vars, e.getMessage(), "Error", "Error");
     } catch (Exception e) {
       OBDal.getInstance().rollbackAndClose();
       return getOBError(conn, vars, "@APRM_InvalidOrMissingValues@", "Error", "Error");
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Thu Feb 06 15:52:22 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Fri Feb 07 12:31:59 2014 +0100
@@ -253,6 +253,7 @@
 
     if (!multiSelect) {
       OB.Utilities.fixNull250(currentValues);
+      OB.Utilities.fixNull250(context);
 
       this.visible = !this.displayIf || (context && this.displayIf(this.contextView.viewForm, currentValues, context));
       readonly = this.readOnlyIf && context && this.readOnlyIf(this.contextView.viewForm, currentValues, context);
--- a/src-db/database/model/tables/FACT_ACCT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/src-db/database/model/tables/FACT_ACCT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -205,6 +205,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <column name="DATEBALANCED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_FACT_ACCT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
@@ -292,9 +296,18 @@
       <index name="FACT_ACCT_DATEACCT" unique="false">
         <index-column name="DATEACCT"/>
       </index>
+      <index name="FACT_ACCT_DATEBALANCED" unique="false">
+        <index-column name="DATEBALANCED"/>
+      </index>
+      <index name="FACT_ACCT_FACT_ACCT_GROUP_ID" unique="false">
+        <index-column name="FACT_ACCT_GROUP_ID"/>
+      </index>
       <index name="FACT_ACCT_GROUP" unique="false">
         <index-column name="FACT_ACCT_GROUP_ID"/>
       </index>
+      <index name="FACT_ACCT_RECORD_ID2" unique="false">
+        <index-column name="RECORD_ID2"/>
+      </index>
       <index name="FACT_ACCT_TABLE_RECORD_ID" unique="false">
         <index-column name="AD_TABLE_ID"/>
         <index-column name="RECORD_ID"/>
--- a/src-db/database/model/triggers/C_ORDER_TRG.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/src-db/database/model/triggers/C_ORDER_TRG.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -54,11 +54,14 @@
     )
     THEN  RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
-  -- Propagate Description changes
-  UPDATE C_Invoice
-   SET Description=:new.Description,
-   POReference=:new.POReference
-  WHERE C_Order_ID=:new.C_Order_ID;
+    IF (COALESCE(:old.POReference, '.') <> COALESCE(:NEW.POReference, '.')
+    OR COALESCE(:old.Description, '0') <> COALESCE(:NEW.Description, '0')) THEN
+		  -- Propagate Description changes
+		  UPDATE C_Invoice
+		   SET Description=:new.Description,
+		   POReference=:new.POReference
+		  WHERE C_Order_ID=:new.C_Order_ID;
+		END IF;
   END IF;
  END IF;
 END C_ORDER_TRG
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -996,6 +996,17 @@
 <!--1FEA6AF375714E1A962C67E094001342-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1FEA6AF375714E1A962C67E094001342--></AD_AUXILIARINPUT>
 
+<!--1FF62A68BA95425CA76E4317DD195C62--><AD_AUXILIARINPUT>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <AD_AUXILIARINPUT_ID><![CDATA[1FF62A68BA95425CA76E4317DD195C62]]></AD_AUXILIARINPUT_ID>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <AD_TAB_ID><![CDATA[2845D761A8394468BD3BA4710AA888D4]]></AD_TAB_ID>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <NAME><![CDATA[DRAFTRECONCILIATION]]></NAME>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <CODE><![CDATA[@SQL=select coalesce(fin_reconciliation_id,'') from fin_reconciliation where fin_financial_account_id = @FIN_Financial_Account_ID@ and processed = 'N']]></CODE>
+<!--1FF62A68BA95425CA76E4317DD195C62-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1FF62A68BA95425CA76E4317DD195C62--></AD_AUXILIARINPUT>
+
 <!--21B56210EEAD4C08AB3A0A1A4F781FE6--><AD_AUXILIARINPUT>
 <!--21B56210EEAD4C08AB3A0A1A4F781FE6-->  <AD_AUXILIARINPUT_ID><![CDATA[21B56210EEAD4C08AB3A0A1A4F781FE6]]></AD_AUXILIARINPUT_ID>
 <!--21B56210EEAD4C08AB3A0A1A4F781FE6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1660,6 +1671,20 @@
 <!--4D9613116EAA46A585AEDB75237D5140-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4D9613116EAA46A585AEDB75237D5140--></AD_AUXILIARINPUT>
 
+<!--4FD70C86888041D695C59CFA792BBCC6--><AD_AUXILIARINPUT>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <AD_AUXILIARINPUT_ID><![CDATA[4FD70C86888041D695C59CFA792BBCC6]]></AD_AUXILIARINPUT_ID>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <AD_TAB_ID><![CDATA[2845D761A8394468BD3BA4710AA888D4]]></AD_TAB_ID>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <NAME><![CDATA[LASTRECON]]></NAME>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <CODE><![CDATA[@SQL=select fin_reconciliation_id from fin_reconciliation where created = (
+select max(created)
+from fin_reconciliation 
+where fin_financial_account_id = @FIN_Financial_Account_ID@)]]></CODE>
+<!--4FD70C86888041D695C59CFA792BBCC6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4FD70C86888041D695C59CFA792BBCC6--></AD_AUXILIARINPUT>
+
 <!--51568B79156646C8966F49F82EE51CB7--><AD_AUXILIARINPUT>
 <!--51568B79156646C8966F49F82EE51CB7-->  <AD_AUXILIARINPUT_ID><![CDATA[51568B79156646C8966F49F82EE51CB7]]></AD_AUXILIARINPUT_ID>
 <!--51568B79156646C8966F49F82EE51CB7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -224495,7 +224495,7 @@
 <!--196BCA9A6C8A4515874C148207641D7D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--196BCA9A6C8A4515874C148207641D7D-->  <POSITION><![CDATA[32]]></POSITION>
+<!--196BCA9A6C8A4515874C148207641D7D-->  <POSITION><![CDATA[34]]></POSITION>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--196BCA9A6C8A4515874C148207641D7D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -231676,7 +231676,7 @@
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--3D20749B2D1642F591849DA6CD6EB654-->  <POSITION><![CDATA[35]]></POSITION>
+<!--3D20749B2D1642F591849DA6CD6EB654-->  <POSITION><![CDATA[31]]></POSITION>
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -233732,7 +233732,7 @@
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <POSITION><![CDATA[34]]></POSITION>
+<!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <POSITION><![CDATA[30]]></POSITION>
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--47254BD6EF8D4F4D97DE902FDEC55DAC-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -237685,7 +237685,7 @@
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--55A52C1851AE437B8C967DDEAE65D9B8-->  <POSITION><![CDATA[31]]></POSITION>
+<!--55A52C1851AE437B8C967DDEAE65D9B8-->  <POSITION><![CDATA[33]]></POSITION>
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--55A52C1851AE437B8C967DDEAE65D9B8-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -283648,6 +283648,41 @@
 <!--8D34A048C2274A2581074DB0418AE215-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--8D34A048C2274A2581074DB0418AE215--></AD_COLUMN>
 
+<!--8D4B933B1BE54B01A42A56C54AE02A13--><AD_COLUMN>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_COLUMN_ID><![CDATA[8D4B933B1BE54B01A42A56C54AE02A13]]></AD_COLUMN_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <NAME><![CDATA[Date Balanced]]></NAME>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <DESCRIPTION><![CDATA[Date on which an entry gets balanced]]></DESCRIPTION>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <HELP><![CDATA[Used for certain accounts to set the date on which the account gets balance equal zero. This is used to exclude entries which are no longer open items. Useful to reduce number of entries to be reviewed]]></HELP>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <COLUMNNAME><![CDATA[Datebalanced]]></COLUMNNAME>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_TABLE_ID><![CDATA[270]]></AD_TABLE_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <SEQNO><![CDATA[131]]></SEQNO>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_ELEMENT_ID><![CDATA[93E29B3166F44C4D8C4BD58A5BC61AE9]]></AD_ELEMENT_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <POSITION><![CDATA[53]]></POSITION>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--8D4B933B1BE54B01A42A56C54AE02A13-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--8D4B933B1BE54B01A42A56C54AE02A13--></AD_COLUMN>
+
 <!--8D6169322485477F8D53E2E246723D3A--><AD_COLUMN>
 <!--8D6169322485477F8D53E2E246723D3A-->  <AD_COLUMN_ID><![CDATA[8D6169322485477F8D53E2E246723D3A]]></AD_COLUMN_ID>
 <!--8D6169322485477F8D53E2E246723D3A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -290814,7 +290849,7 @@
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <POSITION><![CDATA[30]]></POSITION>
+<!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <POSITION><![CDATA[32]]></POSITION>
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--9ECAE2711AFE4A1D8EF9CCA5652470CD-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Feb 06 15:52:22 2014 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Feb 07 12:31:59 2014 +0100
@@ -28417,6 +28417,20 @@
 <!--9397E02890444B43E040007F0100749D-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--9397E02890444B43E040007F0100749D--></AD_ELEMENT>
 
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9--><AD_ELEMENT>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <AD_ELEMENT_ID><![CDATA[93E29B3166F44C4D8C4BD58A5BC61AE9]]></AD_ELEMENT_ID>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <COLUMNNAME><![CDATA[Datebalanced]]></COLUMNNAME>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <NAME><![CDATA[Date Balanced]]></NAME>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <PRINTNAME><![CDATA[Date Balanced]]></PRINTNAME>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <DESCRIPTION><![CDATA[Date on which an entry gets balanced]]></DESCRIPTION>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <HELP><![CDATA[Used for certain accounts to set the date on which the account gets balance equal zero. This is used to exclude entries which are no longer open items. Useful to reduce number of entries to be reviewed]]></HELP>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--93E29B3166F44C4D8C4BD58A5BC61AE9--></AD_ELEMENT>
+
 <!--949DE0539399B12AE040A8C0BD0626B6--><AD_ELEMENT>
 <!--949DE0539399B12AE040A8C0BD0626B6-->  <AD_ELEMENT_ID><![CDATA[949DE0539399B12AE040A8C0BD0626B6]]></AD_ELEMENT_ID>
 <!--949DE0539399B12AE040A8C0BD0626B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>