galovics commented on code in PR #4771:
URL: https://github.com/apache/fineract/pull/4771#discussion_r2149944147


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/loan/repayment/LoanRepaymentTest.java:
##########
@@ -36,7 +36,7 @@ public class LoanRepaymentTest extends 
BaseLoanIntegrationTest {
     @Test
     public void 
test_LoanRepaymentWorks_WhenDisbursementChargeIsAvailable_AndAccrualAccounting_AndDailyRecalculateInterest_AndDailyInterestCalculationPeriod()
 {
 
-        runAt("01 January 2023", () -> {
+        runAt("14 June 2025", () -> {

Review Comment:
   Why the change?



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java:
##########
@@ -242,10 +238,18 @@ public LoanTransaction makeRepayment(final 
LoanTransactionType repaymentTransact
         }
 
         LocalDate recalculateFrom = null;
-        if (loan.isInterestBearingAndInterestRecalculationEnabled()) {
+        if (loan.isInterestBearingAndInterestRecalculationEnabled() && 
loan.getLoanProduct().getProductInterestRecalculationDetails().getPreCloseInterestCalculationStrategy().calculateTillPreClosureDateEnabled())
 {
             recalculateFrom = transactionDate;
         }
-        final ScheduleGeneratorDTO scheduleGeneratorDTO = 
this.loanUtilService.buildScheduleGeneratorDTO(loan, recalculateFrom,
+        final ScheduleGeneratorDTO scheduleGeneratorDTOForPrepay = 
this.loanUtilService.buildScheduleGeneratorDTO(loan, recalculateFrom, null, 
holidayDetailDto);
+
+        Money outstanding = 
loanTransactionProcessingService.fetchPrepaymentDetail(scheduleGeneratorDTOForPrepay,
 transactionDate, loan).getTotalOutstanding();
+        LocalDate recalculateTill = null;
+        if (repaymentAmount.isGreaterThanOrEqualTo(outstanding) && 
loan.isInterestBearingAndInterestRecalculationEnabled() && 
loan.getLoanProduct().getProductInterestRecalculationDetails().getPreCloseInterestCalculationStrategy().calculateTillPreClosureDateEnabled()){

Review Comment:
   Can this be null? 
loan.getLoanProduct().getProductInterestRecalculationDetails()
   
   Or this: 
   
loan.getLoanProduct().getProductInterestRecalculationDetails().getPreCloseInterestCalculationStrategy()
   
   Or this?
   
loan.getLoanProduct().getProductInterestRecalculationDetails().getPreCloseInterestCalculationStrategy().calculateTillPreClosureDateEnabled()
   



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