This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new f3bda3aff5 FINERACT-2412: full term tranche - write-off handling
f3bda3aff5 is described below

commit f3bda3aff5aa2fa941cbdbf6f4d501705603dcd2
Author: mariiaKraievska <[email protected]>
AuthorDate: Mon Jan 26 18:14:49 2026 +0200

    FINERACT-2412: full term tranche - write-off handling
---
 .../features/LoanDelayedScheduleCaptures.feature   | 155 +++++++++++++++++++++
 1 file changed, 155 insertions(+)

diff --git 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanDelayedScheduleCaptures.feature
 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanDelayedScheduleCaptures.feature
index 77efcc658b..39b5c1b1dc 100644
--- 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanDelayedScheduleCaptures.feature
+++ 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanDelayedScheduleCaptures.feature
@@ -1777,3 +1777,158 @@ Feature: Full Term Tranche - Schedule handling and 
Calculations
       | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
     When Loan Pay-off is made on "15 February 2024"
     Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4559 @AdvancedPaymentAllocation
+  Scenario: Verify full term tranche interest bearing progressive loan - 
second disbursement on installment date - write-off - UC12
+    When Admin sets the business date to "01 January 2024"
+    When Admin creates a client with random data
+    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            |
+      | 
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE
 | 01 January 2024   | 200            | 9.4822                 | 
DECLINING_BALANCE | DAILY                       | EQUAL_INSTALLMENTS | 6        
         | MONTHS                | 1              | MONTHS                 | 6  
                | 0                       | 0                      | 0          
          | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "01 January 2024" with "200" 
amount and expected disbursement date on "01 January 2024"
+    When Admin successfully disburse the loan on "01 January 2024" with "100" 
EUR transaction amount
+    Then Loan Repayment schedule has 6 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 |
+      |    |      | 01 January 2024  |           | 100.0           |           
    |          | 0.0  |           | 0.0    | 0.0  |            |      |         
    |
+      | 1  | 31   | 01 February 2024 |           | 83.66           | 16.34     
    | 0.79     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 2  | 29   | 01 March 2024    |           | 67.19           | 16.47     
    | 0.66     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 3  | 31   | 01 April 2024    |           | 50.59           | 16.6      
    | 0.53     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 4  | 30   | 01 May 2024      |           | 33.86           | 16.73     
    | 0.4      | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 5  | 31   | 01 June 2024     |           | 17.0            | 16.86     
    | 0.27     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 17.0      
    | 0.13     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 100.0         | 2.78     | 0.0  | 0.0       | 102.78 | 0.0  | 0.0      
  | 0.0  | 102.78      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
+#   --- 2nd disbursement on installment date ---
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.13 
EUR transaction amount
+    Then Loan Repayment schedule has 6 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 |
+      |    |      | 01 January 2024  |                  | 100.0           |    
           |          | 0.0  |           | 0.0    | 0.0   |            |      | 
            |
+      | 1  | 31   | 01 February 2024 | 01 February 2024 | 83.66           | 
16.34         | 0.79     | 0.0  | 0.0       | 17.13  | 17.13 | 0.0        | 0.0 
 | 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.19           | 
16.47         | 0.66     | 0.0  | 0.0       | 17.13  | 0.0   | 0.0        | 0.0 
 | 17.13       |
+      | 3  | 31   | 01 April 2024    |                  | 50.59           | 
16.6          | 0.53     | 0.0  | 0.0       | 17.13  | 0.0   | 0.0        | 0.0 
 | 17.13       |
+      | 4  | 30   | 01 May 2024      |                  | 33.86           | 
16.73         | 0.4      | 0.0  | 0.0       | 17.13  | 0.0   | 0.0        | 0.0 
 | 17.13       |
+      | 5  | 31   | 01 June 2024     |                  | 17.0            | 
16.86         | 0.27     | 0.0  | 0.0       | 17.13  | 0.0   | 0.0        | 0.0 
 | 17.13       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
17.0          | 0.13     | 0.0  | 0.0       | 17.13  | 0.0   | 0.0        | 0.0 
 | 17.13       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.78     | 0.0  | 0.0       | 102.78 | 17.13 | 0.0     
   | 0.0  | 85.65       |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
+      | 01 February 2024 | Repayment        | 17.13  | 16.34     | 0.79     | 
0.0  | 0.0       | 83.66        | false    | false    |
+    When Admin successfully disburse the loan on "01 February 2024" with "100" 
EUR transaction amount
+    Then Loan Repayment schedule has 7 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 |
+      |    |      | 01 January 2024  |                  | 100.0           |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 1  | 31   | 01 February 2024 | 01 February 2024 | 83.66           | 
16.34         | 0.79     | 0.0  | 0.0       | 17.13 | 17.13 | 0.0        | 0.0  
| 0.0         |
+      |    |      | 01 February 2024 |                  | 100.0           |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 2  | 29   | 01 March 2024    |                  | 150.85          | 
32.81         | 1.45     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 34.26       |
+      | 3  | 31   | 01 April 2024    |                  | 117.78          | 
33.07         | 1.19     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 34.26       |
+      | 4  | 30   | 01 May 2024      |                  | 84.45           | 
33.33         | 0.93     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 34.26       |
+      | 5  | 31   | 01 June 2024     |                  | 50.86           | 
33.59         | 0.67     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 34.26       |
+      | 6  | 30   | 01 July 2024     |                  | 17.0            | 
33.86         | 0.4      | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 34.26       |
+      | 7  | 31   | 01 August 2024   |                  | 0.0             | 
17.0          | 0.13     | 0.0  | 0.0       | 17.13 | 0.0   | 0.0        | 0.0  
| 17.13       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 200.0         | 5.56     | 0.0  | 0.0       | 205.56 | 17.13 | 0.0     
   | 0.0  | 188.43      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
+      | 01 February 2024 | Repayment        | 17.13  | 16.34     | 0.79     | 
0.0  | 0.0       | 83.66        | false    | false    |
+      | 01 February 2024 | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 183.66       | false    | false    |
+    When Admin sets the business date to "01 March 2024"
+    And Admin does write-off the loan on "01 March 2024"
+    Then Loan status will be "CLOSED_WRITTEN_OFF"
+    Then Loan Repayment schedule has 7 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 |
+      |    |      | 01 January 2024  |                  | 100.0           |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 1  | 31   | 01 February 2024 | 01 February 2024 | 83.66           | 
16.34         | 0.79     | 0.0  | 0.0       | 17.13 | 17.13 | 0.0        | 0.0  
| 0.0         |
+      |    |      | 01 February 2024 |                  | 100.0           |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 2  | 29   | 01 March 2024    | 01 March 2024    | 150.85          | 
32.81         | 1.45     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    | 01 March 2024    | 117.78          | 
33.07         | 1.19     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 4  | 30   | 01 May 2024      | 01 March 2024    | 84.45           | 
33.33         | 0.93     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 5  | 31   | 01 June 2024     | 01 March 2024    | 50.86           | 
33.59         | 0.67     | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 6  | 30   | 01 July 2024     | 01 March 2024    | 17.0            | 
33.86         | 0.4      | 0.0  | 0.0       | 34.26 | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 7  | 31   | 01 August 2024   | 01 March 2024    | 0.0             | 
17.0          | 0.13     | 0.0  | 0.0       | 17.13 | 0.0   | 0.0        | 0.0  
| 0.0         |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 200.0         | 5.56     | 0.0  | 0.0       | 205.56 | 17.13 | 0.0     
   | 0.0  | 0.0         |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement           | 100.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 100.0        | false    | false    |
+      | 01 February 2024 | Repayment              | 17.13  | 16.34     | 0.79  
   | 0.0  | 0.0       | 83.66        | false    | false    |
+      | 01 February 2024 | Disbursement           | 100.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 183.66       | false    | false    |
+      | 01 March 2024    | Close (as written-off) | 188.43 | 183.66    | 4.77  
   | 0.0  | 0.0       | 0.0          | false    | false    |
+
+  @TestRailId:C4560 @AdvancedPaymentAllocation
+  Scenario: Verify full term tranche interest bearing progressive loan - 
second disbursement mid-period - write-off - UC12.1
+    When Admin sets the business date to "01 January 2024"
+    When Admin creates a client with random data
+    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            |
+      | 
LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_FULL_TERM_TRANCHE
 | 01 January 2024   | 200            | 9.4822                 | 
DECLINING_BALANCE | DAILY                       | EQUAL_INSTALLMENTS | 6        
         | MONTHS                | 1              | MONTHS                 | 6  
                | 0                       | 0                      | 0          
          | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "01 January 2024" with "200" 
amount and expected disbursement date on "01 January 2024"
+    When Admin successfully disburse the loan on "01 January 2024" with "100" 
EUR transaction amount
+    Then Loan Repayment schedule has 6 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 |
+      |    |      | 01 January 2024  |           | 100.0           |           
    |          | 0.0  |           | 0.0    | 0.0  |            |      |         
    |
+      | 1  | 31   | 01 February 2024 |           | 83.66           | 16.34     
    | 0.79     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 2  | 29   | 01 March 2024    |           | 67.19           | 16.47     
    | 0.66     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 3  | 31   | 01 April 2024    |           | 50.59           | 16.6      
    | 0.53     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 4  | 30   | 01 May 2024      |           | 33.86           | 16.73     
    | 0.4      | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 5  | 31   | 01 June 2024     |           | 17.0            | 16.86     
    | 0.27     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 17.0      
    | 0.13     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 100.0         | 2.78     | 0.0  | 0.0       | 102.78 | 0.0  | 0.0      
  | 0.0  | 102.78      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
+#   --- 2nd disbursement mid-period (Feb 15) ---
+    When Admin sets the business date to "15 February 2024"
+    When Admin successfully disburse the loan on "15 February 2024" with "100" 
EUR transaction amount
+    Then Loan Repayment schedule has 7 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 |
+      |    |      | 01 January 2024  |           | 100.0           |           
    |          | 0.0  |           | 0.0    | 0.0  |            |      |         
    |
+      | 1  | 31   | 01 February 2024 |           | 83.66           | 16.34     
    | 0.79     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 17.13   
    |
+      |    |      | 15 February 2024 |           | 100.0           |           
    |          | 0.0  |           | 0.0    | 0.0  |            |      |         
    |
+      | 2  | 29   | 01 March 2024    |           | 150.59          | 33.07     
    | 1.13     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 34.2    
    |
+      | 3  | 31   | 01 April 2024    |           | 117.58          | 33.01     
    | 1.19     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 34.2    
    |
+      | 4  | 30   | 01 May 2024      |           | 84.31           | 33.27     
    | 0.93     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 34.2    
    |
+      | 5  | 31   | 01 June 2024     |           | 50.78           | 33.53     
    | 0.67     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 34.2    
    |
+      | 6  | 30   | 01 July 2024     |           | 16.92           | 33.86     
    | 0.4      | 0.0  | 0.0       | 34.26  | 0.0  | 0.0        | 0.0  | 34.26   
    |
+      | 7  | 31   | 01 August 2024   |           | 0.0             | 16.92     
    | 0.13     | 0.0  | 0.0       | 17.05  | 0.0  | 0.0        | 0.0  | 17.05   
    |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 200.0         | 5.24     | 0.0  | 0.0       | 205.24 | 0.0  | 0.0      
  | 0.0  | 205.24      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date  | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024   | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    | false    |
+      | 15 February 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 200.0        | false    | false    |
+    When Admin sets the business date to "01 March 2024"
+    And Admin does write-off the loan on "01 March 2024"
+    Then Loan status will be "CLOSED_WRITTEN_OFF"
+    Then Loan Repayment schedule has 7 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 |
+      |    |      | 01 January 2024  |               | 100.0           |       
        |          | 0.0  |           | 0.0    | 0.0  |            |      |     
        |
+      | 1  | 31   | 01 February 2024 | 01 March 2024 | 83.66           | 16.34 
        | 0.79     | 0.0  | 0.0       | 17.13  | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      |    |      | 15 February 2024 |               | 100.0           |       
        |          | 0.0  |           | 0.0    | 0.0  |            |      |     
        |
+      | 2  | 29   | 01 March 2024    | 01 March 2024 | 150.66          | 33.0  
        | 1.2      | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      | 3  | 31   | 01 April 2024    | 01 March 2024 | 117.65          | 33.01 
        | 1.19     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      | 4  | 30   | 01 May 2024      | 01 March 2024 | 84.38           | 33.27 
        | 0.93     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      | 5  | 31   | 01 June 2024     | 01 March 2024 | 50.85           | 33.53 
        | 0.67     | 0.0  | 0.0       | 34.2   | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      | 6  | 30   | 01 July 2024     | 01 March 2024 | 16.99           | 33.86 
        | 0.4      | 0.0  | 0.0       | 34.26  | 0.0  | 0.0        | 0.0  | 0.0 
        |
+      | 7  | 31   | 01 August 2024   | 01 March 2024 | 0.0             | 16.99 
        | 0.13     | 0.0  | 0.0       | 17.12  | 0.0  | 0.0        | 0.0  | 0.0 
        |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 200.0         | 5.31     | 0.0  | 0.0       | 205.31 | 0.0  | 0.0      
  | 0.0  | 0.0         |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type       | Amount | Principal | 
Interest | Fees | Penalties | Loan Balance | Reverted | Replayed |
+      | 01 January 2024  | Disbursement           | 100.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 100.0        | false    | false    |
+      | 15 February 2024 | Disbursement           | 100.0  | 0.0       | 0.0   
   | 0.0  | 0.0       | 200.0        | false    | false    |
+      | 01 March 2024    | Close (as written-off) | 205.31 | 200.0     | 5.31  
   | 0.0  | 0.0       | 0.0          | false    | false    |

Reply via email to