From 61e6214fa671e9cbb1cd9a176daf35f585c07aba Mon Sep 17 00:00:00 2001 From: Nazeer Hussain Shaik Date: Wed, 13 Sep 2017 19:49:45 +0530 Subject: [PATCH] FINERACT-494 Issue when selecting savings account on client creation page --- .../SavingsProductReadPlatformServiceImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java index 4758b019c..fec8a217e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java @@ -262,14 +262,19 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead if (isOverdraftType != null) { if (inClauseAdded) { - sql += " and sp.allow_overdraft=?"; + sql += " and sp.allow_overdraft=? and sp.deposit_type_enum = ?"; } else { - sql += " where sp.allow_overdraft=?"; + sql += " where sp.allow_overdraft=? and sp.deposit_type_enum = ?"; } - return this.jdbcTemplate.query(sql, this.savingsProductLookupsRowMapper, isOverdraftType); + return this.jdbcTemplate.query(sql, this.savingsProductLookupsRowMapper, new Object[] {isOverdraftType, DepositAccountType.SAVINGS_DEPOSIT.getValue() }); } - - return this.jdbcTemplate.query(sql, this.savingsProductLookupsRowMapper); + + if(inClauseAdded) { + sql += " and sp.deposit_type_enum = ?"; + }else { + sql += " where sp.deposit_type_enum = ?"; + } + return this.jdbcTemplate.query(sql, this.savingsProductLookupsRowMapper, new Object[] { DepositAccountType.SAVINGS_DEPOSIT.getValue() }); }