Fixes bug 0015504: Implement procedure to rollback reconciliations
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Tue, 08 Mar 2011 11:19:07 +0100
changeset 11077 e512eb8da0b2
parent 11076 819314bb0020
child 11080 b0b6a4571a0b
Fixes bug 0015504: Implement procedure to rollback reconciliations
modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_RECONCILIATION.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_RECONCILIATION_V.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_MESSAGE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.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_REFERENCE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_VAL_RULE.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/Reconciliation.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
src-db/database/sourcedata/AD_REF_LIST.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_RECONCILIATION.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+  <database name="MODIFIED TABLE FIN_RECONCILIATION">
+    <table name="FIN_RECONCILIATION" primaryKey="FIN_RECONCILIATION_KEY">
+      <column name="EM_APRM_PROCESS_RECONCILIATION" 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/views/APRM_RECONCILIATION_V.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/views/APRM_RECONCILIATION_V.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW APRM_RECONCILIATION_V">
-    <view name="APRM_RECONCILIATION_V"><![CDATA[SELECT fin_reconciliation.fin_reconciliation_id AS aprm_reconciliation_v_id, fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive, fin_reconciliation.fin_financial_account_id, fin_reconciliation.documentno, fin_reconciliation.c_doctype_id, fin_reconciliation.dateto, fin_reconciliation.statementdate, fin_reconciliation.endingbalance, fin_reconciliation.startingbalance, fin_reconciliation.docstatus, fin_reconciliation.processing, fin_reconciliation.processed, fin_reconciliation.posted, fin_reconciliation.printdetailed, fin_reconciliation.printsummary, COALESCE(item.item_no, 0) AS item_no, COALESCE(item.item_amt, 0) AS item_amt, COALESCE(unrec.unrec_no, 0) AS unrec_no, COALESCE(unrec.unrec_amt, 0) AS unrec_amt, COALESCE(outstanding.payment_no, 0) AS payment_no, COALESCE(outstanding.payment_amt, 0) AS payment_amt, COALESCE(outstanding.deposit_no, 0) AS deposit_no, COALESCE(outstanding.deposit_amt, 0) AS deposit_amt, (SELECT ad_table.ad_table_id
+    <view name="APRM_RECONCILIATION_V"><![CDATA[SELECT fin_reconciliation.fin_reconciliation_id AS aprm_reconciliation_v_id, fin_reconciliation.fin_reconciliation_id, fin_reconciliation.ad_client_id, fin_reconciliation.ad_org_id, fin_reconciliation.created, fin_reconciliation.createdby, fin_reconciliation.updated, fin_reconciliation.updatedby, fin_reconciliation.isactive, fin_reconciliation.fin_financial_account_id, fin_reconciliation.documentno, fin_reconciliation.c_doctype_id, fin_reconciliation.dateto, fin_reconciliation.statementdate, fin_reconciliation.endingbalance, fin_reconciliation.startingbalance, fin_reconciliation.docstatus, fin_reconciliation.processing, fin_reconciliation.processed, fin_reconciliation.posted, fin_reconciliation.printdetailed, fin_reconciliation.em_aprm_process_reconciliation, fin_reconciliation.printsummary, COALESCE(item.item_no, 0) AS item_no, COALESCE(item.item_amt, 0) AS item_amt, COALESCE(unrec.unrec_no, 0) AS unrec_no, COALESCE(unrec.unrec_amt, 0) AS unrec_amt, COALESCE(outstanding.payment_no, 0) AS payment_no, COALESCE(outstanding.payment_amt, 0) AS payment_amt, COALESCE(outstanding.deposit_no, 0) AS deposit_no, COALESCE(outstanding.deposit_amt, 0) AS deposit_amt, (SELECT ad_table.ad_table_id
 FROM ad_table
 WHERE lower(ad_table.tablename) = 'fin_reconciliation') AS forced_table_id
 FROM fin_reconciliation
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -666,6 +666,41 @@
 <!--57D5BC1D263243128DCD16E2836AE3E1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--57D5BC1D263243128DCD16E2836AE3E1--></AD_COLUMN>
 
+<!--63454E73F07B4C908EB1268C41F5DE8A--><AD_COLUMN>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_COLUMN_ID><![CDATA[63454E73F07B4C908EB1268C41F5DE8A]]></AD_COLUMN_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <NAME><![CDATA[Process Reconciliation]]></NAME>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <DESCRIPTION><![CDATA[Process Reconciliation Document]]></DESCRIPTION>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <HELP><![CDATA[Used to process and reactivate reconciliation documents]]></HELP>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <COLUMNNAME><![CDATA[EM_APRM_Process_Reconciliation]]></COLUMNNAME>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_TABLE_ID><![CDATA[0DFF5BACFB964FDABAA5042C8809C813]]></AD_TABLE_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_REFERENCE_VALUE_ID><![CDATA[36972531DA994BB38ECB91993058282F]]></AD_REFERENCE_VALUE_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <SEQNO><![CDATA[350]]></SEQNO>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_ELEMENT_ID><![CDATA[C8E8009C6BF5427EA930515F217F768E]]></AD_ELEMENT_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_PROCESS_ID><![CDATA[FF8080812E2F8EAE012E2F94CF470014]]></AD_PROCESS_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <POSITION><![CDATA[23]]></POSITION>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <ISAUTOSAVE><![CDATA[N]]></ISAUTOSAVE>
+<!--63454E73F07B4C908EB1268C41F5DE8A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--63454E73F07B4C908EB1268C41F5DE8A--></AD_COLUMN>
+
 <!--68C853FD393C4620A3947EC34C416B9A--><AD_COLUMN>
 <!--68C853FD393C4620A3947EC34C416B9A-->  <AD_COLUMN_ID><![CDATA[68C853FD393C4620A3947EC34C416B9A]]></AD_COLUMN_ID>
 <!--68C853FD393C4620A3947EC34C416B9A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1762,7 +1797,7 @@
 <!--82EFB8E4045319C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045319C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045319C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045319C9E040007F01003778-->  <POSITION><![CDATA[23]]></POSITION>
+<!--82EFB8E4045319C9E040007F01003778-->  <POSITION><![CDATA[24]]></POSITION>
 <!--82EFB8E4045319C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045319C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045319C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1793,7 +1828,7 @@
 <!--82EFB8E4045419C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045419C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045419C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045419C9E040007F01003778-->  <POSITION><![CDATA[24]]></POSITION>
+<!--82EFB8E4045419C9E040007F01003778-->  <POSITION><![CDATA[25]]></POSITION>
 <!--82EFB8E4045419C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045419C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045419C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1824,7 +1859,7 @@
 <!--82EFB8E4045519C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045519C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045519C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045519C9E040007F01003778-->  <POSITION><![CDATA[25]]></POSITION>
+<!--82EFB8E4045519C9E040007F01003778-->  <POSITION><![CDATA[26]]></POSITION>
 <!--82EFB8E4045519C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045519C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045519C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1855,7 +1890,7 @@
 <!--82EFB8E4045619C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045619C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045619C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045619C9E040007F01003778-->  <POSITION><![CDATA[26]]></POSITION>
+<!--82EFB8E4045619C9E040007F01003778-->  <POSITION><![CDATA[27]]></POSITION>
 <!--82EFB8E4045619C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045619C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045619C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1886,7 +1921,7 @@
 <!--82EFB8E4045719C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045719C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045719C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045719C9E040007F01003778-->  <POSITION><![CDATA[27]]></POSITION>
+<!--82EFB8E4045719C9E040007F01003778-->  <POSITION><![CDATA[28]]></POSITION>
 <!--82EFB8E4045719C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045719C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045719C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1917,7 +1952,7 @@
 <!--82EFB8E4045819C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045819C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045819C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045819C9E040007F01003778-->  <POSITION><![CDATA[28]]></POSITION>
+<!--82EFB8E4045819C9E040007F01003778-->  <POSITION><![CDATA[29]]></POSITION>
 <!--82EFB8E4045819C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045819C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045819C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1948,7 +1983,7 @@
 <!--82EFB8E4045919C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045919C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045919C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045919C9E040007F01003778-->  <POSITION><![CDATA[29]]></POSITION>
+<!--82EFB8E4045919C9E040007F01003778-->  <POSITION><![CDATA[30]]></POSITION>
 <!--82EFB8E4045919C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045919C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045919C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1979,7 +2014,7 @@
 <!--82EFB8E4045A19C9E040007F01003778-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--82EFB8E4045A19C9E040007F01003778-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--82EFB8E4045A19C9E040007F01003778-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--82EFB8E4045A19C9E040007F01003778-->  <POSITION><![CDATA[30]]></POSITION>
+<!--82EFB8E4045A19C9E040007F01003778-->  <POSITION><![CDATA[31]]></POSITION>
 <!--82EFB8E4045A19C9E040007F01003778-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--82EFB8E4045A19C9E040007F01003778-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--82EFB8E4045A19C9E040007F01003778-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -2046,7 +2081,7 @@
 <!--8448D679EF655513E040007F01001B17-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--8448D679EF655513E040007F01001B17-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--8448D679EF655513E040007F01001B17-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--8448D679EF655513E040007F01001B17-->  <POSITION><![CDATA[31]]></POSITION>
+<!--8448D679EF655513E040007F01001B17-->  <POSITION><![CDATA[32]]></POSITION>
 <!--8448D679EF655513E040007F01001B17-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--8448D679EF655513E040007F01001B17-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--8448D679EF655513E040007F01001B17-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -3179,6 +3214,42 @@
 <!--F30A5F00B30D407B8C05119E8B91A275-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--F30A5F00B30D407B8C05119E8B91A275--></AD_COLUMN>
 
+<!--F362B84F4718449EAD840F1C25667B37--><AD_COLUMN>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_COLUMN_ID><![CDATA[F362B84F4718449EAD840F1C25667B37]]></AD_COLUMN_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F362B84F4718449EAD840F1C25667B37-->  <NAME><![CDATA[EM_APRM_Process_Reconciliation]]></NAME>
+<!--F362B84F4718449EAD840F1C25667B37-->  <DESCRIPTION><![CDATA[Process Reconciliation Document]]></DESCRIPTION>
+<!--F362B84F4718449EAD840F1C25667B37-->  <HELP><![CDATA[Used to process and reactivate reconciliation documents]]></HELP>
+<!--F362B84F4718449EAD840F1C25667B37-->  <COLUMNNAME><![CDATA[EM_APRM_Process_Reconciliation]]></COLUMNNAME>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_TABLE_ID><![CDATA[B1B7075C46934F0A9FD4C4D0F1457B42]]></AD_TABLE_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_REFERENCE_VALUE_ID><![CDATA[FF8080812E443491012E443C053A001A]]></AD_REFERENCE_VALUE_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--F362B84F4718449EAD840F1C25667B37-->  <DEFAULTVALUE><![CDATA[P]]></DEFAULTVALUE>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--F362B84F4718449EAD840F1C25667B37-->  <SEQNO><![CDATA[240]]></SEQNO>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_ELEMENT_ID><![CDATA[C8E8009C6BF5427EA930515F217F768E]]></AD_ELEMENT_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_PROCESS_ID><![CDATA[FF8080812E2F8EAE012E2F94CF470014]]></AD_PROCESS_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--F362B84F4718449EAD840F1C25667B37-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--F362B84F4718449EAD840F1C25667B37-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--F362B84F4718449EAD840F1C25667B37-->  <POSITION><![CDATA[22]]></POSITION>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--F362B84F4718449EAD840F1C25667B37-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--F362B84F4718449EAD840F1C25667B37-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--F362B84F4718449EAD840F1C25667B37--></AD_COLUMN>
+
 <!--F79D0173541B42CD9F41A58D53929BFA--><AD_COLUMN>
 <!--F79D0173541B42CD9F41A58D53929BFA-->  <AD_COLUMN_ID><![CDATA[F79D0173541B42CD9F41A58D53929BFA]]></AD_COLUMN_ID>
 <!--F79D0173541B42CD9F41A58D53929BFA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -225,4 +225,17 @@
 <!--8BBA8342ED3C20FFE040007F01002E9B-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--8BBA8342ED3C20FFE040007F01002E9B--></AD_ELEMENT>
 
+<!--C8E8009C6BF5427EA930515F217F768E--><AD_ELEMENT>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <AD_ELEMENT_ID><![CDATA[C8E8009C6BF5427EA930515F217F768E]]></AD_ELEMENT_ID>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <COLUMNNAME><![CDATA[EM_APRM_Process_Reconciliation]]></COLUMNNAME>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <NAME><![CDATA[Process Reconciliation]]></NAME>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <PRINTNAME><![CDATA[Process Reconciliation]]></PRINTNAME>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <DESCRIPTION><![CDATA[Process Reconciliation Document]]></DESCRIPTION>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <HELP><![CDATA[Used to process and reactivate reconciliation documents]]></HELP>
+<!--C8E8009C6BF5427EA930515F217F768E-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C8E8009C6BF5427EA930515F217F768E--></AD_ELEMENT>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -1580,6 +1580,32 @@
 <!--6217B6E7C2CA46E8A399B7B4178F8CEC-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--6217B6E7C2CA46E8A399B7B4178F8CEC--></AD_FIELD>
 
+<!--6376408E4B3B4208825144CBD72F54CA--><AD_FIELD>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_FIELD_ID><![CDATA[6376408E4B3B4208825144CBD72F54CA]]></AD_FIELD_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <NAME><![CDATA[Reconciliation Process]]></NAME>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <DESCRIPTION><![CDATA[Manages processing of reconciliation documents]]></DESCRIPTION>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_TAB_ID><![CDATA[C095D2CC39704DBE8B906B7CD7710968]]></AD_TAB_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_COLUMN_ID><![CDATA[63454E73F07B4C908EB1268C41F5DE8A]]></AD_COLUMN_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <DISPLAYLOGIC><![CDATA[@Processed@='Y']]></DISPLAYLOGIC>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <SEQNO><![CDATA[192]]></SEQNO>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--6376408E4B3B4208825144CBD72F54CA-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6376408E4B3B4208825144CBD72F54CA--></AD_FIELD>
+
 <!--642FBD2AB83147E395BF96708345108D--><AD_FIELD>
 <!--642FBD2AB83147E395BF96708345108D-->  <AD_FIELD_ID><![CDATA[642FBD2AB83147E395BF96708345108D]]></AD_FIELD_ID>
 <!--642FBD2AB83147E395BF96708345108D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -3401,7 +3427,7 @@
 <!--82F2E8A160CE472CE040007F01005324-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--82F2E8A160CE472CE040007F01005324-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
 <!--82F2E8A160CE472CE040007F01005324-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--82F2E8A160CE472CE040007F01005324-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--82F2E8A160CE472CE040007F01005324-->  <SEQNO><![CDATA[186]]></SEQNO>
 <!--82F2E8A160CE472CE040007F01005324-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--82F2E8A160CE472CE040007F01005324-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--82F2E8A160CE472CE040007F01005324-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -583,4 +583,26 @@
 <!--FCDC2F10EAAD46A5A24BCEC2BF017A05-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--FCDC2F10EAAD46A5A24BCEC2BF017A05--></AD_MESSAGE>
 
+<!--FF8080812E44C5F1012E44D2099A001A--><AD_MESSAGE>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <AD_MESSAGE_ID><![CDATA[FF8080812E44C5F1012E44D2099A001A]]></AD_MESSAGE_ID>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <VALUE><![CDATA[APRM_FutureReconciliationExists]]></VALUE>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <MSGTEXT><![CDATA[Action can not be performed as a later reconciliation exists. First reactivate and delete later reconciliations.]]></MSGTEXT>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--FF8080812E44C5F1012E44D2099A001A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E44C5F1012E44D2099A001A--></AD_MESSAGE>
+
+<!--FF8080812E44C5F1012E44D35D750020--><AD_MESSAGE>
+<!--FF8080812E44C5F1012E44D35D750020-->  <AD_MESSAGE_ID><![CDATA[FF8080812E44C5F1012E44D35D750020]]></AD_MESSAGE_ID>
+<!--FF8080812E44C5F1012E44D35D750020-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E44C5F1012E44D35D750020-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E44C5F1012E44D35D750020-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E44C5F1012E44D35D750020-->  <VALUE><![CDATA[APRM_ReconciliationNoLines]]></VALUE>
+<!--FF8080812E44C5F1012E44D35D750020-->  <MSGTEXT><![CDATA[Reconciliation contains no line. At least one cleared item is required for a reconciliation document to be processed.]]></MSGTEXT>
+<!--FF8080812E44C5F1012E44D35D750020-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--FF8080812E44C5F1012E44D35D750020-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E44C5F1012E44D35D750020--></AD_MESSAGE>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -216,4 +216,16 @@
 <!--FF73C27402EB45558A1925859CD484F0-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--FF73C27402EB45558A1925859CD484F0--></AD_MODEL_OBJECT>
 
+<!--FF8080812E437710012E43BE26A3000E--><AD_MODEL_OBJECT>
+<!--FF8080812E437710012E43BE26A3000E-->  <AD_MODEL_OBJECT_ID><![CDATA[FF8080812E437710012E43BE26A3000E]]></AD_MODEL_OBJECT_ID>
+<!--FF8080812E437710012E43BE26A3000E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E437710012E43BE26A3000E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E437710012E43BE26A3000E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E437710012E43BE26A3000E-->  <ACTION><![CDATA[P]]></ACTION>
+<!--FF8080812E437710012E43BE26A3000E-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.process.FIN_ReconciliationProcess]]></CLASSNAME>
+<!--FF8080812E437710012E43BE26A3000E-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--FF8080812E437710012E43BE26A3000E-->  <AD_PROCESS_ID><![CDATA[FF8080812E2F8EAE012E2F94CF470014]]></AD_PROCESS_ID>
+<!--FF8080812E437710012E43BE26A3000E-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--FF8080812E437710012E43BE26A3000E--></AD_MODEL_OBJECT>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -338,4 +338,23 @@
 <!--F68F2890E96D4D85A1DEF0274D105BCE-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
 <!--F68F2890E96D4D85A1DEF0274D105BCE--></AD_PROCESS>
 
+<!--FF8080812E2F8EAE012E2F94CF470014--><AD_PROCESS>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <AD_PROCESS_ID><![CDATA[FF8080812E2F8EAE012E2F94CF470014]]></AD_PROCESS_ID>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <VALUE><![CDATA[ReconciliationProcess]]></VALUE>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <NAME><![CDATA[Reconciliation Process]]></NAME>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <DESCRIPTION><![CDATA[Manages processing of reconciliation documents]]></DESCRIPTION>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--FF8080812E2F8EAE012E2F94CF470014--></AD_PROCESS>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -22,4 +22,26 @@
 <!--800BEB6BDA99409194CADF23988D7B6D-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
 <!--800BEB6BDA99409194CADF23988D7B6D--></AD_PROCESS_PARA>
 
+<!--FF8080812E2F8EAE012E2F98D9680030--><AD_PROCESS_PARA>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_PROCESS_PARA_ID><![CDATA[FF8080812E2F8EAE012E2F98D9680030]]></AD_PROCESS_PARA_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <NAME><![CDATA[Action]]></NAME>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <DESCRIPTION><![CDATA[A drop down list box indicating the next step to take.]]></DESCRIPTION>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <HELP><![CDATA[The Action field indicates the Action to be performed for this element.]]></HELP>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_PROCESS_ID><![CDATA[FF8080812E2F8EAE012E2F94CF470014]]></AD_PROCESS_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_REFERENCE_VALUE_ID><![CDATA[36972531DA994BB38ECB91993058282F]]></AD_REFERENCE_VALUE_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_VAL_RULE_ID><![CDATA[FF8080812E448A62012E44943A160017]]></AD_VAL_RULE_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <COLUMNNAME><![CDATA[action]]></COLUMNNAME>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <DEFAULTVALUE><![CDATA[@EM_APRM_Process_Reconciliation@]]></DEFAULTVALUE>
+<!--FF8080812E2F8EAE012E2F98D9680030-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
+<!--FF8080812E2F8EAE012E2F98D9680030--></AD_PROCESS_PARA>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -109,4 +109,17 @@
 <!--F903F726B41A49D3860243101CEEBA25-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--F903F726B41A49D3860243101CEEBA25--></AD_REFERENCE>
 
+<!--FF8080812E443491012E443C053A001A--><AD_REFERENCE>
+<!--FF8080812E443491012E443C053A001A-->  <AD_REFERENCE_ID><![CDATA[FF8080812E443491012E443C053A001A]]></AD_REFERENCE_ID>
+<!--FF8080812E443491012E443C053A001A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E443491012E443C053A001A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E443491012E443C053A001A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E443491012E443C053A001A-->  <NAME><![CDATA[APRM_Reconciliation process actions]]></NAME>
+<!--FF8080812E443491012E443C053A001A-->  <DESCRIPTION><![CDATA[Reconciliation process actions]]></DESCRIPTION>
+<!--FF8080812E443491012E443C053A001A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E443491012E443C053A001A-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--FF8080812E443491012E443C053A001A-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--FF8080812E443491012E443C053A001A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--FF8080812E443491012E443C053A001A--></AD_REFERENCE>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -118,4 +118,27 @@
 <!--C5D1596D065545B49156C1F9426C9E14-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--C5D1596D065545B49156C1F9426C9E14--></AD_REF_LIST>
 
+<!--FF8080812E443491012E443C4ED60020--><AD_REF_LIST>
+<!--FF8080812E443491012E443C4ED60020-->  <AD_REF_LIST_ID><![CDATA[FF8080812E443491012E443C4ED60020]]></AD_REF_LIST_ID>
+<!--FF8080812E443491012E443C4ED60020-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E443491012E443C4ED60020-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E443491012E443C4ED60020-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E443491012E443C4ED60020-->  <VALUE><![CDATA[R]]></VALUE>
+<!--FF8080812E443491012E443C4ED60020-->  <NAME><![CDATA[Reactivate]]></NAME>
+<!--FF8080812E443491012E443C4ED60020-->  <DESCRIPTION><![CDATA[Reconciliation process actions]]></DESCRIPTION>
+<!--FF8080812E443491012E443C4ED60020-->  <AD_REFERENCE_ID><![CDATA[FF8080812E443491012E443C053A001A]]></AD_REFERENCE_ID>
+<!--FF8080812E443491012E443C4ED60020-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E443491012E443C4ED60020--></AD_REF_LIST>
+
+<!--FF8080812E443491012E443CA7460027--><AD_REF_LIST>
+<!--FF8080812E443491012E443CA7460027-->  <AD_REF_LIST_ID><![CDATA[FF8080812E443491012E443CA7460027]]></AD_REF_LIST_ID>
+<!--FF8080812E443491012E443CA7460027-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E443491012E443CA7460027-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E443491012E443CA7460027-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E443491012E443CA7460027-->  <VALUE><![CDATA[P]]></VALUE>
+<!--FF8080812E443491012E443CA7460027-->  <NAME><![CDATA[Process Reconciliation]]></NAME>
+<!--FF8080812E443491012E443CA7460027-->  <AD_REFERENCE_ID><![CDATA[FF8080812E443491012E443C053A001A]]></AD_REFERENCE_ID>
+<!--FF8080812E443491012E443CA7460027-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E443491012E443CA7460027--></AD_REF_LIST>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_VAL_RULE.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_VAL_RULE.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -33,4 +33,15 @@
 <!--575E470ABADB4C278132C957A78C47E3-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--575E470ABADB4C278132C957A78C47E3--></AD_VAL_RULE>
 
+<!--FF8080812E448A62012E44943A160017--><AD_VAL_RULE>
+<!--FF8080812E448A62012E44943A160017-->  <AD_VAL_RULE_ID><![CDATA[FF8080812E448A62012E44943A160017]]></AD_VAL_RULE_ID>
+<!--FF8080812E448A62012E44943A160017-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8080812E448A62012E44943A160017-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8080812E448A62012E44943A160017-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8080812E448A62012E44943A160017-->  <NAME><![CDATA[APRM_Process Reconciliation valid actions]]></NAME>
+<!--FF8080812E448A62012E44943A160017-->  <TYPE><![CDATA[S]]></TYPE>
+<!--FF8080812E448A62012E44943A160017-->  <CODE><![CDATA[((@EM_APRM_Process_Reconciliation@ = 'P' AND AD_Ref_List.value='P') OR (@EM_APRM_Process_Reconciliation@ = 'R' AND AD_Ref_List.value='R') OR (@EM_APRM_Process_Reconciliation@ is null))]]></CODE>
+<!--FF8080812E448A62012E44943A160017-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FF8080812E448A62012E44943A160017--></AD_VAL_RULE>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Tue Mar 08 11:19:07 2011 +0100
@@ -294,6 +294,7 @@
           .getBankStatementLineMaxDate(financialAccount));
       reconciliation.setProcessed(process);
       reconciliation.setDocumentStatus(process ? "CO" : "DR");
+      reconciliation.setAPRMProcessReconciliation(process ? "R" : "P");
       OBDal.getInstance().save(reconciliation);
       OBDal.getInstance().flush();
     } catch (Exception ex) {
@@ -595,9 +596,11 @@
   }
 
   private void getSnapShot(FIN_Reconciliation reconciliation) {
-    // First remove old temp info if exists
+    if (reconciliation == null)
+      return;
     OBContext.setAdminMode();
     try {
+      // First remove old temp info if exists
       List<FIN_ReconciliationLineTemp> oldTempLines = reconciliation
           .getFINReconciliationLineTempList();
       for (FIN_ReconciliationLineTemp oldtempLine : oldTempLines) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/Reconciliation.java	Tue Mar 08 11:16:13 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/Reconciliation.java	Tue Mar 08 11:19:07 2011 +0100
@@ -211,6 +211,7 @@
       reconciliation.setEndingDate(FIN_Utility.getDateTime(strStatementDate));
       reconciliation.setDocumentStatus(process ? "CO" : "DR");
       reconciliation.setProcessed(process);
+      reconciliation.setAPRMProcessReconciliation(process ? "R" : "P");
       OBDal.getInstance().save(reconciliation);
       OBDal.getInstance().flush();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Tue Mar 08 11:19:07 2011 +0100
@@ -0,0 +1,159 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.advpaymentmngt.process;
+
+import java.util.List;
+
+import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Order;
+import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
+import org.openbravo.advpaymentmngt.utility.FIN_Utility;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.database.ConnectionProvider;
+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.scheduling.ProcessBundle;
+
+public class FIN_ReconciliationProcess implements org.openbravo.scheduling.Process {
+  private static AdvPaymentMngtDao dao;
+
+  public void execute(ProcessBundle bundle) throws Exception {
+    dao = new AdvPaymentMngtDao();
+    OBError msg = new OBError();
+    msg.setType("Success");
+    msg.setTitle(Utility.messageBD(bundle.getConnection(), "Success", bundle.getContext()
+        .getLanguage()));
+
+    OBContext.setAdminMode();
+    try {
+      // retrieve custom params
+      final String strAction = (String) bundle.getParams().get("action");
+
+      // retrieve standard params
+      final String recordID = (String) bundle.getParams().get("Aprm_Reconciliation_V_ID");
+      final FIN_Reconciliation reconciliation = dao.getObject(FIN_Reconciliation.class, recordID);
+      final VariablesSecureApp vars = bundle.getContext().toVars();
+      final ConnectionProvider conProvider = bundle.getConnection();
+      reconciliation.setProcessNow(true);
+      OBDal.getInstance().save(reconciliation);
+      OBDal.getInstance().flush();
+      if (strAction.equals("P")) {
+        // Check lines exist
+        if (reconciliation.getFINReconciliationLineVList().size() == 0) {
+          msg.setType("Error");
+          msg.setTitle(Utility.messageBD(conProvider, "Error", vars.getLanguage()));
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, vars.getLanguage(),
+              "@APRM_ReconciliationNoLines@" + ": " + reconciliation.getDocumentNo()));
+          bundle.setResult(msg);
+          return;
+        }
+        reconciliation.setProcessed(true);
+        reconciliation.setAPRMProcessReconciliation("R");
+        reconciliation.setDocumentStatus("CO");
+        OBDal.getInstance().save(reconciliation);
+        OBDal.getInstance().flush();
+
+        // ***********************
+        // Reactivate Reconciliation
+        // ***********************
+      } else if (strAction.equals("R")) {
+        // Already Posted Document
+        if ("Y".equals(reconciliation.getPosted())) {
+          msg.setType("Error");
+          msg.setTitle(Utility.messageBD(conProvider, "Error", vars.getLanguage()));
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, vars.getLanguage(),
+              "@PostedDocument@" + ": " + reconciliation.getDocumentNo()));
+          bundle.setResult(msg);
+          return;
+        }
+        // Transaction exists
+        if (!isLastReconciliation(reconciliation)) {
+          msg.setType("Error");
+          msg.setTitle(Utility.messageBD(conProvider, "Error", vars.getLanguage()));
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, vars.getLanguage(),
+              "@APRM_FutureReconciliationExists@"));
+          bundle.setResult(msg);
+          return;
+        }
+        reconciliation.setProcessed(false);
+        OBDal.getInstance().save(reconciliation);
+        OBDal.getInstance().flush();
+        reconciliation.setDocumentStatus("DR");
+        reconciliation.setAPRMProcessReconciliation("P");
+        OBDal.getInstance().save(reconciliation);
+        OBDal.getInstance().flush();
+      }
+      reconciliation.setProcessNow(false);
+      OBDal.getInstance().save(reconciliation);
+      OBDal.getInstance().flush();
+      bundle.setResult(msg);
+    } catch (final Exception e) {
+      OBDal.getInstance().rollbackAndClose();
+      e.printStackTrace(System.err);
+      msg.setType("Error");
+      msg.setTitle(Utility.messageBD(bundle.getConnection(), "Error", bundle.getContext()
+          .getLanguage()));
+      msg.setMessage(FIN_Utility.getExceptionMessage(e));
+      bundle.setResult(msg);
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  private boolean isLastReconciliation(FIN_Reconciliation reconciliation) {
+    final OBCriteria<FIN_Reconciliation> obc = OBDal.getInstance().createCriteria(
+        FIN_Reconciliation.class);
+    obc.add(Expression.ge(FIN_Reconciliation.PROPERTY_ENDINGDATE, reconciliation.getEndingDate()));
+    obc.add(Expression.gt(FIN_Reconciliation.PROPERTY_CREATIONDATE, reconciliation
+        .getCreationDate()));
+    obc.add(Expression.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;
+    }
+  }
+}
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Mar 08 11:16:13 2011 +0100
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Mar 08 11:19:07 2011 +0100
@@ -10067,7 +10067,7 @@
 <!--C293E5B8BA954575B979A1DA586B89D8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C293E5B8BA954575B979A1DA586B89D8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C293E5B8BA954575B979A1DA586B89D8-->  <VALUE><![CDATA[P]]></VALUE>
-<!--C293E5B8BA954575B979A1DA586B89D8-->  <NAME><![CDATA[Process Payment]]></NAME>
+<!--C293E5B8BA954575B979A1DA586B89D8-->  <NAME><![CDATA[Process]]></NAME>
 <!--C293E5B8BA954575B979A1DA586B89D8-->  <AD_REFERENCE_ID><![CDATA[36972531DA994BB38ECB91993058282F]]></AD_REFERENCE_ID>
 <!--C293E5B8BA954575B979A1DA586B89D8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C293E5B8BA954575B979A1DA586B89D8--></AD_REF_LIST>