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() }); }