You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "mariiaKraievska (via GitHub)" <gi...@apache.org> on 2026/07/29 12:07:37 UTC
[PR] FINERACT-2699: Future dated Accrual Activity created during loan re-open and re-close [fineract]
mariiaKraievska opened a new pull request, #6200:
URL: https://github.com/apache/fineract/pull/6200
## 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](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
- [ ] 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](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [ ] 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
- [ ] [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).
- [ ] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2699: Future dated Accrual Activity created during loan re-open and re-close [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #6200:
URL: https://github.com/apache/fineract/pull/6200
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2699: Future dated Accrual Activity created during loan re-open and re-close [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #6200:
URL: https://github.com/apache/fineract/pull/6200#discussion_r3703592310
##########
fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualActivity-Part2.feature:
##########
@@ -4111,3 +4113,264 @@ Feature: LoanAccrualActivity - Part2
| Accrual Adjustment | 19.75 | 19.75 | false |
# Net recognised interest income is unchanged
Then Loan has 19.75 total Accruals
+
+ @TestRailId:C89817
+ Scenario: Verify that reversed Accrual Activity must not be stamped with future installment due date when loan re-opens after payoff reversal
+ When Admin sets the business date to "09 May 2026"
+ And Admin creates a client with random data
+ And Admin creates a fully customized loan with the following data:
+ | LoanProduct | submitted on date | with Principal | ANNUAL interest rate % | interest type | interest calculation period | amortization type | loanTermFrequency | loanTermFrequencyType | repaymentEvery | repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | graceOnInterestPayment | interest free period | Payment strategy |
+ | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_REFUND_INTEREST_RECALC_DOWNPAYMENT_ACCRUAL_ACTIVITY | 09 May 2026 | 279.99 | 24.99 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
+ And Admin successfully approves the loan on "09 May 2026" with "279.99" amount and expected disbursement date on "09 May 2026"
+ And Admin successfully disburse the loan on "09 May 2026" with "279.99" EUR transaction amount
+ When Admin sets the business date to "24 May 2026"
+ And Admin runs inline COB job for Loan
+ And Loan Pay-off is made on "24 May 2026"
+ Then Loan status will be "CLOSED_OBLIGATIONS_MET"
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 09 May 2026 | Down Payment | 70.0 | 70.0 | 0.0 | 0.0 | 0.0 | 209.99 | false | false |
+ | 23 May 2026 | Accrual | 1.97 | 0.0 | 1.97 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 212.11 | 209.99 | 2.12 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.15 | 0.0 | 0.15 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.12 | 0.0 | 2.12 | 0.0 | 0.0 | 0.0 | false | false |
+ When Admin sets the business date to "29 May 2026"
+ And Admin runs inline COB job for Loan
+ And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" payment type on "29 May 2026" with 100.0 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation true
+ Then Loan status will be "OVERPAID"
+ When Customer undo "1"th "Repayment" transaction made on "24 May 2026"
+ Then Loan status will be "ACTIVE"
+ And Loan has no "Accrual Activity" transaction with transaction date later than "29 May 2026", including reversed transactions
+
+ @TestRailId:C89818 @Debug
+ Scenario: Future dated Accrual Activity must not be created and final activity moves back after later MIR reversal
+ When Admin sets the business date to "09 May 2026"
+ And Admin creates a client with random data
+ And Admin creates a fully customized loan with the following data:
+ | LoanProduct | submitted on date | with Principal | ANNUAL interest rate % | interest type | interest calculation period | amortization type | loanTermFrequency | loanTermFrequencyType | repaymentEvery | repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | graceOnInterestPayment | interest free period | Payment strategy |
+ | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_REFUND_INTEREST_RECALC_ACCRUAL_ACTIVITY | 09 May 2026 | 279.99 | 24.99 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
+ And Admin successfully approves the loan on "09 May 2026" with "279.99" amount and expected disbursement date on "09 May 2026"
+ And Admin successfully disburse the loan on "09 May 2026" with "279.99" EUR transaction amount
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | | 188.58 | 91.41 | 5.83 | 0.0 | 0.0 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 |
+ | 2 | 30 | 09 July 2026 | | 95.27 | 93.31 | 3.93 | 0.0 | 0.0 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 |
+ | 3 | 31 | 09 August 2026 | | 0.0 | 95.27 | 1.98 | 0.0 | 0.0 | 97.25 | 0.0 | 0.0 | 0.0 | 97.25 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 11.74 | 0.0 | 0.0 | 291.73 | 0.0 | 0.0 | 0.0 | 291.73 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "09 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | ASSET | 112601 | Loans Receivable | 279.99 | |
+ | LIABILITY | 145023 | Suspense/Clearing account | | 279.99 |
+ When Admin sets the business date to "24 May 2026"
+ And Admin runs inline COB job for Loan
+ And Loan Pay-off is made on "24 May 2026"
+ Then Loan status will be "CLOSED_OBLIGATIONS_MET"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ Then Loan Transactions tab has a "REPAYMENT" transaction with date "24 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | ASSET | 112601 | Loans Receivable | | 279.99 |
+ | ASSET | 112603 | Interest/Fee Receivable | | 2.82 |
+ | LIABILITY | 145023 | Suspense/Clearing account | 282.81 | |
+ When Admin sets the business date to "29 May 2026"
+ And Admin runs inline COB job for Loan
+ And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" payment type on "29 May 2026" with 279.99 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation true
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Interest Refund | 2.82 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false |
+ Then Loan Transactions tab has a "MERCHANT_ISSUED_REFUND" transaction with date "29 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | LIABILITY | l1 | Overpayment account | | 279.99 |
+ | LIABILITY | 145023 | Suspense/Clearing account | 279.99 | |
+ Then Loan Transactions tab has a "INTEREST_REFUND" transaction with date "29 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | LIABILITY | l1 | Overpayment account | | 2.82 |
+ | INCOME | 404000 | Interest Income | 2.82 | |
+ And Customer adjust "1"th repayment on "24 May 2026" with amount "0"
+ Then Loan is closed with zero outstanding balance and it's all installments have obligations met
+ And Loan closedon_date is "29 May 2026"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 29 May 2026 | 186.51 | 93.48 | 3.76 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 29 May 2026 | 89.27 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 29 May 2026 | 0.0 | 89.27 | 0.0 | 0.0 | 0.0 | 89.27 | 89.27 | 89.27 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 3.76 | 0.0 | 0.0 | 283.75 | 283.75 | 283.75 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | true | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 276.23 | 3.76 | 0.0 | 0.0 | 3.76 | false | true |
+ | 29 May 2026 | Interest Refund | 3.76 | 3.76 | 0.0 | 0.0 | 0.0 | 0.0 | false | true |
+ | 29 May 2026 | Accrual Activity | 3.76 | 0.0 | 3.76 | 0.0 | 0.0 | 0.0 | false | true |
+ | 29 May 2026 | Accrual | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+ And Admin makes "REPAYMENT" transaction with "AUTOPAY" payment type on "24 May 2026" with 282.81 EUR transaction amount
+ Then Loan status will be "OVERPAID"
+ And Loan has 282.81 overpaid amount
+ # Reversing the later transaction moves both the loan closure and the final Accrual Activity back to 24 May
+ When Customer undo "1"th "Merchant Issued Refund" transaction made on "29 May 2026"
+ Then Loan is closed with zero outstanding balance and it's all installments have obligations met
+ And Loan closedon_date is "24 May 2026"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | true | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | true |
+ | 29 May 2026 | Interest Refund | 2.82 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | true |
+ | 29 May 2026 | Accrual | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Accrual Adjustment | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+
+ @TestRailId:C89819 @Debug
Review Comment:
Done
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2699: Future dated Accrual Activity created during loan re-open and re-close [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6200:
URL: https://github.com/apache/fineract/pull/6200#discussion_r3703483493
##########
fineract-e2e-tests-runner/src/test/resources/features/LoanAccrualActivity-Part2.feature:
##########
@@ -4111,3 +4113,264 @@ Feature: LoanAccrualActivity - Part2
| Accrual Adjustment | 19.75 | 19.75 | false |
# Net recognised interest income is unchanged
Then Loan has 19.75 total Accruals
+
+ @TestRailId:C89817
+ Scenario: Verify that reversed Accrual Activity must not be stamped with future installment due date when loan re-opens after payoff reversal
+ When Admin sets the business date to "09 May 2026"
+ And Admin creates a client with random data
+ And Admin creates a fully customized loan with the following data:
+ | LoanProduct | submitted on date | with Principal | ANNUAL interest rate % | interest type | interest calculation period | amortization type | loanTermFrequency | loanTermFrequencyType | repaymentEvery | repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | graceOnInterestPayment | interest free period | Payment strategy |
+ | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_REFUND_INTEREST_RECALC_DOWNPAYMENT_ACCRUAL_ACTIVITY | 09 May 2026 | 279.99 | 24.99 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
+ And Admin successfully approves the loan on "09 May 2026" with "279.99" amount and expected disbursement date on "09 May 2026"
+ And Admin successfully disburse the loan on "09 May 2026" with "279.99" EUR transaction amount
+ When Admin sets the business date to "24 May 2026"
+ And Admin runs inline COB job for Loan
+ And Loan Pay-off is made on "24 May 2026"
+ Then Loan status will be "CLOSED_OBLIGATIONS_MET"
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 09 May 2026 | Down Payment | 70.0 | 70.0 | 0.0 | 0.0 | 0.0 | 209.99 | false | false |
+ | 23 May 2026 | Accrual | 1.97 | 0.0 | 1.97 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 212.11 | 209.99 | 2.12 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.15 | 0.0 | 0.15 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.12 | 0.0 | 2.12 | 0.0 | 0.0 | 0.0 | false | false |
+ When Admin sets the business date to "29 May 2026"
+ And Admin runs inline COB job for Loan
+ And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" payment type on "29 May 2026" with 100.0 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation true
+ Then Loan status will be "OVERPAID"
+ When Customer undo "1"th "Repayment" transaction made on "24 May 2026"
+ Then Loan status will be "ACTIVE"
+ And Loan has no "Accrual Activity" transaction with transaction date later than "29 May 2026", including reversed transactions
+
+ @TestRailId:C89818 @Debug
+ Scenario: Future dated Accrual Activity must not be created and final activity moves back after later MIR reversal
+ When Admin sets the business date to "09 May 2026"
+ And Admin creates a client with random data
+ And Admin creates a fully customized loan with the following data:
+ | LoanProduct | submitted on date | with Principal | ANNUAL interest rate % | interest type | interest calculation period | amortization type | loanTermFrequency | loanTermFrequencyType | repaymentEvery | repaymentFrequencyType | numberOfRepayments | graceOnPrincipalPayment | graceOnInterestPayment | interest free period | Payment strategy |
+ | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_REFUND_INTEREST_RECALC_ACCRUAL_ACTIVITY | 09 May 2026 | 279.99 | 24.99 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 3 | MONTHS | 1 | MONTHS | 3 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION |
+ And Admin successfully approves the loan on "09 May 2026" with "279.99" amount and expected disbursement date on "09 May 2026"
+ And Admin successfully disburse the loan on "09 May 2026" with "279.99" EUR transaction amount
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | | 188.58 | 91.41 | 5.83 | 0.0 | 0.0 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 |
+ | 2 | 30 | 09 July 2026 | | 95.27 | 93.31 | 3.93 | 0.0 | 0.0 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 |
+ | 3 | 31 | 09 August 2026 | | 0.0 | 95.27 | 1.98 | 0.0 | 0.0 | 97.25 | 0.0 | 0.0 | 0.0 | 97.25 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 11.74 | 0.0 | 0.0 | 291.73 | 0.0 | 0.0 | 0.0 | 291.73 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ Then Loan Transactions tab has a "DISBURSEMENT" transaction with date "09 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | ASSET | 112601 | Loans Receivable | 279.99 | |
+ | LIABILITY | 145023 | Suspense/Clearing account | | 279.99 |
+ When Admin sets the business date to "24 May 2026"
+ And Admin runs inline COB job for Loan
+ And Loan Pay-off is made on "24 May 2026"
+ Then Loan status will be "CLOSED_OBLIGATIONS_MET"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ Then Loan Transactions tab has a "REPAYMENT" transaction with date "24 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | ASSET | 112601 | Loans Receivable | | 279.99 |
+ | ASSET | 112603 | Interest/Fee Receivable | | 2.82 |
+ | LIABILITY | 145023 | Suspense/Clearing account | 282.81 | |
+ When Admin sets the business date to "29 May 2026"
+ And Admin runs inline COB job for Loan
+ And Customer makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" payment type on "29 May 2026" with 279.99 EUR transaction amount and system-generated Idempotency key and interestRefundCalculation true
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Interest Refund | 2.82 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | false |
+ Then Loan Transactions tab has a "MERCHANT_ISSUED_REFUND" transaction with date "29 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | LIABILITY | l1 | Overpayment account | | 279.99 |
+ | LIABILITY | 145023 | Suspense/Clearing account | 279.99 | |
+ Then Loan Transactions tab has a "INTEREST_REFUND" transaction with date "29 May 2026" which has the following Journal entries:
+ | Type | Account code | Account name | Debit | Credit |
+ | LIABILITY | l1 | Overpayment account | | 2.82 |
+ | INCOME | 404000 | Interest Income | 2.82 | |
+ And Customer adjust "1"th repayment on "24 May 2026" with amount "0"
+ Then Loan is closed with zero outstanding balance and it's all installments have obligations met
+ And Loan closedon_date is "29 May 2026"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 29 May 2026 | 186.51 | 93.48 | 3.76 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 29 May 2026 | 89.27 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 29 May 2026 | 0.0 | 89.27 | 0.0 | 0.0 | 0.0 | 89.27 | 89.27 | 89.27 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 3.76 | 0.0 | 0.0 | 283.75 | 283.75 | 283.75 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | true | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 276.23 | 3.76 | 0.0 | 0.0 | 3.76 | false | true |
+ | 29 May 2026 | Interest Refund | 3.76 | 3.76 | 0.0 | 0.0 | 0.0 | 0.0 | false | true |
+ | 29 May 2026 | Accrual Activity | 3.76 | 0.0 | 3.76 | 0.0 | 0.0 | 0.0 | false | true |
+ | 29 May 2026 | Accrual | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+ And Admin makes "REPAYMENT" transaction with "AUTOPAY" payment type on "24 May 2026" with 282.81 EUR transaction amount
+ Then Loan status will be "OVERPAID"
+ And Loan has 282.81 overpaid amount
+ # Reversing the later transaction moves both the loan closure and the final Accrual Activity back to 24 May
+ When Customer undo "1"th "Merchant Issued Refund" transaction made on "29 May 2026"
+ Then Loan is closed with zero outstanding balance and it's all installments have obligations met
+ And Loan closedon_date is "24 May 2026"
+ Then Loan Repayment schedule has 3 periods, with the following data for periods:
+ | Nr | Days | Date | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | | | 09 May 2026 | | 279.99 | | | 0.0 | | 0.0 | 0.0 | | | |
+ | 1 | 31 | 09 June 2026 | 24 May 2026 | 185.57 | 94.42 | 2.82 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 2 | 30 | 09 July 2026 | 24 May 2026 | 88.33 | 97.24 | 0.0 | 0.0 | 0.0 | 97.24 | 97.24 | 97.24 | 0.0 | 0.0 |
+ | 3 | 31 | 09 August 2026 | 24 May 2026 | 0.0 | 88.33 | 0.0 | 0.0 | 0.0 | 88.33 | 88.33 | 88.33 | 0.0 | 0.0 |
+ And Loan Repayment schedule has the following data in Total row:
+ | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding |
+ | 279.99 | 2.82 | 0.0 | 0.0 | 282.81 | 282.81 | 282.81 | 0.0 | 0.0 |
+ And Loan Transactions tab has the following data:
+ | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+ | 09 May 2026 | Disbursement | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 279.99 | false | false |
+ | 23 May 2026 | Accrual | 2.63 | 0.0 | 2.63 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | true | false |
+ | 24 May 2026 | Repayment | 282.81 | 279.99 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual | 0.19 | 0.0 | 0.19 | 0.0 | 0.0 | 0.0 | false | false |
+ | 24 May 2026 | Accrual Activity | 2.82 | 0.0 | 2.82 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Merchant Issued Refund | 279.99 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | true |
+ | 29 May 2026 | Interest Refund | 2.82 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | true | true |
+ | 29 May 2026 | Accrual | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+ | 29 May 2026 | Accrual Adjustment | 0.94 | 0.0 | 0.94 | 0.0 | 0.0 | 0.0 | false | false |
+
+ @TestRailId:C89819 @Debug
Review Comment:
I think we can remove the `@Debug` tags
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org