diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index d84a219d3..e1a276cda 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -18542,7 +18542,7 @@ No Request Body:
Optional Fields |
- | accountNo, externalId, fieldOfficerId |
+ | accountNo, externalId, fieldOfficerId,linkAccountId |
diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FixedDepositTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FixedDepositTest.java
index 44819bce9..fb8dd4431 100644
--- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FixedDepositTest.java
+++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FixedDepositTest.java
@@ -109,7 +109,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -172,7 +172,7 @@ public class FixedDepositTest {
this.responseSpec, fixedDepositProductId.toString());
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
todaysDate.add(Calendar.DATE, -1);
@@ -230,7 +230,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -311,7 +311,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -368,7 +368,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -410,7 +410,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -450,7 +450,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -488,7 +488,7 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositProductId);
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
- VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM);
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, null);
Assert.assertNotNull(fixedDepositAccountId);
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
@@ -499,6 +499,64 @@ public class FixedDepositTest {
Assert.assertNotNull(fixedDepositAccountId);
}
+ @Test
+ public void testFixedDepositAccountWithLinkedAccount() {
+ this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
+ this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
+ this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
+ this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
+
+ FixedDepositAccountHelper fixedDepositAccountHelperValidationError = new FixedDepositAccountHelper(this.requestSpec,
+ new ResponseSpecBuilder().build());
+
+ DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
+ DateFormat monthDayFormat = new SimpleDateFormat("dd MMM");
+
+ Calendar todaysDate = Calendar.getInstance();
+ todaysDate.add(Calendar.MONTH, -3);
+ final String VALID_FROM = dateFormat.format(todaysDate.getTime());
+ todaysDate.add(Calendar.YEAR, 10);
+ final String VALID_TO = dateFormat.format(todaysDate.getTime());
+
+ todaysDate = Calendar.getInstance();
+ todaysDate.add(Calendar.MONTH, -1);
+ final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
+ final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
+ final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
+ final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
+ todaysDate.add(Calendar.MONTH, 1);
+ final String CLOSED_ON_DATE = dateFormat.format(todaysDate.getTime());
+
+ Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
+ Assert.assertNotNull(clientId);
+ Float balance = new Float(MINIMUM_OPENING_BALANCE) + new Float(FixedDepositAccountHelper.depositAmount);
+ final Integer savingsId = createSavings(clientId, String.valueOf(balance));
+
+ HashMap summary = savingsAccountHelper.getSavingsSummary(savingsId);
+ assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
+
+ Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO);
+ Assert.assertNotNull(fixedDepositProductId);
+
+ Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(), VALID_FROM,
+ VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, savingsId.toString());
+ Assert.assertNotNull(fixedDepositAccountId);
+
+ HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
+ this.responseSpec, fixedDepositAccountId.toString());
+ FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
+
+ fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
+ FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
+
+ fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
+ FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
+ summary = savingsAccountHelper.getSavingsSummary(savingsId);
+ balance = new Float(MINIMUM_OPENING_BALANCE);
+ assertEquals("Verifying opening Balance", balance, summary.get("accountBalance"));
+
+ }
+
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
System.out.println("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
@@ -509,10 +567,12 @@ public class FixedDepositTest {
}
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
- final String validTo, final String submittedOnDate, final String penalInterestType) {
+ final String validTo, final String submittedOnDate, final String penalInterestType, String savingsId) {
System.out.println("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
- final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
- .withSubmittedOnDate(submittedOnDate).build(clientID, productID, validFrom, validTo, penalInterestType);
+ final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
+ //
+ .withSubmittedOnDate(submittedOnDate).withSavings(savingsId)
+ .build(clientID, productID, validFrom, validTo, penalInterestType);
return this.fixedDepositAccountHelper
.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
}
@@ -528,4 +588,24 @@ public class FixedDepositTest {
.withMinimumOpenningBalance(minOpenningBalance).build();
return SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec);
}
+
+ private Integer createSavings(Integer clientID, String openningBalance) {
+ final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, openningBalance);
+ Assert.assertNotNull(savingsProductID);
+
+ SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
+
+ final Integer savingsId = savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
+ Assert.assertNotNull(savingsProductID);
+
+ HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
+ SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
+
+ savingsStatusHashMap = savingsAccountHelper.approveSavings(savingsId);
+ SavingsStatusChecker.verifySavingsIsApproved(savingsStatusHashMap);
+
+ savingsStatusHashMap = savingsAccountHelper.activateSavings(savingsId);
+ SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
+ return savingsId;
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
index f22d85199..be314127e 100644
--- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
+++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
@@ -78,10 +78,11 @@ public class FixedDepositAccountHelper {
private final boolean preClosurePenalApplicable = true;
private final boolean isActiveChart = true;
private final String currencyCode = USD;
- private final String depositAmount = "100000";
+ public static final String depositAmount = "100000";
private final String depositPeriod = "14";
private final String depositPeriodFrequencyId = MONTHS;
private String submittedOnDate = "";
+ private String savingsId = null;
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
final String penalInterestType) {
@@ -156,10 +157,11 @@ public class FixedDepositAccountHelper {
map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
map.put("preClosurePenalInterest", this.preClosurePenalInterest);
map.put("preClosurePenalInterestOnTypeId", penalInterestType);
- map.put("depositAmount", this.depositAmount);
+ map.put("depositAmount", depositAmount);
map.put("depositPeriod", this.depositPeriod);
map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
map.put("submittedOnDate", this.submittedOnDate);
+ map.put("linkAccountId", savingsId);
String fixedDepositAccountJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountJson);
@@ -211,9 +213,10 @@ public class FixedDepositAccountHelper {
+ Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
}
- public HashMap updateInterestCalculationConfigForFixedDeposit(final String clientID, final String productID, final String accountID, final String submittedOnDate,
- final String validFrom, final String validTo, final String numberOfDaysPerYear, final String penalInterestType,
- final String interestCalculationType, final String interestCompoundingPeriodType, final String interestPostingPeriodType) {
+ public HashMap updateInterestCalculationConfigForFixedDeposit(final String clientID, final String productID, final String accountID,
+ final String submittedOnDate, final String validFrom, final String validTo, final String numberOfDaysPerYear,
+ final String penalInterestType, final String interestCalculationType, final String interestCompoundingPeriodType,
+ final String interestPostingPeriodType) {
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
.withSubmittedOnDate(submittedOnDate) //
@@ -425,4 +428,8 @@ public class FixedDepositAccountHelper {
return this;
}
+ public FixedDepositAccountHelper withSavings(final String savingsId) {
+ this.savingsId = savingsId;
+ return this;
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/data/AccountTransferDTO.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/data/AccountTransferDTO.java
index 91529a09b..e938d122c 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/data/AccountTransferDTO.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/data/AccountTransferDTO.java
@@ -9,6 +9,7 @@ import org.mifosplatform.portfolio.account.PortfolioAccountType;
import org.mifosplatform.portfolio.account.domain.AccountTransferDetails;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetail;
+import org.mifosplatform.portfolio.savings.domain.SavingsAccount;
public class AccountTransferDTO {
@@ -31,13 +32,14 @@ public class AccountTransferDTO {
private final String noteText;
private final String txnExternalId;
private final Loan loan;
+ private final SavingsAccount savingsAccount;
public AccountTransferDTO(final LocalDate transactionDate, final BigDecimal transactionAmount,
final PortfolioAccountType fromAccountType, final PortfolioAccountType toAccountType, final Long fromAccountId,
final Long toAccountId, final String description, final Locale locale, final DateTimeFormatter fmt,
final PaymentDetail paymentDetail, final Integer fromTransferType, final Integer toTransferType, final Long chargeId,
- Integer loanInstallmentNumber, Integer transferType, final AccountTransferDetails accountTransferDetails,final String noteText,
- final String txnExternalId,final Loan loan) {
+ Integer loanInstallmentNumber, Integer transferType, final AccountTransferDetails accountTransferDetails,
+ final String noteText, final String txnExternalId, final Loan loan, SavingsAccount savingsAccount) {
this.transactionDate = transactionDate;
this.transactionAmount = transactionAmount;
this.fromAccountType = fromAccountType;
@@ -57,6 +59,7 @@ public class AccountTransferDTO {
this.noteText = noteText;
this.txnExternalId = txnExternalId;
this.loan = loan;
+ this.savingsAccount = savingsAccount;
}
public LocalDate getTransactionDate() {
@@ -131,9 +134,12 @@ public class AccountTransferDTO {
return this.txnExternalId;
}
-
public Loan getLoan() {
return this.loan;
}
+ public SavingsAccount getSavingsAccount() {
+ return this.savingsAccount;
+ }
+
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociations.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociations.java
index ff5299ef8..d17b05c65 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociations.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociations.java
@@ -13,14 +13,17 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
@Table(name = "m_portfolio_account_associations")
public class AccountAssociations extends AbstractPersistable {
+ @SuppressWarnings("unused")
@ManyToOne
@JoinColumn(name = "loan_account_id", nullable = true)
private Loan loanAccount;
+ @SuppressWarnings("unused")
@ManyToOne
@JoinColumn(name = "savings_account_id", nullable = true)
private SavingsAccount savingsAccount;
+ @SuppressWarnings("unused")
@ManyToOne
@JoinColumn(name = "linked_loan_account_id", nullable = true)
private Loan linkedLoanAccount;
@@ -43,6 +46,10 @@ public class AccountAssociations extends AbstractPersistable {
return new AccountAssociations(loan, null, null, savingsAccount);
}
+ public static AccountAssociations associateSavingsAccount(final SavingsAccount savingsAccount, final SavingsAccount linkedSavingsAccount) {
+ return new AccountAssociations(null, savingsAccount, null, linkedSavingsAccount);
+ }
+
public SavingsAccount linkedSavingsAccount() {
return this.linkedSavingsAccount;
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociationsRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociationsRepository.java
index f63612a17..05f27025d 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociationsRepository.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/domain/AccountAssociationsRepository.java
@@ -11,4 +11,6 @@ public interface AccountAssociationsRepository extends JpaRepository statusList = this.jdbcTemplate.queryForList(sql, Integer.class, savingsId);
for (final Integer status : statusList) {
final LoanStatus loanStatus = LoanStatus.fromInt(status);
- if (loanStatus.isActiveOrAwaitingApprovalOrDisbursal() || loanStatus.isUnderTransfer()) {
- hasActiveLoan = true;
- break;
- }
+ if (loanStatus.isActiveOrAwaitingApprovalOrDisbursal() || loanStatus.isUnderTransfer()) { return true; }
}
- return hasActiveLoan;
+
+ final String savsql = "select savingAccount.status_enum as status from m_portfolio_account_associations aa "
+ + "left join m_savings_account savingAccount on savingAccount.id = aa.savings_account_id "
+ + "where aa.linked_savings_account_id = ?";
+
+ final List savstatusList = this.jdbcTemplate.queryForList(savsql, Integer.class, savingsId);
+ for (final Integer status : savstatusList) {
+ final SavingsAccountStatusType saveStatus = SavingsAccountStatusType.fromInt(status);
+ if (saveStatus.isActiveOrAwaitingApprovalOrDisbursal() || saveStatus.isUnderTransfer()) { return true; }
+ }
+
+ return hasActiveAccount;
}
private static final class AccountAssociationsMapper implements RowMapper {
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java
index 5be3dac29..1090afaab 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersReadPlatformServiceImpl.java
@@ -177,7 +177,7 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
final String currencyCode = excludeThisAccountFromOptions != null ? excludeThisAccountFromOptions.currencyCode() : null;
Collection accountOptions = this.portfolioAccountReadPlatformService.retrieveAllForLookup(toAccountType,
- toClientId, currencyCode, null);
+ toClientId, currencyCode, null, null);
if (!CollectionUtils.isEmpty(accountOptions)) {
accountOptions.remove(excludeThisAccountFromOptions);
} else {
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
index 6d3db96c8..c6e81e0e5 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/AccountTransfersWritePlatformServiceImpl.java
@@ -268,7 +268,11 @@ public class AccountTransfersWritePlatformServiceImpl implements AccountTransfer
SavingsAccount toSavingsAccount = null;
if (accountTransferDetails == null) {
fromSavingsAccount = this.savingsAccountAssembler.assembleFrom(accountTransferDTO.getFromAccountId());
- toSavingsAccount = this.savingsAccountAssembler.assembleFrom(accountTransferDTO.getToAccountId());
+ if (accountTransferDTO.getSavingsAccount() == null) {
+ toSavingsAccount = this.savingsAccountAssembler.assembleFrom(accountTransferDTO.getToAccountId());
+ } else {
+ toSavingsAccount = accountTransferDTO.getSavingsAccount();
+ }
} else {
fromSavingsAccount = accountTransferDetails.fromSavingsAccount();
this.savingsAccountAssembler.setHelpers(fromSavingsAccount);
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformService.java
index f85b55c3b..9c370b443 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformService.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformService.java
@@ -17,5 +17,5 @@ public interface PortfolioAccountReadPlatformService {
Collection retrieveAllForLookup(Integer toAccountType, Long toClientId, long[] accountStatus);
- Collection retrieveAllForLookup(Integer toAccountType, Long toClientId, String currencyCode, long[] accountStatus);
+ Collection retrieveAllForLookup(Integer toAccountType, Long toClientId, String currencyCode, long[] accountStatus, Integer depositType);
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java
index 46de1ad64..83116e5fb 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java
@@ -8,7 +8,9 @@ package org.mifosplatform.portfolio.account.service;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
@@ -86,14 +88,15 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount
@Override
public Collection retrieveAllForLookup(final Integer accountTypeId, final Long clientId,
final long[] accountStatus) {
- return retrieveAllForLookup(accountTypeId, clientId, null, accountStatus);
+ return retrieveAllForLookup(accountTypeId, clientId, null, accountStatus, null);
}
@Override
public Collection retrieveAllForLookup(final Integer accountTypeId, final Long clientId,
- final String currencyCode, final long[] accountStatus) {
+ final String currencyCode, final long[] accountStatus,final Integer depositType) {
- Object[] sqlParams = new Object[] { clientId };
+ List