You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "ruchiD (via GitHub)" <gi...@apache.org> on 2023/09/22 13:16:22 UTC

[GitHub] [fineract] ruchiD commented on a diff in pull request #3467: FINERACT-1958-Rework-Down-Payment-Overlapping-Installment

ruchiD commented on code in PR #3467:
URL: https://github.com/apache/fineract/pull/3467#discussion_r1334367299


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java:
##########
@@ -430,6 +435,30 @@ private LoanScheduleModel generate(final MathContext mc, final LoanApplicationTe
                 totalOutstanding);
     }
 
+    private void checkDownPaymentInstallmentForOverlappingInstallments(Collection<LoanScheduleModelPeriod> periods,
+            LocalDate scheduledDueDate) {
+        Integer downPaymentPeriodNumber = 0;
+        Integer repaymentPeriodNumber = 0;
+        List<LoanScheduleModelPeriod> overlappingPeriods = periods.stream()
+                .filter(p -> p.periodDueDate() != null && p.periodDueDate().isEqual(scheduledDueDate))
+                .sorted(Comparator.comparing(LoanScheduleModelPeriod::periodNumber)).toList();
+        if (overlappingPeriods.size() == 2) {

Review Comment:
   Hi Adam, here i am finding overlapping periods for every period in the loop and checking by comparing with scheduleDueDate. This takes care of multiple overlapping periods.



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org