bharathcgowda commented on code in PR #3651:
URL: https://github.com/apache/fineract/pull/3651#discussion_r1441650724


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractCumulativeLoanScheduleGenerator.java:
##########
@@ -423,6 +427,87 @@ private LoanScheduleModel generate(final MathContext mc, 
final LoanApplicationTe
                 scheduleParams.getTotalRepaymentExpected().getAmount(), 
totalOutstanding);
     }
 
+    private void addChargesOnlyRepaymentSchedule(MonetaryCurrency currency, 
LoanScheduleParams scheduleParams,
+            List<LoanScheduleModelPeriod> periods, Set<LoanCharge> 
loanCharges, MathContext mc, LoanApplicationTerms loanApplicationTerms,
+            Collection<RecalculationDetail> transactions,
+            LoanRepaymentScheduleTransactionProcessor 
loanRepaymentScheduleTransactionProcessor, final HolidayDetailDTO 
holidayDetailDTO,
+            final LocalDate lastRestDate, final LocalDate firstRepaymentDate, 
final LocalDate idealDisbursementDate) {
+        if (periods.size() > 0) {
+            LoanScheduleModelPeriod lastInstallment = 
periods.get(periods.size() - 1);
+            // get end date for the schedule from loan charges
+            LocalDate scheduleDueDate = null;
+            if 
(!(BigDecimal.ZERO.compareTo(loanApplicationTerms.getAnnualNominalInterestRate())
 < 0)) {
+                for (final LoanCharge loanCharge : loanCharges) {
+                    if (loanCharge.isSpecifiedDueDate() && 
DateUtils.isAfter(loanCharge.getDueDate(), lastInstallment.periodDueDate())) {
+                        scheduleDueDate = loanCharge.getDueDate();
+                    }
+                }
+            }
+            if (scheduleDueDate != null) {
+                final Collection<LoanTermVariationsData> interestRates = 
loanApplicationTerms.getLoanTermVariations()
+                        .getInterestRateChanges();
+
+                LocalDate periodStartDateApplicableForInterest = 
calculateInterestStartDateForPeriod(loanApplicationTerms,

Review Comment:
   @ruchiD As discussed there is not interest calculcation involved for N+1 
Installment that is after the maturity date.
   
   N+1 Installment scenario happens only for 2 cases
   1. for charges - here user entered amount will be the installment amount
   2. for Charge-backs- here amounts are inherited from the repayment that 
charge-back was triggered from.
   
   @adamsaghy cc



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