diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/RestructureCreditsWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/RestructureCreditsWritePlatformServiceImpl.java index e511802446a..3f009c52fec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/RestructureCreditsWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/RestructureCreditsWritePlatformServiceImpl.java @@ -182,6 +182,7 @@ private Long openNewLoanAccount(RestructureCreditsRequest request, JsonCommand c loanObject.add("principal", this.fromApiJsonHelper.parse(request.getTotalLoanAmount().toPlainString())); loanObject.add("locale", command.jsonElement("locale")); loanObject.add("dateFormat", command.jsonElement("dateFormat")); + loanObject.addProperty("isRestructuredLoan", true); JsonElement finalCommand = this.fromApiJsonHelper.parse(loanObject.toString()); JsonCommand jsonCommand = JsonCommand.fromExistingCommand(command, finalCommand); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java index 58a99407b36..48cebdae10d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java @@ -126,7 +126,7 @@ public final class LoanApplicationCommandFromApiJsonHelper { LoanApiConstants.paymentCapacityParamName, LoanApiConstants.facilitatorParamName, LoanApiConstants.maidenNameParamName, LoanApiConstants.politicallyExposedParamName, LoanApiConstants.otherIncomeParamName, LoanApiConstants.currentLoansParamName, LoanApiConstants.dateOfBirthParamName, LoanApiConstants.businessActivityParamName, LoanApiConstants.LOAN_ADDITIONAL_DATA, - "borrowerCycle", "isBulkImport")); + "borrowerCycle", "isBulkImport","isRestructuredLoan")); private final FromJsonHelper fromApiJsonHelper; private final CalculateLoanScheduleQueryFromApiJsonHelper apiJsonHelper; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java index 33b4ef61561..bf05ca5bf5e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java @@ -350,7 +350,8 @@ private Loan assembleApplication(final JsonElement element, final Long clientId, PrequalificationGroup prequalificationGroup = null; final Boolean isBulkImport = this.fromApiJsonHelper.extractBooleanNamed("isBulkImport", element); - if (isBulkImport == null || !isBulkImport) { + final Boolean isRestructuredLoan = this.fromApiJsonHelper.extractBooleanNamed("isRestructuredLoan", element); + if ((isBulkImport == null || !isBulkImport) && (isRestructuredLoan == null || !isRestructuredLoan)) { final Long prequalificationId = this.fromApiJsonHelper.extractLongNamed("prequalificationId", element); prequalificationGroup = this.prequalificationGroupRepositoryWrapper.findOneWithNotFoundDetection(prequalificationId); if (!PrequalificationStatus.BURO_CHECKED.getValue().equals(prequalificationGroup.getStatus())) {