diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationChecklistWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationChecklistWritePlatformServiceImpl.java index 55d03f00400..5b9d0382b43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationChecklistWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationChecklistWritePlatformServiceImpl.java @@ -22,6 +22,7 @@ import java.sql.Date; import java.sql.ResultSet; import java.sql.SQLException; +import java.text.DecimalFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; @@ -1006,20 +1007,22 @@ private CheckValidationColor runCheck25(final ClientData clientData) { final ClientData params = retrieveClientParams(clientData.getClientId(), clientData.getProductId()); final List loanAdditionPropertiesList = this.loanAdditionalPropertiesRepository .findByClientIdAndLoanId(clientData.getClientId(), clientData.getLoanId()); - int yearsInBusiness = 0; + String yearsInBusiness = "0"; if (!CollectionUtils.isEmpty(loanAdditionPropertiesList)) { final LoanAdditionProperties loanAdditionProperties = loanAdditionPropertiesList.get(0); LocalDate businessStartDate = loanAdditionProperties.getFecha_inicio_negocio(); LocalDate currentDate = DateUtils.getLocalDateOfTenant(); - Integer monthsBetween = Math.toIntExact(ChronoUnit.MONTHS.between(currentDate, businessStartDate)); - yearsInBusiness = monthsBetween / 12; + Double monthsBetween = Double.valueOf(ChronoUnit.MONTHS.between(businessStartDate,currentDate)); + DecimalFormat f = new DecimalFormat("##.0"); + + yearsInBusiness = f.format(Double.valueOf(monthsBetween / 12)); } final Map reportParams = new HashMap<>(); reportParams.put("${clientId}", clientId); reportParams.put("${loanProductId}", productId); reportParams.put("${clientCategorization}", params.getClientCategorization()); reportParams.put("${recreditCategorization}", params.getRecreditCategorization()); - reportParams.put("${businessAge}", String.valueOf(yearsInBusiness)); + reportParams.put("${businessAge}", yearsInBusiness); reportParams.put("${requestedAmount}", String.valueOf(clientData.getRequestedAmount())); final GenericResultsetData result = this.readReportingService.retrieveGenericResultset(reportName, "report", reportParams, false); return extractColorFromResultset(result);