Fixes bug 28987: Add payment does not take long to load with lot of credit paym.
authorUnai Martirena <unai.martirena@openbravo.com>
Tue, 24 Feb 2015 12:38:51 +0100
changeset 26066 aba0f61a4140
parent 26065 efe82870c240
child 26067 a169e46939db
Fixes bug 28987: Add payment does not take long to load with lot of credit paym.

When opening Add Payment process definition it has to load the default values of the parameters of the process definition. One of this parameters is the credit of the business partner of the payment. The method that calculates this credit calls the method seqnumberpaymentstatus that uses CallStoredProcedure.getInstance().call to call the database function. This method is executed for each credit payment of the customer and on each execution an unnecessary flush was being done, so with lots of credit payments the impact on performance was huge.
A false flag has been added to call process to not to do flush on each execution of the process, so the performance problem is avoided.
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Mon Feb 23 17:10:34 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Tue Feb 24 12:38:51 2015 +0100
@@ -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) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -1444,7 +1444,7 @@
   }
 
   /**
-   * Returns the secuence number of payment status in reference list
+   * Returns the sequence number of payment status in reference list
    * 
    * 
    */
@@ -1452,7 +1452,7 @@
     List<Object> parameters = new ArrayList<Object>();
     parameters.add(status);
     int result = Integer.parseInt((String) CallStoredProcedure.getInstance().call(
-        "aprm_seqnumberpaymentstatus", parameters, null));
+        "aprm_seqnumberpaymentstatus", parameters, null, false));
 
     return result;
   }