diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java index 0a45c645ea1..48e98b06bd3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java @@ -178,14 +178,22 @@ public String newClientIdentifierDetails(@Context final UriInfo uriInfo) { String type = queryParameters.getFirst("type"); String groupingType = queryParameters.getFirst("groupingType"); + String groupId = queryParameters.getFirst("groupId"); Long agencyId = null; Long centerId = null; + if (!StringUtils.isBlank(groupId)){ + GroupPrequalificationData prequalificationGroup = this.prequalificationReadPlatformService.retrieveOne(Long.valueOf(groupId)); + agencyId = prequalificationGroup.getAgencyId(); + centerId = prequalificationGroup.getCenterId(); + } + if (queryParameters.getFirst("agencyId") != null) { agencyId = NumberUtils.toLong(queryParameters.getFirst("agencyId"), Long.MAX_VALUE); } if (queryParameters.getFirst("centerId") != null) { centerId = NumberUtils.toLong(queryParameters.getFirst("centerId"), Long.MAX_VALUE); } + Collection loanProducts = this.loanProductReadPlatformService.retrieveAllLoanProducts(); Integer prequalificationType = null; if (StringUtils.isNotBlank(groupingType)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java index 98e37cd374d..845a3488558 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java @@ -178,7 +178,8 @@ public CommandProcessingResult processPrequalification(JsonCommand command) { if (previousPrequalificationId != null) { parentGroup = this.prequalificationGroupRepositoryWrapper.findOneWithNotFoundDetection(previousPrequalificationId); if (!parentGroup.getStatus().equals(PrequalificationStatus.COMPLETED.getValue()) - && !parentGroup.getStatus().equals(PrequalificationStatus.REJECTED.getValue())) { + && !parentGroup.getStatus().equals(PrequalificationStatus.REJECTED.getValue()) + && !parentGroup.getStatus().equals(PrequalificationStatus.TIME_EXPIRED.getValue())) { throw new PrequalificationStatusNotCompletedException(PrequalificationStatus.fromInt(parentGroup.getStatus()).toString()); } existingGroupParentGroup = this.groupRepositoryWrapper.findOneWithPrequalificationIdNotFoundDetection(parentGroup); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentImport.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentImport.java index ec0a65acc94..6bdd4d0c653 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentImport.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentImport.java @@ -181,6 +181,19 @@ public class LoanRepaymentImport { @Column(name = "Id_error") private Long errorId; + public void resetMifosFields() { + this.status = null; + this.mifosProcessingDate = null; + this.mifosProcessingTime = null; + this.mifosFileName = null; + this.operationResult = null; + this.scheduledPaymentAmount = null; + this.paymentNumber = null; + this.lastPayment = null; + this.tolerance = null; + this.errorId = null; + } + public void setStatus(Long status) { this.status = status; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java index 0b48eccf8ad..9aa30098e26 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java @@ -342,8 +342,9 @@ public void importLoanRepaymentBatches() throws JobExecutionException { for (final LoanRepaymentImportData loanRepaymentImportData : loanRepayments) { iterations++; final String loanCode = loanRepaymentImportData.getLoanCode(); - LoanRepaymentImport loanRepaymentImport = this.loanRepaymentImportRepository.findById(loanRepaymentImportData.getId()) + final LoanRepaymentImport loanRepaymentImport = this.loanRepaymentImportRepository.findById(loanRepaymentImportData.getId()) .orElseThrow(() -> new NotFoundException("error.msg.loanRepaymentImport.not.found.")); + loanRepaymentImport.resetMifosFields(); final LocalDateTime localDateTime = DateUtils.getLocalDateTimeOfSystem(); loanRepaymentImport.setMifosProcessingDate(localDateTime); loanRepaymentImport.setMifosProcessingTime(localDateTime.toLocalTime());