From a941bbdded1e7d4eb2371f102a04cc962d77ea07 Mon Sep 17 00:00:00 2001 From: goutham-M Date: Wed, 3 Jul 2013 11:10:39 +0530 Subject: [PATCH] Loan is getting approved for a Closed client(fixed) --- .../service/ClientWritePlatformServiceJpaRepositoryImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index b46d54bd4..01f0bd45c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -356,6 +356,9 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP final String errorMessage = "The client closureDate cannot be before the loan closedOnDate."; throw new InvalidClientStateTransitionException("close", "date.cannot.before.loan.closed.date", errorMessage, closureDate, loan.getClosedOnDate()); + } else if (loanStatus.isPendingApproval()) { + final String errorMessage = "Client cannot be closed because of non-closed loans."; + throw new InvalidClientStateTransitionException("close", "loan.non-closed", errorMessage); } } List clientSavingAccounts = this.savingsRepository.findSavingAccountByClientId(clientId);