diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/service/StaffReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/service/StaffReadPlatformServiceImpl.java index f66cb34a5..5f2f7e79b 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/service/StaffReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/service/StaffReadPlatformServiceImpl.java @@ -74,7 +74,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService { sqlBuilder.append("s.mobile_no as mobileNo, s.is_active as isActive "); sqlBuilder.append("from m_office o "); sqlBuilder.append("join m_office ohierarchy on o.hierarchy like concat(ohierarchy.hierarchy, '%') "); - sqlBuilder.append("join m_staff s on s.office_id = ohierarchy.id "); + sqlBuilder.append("join m_staff s on s.office_id = ohierarchy.id and s.is_active=1 "); if (loanOfficersOnly) { sqlBuilder.append("and s.is_loan_officer is true "); @@ -140,7 +140,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService { final Long defaultOfficeId = defaultToUsersOfficeIfNull(officeId); - final String sql = "select " + this.lookupMapper.schema() + " where s.office_id = ?"; + final String sql = "select " + this.lookupMapper.schema() + " where s.office_id = ? and s.is_active=1 "; return this.jdbcTemplate.query(sql, this.lookupMapper, new Object[] { defaultOfficeId }); }