diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanReschedule.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanReschedule.feature index 7b4d5db6770..60556ac8666 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanReschedule.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanReschedule.feature @@ -2427,3 +2427,199 @@ Feature: LoanReschedule | 21 January 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | | 23 January 2026 | Re-age | 150.1 | 150.0 | 0.1 | 0.0 | 0.0 | 0.0 | false | | 24 January 2026 | Re-age | 150.15 | 150.0 | 0.15 | 0.0 | 0.0 | 0.0 | false | + + @TestRailId:TODO_ADD_1 + Scenario: Verify that reschedule after ReAge produces correct schedule and balance for non-interest bearing single-installment product - UC4: 2nd reAge DEFAULT + When Admin sets the business date to "10 June 2026" + When Admin creates a client with random data + When Admin set "LP1_ADV_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule + When 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 | + | LP1_ADV_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 31 May 2026 | 150 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 30 | DAYS | 30 | DAYS | 1 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | + And Admin successfully approves the loan on "31 May 2026" with "150" amount and expected disbursement date on "31 May 2026" + When Admin successfully disburse the loan on "31 May 2026" with "150" EUR transaction amount + Then Loan has 150.0 outstanding amount + Then Loan Repayment schedule has 1 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 30 | 30 June 2026 | | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + # --- Step 1: Reschedule #1 date : 2026-06-30 (from: 2026-06-30 → adjusted: 2026-09-30) --- + When Admin creates and approves Loan reschedule with the following data: + | rescheduleFromDate | submittedOnDate | adjustedDueDate | graceOnPrincipal | graceOnInterest | extraTerms | newInterestRate | + | 30 June 2026 | 10 June 2026 | 30 September 2026 | | | | | + Then Loan has 150.0 outstanding amount + Then Loan Repayment schedule has 1 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 122 | 30 September 2026 | | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + # --- Step 2: ReAge for 15 monthly installments starting 22 March 2026 --- + When Admin creates a Loan re-aging transaction with the following data: + | frequencyNumber | frequencyType | startDate | numberOfInstallments | reAgeInterestHandling | + | 1 | MONTHS | 12 June 2026 | 15 | DEFAULT | + Then Loan has 150.0 outstanding amount + And Loan Repayment schedule has 16 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 10 | 10 June 2026 | 10 June 2026 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | 2 | 2 | 12 June 2026 | | 140.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 3 | 30 | 12 July 2026 | | 130.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 4 | 31 | 12 August 2026 | | 120.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 5 | 31 | 12 September 2026 | | 110.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 6 | 30 | 12 October 2026 | | 100.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 7 | 31 | 12 November 2026 | | 90.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 8 | 30 | 12 December 2026 | | 80.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 9 | 31 | 12 January 2027 | | 70.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 10 | 31 | 12 February 2027 | | 60.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 11 | 28 | 12 March 2027 | | 50.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 12 | 31 | 12 April 2027 | | 40.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 13 | 30 | 12 May 2027 | | 30.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 14 | 31 | 12 June 2027 | | 20.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 15 | 30 | 12 July 2027 | | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 16 | 31 | 12 August 2027 | | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + | 10 June 2026 | Re-age | 150.0 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | + # --- Step 3: Reschedule again (push schedule 2 more months: 12 June -> 23 June) --- + When Admin creates and approves Loan reschedule with the following data: + | rescheduleFromDate | submittedOnDate | adjustedDueDate | graceOnPrincipal | graceOnInterest | extraTerms | newInterestRate | + | 12 June 2026 | 10 June 2026 | 23 June 2026 | | | | | + Then Loan Repayment schedule has 16 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 10 | 10 June 2026 | 10 June 2026 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | 2 | 13 | 23 June 2026 | | 140.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 3 | 30 | 23 July 2026 | | 130.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 4 | 31 | 23 August 2026 | | 120.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 5 | 31 | 23 September 2026 | | 110.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 6 | 30 | 23 October 2026 | | 100.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 7 | 31 | 23 November 2026 | | 90.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 8 | 30 | 23 December 2026 | | 80.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 9 | 31 | 23 January 2027 | | 70.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 10 | 31 | 23 February 2027 | | 60.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 11 | 28 | 23 March 2027 | | 50.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 12 | 31 | 23 April 2027 | | 40.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 13 | 30 | 23 May 2027 | | 30.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 14 | 31 | 23 June 2027 | | 20.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 15 | 30 | 23 July 2027 | | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 16 | 31 | 23 August 2027 | | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + | 10 June 2026 | Re-age | 150.0 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | + + @TestRailId:TODO_ADD_2 + Scenario: Verify that reschedule after ReAge produces correct schedule and balance for non-interest bearing single-installment product - UC5: 2nd reAge EQUAL_AMORTIZATION_PAYABLE_INTEREST + When Admin sets the business date to "10 June 2026" + When Admin creates a client with random data + When Admin set "LP1_ADV_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL" loan product "DEFAULT" transaction type to "NEXT_INSTALLMENT" future installment allocation rule + When 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 | + | LP1_ADV_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL | 31 May 2026 | 150 | 0 | FLAT | SAME_AS_REPAYMENT_PERIOD | EQUAL_INSTALLMENTS | 30 | DAYS | 30 | DAYS | 1 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | + And Admin successfully approves the loan on "31 May 2026" with "150" amount and expected disbursement date on "31 May 2026" + When Admin successfully disburse the loan on "31 May 2026" with "150" EUR transaction amount + Then Loan has 150.0 outstanding amount + Then Loan Repayment schedule has 1 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 30 | 30 June 2026 | | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + # --- Step 1: Reschedule #1 date : 2026-06-30 (from: 2026-06-30 → adjusted: 2026-09-30) --- + When Admin creates and approves Loan reschedule with the following data: + | rescheduleFromDate | submittedOnDate | adjustedDueDate | graceOnPrincipal | graceOnInterest | extraTerms | newInterestRate | + | 30 June 2026 | 10 June 2026 | 30 September 2026 | | | | | + Then Loan has 150.0 outstanding amount + Then Loan Repayment schedule has 1 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 122 | 30 September 2026 | | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + # --- Step 2: ReAge for 15 monthly installments starting 22 March 2026 --- + When Admin creates a Loan re-aging transaction with the following data: + | frequencyNumber | frequencyType | startDate | numberOfInstallments | reAgeInterestHandling | + | 1 | MONTHS | 12 June 2026 | 15 | EQUAL_AMORTIZATION_PAYABLE_INTEREST | + Then Loan has 150.0 outstanding amount + And Loan Repayment schedule has 16 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 10 | 10 June 2026 | 10 June 2026 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | 2 | 2 | 12 June 2026 | | 140.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 3 | 30 | 12 July 2026 | | 130.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 4 | 31 | 12 August 2026 | | 120.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 5 | 31 | 12 September 2026 | | 110.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 6 | 30 | 12 October 2026 | | 100.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 7 | 31 | 12 November 2026 | | 90.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 8 | 30 | 12 December 2026 | | 80.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 9 | 31 | 12 January 2027 | | 70.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 10 | 31 | 12 February 2027 | | 60.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 11 | 28 | 12 March 2027 | | 50.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 12 | 31 | 12 April 2027 | | 40.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 13 | 30 | 12 May 2027 | | 30.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 14 | 31 | 12 June 2027 | | 20.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 15 | 30 | 12 July 2027 | | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 16 | 31 | 12 August 2027 | | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + | 10 June 2026 | Re-age | 150.0 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | +# --- Step 3: Reschedule again (push schedule 2 more months: 12 June -> 23 June) --- + When Admin creates and approves Loan reschedule with the following data: + | rescheduleFromDate | submittedOnDate | adjustedDueDate | graceOnPrincipal | graceOnInterest | extraTerms | newInterestRate | + | 12 June 2026 | 10 June 2026 | 23 June 2026 | | | | | + Then Loan Repayment schedule has 16 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 | + | | | 31 May 2026 | | 150.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 1 | 10 | 10 June 2026 | 10 June 2026 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | 2 | 13 | 23 June 2026 | | 140.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 3 | 30 | 23 July 2026 | | 130.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 4 | 31 | 23 August 2026 | | 120.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 5 | 31 | 23 September 2026 | | 110.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 6 | 30 | 23 October 2026 | | 100.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 7 | 31 | 23 November 2026 | | 90.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 8 | 30 | 23 December 2026 | | 80.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 9 | 31 | 23 January 2027 | | 70.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 10 | 31 | 23 February 2027 | | 60.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 11 | 28 | 23 March 2027 | | 50.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 12 | 31 | 23 April 2027 | | 40.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 13 | 30 | 23 May 2027 | | 30.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 14 | 31 | 23 June 2027 | | 20.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 15 | 30 | 23 July 2027 | | 10.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + | 16 | 31 | 23 August 2027 | | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 0.0 | 0.0 | 10.0 | + And Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | 0.0 | 0.0 | 0.0 | 150.0 | + And Loan Transactions tab has the following data: + | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance | Reverted | + | 31 May 2026 | Disbursement | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | 150.0 | false | + | 10 June 2026 | Re-age | 150.0 | 150.0 | 0.0 | 0.0 | 0.0 | 0.0 | false | \ No newline at end of file diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTermVariationsData.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTermVariationsData.java index 55ee574bf3e..b2f1fe71927 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTermVariationsData.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTermVariationsData.java @@ -20,6 +20,7 @@ import java.math.BigDecimal; import java.time.LocalDate; +import java.time.OffsetDateTime; import lombok.Getter; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.core.service.DateUtils; @@ -36,6 +37,7 @@ public class LoanTermVariationsData implements Comparable lastActiveReAgeTransaction = findLastActiveReAgeTransactionIn(alreadyProcessedTransactions); + if (termVariationsData.getCreatedDate() != null && lastActiveReAgeTransaction.isPresent() && lastActiveReAgeTransaction.get() + .getCreatedDate().orElse(OffsetDateTime.now()).isAfter(termVariationsData.getCreatedDate())) { + return; + } final Integer repayEvery = lastActiveReAgeTransaction.map(t -> t.getLoanReAgeParameter().getFrequencyNumber()) .orElse(loan.getLoanProductRelatedDetail().getRepayEvery()); final PeriodFrequencyType repaymentFrequency = lastActiveReAgeTransaction.map(t -> t.getLoanReAgeParameter().getFrequencyType()) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/reaging/LoanReAgingService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/reaging/LoanReAgingService.java index f374cdd3d2f..019bfa9d25b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/reaging/LoanReAgingService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/reaging/LoanReAgingService.java @@ -208,7 +208,9 @@ private void processReAgeTransaction(final Loan loan, final LoanTransaction reAg || LoanReAgeInterestHandlingType.EQUAL_AMORTIZATION_FULL_INTEREST .equals(reAgeTransaction.getLoanReAgeParameter().getInterestHandlingType()) || LoanReAgeInterestHandlingType.EQUAL_AMORTIZATION_PAYABLE_INTEREST - .equals(reAgeTransaction.getLoanReAgeParameter().getInterestHandlingType())) { + .equals(reAgeTransaction.getLoanReAgeParameter().getInterestHandlingType()) + || loan.getActiveLoanTermVariations().stream().anyMatch(ltv->ltv.getTermApplicableFrom().isAfter(reAgeTransaction.getSubmittedOnDate())) + ) { final ScheduleGeneratorDTO scheduleGeneratorDTO = loanUtilService.buildScheduleGeneratorDTO(loan, null); loanScheduleService.regenerateRepaymentSchedule(loan, scheduleGeneratorDTO); if (withPostTransactionChecks) {