adamsaghy commented on code in PR #3808:
URL: https://github.com/apache/fineract/pull/3808#discussion_r1535318008


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java:
##########
@@ -46,15 +45,16 @@ public LocalDate getLastRepaymentDate(final 
LoanApplicationTerms loanApplication
 
         final int numberOfRepayments = 
loanApplicationTerms.getNumberOfRepayments();
 
-        RepaymentStartDateType repaymentStartDateType = 
loanApplicationTerms.getRepaymentStartDateType();
-
-        LocalDate lastRepaymentDate = 
RepaymentStartDateType.DISBURSEMENT_DATE.equals(repaymentStartDateType)
-                ? loanApplicationTerms.getExpectedDisbursementDate()
-                : loanApplicationTerms.getSubmittedOnDate();
-        boolean isFirstRepayment = true;
-        for (int repaymentPeriod = 1; repaymentPeriod <= numberOfRepayments; 
repaymentPeriod++) {
-            lastRepaymentDate = generateNextRepaymentDate(lastRepaymentDate, 
loanApplicationTerms, isFirstRepayment);
-            isFirstRepayment = false;
+        LocalDate lastRepaymentDate = 
loanApplicationTerms.getRepaymentStartDate();
+        // When exists defined a Fixed Length value

Review Comment:
   We dont really need this..
   
   Please revert and just adjust the lastRepaymentDate after it got calculated 
(the after the for cycle) in the following manner:
   if the `lastRepaymentDate` is not equals with 
`calculatedMaxDateForFixedLenght` than override the `lastRepaymentDate` with it.



-- 
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]

Reply via email to