diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositMaturityDashboardApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositMaturityDashboardApiResource.java index c1a1c8b51..9ab7d736f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositMaturityDashboardApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositMaturityDashboardApiResource.java @@ -33,8 +33,12 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; /** - * FD Dashboard's data source: every ACTIVE Fixed Deposit with just the fields the maturity ladder - * needs (account/client/product identity, maturity date, deposit and maturity amounts). + * FD Dashboard's data source: every Fixed Deposit still sitting on its own account -- ACTIVE, or the + * real MATURED(800) status the nightly maturity job sets once it's past maturity_date with no + * closure instruction to auto-process -- with just the fields the maturity ladder needs + * (account/client/product identity, maturity date, deposit and maturity amounts). A MATURED FD stays + * here until it's actually renewed or closed, since that's exactly the "needs manual attention" + * state the ladder exists to surface. * * Deliberately not routed through {@link FixedDepositAccountsApiResource#retrieveAll}: that * endpoint's mapper joins m_savings_account to m_client, m_group, m_staff, m_currency, @@ -57,6 +61,8 @@ public class FixedDepositMaturityDashboardApiResource { private static final int FIXED_DEPOSIT = 200; /** SavingsAccountStatusType.ACTIVE. */ private static final int ACTIVE = 300; + /** SavingsAccountStatusType.MATURED -- set by the nightly job once past maturity_date. */ + private static final int MATURED = 800; private final PlatformSecurityContext context; private final JdbcTemplate jdbcTemplate; @@ -87,9 +93,9 @@ public class FixedDepositMaturityDashboardApiResource { JOIN m_savings_product sp ON sp.id = sa.product_id LEFT JOIN m_deposit_product_term_and_preclosure dptp ON dptp.savings_product_id = sp.id LEFT JOIN m_client c ON c.id = sa.client_id - WHERE sa.deposit_type_enum = ? AND sa.status_enum = ? + WHERE sa.deposit_type_enum = ? AND sa.status_enum IN (?, ?) ORDER BY datp.maturity_date ASC - """, FIXED_DEPOSIT, ACTIVE); + """, FIXED_DEPOSIT, ACTIVE, MATURED); return this.gson.toJson(rows); }