details:   /erp/devel/pi/rev/ac0f516bd3c1
changeset: 11340:ac0f516bd3c1
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Tue Mar 22 18:21:54 2011 +0100
summary:   CI: update AD_MODULE to version 11337

details:   /erp/devel/pi/rev/cfd1655781f1
changeset: 11341:cfd1655781f1
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Tue Mar 22 18:52:22 2011 +0100
summary:   CI: merge back from main

diffstat:

 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.class
                       |    0 
 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.class
                   |    0 
 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml  
                                                                  |    2 +-
 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                         |    4 +-
 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.java
         |   31 +-
 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments_data.xsql
    |    9 +
 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java
 |  114 ++++++---
 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml       
                                                                  |    2 +-
 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                              |    2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
                                                                |    2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                     |    8 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
                                                                 |    2 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                      |    2 +-
 modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml   
                                                                  |    2 +-
 
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                          |    6 +-
 modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml     
                                                                  |    2 +-
 
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                            |    4 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml 
                                                                 |    2 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                       |    2 +-
 modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml  
                                                                  |    2 +-
 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                         |    2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
                                                           |    2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                |    2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
                                                    |    2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                         |    2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
                                                                |    2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                     |   10 +-
 modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml    
                                                                  |    2 +-
 
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                           |    2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
                                                            |    2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                 |   12 +-
 
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml
                                                   |    2 +-
 
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                        |    2 +-
 
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml
                                                         |    2 +-
 
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                              |    6 +-
 modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml     
                                                                  |    2 +-
 
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                            |    6 +-
 modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml    
                                                                  |    2 +-
 
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                                                           |   24 +-
 modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml              
                                                                  |    2 +-
 modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml   
                                                                  |   14 +-
 src-db/database/model/prescript-PostgreSql.sql                                 
                                                                  |   16 -
 src-db/database/sourcedata/AD_MODULE.xml                                       
                                                                  |    2 +-
 43 files changed, 177 insertions(+), 141 deletions(-)

diffs (truncated from 1072 to 300 lines):

diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.class
 has changed
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.class
 has changed
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Tue Mar 22 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Tue Mar 22 18:52:22 2011 +0100
@@ -6,7 +6,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <NAME><![CDATA[Advanced Payables and 
Receivables Mngmt]]></NAME>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  
<VERSION><![CDATA[3.0.11317]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  
<VERSION><![CDATA[3.0.11337]]></VERSION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <DESCRIPTION><![CDATA[Managing your 
finances with an ERP does not have to be difficult. Enjoy a radically improved 
user experience that combines the power of an enterprise grade financial 
application with the simplicity and ease of a web 2.0 personal accounting 
service.]]></DESCRIPTION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <HELP><![CDATA[Advanced Payables and 
Receivables Management simplifies and automates the business processes around 
the management of financial accounts, from the receipt and issue of payment, to 
the reconciliation of those events with bank statements.
 If you would like to help shape this module you are welcome to take part in 
the forum discussions or register feature requests or issues in the 
corresponding (Forum and Bug Tracking) sections in the Advanced Payables and 
Receivable project in the OB Forge.]]></HELP>
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  Tue Mar 22 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  Tue Mar 22 18:52:22 2011 +0100
@@ -7,7 +7,7 @@
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<STARTVERSION><![CDATA[2.1.11317]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<STARTVERSION><![CDATA[2.1.11337]]></STARTVERSION>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDANT_MODULE_NAME><![CDATA[User 
Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--B97FC854C6DD41E692161585645A900F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B97FC854C6DD41E692161585645A900F-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B97FC854C6DD41E692161585645A900F-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--B97FC854C6DD41E692161585645A900F-->  
<STARTVERSION><![CDATA[3.0.11317]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  
<STARTVERSION><![CDATA[3.0.11337]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.java
  Tue Mar 22 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments.java
  Tue Mar 22 18:52:22 2011 +0100
@@ -31,21 +31,26 @@
     ConnectionProvider cp = getConnectionProvider();
     ArrayList<String> errors = new ArrayList<String>();
     try {
-      if (UnpostRefundPaymentsData.existsPostedRefundPayments(cp )) {
-        String errorClients = "";
-        UnpostRefundPaymentsData[] clients = 
UnpostRefundPaymentsData.clientsWithPayments(cp);
-        for (int i = 0; i < clients.length; i++)
-          errorClients += clients[i].name + ",";
-        errorClients = errorClients.substring(0, errorClients.length()-1);
+      // Prevent error when upgrading from a pure 2.50
+      if (UnpostRefundPaymentsData.existAPRMbasetables(cp)) {
 
-        errors
-            .add("You can not apply this Advanced Payables and Receivables 
Management module version because your instance fails in a pre-validation: 
since APRM 1.0.5 version the accounting of refund payments has changed. So it 
is not allowed to upgrade to the latest version having payments accounted with 
the old rules. To fix this problem in your instance, you can know the 
duplicated entries by reviewing Alerts in your system (Alert Rule: Posted 
Refund Payments). Find the Posted Payments to unpost them, you should as well 
disable the accounting background process. Once it is fixed you should be able 
to apply this APRM module version. Clients with payments: " + errorClients);
-        String alertRuleId = UnpostRefundPaymentsData.getUUID(cp);
-        if (!UnpostRefundPaymentsData.existsAlertRule(cp)){
-          UnpostRefundPaymentsData.insertAlertRule(cp, alertRuleId);
+        if (UnpostRefundPaymentsData.existsPostedRefundPayments(cp )) {
+          String errorClients = "";
+          UnpostRefundPaymentsData[] clients = 
UnpostRefundPaymentsData.clientsWithPayments(cp);
+          for (int i = 0; i < clients.length; i++)
+            errorClients += clients[i].name + ",";
+          errorClients = errorClients.substring(0, errorClients.length()-1);
+
+          errors
+              .add("You can not apply this Advanced Payables and Receivables 
Management module version because your instance fails in a pre-validation: 
since APRM 1.0.5 version the accounting of refund payments has changed. So it 
is not allowed to upgrade to the latest version having payments accounted with 
the old rules. To fix this problem in your instance, you can know the 
duplicated entries by reviewing Alerts in your system (Alert Rule: Posted 
Refund Payments). Find the Posted Payments to unpost them, you should as well 
disable the accounting background process. Once it is fixed you should be able 
to apply this APRM module version. Clients with payments: " + errorClients);
+          String alertRuleId = UnpostRefundPaymentsData.getUUID(cp);
+          if (!UnpostRefundPaymentsData.existsAlertRule(cp)){
+            UnpostRefundPaymentsData.insertAlertRule(cp, alertRuleId);
+          }
+          alertRuleId = UnpostRefundPaymentsData.getAlertRuleId(cp);
+          processAlert(alertRuleId, cp);
         }
-        alertRuleId = UnpostRefundPaymentsData.getAlertRuleId(cp);
-        processAlert(alertRuleId, cp);
+
       }
     } catch (Exception e) {
       return handleError(e);
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments_data.xsql
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments_data.xsql
     Tue Mar 22 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPayments_data.xsql
     Tue Mar 22 18:52:22 2011 +0100
@@ -143,4 +143,13 @@
     ]]></Sql>
     <Parameter name="sql" type="replace" optional="true" after="FROM (" 
text="SELECT '' AS DESCRIPTION, '' AS RECORD_ID, '' AS REFERENCEKEY_ID, '' AS 
AD_CLIENT_ID FROM DUAL"/>
   </SqlMethod>
+    <SqlMethod name="existAPRMbasetables" type="preparedStatement" 
return="boolean">
+    <SqlMethodComment>Check if the FIN_Payment table exist</SqlMethodComment>
+    <Sql><![CDATA[
+       SELECT count(*) AS EXISTING
+       FROM ad_table
+       WHERE ad_table_id = 'D1A97202E832470285C9B1EB026D54E2'
+      ]]>
+    </Sql>
+  </SqlMethod>
 </SqlClass>
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java
  Tue Mar 22 14:44:53 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/buildvalidation/src/src/org/openbravo/advpaymentmngt/buildvalidation/UnpostRefundPaymentsData.java
  Tue Mar 22 18:52:22 2011 +0100
@@ -35,33 +35,33 @@
   }
 
   public String getField(String fieldName) {
-    if (fieldName.equalsIgnoreCase("AD_CLIENT_ID") || 
fieldName.equals("adClientId"))
+    if (fieldName.equalsIgnoreCase("ad_client_id") || 
fieldName.equals("adClientId"))
       return adClientId;
-    else if (fieldName.equalsIgnoreCase("AD_ORG_ID") || 
fieldName.equals("adOrgId"))
+    else if (fieldName.equalsIgnoreCase("ad_org_id") || 
fieldName.equals("adOrgId"))
       return adOrgId;
-    else if (fieldName.equalsIgnoreCase("CREATED"))
+    else if (fieldName.equalsIgnoreCase("created"))
       return created;
-    else if (fieldName.equalsIgnoreCase("CREATEDBY"))
+    else if (fieldName.equalsIgnoreCase("createdby"))
       return createdby;
-    else if (fieldName.equalsIgnoreCase("UPDATED"))
+    else if (fieldName.equalsIgnoreCase("updated"))
       return updated;
-    else if (fieldName.equalsIgnoreCase("UPDATEDBY"))
+    else if (fieldName.equalsIgnoreCase("updatedby"))
       return updatedby;
-    else if (fieldName.equalsIgnoreCase("ISACTIVE"))
+    else if (fieldName.equalsIgnoreCase("isactive"))
       return isactive;
-    else if (fieldName.equalsIgnoreCase("RECORD_ID") || 
fieldName.equals("recordId"))
+    else if (fieldName.equalsIgnoreCase("record_id") || 
fieldName.equals("recordId"))
       return recordId;
-    else if (fieldName.equalsIgnoreCase("DESCRIPTION"))
+    else if (fieldName.equalsIgnoreCase("description"))
       return description;
-    else if (fieldName.equalsIgnoreCase("REFERENCEKEY_ID") || 
fieldName.equals("referencekeyId"))
+    else if (fieldName.equalsIgnoreCase("referencekey_id") || 
fieldName.equals("referencekeyId"))
       return referencekeyId;
-    else if (fieldName.equalsIgnoreCase("AD_ROLE_ID") || 
fieldName.equals("adRoleId"))
+    else if (fieldName.equalsIgnoreCase("ad_role_id") || 
fieldName.equals("adRoleId"))
       return adRoleId;
-    else if (fieldName.equalsIgnoreCase("AD_ALERTRULE_ID") || 
fieldName.equals("adAlertruleId"))
+    else if (fieldName.equalsIgnoreCase("ad_alertrule_id") || 
fieldName.equals("adAlertruleId"))
       return adAlertruleId;
-    else if (fieldName.equalsIgnoreCase("SQL"))
+    else if (fieldName.equalsIgnoreCase("sql"))
       return sql;
-    else if (fieldName.equalsIgnoreCase("NAME"))
+    else if (fieldName.equalsIgnoreCase("name"))
       return name;
    else {
      log4j.debug("Field does not exist: " + fieldName);
@@ -103,20 +103,20 @@
       while(continueResult && result.next()) {
         countRecord++;
         UnpostRefundPaymentsData objectUnpostRefundPaymentsData = new 
UnpostRefundPaymentsData();
-        objectUnpostRefundPaymentsData.adClientId = UtilSql.getValue(result, 
"AD_CLIENT_ID");
-        objectUnpostRefundPaymentsData.adOrgId = UtilSql.getValue(result, 
"AD_ORG_ID");
-        objectUnpostRefundPaymentsData.created = UtilSql.getDateValue(result, 
"CREATED", "dd-MM-yyyy");
-        objectUnpostRefundPaymentsData.createdby = UtilSql.getValue(result, 
"CREATEDBY");
-        objectUnpostRefundPaymentsData.updated = UtilSql.getDateValue(result, 
"UPDATED", "dd-MM-yyyy");
-        objectUnpostRefundPaymentsData.updatedby = UtilSql.getValue(result, 
"UPDATEDBY");
-        objectUnpostRefundPaymentsData.isactive = UtilSql.getValue(result, 
"ISACTIVE");
-        objectUnpostRefundPaymentsData.recordId = UtilSql.getValue(result, 
"RECORD_ID");
-        objectUnpostRefundPaymentsData.description = UtilSql.getValue(result, 
"DESCRIPTION");
-        objectUnpostRefundPaymentsData.referencekeyId = 
UtilSql.getValue(result, "REFERENCEKEY_ID");
-        objectUnpostRefundPaymentsData.adRoleId = UtilSql.getValue(result, 
"AD_ROLE_ID");
-        objectUnpostRefundPaymentsData.adAlertruleId = 
UtilSql.getValue(result, "AD_ALERTRULE_ID");
-        objectUnpostRefundPaymentsData.sql = UtilSql.getValue(result, "SQL");
-        objectUnpostRefundPaymentsData.name = UtilSql.getValue(result, "NAME");
+        objectUnpostRefundPaymentsData.adClientId = UtilSql.getValue(result, 
"ad_client_id");
+        objectUnpostRefundPaymentsData.adOrgId = UtilSql.getValue(result, 
"ad_org_id");
+        objectUnpostRefundPaymentsData.created = UtilSql.getDateValue(result, 
"created", "dd-MM-yyyy");
+        objectUnpostRefundPaymentsData.createdby = UtilSql.getValue(result, 
"createdby");
+        objectUnpostRefundPaymentsData.updated = UtilSql.getDateValue(result, 
"updated", "dd-MM-yyyy");
+        objectUnpostRefundPaymentsData.updatedby = UtilSql.getValue(result, 
"updatedby");
+        objectUnpostRefundPaymentsData.isactive = UtilSql.getValue(result, 
"isactive");
+        objectUnpostRefundPaymentsData.recordId = UtilSql.getValue(result, 
"record_id");
+        objectUnpostRefundPaymentsData.description = UtilSql.getValue(result, 
"description");
+        objectUnpostRefundPaymentsData.referencekeyId = 
UtilSql.getValue(result, "referencekey_id");
+        objectUnpostRefundPaymentsData.adRoleId = UtilSql.getValue(result, 
"ad_role_id");
+        objectUnpostRefundPaymentsData.adAlertruleId = 
UtilSql.getValue(result, "ad_alertrule_id");
+        objectUnpostRefundPaymentsData.sql = UtilSql.getValue(result, "sql");
+        objectUnpostRefundPaymentsData.name = UtilSql.getValue(result, "name");
         objectUnpostRefundPaymentsData.InitRecordNumber = 
Integer.toString(firstRegister);
         vector.addElement(objectUnpostRefundPaymentsData);
         if (countRecord >= numberRegisters && numberRegisters != 0) {
@@ -159,7 +159,7 @@
 
       result = st.executeQuery();
       if(result.next()) {
-        boolReturn = !UtilSql.getValue(result, "EXISTING").equals("0");
+        boolReturn = !UtilSql.getValue(result, "existing").equals("0");
       }
       result.close();
     } catch(SQLException e){
@@ -195,7 +195,7 @@
 
       result = st.executeQuery();
       if(result.next()) {
-        strReturn = UtilSql.getValue(result, "NAME");
+        strReturn = UtilSql.getValue(result, "name");
       }
       result.close();
     } catch(SQLException e){
@@ -235,7 +235,7 @@
 
       result = st.executeQuery();
       if(result.next()) {
-        boolReturn = !UtilSql.getValue(result, "EXISTING").equals("0");
+        boolReturn = !UtilSql.getValue(result, "existing").equals("0");
       }
       result.close();
     } catch(SQLException e){
@@ -269,7 +269,7 @@
 
       result = st.executeQuery();
       if(result.next()) {
-        strReturn = UtilSql.getValue(result, "NAME");
+        strReturn = UtilSql.getValue(result, "name");
       }
       result.close();
     } catch(SQLException e){
@@ -326,7 +326,7 @@
       while(continueResult && result.next()) {
         countRecord++;
         UnpostRefundPaymentsData objectUnpostRefundPaymentsData = new 
UnpostRefundPaymentsData();
-        objectUnpostRefundPaymentsData.name = UtilSql.getValue(result, "NAME");
+        objectUnpostRefundPaymentsData.name = UtilSql.getValue(result, "name");
         objectUnpostRefundPaymentsData.InitRecordNumber = 
Integer.toString(firstRegister);
         vector.addElement(objectUnpostRefundPaymentsData);
         if (countRecord >= numberRegisters && numberRegisters != 0) {
@@ -374,7 +374,7 @@
 
       result = st.executeQuery();
       if(result.next()) {
-        boolReturn = !UtilSql.getValue(result, "EXISTING").equals("0");
+        boolReturn = !UtilSql.getValue(result, "existing").equals("0");
       }
       result.close();
     } catch(SQLException e){
@@ -516,10 +516,10 @@
       while(continueResult && result.next()) {
         countRecord++;
         UnpostRefundPaymentsData objectUnpostRefundPaymentsData = new 
UnpostRefundPaymentsData();
-        objectUnpostRefundPaymentsData.description = UtilSql.getValue(result, 
"DESCRIPTION");
-        objectUnpostRefundPaymentsData.recordId = UtilSql.getValue(result, 
"RECORD_ID");
-        objectUnpostRefundPaymentsData.referencekeyId = 
UtilSql.getValue(result, "REFERENCEKEY_ID");
-        objectUnpostRefundPaymentsData.adClientId = UtilSql.getValue(result, 
"AD_CLIENT_ID");
+        objectUnpostRefundPaymentsData.description = UtilSql.getValue(result, 
"description");
+        objectUnpostRefundPaymentsData.recordId = UtilSql.getValue(result, 
"record_id");
+        objectUnpostRefundPaymentsData.referencekeyId = 
UtilSql.getValue(result, "referencekey_id");
+        objectUnpostRefundPaymentsData.adClientId = UtilSql.getValue(result, 
"ad_client_id");
         objectUnpostRefundPaymentsData.InitRecordNumber = 
Integer.toString(firstRegister);
         vector.addElement(objectUnpostRefundPaymentsData);
         if (countRecord >= numberRegisters && numberRegisters != 0) {
@@ -544,4 +544,42 @@
     vector.copyInto(objectUnpostRefundPaymentsData);
     return(objectUnpostRefundPaymentsData);
   }
+
+/**
+Check if the FIN_Payment table exist
+ */
+  public static boolean existAPRMbasetables(ConnectionProvider 
connectionProvider)    throws ServletException {
+    String strSql = "";
+    strSql = strSql + 
+      "       SELECT count(*) AS EXISTING" +
+      "       FROM ad_table" +
+      "       WHERE ad_table_id = 'D1A97202E832470285C9B1EB026D54E2'";
+
+    ResultSet result;
+    boolean boolReturn = false;
+    PreparedStatement st = null;
+
+    try {
+    st = connectionProvider.getPreparedStatement(strSql);
+
+      result = st.executeQuery();
+      if(result.next()) {
+        boolReturn = !UtilSql.getValue(result, "existing").equals("0");
+      }
+      result.close();
+    } catch(SQLException e){
+      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
+      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) 
+ "@" + e.getMessage());
+    } catch(Exception ex){
+      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
+      throw new ServletException("@CODE=@" + ex.getMessage());
+    } finally {
+      try {
+        connectionProvider.releasePreparedStatement(st);
+      } catch(Exception ignore){
+        ignore.printStackTrace();
+      }
+    }
+    return(boolReturn);
+  }
 }
diff -r 91fe001a8c53 -r cfd1655781f1 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml  
Tue Mar 22 14:44:53 2011 +0100
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml  
Tue Mar 22 18:52:22 2011 +0100
@@ -6,7 +6,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to