[
https://issues.apache.org/jira/browse/FINERACT-3022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
김다연 updated FINERACT-3022:
--------------------------
Description:
When the "Update Deposit Accounts Maturity details" job matures a fixed deposit
whose maturity instruction is REINVEST (300, re-invest principal and interest),
the matured deposit is paid out with principal + interest, but the new deposit
is funded with the original principal only.
{{DepositAccountDomainServiceJpa#handleFDAccountMaturityClosure}} creates the
new deposit with the maturity amount as its deposit amount and withdraws that
amount from the matured deposit.
{{DepositAccountWritePlatformServiceJpaRepositoryImpl#updateMaturityDetails}}
then deposits {{account.activateWithBalance()}} into the new deposit.
{{account}} is the matured deposit, so this is its original deposit amount.
*Steps to reproduce* (develop 755657010b, PostgreSQL)
# Fixed deposit product with cash based accounting.
# Fixed deposit of 100,000 for 14 months with {{"maturityInstructionId": 300}},
submitted, approved and activated on 2026-01-01.
# Enable the business date, set it to 2027-03-01 (the maturity date) and run
"Update Deposit Accounts Maturity details".
Actual result:
||Account||Status||Deposit amount||Maturity amount||Balance||
|matured FD|closed|100,000.00|108,445.72|0.00 (withdrawal of 108,445.72)|
|new FD|active|108,445.72|117,672.05|*100,000.00*|
Expected result: the new deposit's balance is 108,445.72.
The interest (8,445.72) is withdrawn from the matured deposit but never reaches
the new one, and the new deposit's balance does not match its deposit amount.
Not affected: "reinvest principal only" (400), where the withdrawal and the
deposit are both the principal, and a manual close with reinvest
({{handleFDAccountClosure}}), which leaves the new deposit pending.
*History*
The line came with the rollover feature (FINERACT-893, commit bd99138aad).
FINERACT-2376 (1.13.0) fixed a 500 on reinvest at closing that its report says
also affected this job. The job test
{{testCloseFixedDepositForCLOSURE_TYPE_REINVEST_withConfigurationMaturityInstruction}}
checks that the matured deposit is closed, not the new deposit's balance.
*Suggested fix*
Deposit the new deposit's amount instead of the matured deposit's, and extend
the job test to check the new deposit's balance.
The journal entries of the same payout are also posted more than once; reported
separately in FINERACT-3023.
I'd like to work on this and will open a PR.
was:
When the "Update Deposit Accounts Maturity details" job matures a fixed deposit
whose maturity instruction is REINVEST (300, re-invest principal and interest),
the matured deposit is paid out with principal + interest, but the new deposit
is funded with the original principal only.
{{DepositAccountDomainServiceJpa#handleFDAccountMaturityClosure}} creates the
new deposit with the maturity amount as its deposit amount and withdraws that
amount from the matured deposit.
{{DepositAccountWritePlatformServiceJpaRepositoryImpl#updateMaturityDetails}}
then deposits {{account.activateWithBalance()}} into the new deposit.
{{account}} is the matured deposit, so this is its original deposit amount.
*Steps to reproduce* (develop 755657010b, PostgreSQL)
# Fixed deposit product with cash based accounting.
# Fixed deposit of 100,000 for 14 months with {{"maturityInstructionId": 300}},
submitted, approved and activated on 2026-01-01.
# Enable the business date, set it to 2027-03-01 (the maturity date) and run
"Update Deposit Accounts Maturity details".
Actual result:
||Account||Status||Deposit amount||Maturity amount||Balance||
|matured FD|closed|100,000.00|108,445.72|0.00 (withdrawal of 108,445.72)|
|new FD|active|108,445.72|117,672.05|*100,000.00*|
Expected result: the new deposit's balance is 108,445.72.
The interest (8,445.72) is withdrawn from the matured deposit but never reaches
the new one, and the new deposit's balance does not match its deposit amount.
Not affected: "reinvest principal only" (400), where the withdrawal and the
deposit are both the principal, and a manual close with reinvest
({{handleFDAccountClosure}}), which leaves the new deposit pending.
*History*
The line came with the rollover feature (FINERACT-893, commit bd99138aad).
FINERACT-2376 (1.13.0) fixed a 500 on reinvest at closing that its report says
also affected this job. The job test
{{testCloseFixedDepositForCLOSURE_TYPE_REINVEST_withConfigurationMaturityInstruction}}
checks that the matured deposit is closed, not the new deposit's balance.
*Suggested fix*
Deposit the new deposit's amount instead of the matured deposit's, and extend
the job test to check the new deposit's balance.
The journal entries of the same payout are also posted more than once; reported
separately in FINERACT-XXXX.
I'd like to work on this and will open a PR.
> Fixed deposit maturity job funds the reinvested deposit with the principal
> only when the instruction is "reinvest principal and interest"
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-3022
> URL: https://issues.apache.org/jira/browse/FINERACT-3022
> Project: Apache Fineract
> Issue Type: Bug
> Components: Savings
> Affects Versions: 1.15.0
> Reporter: 김다연
> Priority: Major
>
> When the "Update Deposit Accounts Maturity details" job matures a fixed
> deposit whose maturity instruction is REINVEST (300, re-invest principal and
> interest), the matured deposit is paid out with principal + interest, but the
> new deposit is funded with the original principal only.
> {{DepositAccountDomainServiceJpa#handleFDAccountMaturityClosure}} creates the
> new deposit with the maturity amount as its deposit amount and withdraws that
> amount from the matured deposit.
> {{DepositAccountWritePlatformServiceJpaRepositoryImpl#updateMaturityDetails}}
> then deposits {{account.activateWithBalance()}} into the new deposit.
> {{account}} is the matured deposit, so this is its original deposit amount.
> *Steps to reproduce* (develop 755657010b, PostgreSQL)
> # Fixed deposit product with cash based accounting.
> # Fixed deposit of 100,000 for 14 months with {{"maturityInstructionId":
> 300}}, submitted, approved and activated on 2026-01-01.
> # Enable the business date, set it to 2027-03-01 (the maturity date) and run
> "Update Deposit Accounts Maturity details".
> Actual result:
> ||Account||Status||Deposit amount||Maturity amount||Balance||
> |matured FD|closed|100,000.00|108,445.72|0.00 (withdrawal of 108,445.72)|
> |new FD|active|108,445.72|117,672.05|*100,000.00*|
> Expected result: the new deposit's balance is 108,445.72.
> The interest (8,445.72) is withdrawn from the matured deposit but never
> reaches the new one, and the new deposit's balance does not match its deposit
> amount.
> Not affected: "reinvest principal only" (400), where the withdrawal and the
> deposit are both the principal, and a manual close with reinvest
> ({{handleFDAccountClosure}}), which leaves the new deposit pending.
> *History*
> The line came with the rollover feature (FINERACT-893, commit bd99138aad).
> FINERACT-2376 (1.13.0) fixed a 500 on reinvest at closing that its report
> says also affected this job. The job test
> {{testCloseFixedDepositForCLOSURE_TYPE_REINVEST_withConfigurationMaturityInstruction}}
> checks that the matured deposit is closed, not the new deposit's balance.
> *Suggested fix*
> Deposit the new deposit's amount instead of the matured deposit's, and extend
> the job test to check the new deposit's balance.
> The journal entries of the same payout are also posted more than once;
> reported separately in FINERACT-3023.
> I'd like to work on this and will open a PR.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)