danhandev opened a new pull request, #6788: URL: https://github.com/apache/fineract/pull/6788
## Description Fixes [FINERACT-3022](https://issues.apache.org/jira/browse/FINERACT-3022). **Original issue** When the "Update Deposit Accounts Maturity details" job reinvests a fixed deposit with the "reinvest principal and interest" instruction (300), the matured deposit is paid out with principal + interest and the new deposit is opened for that amount, but `updateMaturityDetails` deposited `account.activateWithBalance()` into it. `account` is the matured deposit, so only its original principal was deposited: in the reproduction the new deposit was opened for 108,445.72 and held 100,000.00. **What changed** `updateMaturityDetails` now deposits `reinvestAccount.activateWithBalance()`, the new deposit's own amount, as activating a fixed deposit does. "Reinvest principal only" (400) is unchanged, as both amounts are the principal there. **How it is covered** `FixedDepositTest.testMaturityJobReinvestsPrincipalAndInterestIntoNewDeposit` runs the job on a mature deposit with instruction 300 and checks that the new deposit is opened for the maturity amount and holds it. It fails on unmodified develop ("must hold the maturity amount 108445.717400, but holds 100000.000000") and passes with the fix. `FixedDepositTest` (50) and `RecurringDepositTest` (39) pass locally on PostgreSQL; `spotlessCheck` and Checkstyle pass. Before: new deposit opened for 108,445.72, balance 100,000.00. After: balance 108,445.72. **Out of scope** The journal entries of the same payout are posted more than once (FINERACT-3023); that fix will be a separate PR. ## 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). - [ ] 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]
