Samer-Melhem-FOO opened a new pull request, #6524:
URL: https://github.com/apache/fineract/pull/6524

   ## Description
   
   [FINERACT-2861](https://issues.apache.org/jira/browse/FINERACT-2861)
   
   `LoanTransaction.updateComponents(...)` accumulates onto the portions 
already set on the transaction. In 
`CreocoreLoanRepaymentScheduleTransactionProcessor.handleTransactionThatIsOnTimePaymentOfInstallment`,
 and in both `handleTransactionThatIsPaymentInAdvanceOfInstallment` and 
`handleTransactionThatIsOnTimePaymentOfInstallment` of 
`HeavensFamilyLoanRepaymentScheduleTransactionProcessor`, the interest-waiver 
branch calls it and the unconditional call at the end of the method calls it 
again. A waiver of X therefore gets an interest portion of 2X, and the accrual 
journal entries post 2X. The installment itself (`waiveInterestComponent`) is 
only applied once, so the schedule stays correct and only the transaction's 
portion and the GL are wrong.
   
   This removes the call inside the waiver branch in those three methods, 
leaving the single trailing call, which is what 
`FineractStyleLoanRepaymentScheduleTransactionProcessor` already does.
   
   **Tests**
   - New `CreocoreLoanRepaymentScheduleTransactionProcessorTest` and 
`HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest`: a waiver of 10 
must leave the transaction's interest portion at 10. Without the fix the three 
waiver cases fail with `got 20.00`; with it all tests pass.
   - Checked manually on a local `develop` build (PostgreSQL, accrual 
accounting, `creocore-strategy` product): `POST 
/loans/{id}/transactions?command=waiveinterest` with `transactionAmount: 10` 
returned `interestPortion: 20` with journal entries of 20 / 20 before the 
change, and `interestPortion: 10` with 10 / 10 after it.
   
   ## Checklist
   
   - [x] Write the commit message as per [our 
guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [x] 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.
   - [x] Create/update [unit or integration 
tests](https://fineract.apache.org/docs/current/#_testing) for verifying the 
changes made.
   - [x] Follow our [coding 
conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [x] 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 (no API change)
   - [x] [This PR must not be a "code 
dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit).
 Large changes can be made in a branch, with assistance. Ask for help on the 
[developer mailing list](https://fineract.apache.org/#contribute).
   - [x] If merging this PR resolves a JIRA issue, I will mark that issue as 
resolved and set "Fix Version/s" appropriately.
   - [x] I followed the [AI 
Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy).
   


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