multi tranche loan validation add and foreclose issues for multi tranche issues fixed
This commit is contained in:
+7
-1
@@ -6227,7 +6227,13 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(LoanDisbursementDetails loanDisbursementDetails : getDisbursementDetails()){
|
||||||
|
if(loanDisbursementDetails.actualDisbursementDate() == null){
|
||||||
|
totalPrincipal = Money.of(currency, totalPrincipal.getAmount().subtract(loanDisbursementDetails.principal()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LocalDate installmentStartDate = getDisbursementDate();
|
LocalDate installmentStartDate = getDisbursementDate();
|
||||||
|
|
||||||
if (newInstallments.size() > 0) {
|
if (newInstallments.size() > 0) {
|
||||||
|
|||||||
+8
-1
@@ -33,7 +33,6 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
|
import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
|
||||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
||||||
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||||
@@ -2903,6 +2902,14 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
|
|
||||||
String noteText = this.fromApiJsonHelper.extractStringNamed(LoanApiConstants.noteParamName, element);
|
String noteText = this.fromApiJsonHelper.extractStringNamed(LoanApiConstants.noteParamName, element);
|
||||||
LoanRescheduleRequest loanRescheduleRequest = null;
|
LoanRescheduleRequest loanRescheduleRequest = null;
|
||||||
|
for (LoanDisbursementDetails loanDisbursementDetails : loan.getDisbursementDetails()) {
|
||||||
|
if (!loanDisbursementDetails.expectedDisbursementDateAsLocalDate().isAfter(transactionDate)
|
||||||
|
&& loanDisbursementDetails.actualDisbursementDate() == null) {
|
||||||
|
final String defaultUserMessage = "The loan with undisbrsed tranche before foreclosure cannot be foreclosed.";
|
||||||
|
throw new LoanForeclosureException("loan.with.undisbursed.tranche.before.foreclosure.cannot.be.foreclosured",
|
||||||
|
defaultUserMessage, transactionDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.loanScheduleHistoryWritePlatformService.createAndSaveLoanScheduleArchive(loan.getRepaymentScheduleInstallments(),
|
this.loanScheduleHistoryWritePlatformService.createAndSaveLoanScheduleArchive(loan.getRepaymentScheduleInstallments(),
|
||||||
loan, loanRescheduleRequest);
|
loan, loanRescheduleRequest);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user