Fixes Issue 0041424:Remove several unused methods in FIN_Utility.java
authorAtul Gaware <atul.gaware@openbravo.com>
Wed, 07 Aug 2019 23:38:57 +0530
changeset 36431 b9af88ac78ee
parent 36430 18b55aec2e34
child 36432 110e54591950
Fixes Issue 0041424:Remove several unused methods in FIN_Utility.java

**Remove methods getInStrList, getInStrSet, getPaymentMethodList,
getFinancialAccountList and getOrderedPaymentDetailList that are
not used any more.
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	Wed Aug 07 23:40:26 2019 +0530
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Wed Aug 07 23:38:57 2019 +0530
@@ -30,7 +30,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.TimeZone;
 
@@ -59,7 +58,6 @@
 import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
-import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.utility.Sequence;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
@@ -73,7 +71,6 @@
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
-import org.openbravo.model.financialmgmt.payment.FIN_PaymentDetail;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentProposal;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule;
@@ -230,32 +227,6 @@
   }
 
   /**
-   * Creates a comma separated string with the Id's of the OBObjects included in the List.
-   * 
-   * @param <T>
-   * @param obObjectList
-   *          List of OBObjects
-   * @return Comma separated string of Id's
-   */
-  @Deprecated
-  public static <T extends BaseOBObject> String getInStrList(List<T> obObjectList) {
-    return Utility.getInStrList(obObjectList);
-  }
-
-  /**
-   * Creates a comma separated string with the Id's of the Set of Strings. This method is deprecated
-   * as it has been added to Utility (core)
-   * 
-   * @param set
-   *          Set of Strings
-   * @return Comma separated string of Id's
-   */
-  @Deprecated
-  public static String getInStrSet(Set<String> set) {
-    return Utility.getInStrSet(set);
-  }
-
-  /**
    * Returns the cause of a trigger exception (BatchupdateException).
    * 
    * Hibernate and JDBC will wrap the exception thrown by the trigger in another exception (the
@@ -482,36 +453,6 @@
    *          if the strPaymentMethodId is empty or null then depending on this parameter the list
    *          will include payment methods with no Financial Accounts associated or only show the
    *          Payment Methods that belongs to at least on Financial Account
-   * @return a String with the html code with the options to fill the drop-down of Payment Methods.
-   */
-  @Deprecated
-  public static String getPaymentMethodList(String strPaymentMethodId, String strFinancialAccountId,
-      String strOrgId, boolean isMandatory, boolean excludePaymentMethodWithoutAccount) {
-    dao = new AdvPaymentMngtDao();
-    List<FIN_PaymentMethod> paymentMethods = dao.getFilteredPaymentMethods(strFinancialAccountId,
-        strOrgId, excludePaymentMethodWithoutAccount, AdvPaymentMngtDao.PaymentDirection.EITHER);
-    String options = getOptionsList(paymentMethods, strPaymentMethodId, isMandatory);
-    return options;
-  }
-
-  /**
-   * Gets the available Payment Methods and returns in a String the html code containing all the
-   * Payment Methods in the natural tree of the given organization filtered by the Financial
-   * Account.
-   * 
-   * @param strPaymentMethodId
-   *          the Payment Method id that will be selected by default in case it is present in the
-   *          list.
-   * @param strFinancialAccountId
-   *          optional Financial Account id to filter the Payment Methods.
-   * @param strOrgId
-   *          the Organization id the record belongs to.
-   * @param isMandatory
-   *          boolean parameter to add an extra blank option if the drop-down is optional.
-   * @param excludePaymentMethodWithoutAccount
-   *          if the strPaymentMethodId is empty or null then depending on this parameter the list
-   *          will include payment methods with no Financial Accounts associated or only show the
-   *          Payment Methods that belongs to at least on Financial Account
    * @param isInPayment
    *          specifies the type of payment to get payment methods for. If true, will return payment
    *          methods with Payment In enabled, if false will return payment methods with Payment Out
@@ -549,32 +490,6 @@
    *          the Organization id the record belongs to.
    * @param strCurrencyId
    *          optional Currency id to filter the Financial Accounts.
-   * @return a String with the html code with the options to fill the drop-down of Financial
-   *         Accounts.
-   */
-  @Deprecated
-  public static String getFinancialAccountList(String strPaymentMethodId,
-      String strFinancialAccountId, String strOrgId, boolean isMandatory, String strCurrencyId) {
-    List<FIN_FinancialAccount> financialAccounts = dao.getFilteredFinancialAccounts(
-        strPaymentMethodId, strOrgId, strCurrencyId, AdvPaymentMngtDao.PaymentDirection.EITHER);
-    String options = getOptionsList(financialAccounts, strFinancialAccountId, isMandatory);
-    return options;
-  }
-
-  /**
-   * Gets the available Financial Accounts and returns in a String the html code containing all the
-   * Financial Accounts in the natural tree of the given organization filtered by the Payment
-   * Method.
-   * 
-   * @param strPaymentMethodId
-   *          optional Payment Method id to filter the Financial Accounts.
-   * @param strFinancialAccountId
-   *          the Financial Account id that will be selected by default in case it is present in the
-   *          list.
-   * @param strOrgId
-   *          the Organization id the record belongs to.
-   * @param strCurrencyId
-   *          optional Currency id to filter the Financial Accounts.
    * @param isInPayment
    *          specifies the type of payment to that is being made. If true, will return accounts
    *          with payment methods that have Payment In enabled, if false will return accounts with
@@ -1390,41 +1305,6 @@
   }
 
   /**
-   * Returns Payment Details from a Payment ordered by Invoice and Order. This method is deprecated
-   * as it does not perform well. Use {@link #getOrderedPaymentDetailList(String paymentId)} instead
-   * 
-   */
-  @Deprecated
-  public static List<FIN_PaymentDetail> getOrderedPaymentDetailList(FIN_Payment payment) {
-
-    List<FIN_PaymentDetail> pdList = null;
-
-    OBContext.setAdminMode();
-    try {
-      // @formatter:off
-      final String whereClause = ""
-          + " as pd "
-          + "   left join pd.fINPaymentScheduleDetailList as psd"
-          + " where pd.finPayment.id = :paymentId"
-          + " order by psd.invoicePaymentSchedule"
-          + "   , coalesce(psd.orderPaymentSchedule"
-          + "   , '0')";
-      // @formatter:on
-      OBQuery<FIN_PaymentDetail> query = OBDal.getInstance()
-          .createQuery(FIN_PaymentDetail.class, whereClause);
-      query.setNamedParameter("paymentId", payment.getId());
-      query.setFilterOnReadableClients(false);
-      query.setFilterOnReadableOrganization(false);
-      pdList = query.list();
-
-    } finally {
-      OBContext.restorePreviousMode();
-    }
-
-    return pdList;
-  }
-
-  /**
    * Returns Payment Details from a Payment ordered by Invoice and Order
    */
   public static List<String> getOrderedPaymentDetailList(String paymentId) {