Skip to content

Conversation

@MarianaDmytrivBinariks
Copy link
Contributor

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@adamsaghy
Copy link
Contributor

  Wrong value in Transactions tab of resource 116 line 5.
  Actual values in line (with the same date) are: 
  [01 April 2024, Accrual Adjustment, 0.69, 0.0, 0.69, 0.0, 0.0, 0.0, false, false] 
  Expected values in line: 
  [01 April 2024, Contract Termination, 84.55, 83.57, 0.98, 0.0, 0.0, 0.0, false, false]] 
  Expecting value to be true but was false
  	at org.apache.fineract.test.stepdef.loan.LoanStepDef.loanTransactionsTabCheck(LoanStepDef.java:2235)
  	at ✽.Loan Transactions tab has the following data:(file:///home/runner/work/fineract/fineract/fineract-e2e-tests-runner/src/test/resources/features/LoanReAgingEqualAmortization.feature:11224)
  
    When Loan Pay-off is made on "01 April 2024"                                                                                                                        # org.apache.fineract.test.stepdef.loan.LoanRepaymentStepDef.makeLoanPayOff(java.lang.String)
    Then Loan is closed with zero outstanding balance and it's all installments have obligations met                                                                    # org.apache.fineract.test.stepdef.loan.LoanStepDef.loanClosedAndInstallmentsObligationsMet()
  

@MarianaDmytrivBinariks MarianaDmytrivBinariks force-pushed the FINERACT-2354/e2e-test-scenarios-with-charge-off-or-contract-termination-trns-after-re-aging branch from 7802df0 to f01002e Compare January 12, 2026 13:32
@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2354/e2e-test-scenarios-with-charge-off-or-contract-termination-trns-after-re-aging branch 2 times, most recently from 826de95 to c58dc54 Compare January 14, 2026 13:38
@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2354/e2e-test-scenarios-with-charge-off-or-contract-termination-trns-after-re-aging branch from c58dc54 to d2f69b0 Compare January 15, 2026 13:33
}

@Override
public Money calculateInterestForAccelerateMaturity(final ProgressiveLoanInterestScheduleModel scheduleModel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?
Also i really dont like the idea to get parts of the scheduleModel from outside as arguments...


loanSchedule.updateLoanSchedule(loan, installmentsUpToTransactionDate);

final boolean hasReAgedInstallments = currentInstallment.isReAged()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it matter? The calculator and model should be aware already... there should be no difference in the handling

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets rework this whole logic:

  • AdvancedPaymentScheduleTransactionProcessor should do NO changes on the ProgressiveLoanInterestScheduleModel at all!
  • The action is accelerateMaturityDate executed on the model, the model is updated by the EMICalculator
  • The result is read from the model and repayment installment entities are updated.
  • Model is the single source of truth for calculations and interest...! -> Action executed on the model, result fetched from the model...

| 14 March 2024 | Accrual | 1.27 | 0.0 | 1.27 | 0.0 | 0.0 | 0.0 | false | false |
| 15 March 2024 | Re-age | 84.28 | 83.57 | 0.71 | 0.0 | 0.0 | 0.0 | false | false |
| 15 March 2024 | Accrual | 1.53 | 0.0 | 1.53 | 0.0 | 0.0 | 0.0 | false | false |
| 15 March 2024 | Charge-off | 85.79 | 83.57 | 2.22 | 0.0 | 0.0 | 0.0 | false | false |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be the payable interest till that date, which probably is 0.71

final boolean hasReAgedInterest = hasReAgedInterest(lastPeriod, periodsToRemove);

if (hasReAgedInterest) {
final Money futureInterest = periodsToRemove.stream().map(RepaymentPeriod::getDueInterest).reduce(scheduleModel.zero(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is cannot be true for accelerate maturity date charge-off. We should not consider the future interest. Only the past due (including the reaged interest).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants