TRY_PARAMS###JOBS_TO_BUILD=try-api
authorAtul Gaware <atul.gaware@openbravo.com>
Thu, 25 Apr 2019 14:49:30 +0530
changeset 36064 347c018ab1bf
parent 36061 e62dace3de97
TRY_PARAMS###JOBS_TO_BUILD=try-api
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Thu Apr 25 11:02:12 2019 +0530
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Thu Apr 25 14:49:30 2019 +0530
@@ -821,13 +821,6 @@
     }
   }
 
-  @Deprecated
-  public List<FIN_PaymentMethod> getFilteredPaymentMethods(String strFinancialAccountId,
-      String strOrgId, boolean excludePaymentMethodWithoutAccount) {
-    return getFilteredPaymentMethods(strFinancialAccountId, strOrgId,
-        excludePaymentMethodWithoutAccount, PaymentDirection.EITHER);
-  }
-
   public List<FIN_PaymentMethod> getFilteredPaymentMethods(String strFinancialAccountId,
       String strOrgId, boolean excludePaymentMethodWithoutAccount,
       PaymentDirection paymentDirection) {
@@ -934,13 +927,6 @@
     }
   }
 
-  @Deprecated
-  public List<FIN_FinancialAccount> getFilteredFinancialAccounts(String strPaymentMethodId,
-      String strOrgId, String strCurrencyId) {
-    return getFilteredFinancialAccounts(strPaymentMethodId, strOrgId, strCurrencyId,
-        PaymentDirection.EITHER);
-  }
-
   public List<FIN_FinancialAccount> getFilteredFinancialAccounts(String strPaymentMethodId,
       String strOrgId, String strCurrencyId, PaymentDirection paymentDirection) {
     final OBCriteria<FIN_FinancialAccount> obc = OBDal.getInstance()
@@ -1290,16 +1276,6 @@
     return ppfiCriteria.list();
   }
 
-  @Deprecated
-  public BigDecimal getCustomerCredit(BusinessPartner bp, boolean isReceipt) {
-    BigDecimal creditAmount = BigDecimal.ZERO;
-    for (FIN_Payment payment : getCustomerPaymentsWithCredit(bp, isReceipt)) {
-      creditAmount = creditAmount.add(payment.getGeneratedCredit())
-          .subtract(payment.getUsedCredit());
-    }
-    return creditAmount;
-  }
-
   public BigDecimal getCustomerCredit(BusinessPartner bp, boolean isReceipt, Organization Org) {
     return getCustomerCredit(bp, isReceipt, Org, null);
   }
@@ -1315,21 +1291,6 @@
     return creditAmount;
   }
 
-  @Deprecated
-  public List<FIN_Payment> getCustomerPaymentsWithCredit(BusinessPartner bp, boolean isReceipt) {
-    OBCriteria<FIN_Payment> obcPayment = OBDal.getInstance().createCriteria(FIN_Payment.class);
-    obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_BUSINESSPARTNER, bp));
-    obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_RECEIPT, isReceipt));
-    obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_GENERATEDCREDIT, BigDecimal.ZERO));
-    obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPAP"));
-    obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPVOID"));
-    obcPayment.add(Restrictions.neProperty(FIN_Payment.PROPERTY_GENERATEDCREDIT,
-        FIN_Payment.PROPERTY_USEDCREDIT));
-    obcPayment.addOrderBy(FIN_Payment.PROPERTY_PAYMENTDATE, true);
-    obcPayment.addOrderBy(FIN_Payment.PROPERTY_DOCUMENTNO, true);
-    return obcPayment.list();
-  }
-
   /**
    * Returns the list of credit payments for the selected business partner that belongs to the legal
    * entity's natural tree of the given organization
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Thu Apr 25 11:02:12 2019 +0530
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Thu Apr 25 14:49:30 2019 +0530
@@ -56,20 +56,6 @@
     return OBDal.getInstance().get(t, strId);
   }
 
-  @Deprecated
-  public static FIN_Reconciliation getReconciliationPending() {
-    OBCriteria<FIN_Reconciliation> obCriteria = OBDal.getInstance()
-        .createCriteria(FIN_Reconciliation.class);
-    obCriteria.add(Restrictions.eq(FIN_Reconciliation.PROPERTY_PROCESSED, false));
-    List<FIN_Reconciliation> lines = obCriteria.list();
-
-    if (lines.isEmpty()) {
-      return null;
-    } else {
-      return lines.get(0);
-    }
-  }
-
   public static BigDecimal getClearedLinesAmount(String strReconciliationId) {
     OBCriteria<FIN_FinaccTransaction> obCriteria = OBDal.getInstance()
         .createCriteria(FIN_FinaccTransaction.class);
@@ -369,54 +355,6 @@
   }
 
   /**
-   * Calculates the ending balance of automatic reconciliations. The sum of all the bank statement
-   * lines of the reconciliation financial account that belong to the given reconciliation plus the
-   * ones that does not have a transaction associated yet.
-   * 
-   * @param reconciliation
-   *          Reconciliation.
-   * @return Ending balance of an automatic reconciliation.
-   */
-  @Deprecated
-  public static BigDecimal getReconciliationEndingBalance(FIN_Reconciliation reconciliation) {
-    BigDecimal total = BigDecimal.ZERO;
-    OBContext.setAdminMode(true);
-    try {
-      OBCriteria<FIN_BankStatementLine> obcBsl = OBDal.getInstance()
-          .createCriteria(FIN_BankStatementLine.class);
-      obcBsl.createAlias(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT, "bs");
-      obcBsl.createAlias(FIN_BankStatementLine.PROPERTY_FINANCIALACCOUNTTRANSACTION, "tr",
-          JoinType.LEFT_OUTER_JOIN);
-      obcBsl.add(Restrictions.or(
-          Restrictions.isNull(FIN_BankStatementLine.PROPERTY_FINANCIALACCOUNTTRANSACTION),
-          Restrictions.eq("tr." + FIN_FinaccTransaction.PROPERTY_RECONCILIATION, reconciliation)));
-
-      obcBsl.add(
-          Restrictions.eq("bs." + FIN_BankStatement.PROPERTY_ACCOUNT, reconciliation.getAccount()));
-      obcBsl.add(Restrictions.eq("bs." + FIN_BankStatement.PROPERTY_PROCESSED, true));
-      ProjectionList projections = Projections.projectionList();
-      projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_CRAMOUNT));
-      projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
-      obcBsl.setProjection(projections);
-
-      @SuppressWarnings("rawtypes")
-      List o = obcBsl.list();
-      if (o != null && o.size() > 0) {
-        Object[] resultSet = (Object[]) o.get(0);
-        BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] : BigDecimal.ZERO;
-        BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] : BigDecimal.ZERO;
-        total = credit.subtract(debit);
-      }
-      o.clear();
-
-    } finally {
-      OBContext.restorePreviousMode();
-    }
-
-    return total;
-  }
-
-  /**
    * Calculates the balance of unmatched bank statements for the given reconciliation
    * 
    * @param lastReconciliation
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Thu Apr 25 11:02:12 2019 +0530
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Thu Apr 25 14:49:30 2019 +0530
@@ -121,29 +121,6 @@
     return 0l;
   }
 
-  @Deprecated
-  public static void process(FIN_FinaccTransaction finFinancialAccountTransaction) {
-    final FIN_FinancialAccount financialAccount = OBDal.getInstance()
-        .get(FIN_FinancialAccount.class, finFinancialAccountTransaction.getAccount().getId());
-    financialAccount.setCurrentBalance(financialAccount.getCurrentBalance()
-        .add(finFinancialAccountTransaction.getDepositAmount()
-            .subtract(finFinancialAccountTransaction.getPaymentAmount())));
-    finFinancialAccountTransaction.setProcessed(true);
-    FIN_Payment payment = finFinancialAccountTransaction.getFinPayment();
-    if (payment != null) {
-      payment.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
-      finFinancialAccountTransaction.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
-      OBDal.getInstance().save(payment);
-    } else {
-      finFinancialAccountTransaction.setStatus(finFinancialAccountTransaction.getDepositAmount()
-          .compareTo(finFinancialAccountTransaction.getPaymentAmount()) > 0 ? "RDNC" : "PWNC");
-    }
-    OBDal.getInstance().save(financialAccount);
-    OBDal.getInstance().save(finFinancialAccountTransaction);
-    OBDal.getInstance().flush();
-    return;
-  }
-
   public static void post(VariablesSecureApp vars, ConnectionProvider connectionProvider,
       FIN_FinaccTransaction finFinancialAccountTransaction) {
     final String AD_TABLE_ID = "4D8C3B3C31D1410DA046140C9F024D17";