Ankit-muellner commented on a change in pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#discussion_r710604338
##########
File path:
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
##########
@@ -4509,30 +4511,77 @@ private LocalDate getMaxDateLimitForNewRepayment(final
PeriodFrequencyType perio
// startDate
}
- public void applyHolidayToRepaymentScheduleDates(final Holiday holiday) {
+ public void applyHolidayToRepaymentScheduleDates(final Holiday holiday,
final LoanUtilService loanUtilService) {
+ final DefaultScheduledDateGenerator scheduledDateGenerator = new
DefaultScheduledDateGenerator();
+ ScheduleGeneratorDTO scheduleGeneratorDTO =
loanUtilService.buildScheduleGeneratorDTO(this, holiday.getFromDateLocalDate());
+ final LoanApplicationTerms loanApplicationTerms =
this.constructLoanApplicationTerms(scheduleGeneratorDTO);
+
+ // LocalDate rescheduleFromDate = holiday.getFromDateLocalDate();
+ LocalDate adjustedRescheduleToDate = null;
+
+ if (holiday.getReScheduleType().isResheduleToNextRepaymentDate()) {
+ final LocalDate rescheduleToDate = holiday.getToDateLocalDate();
+ for (final LoanRepaymentScheduleInstallment
loanRepaymentScheduleInstallment : this.getRepaymentScheduleInstallments()) {
+ if
(rescheduleToDate.isEqual(loanRepaymentScheduleInstallment.getDueDate())) {
+ adjustedRescheduleToDate = rescheduleToDate;
+ break;
+ } else {
+ // Account for a Bimonthly Loan Product
+ // if
(loanApplicationTerms.getRepaymentPeriodFrequencyType().isSemiMonthly()) {
+ // if
(rescheduleToDate.isAfter(loanRepaymentScheduleInstallment.getDueDate())
+ // &&
rescheduleToDate.isBefore(loanRepaymentScheduleInstallment.getDueDate().plusDays(15)))
{
Review comment:
thanks Kaze for focusing on detail here. very thoughtful!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]