adamsaghy commented on code in PR #2519:
URL: https://github.com/apache/fineract/pull/2519#discussion_r960545985
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -5240,6 +5231,25 @@ public ChangedTransactionDetail
updateDisbursementDateAndAmountForTranche(final
return changedTransactionDetail;
}
+ public BigDecimal getPrincipalAmountForRepaymentSchedule() {
+ BigDecimal principalAmount = BigDecimal.ZERO;
+
+ if (isMultiDisburmentLoan() && isDisbursed()) {
Review Comment:
@josehernandezfintecheandomx I think this logic is faulty if the loan is not
a multi disbursement loan...
It should rather use the totalDisbursedAmount and no check whether it is
multi disbursement or not...
What do you think?
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java:
##########
@@ -131,23 +133,31 @@ private AdjustedDateDetailsDTO
getAdjustedDateDetailsDTO(final LocalDate dueRepa
private AdjustedDateDetailsDTO
recursivelyCheckNonWorkingDaysAndHolidaysAndWorkingDaysExemptionToGenerateNextRepaymentPeriodDate(
final AdjustedDateDetailsDTO adjustedDateDetailsDTO, final
LoanApplicationTerms loanApplicationTerms,
final HolidayDetailDTO holidayDetailDTO, final boolean
isFirstRepayment) {
-
-
checkAndUpdateWorkingDayIfRepaymentDateIsNonWorkingDay(adjustedDateDetailsDTO,
holidayDetailDTO, loanApplicationTerms,
- isFirstRepayment);
-
+ final Recur recur =
CalendarUtils.getICalRecur(holidayDetailDTO.getWorkingDays().getRecurrence());
+ final boolean isSevenDaysWeek = (recur.getDayList().size() == 7); // 7
Seven days in the week
+ // If Workings days are not seven day week
Review Comment:
@josehernandezfintecheandomx Can you please tell about this newly introduced
condition?
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java:
##########
@@ -320,7 +320,7 @@ public void
testCenterReschedulingMultiTrancheLoansWithInterestRecalculationEnab
// VERIFY THE INTEREST
Float interestDue = (Float) ((HashMap)
loanRepaymnetSchedule.get(2)).get("interestDue");
- assertEquals("41.05", String.valueOf(interestDue));
+ assertEquals("45.41", String.valueOf(interestDue));
Review Comment:
@josehernandezfintecheandomx Are you sure it is valid to change the interest
in this test case?
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanRepaymentRescheduleAtDisbursementTest.java:
##########
@@ -134,11 +134,11 @@ public void testLoanRepaymentRescheduleAtDisbursement() {
Calendar date = Calendar.getInstance(Utils.getTimeZoneOfTenant());
date.set(2015, Calendar.MARCH, 16);
expectedvalues.put("dueDate", getDateAsArray(date, 0));
- expectedvalues.put("principalDue", "834.71");
Review Comment:
@josehernandezfintecheandomx Could you please tell more why this test was
changed?
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -5240,6 +5231,25 @@ public ChangedTransactionDetail
updateDisbursementDateAndAmountForTranche(final
return changedTransactionDetail;
}
+ public BigDecimal getPrincipalAmountForRepaymentSchedule() {
+ BigDecimal principalAmount = BigDecimal.ZERO;
+
+ if (isMultiDisburmentLoan() && isDisbursed()) {
Review Comment:
Also, i am a little bit hesitant here...if expected disbursement details
were provided, we should rather show repayment schedule based on those total
principal, no? @bharathcgowda
--
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]