diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationReadPlatformServiceImpl.java index 17b3435f557..fc87fe1f05f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationReadPlatformServiceImpl.java @@ -312,7 +312,11 @@ private String buildSqlStringFromBlacklistCriteria(final SearchParameters search if (agencyId != null) { - extraCriteria += " and individualOffice.agency_id = ? "; + if (StringUtils.equalsIgnoreCase(groupingType, "individual")) { + extraCriteria += " and individualOffice.agency_id = ? "; + }else { + extraCriteria += " and ma.id = ? "; + } paramList.add(agencyId); }