Github user rajuan commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/110#discussion_r62999753 --- Diff: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java --- @@ -96,10 +96,37 @@ public LocalDate generateNextRepaymentDate(final LocalDate lastRepaymentDate, fi loanApplicationTerms.getNumberOfdays()); } } - + if (currentCalendar == null && holidayDetailDTO.getWorkingDays().getExtendTermForRepaymentsOnHolidays()) { + boolean repaymentDateIsOnHoliday = false; + // compile the list of holidays into Intervals to see if this date lands on a holiday + final List<Interval> holidayInterval = new ArrayList<>(); + for (Holiday holiday : holidayDetailDTO.getHolidays()) { + holidayInterval.add(new Interval( + holiday.getFromDateLocalDate().toDateTimeAtStartOfDay(), + holiday.getToDateLocalDate().toDateTime(LocalTime.parse("23:59:59")) + )); + } + while (intervalListContainsDate(holidayInterval, dueRepaymentPeriodDate)) { + LocalDate previousDate = dueRepaymentPeriodDate; + dueRepaymentPeriodDate = getRepaymentPeriodDate(loanApplicationTerms.getRepaymentPeriodFrequencyType(), + loanApplicationTerms.getRepaymentEvery(), dueRepaymentPeriodDate, loanApplicationTerms.getNthDay(), + loanApplicationTerms.getWeekDayType()); + if (previousDate == dueRepaymentPeriodDate) { --- End diff -- As long as repayment period frequency type is valid, this condition will never satisfy.... I do not understand why if condition is added
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---