Merge pull request #1351 from chandrikamohith/tranche
MIFOSX-1842 Adding validation for add/delete tranche based on loan statu...
This commit is contained in:
+1
-1
@@ -885,7 +885,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
loan.regenerateRepaymentSchedule(scheduleGeneratorDTO, currentUser);
|
||||
}
|
||||
|
||||
this.loanRepository.save(loan);
|
||||
saveAndFlushLoanWithDataIntegrityViolationChecks(loan);
|
||||
|
||||
final String noteText = command.stringValueOfParameterNamed("note");
|
||||
if (StringUtils.isNotBlank(noteText)) {
|
||||
|
||||
+3
-2
@@ -2612,8 +2612,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final String errorMessage = "loan.product.does.not.support.multiple.disbursals";
|
||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||
}
|
||||
if(loan.isSubmittedAndPendingApproval()){
|
||||
final String errorMessage = "loan.account.should.be.approved";
|
||||
if(loan.isSubmittedAndPendingApproval() || loan.isClosed() || loan.isClosedWrittenOff() || loan.status().isClosedObligationsMet() ||
|
||||
loan.status().isOverpaid()){
|
||||
final String errorMessage = "cannot.modify.tranches.if.loan.is.pendingapproval.closed.overpaid.writtenoff";
|
||||
throw new LoanMultiDisbursementException(LoanApiConstants.disbursementDataParameterName, errorMessage);
|
||||
}
|
||||
validateMultiDisbursementData(command, expectedDisbursementDate);
|
||||
|
||||
Reference in New Issue
Block a user