details:   https://code.openbravo.com/erp/devel/pi/rev/1f5958d600fb
changeset: 21789:1f5958d600fb
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Tue Jan 14 15:21:56 2014 +0530
summary:   Backout Issue 24866

details:   https://code.openbravo.com/erp/devel/pi/rev/4535a885ce86
changeset: 21790:4535a885ce86
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Tue Jan 14 15:23:08 2014 +0530
summary:   Backout Issue 24866 Related to Issue 24866

diffstat:

 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.class
                    |    0 
 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.class
                |    0 
 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PREFERENCE.xml
                                                           |    2 +-
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.java
         |    4 +-
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance_data.xsql
    |   21 +----
 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java
 |   41 +---------
 6 files changed, 4 insertions(+), 64 deletions(-)

diffs (136 lines):

diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.class
 has changed
diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.class
Binary file 
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.class
 has changed
diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PREFERENCE.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PREFERENCE.xml
 Mon Jan 13 09:42:39 2014 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PREFERENCE.xml
 Tue Jan 14 15:23:08 2014 +0530
@@ -26,7 +26,7 @@
 <!--43ECD009731844E38DEA2EA80D790D6F-->  
<AD_PREFERENCE_ID><![CDATA[43ECD009731844E38DEA2EA80D790D6F]]></AD_PREFERENCE_ID>
 <!--43ECD009731844E38DEA2EA80D790D6F-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--43ECD009731844E38DEA2EA80D790D6F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--43ECD009731844E38DEA2EA80D790D6F-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
+<!--43ECD009731844E38DEA2EA80D790D6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--43ECD009731844E38DEA2EA80D790D6F-->  
<ATTRIBUTE><![CDATA[IsCustomerBalanceRestored]]></ATTRIBUTE>
 <!--43ECD009731844E38DEA2EA80D790D6F-->  <VALUE><![CDATA[Y]]></VALUE>
 <!--43ECD009731844E38DEA2EA80D790D6F-->  
<ISPROPERTYLIST><![CDATA[N]]></ISPROPERTYLIST>
diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.java
       Mon Jan 13 09:42:39 2014 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance.java
       Tue Jan 14 15:23:08 2014 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2014 Openbravo SLU
+ * All portions are Copyright (C) 2011 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -35,8 +35,6 @@
       // If the preference does not exist in the database yet the modulescript 
must be executed.
       boolean isCustomerBalanceFixed = 
UpdateCustomerBalanceData.isCustomerBalanceFixed(cp);
       if (!isCustomerBalanceFixed) {
-        // Create Preference
-        UpdateCustomerBalanceData.createPreference(cp);
         // Reset the customer balance to 0
         UpdateCustomerBalanceData.resetCustomerCredit(cp);
         // Obtain the correct customer balance
diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance_data.xsql
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance_data.xsql
  Mon Jan 13 09:42:39 2014 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance_data.xsql
  Tue Jan 14 15:23:08 2014 +0530
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!--
  
************************************************************************************
- * Copyright (C) 2011-2014 Openbravo S.L.U.
+ * Copyright (C) 2011 Openbravo S.L.U.
  * Licensed under the Openbravo Commercial License version 1.0
  * You may obtain a copy of the License at 
http://www.openbravo.com/legal/obcl.html
  * or in the legal folder of this module distribution.
@@ -24,7 +24,6 @@
         SELECT count(*) as existpreference
         FROM ad_preference
         WHERE attribute = 'IsCustomerBalanceRestored'
-        AND isactive = 'Y'
       ]]>
     </Sql>
   </SqlMethod>
@@ -67,22 +66,4 @@
     <Parameter name="cumstomeCredit"/>
     <Parameter name="businessPartnerId"/>
   </SqlMethod>
-  <SqlMethod name="createPreference" type="preparedStatement" 
return="rowcount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-      <![CDATA[
-        INSERT INTO
-        ad_preference (
-          ad_preference_id, ad_client_id, ad_org_id, isactive,
-          createdby, created, updatedby, updated,
-          attribute, value, ad_module_id
-        )
-        VALUES (
-          get_uuid(), '0', '0', 'Y',
-          '0', NOW(), '0', NOW(),
-          'IsCustomerBalanceRestored', 'Y', NULL
-        )
-      ]]>
-    </Sql>
-  </SqlMethod>
 </SqlClass>
diff -r 247ee5cb2d80 -r 4535a885ce86 
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java
--- 
a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java
       Mon Jan 13 09:42:39 2014 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java
       Tue Jan 14 15:23:08 2014 +0530
@@ -96,8 +96,7 @@
     strSql = strSql + 
       "        SELECT count(*) as existpreference" +
       "        FROM ad_preference" +
-      "        WHERE attribute = 'IsCustomerBalanceRestored'" +
-      "        AND isactive = 'Y'";
+      "        WHERE attribute = 'IsCustomerBalanceRestored'";
 
     ResultSet result;
     boolean boolReturn = false;
@@ -252,42 +251,4 @@
     }
     return(updateCount);
   }
-
-  public static int createPreference(ConnectionProvider connectionProvider)    
throws ServletException {
-    String strSql = "";
-    strSql = strSql + 
-      "        INSERT INTO" +
-      "        ad_preference (" +
-      "          ad_preference_id, ad_client_id, ad_org_id, isactive," +
-      "          createdby, created, updatedby, updated," +
-      "          attribute, value, ad_module_id" +
-      "        )" +
-      "        VALUES (" +
-      "          get_uuid(), '0', '0', 'Y'," +
-      "          '0', NOW(), '0', NOW()," +
-      "          'IsCustomerBalanceRestored', 'Y', NULL" +
-      "        )";
-
-    int updateCount = 0;
-    PreparedStatement st = null;
-
-    try {
-    st = connectionProvider.getPreparedStatement(strSql);
-
-      updateCount = st.executeUpdate();
-    } 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(updateCount);
-  }
 }

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to