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

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

commit 46f218fdc2c6469849ae4cd291a09152e82a0e9f
Author: MarianaDmytrivBinariks <[email protected]>
AuthorDate: Fri Dec 19 18:23:47 2025 +0200

    FINERACT-2354: e2e tests for re-amortization undo
---
 .../resources/features/LoanReAmortization.feature  | 672 ++++++++++++++++++++-
 1 file changed, 671 insertions(+), 1 deletion(-)

diff --git 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanReAmortization.feature
 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanReAmortization.feature
index 488464ac53..e1e0e56666 100644
--- 
a/fineract-e2e-tests-runner/src/test/resources/features/LoanReAmortization.feature
+++ 
b/fineract-e2e-tests-runner/src/test/resources/features/LoanReAmortization.feature
@@ -2004,6 +2004,7 @@ Feature: LoanReAmortization
     When Loan Pay-off is made on "15 March 2024"
     Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
 
+  @TestRailId:C4389 @AdvancedPaymentAllocation
   Scenario: Verify Re-amortization reversal on interest bearing loan - 
Interest calculation: Default Behavior - UC8
     When Admin sets the business date to "01 January 2024"
     When Admin creates a client with random data
@@ -2087,6 +2088,7 @@ Feature: LoanReAmortization
     When Loan Pay-off is made on "15 March 2024"
     Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
 
+  @TestRailId:C4390 @AdvancedPaymentAllocation
   Scenario: Verify Re-amortization reversal on interest bearing loan - 
Interest handling: EQUAL_AMORTIZATION_INTEREST_SPLIT - UC8
     When Admin sets the business date to "01 January 2024"
     And Admin creates a client with random data
@@ -2167,4 +2169,672 @@ Feature: LoanReAmortization
       | 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
-      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
\ No newline at end of file
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
+
+    When Loan Pay-off is made on "1 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4396 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after repayment on interest 
bearing loan - Interest calculation: Default Behavior - UC8.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_NO_CALC_ON_PAST_DUE_TILL_PRECLOSE
 | 01 January 2024   | 100            | 7                      | 
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 "100" 
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.57           | 16.43     
    | 0.58     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 2  | 29   | 01 March 2024    |           | 67.05           | 16.52     
    | 0.49     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 3  | 31   | 01 April 2024    |           | 50.43           | 16.62     
    | 0.39     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 4  | 30   | 01 May 2024      |           | 33.71           | 16.72     
    | 0.29     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 5  | 31   | 01 June 2024     |           | 16.9            | 16.81     
    | 0.2      | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 16.9      
    | 0.1      | 0.0  | 0.0       | 17.0  | 0.0  | 0.0        | 0.0  | 17.0     
   |
+    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.05     | 0.0  | 0.0       | 102.05 | 0.0  | 0.0      
  | 0.0  | 102.05      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    |
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    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.05     | 0.0  | 0.0       | 102.05 | 17.01 | 0.0     
   | 0.0  | 85.04       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+    When Admin sets the business date to "15 March 2024"
+    When Admin creates a Loan re-amortization transaction on current business 
date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 63.23           | 
20.34         | 0.98     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.28           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.21           | 
21.07         | 0.25     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.21         | 0.12     | 0.0  | 0.0       | 21.33 | 0.0   | 0.0        | 0.0  
| 21.33       |
+    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.3      | 0.0  | 0.0       | 102.3 | 17.01 | 0.0      
  | 0.0  | 85.29       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+    When Admin sets the business date to "1 April 2024"
+    And Customer makes "AUTOPAY" repayment on "01 April 2024" with 21.32 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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    | 01 April 2024    | 63.23           | 
20.34         | 0.98     | 0.0  | 0.0       | 21.32 | 21.32 | 0.0        | 0.0  
| 0.0         |
+      | 4  | 30   | 01 May 2024      |                  | 42.28           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.21           | 
21.07         | 0.25     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.21         | 0.12     | 0.0  | 0.0       | 21.33 | 0.0   | 0.0        | 0.0  
| 21.33       |
+    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.3      | 0.0  | 0.0       | 102.3 | 38.33 | 0.0      
  | 0.0  | 63.97       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+      | 01 April 2024    | Repayment        | 21.32  | 20.34     | 0.98     | 
0.0  | 0.0       | 63.23        | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
 | 0.0         |
+      | 2  | 29   | 01 March 2024    | 01 April 2024    | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 
17.01 | 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 4.31  | 0.0        | 0.0  
 | 12.7        |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
 | 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
 | 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
 | 17.0        |
+    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.05     | 0.0  | 0.0       | 102.05 | 38.33 | 0.0     
   | 17.01 | 63.72       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
+      | 01 April 2024    | Repayment        | 21.32  | 20.83     | 0.49     | 
0.0  | 0.0       | 62.74        | false    | true     |
+
+    When Loan Pay-off is made on "1 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4397 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after chargeback on interest 
bearing loan - Interest handling: EQUAL_AMORTIZATION_INTEREST_SPLIT - UC8.2
+    When Admin sets the business date to "01 January 2024"
+    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_INTEREST_RECALC_EMI_360_30_CHARGEBACK_INTEREST_FEE_PRINCIPAL
 | 01 January 2024   | 100            | 7                      | 
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 "100" 
amount and expected disbursement date on "01 January 2024"
+    And 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.57           | 16.43     
    | 0.58     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 2  | 29   | 01 March 2024    |           | 67.05           | 16.52     
    | 0.49     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 3  | 31   | 01 April 2024    |           | 50.43           | 16.62     
    | 0.39     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 4  | 30   | 01 May 2024      |           | 33.71           | 16.72     
    | 0.29     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 5  | 31   | 01 June 2024     |           | 16.9            | 16.81     
    | 0.2      | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 16.9      
    | 0.1      | 0.0  | 0.0       | 17.0  | 0.0  | 0.0        | 0.0  | 17.0     
   |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 100.0         | 2.05     | 0.0  | 0.0       | 102.05 | 0.0  | 0.0      
  | 0.0  | 102.05      |
+    And 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    |
+#  --- Repayment on due date ---
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.05     | 0.0  | 0.0       | 102.05 | 17.01 | 0.0     
   | 0.0  | 85.04       |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+#   --- Re-amortization transaction ---
+    When Admin sets the business date to "15 March 2024"
+    And Admin creates a Loan re-amortization transaction on current business 
date with reAmortizationInterestHandling "EQUAL_AMORTIZATION_INTEREST_SPLIT"
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 62.86           | 
20.71         | 0.61     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.03           | 
20.83         | 0.49     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.08           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.08         | 0.24     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.29     | 0.0  | 0.0       | 102.29 | 17.01 | 0.0     
   | 0.0  | 85.28       |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+    When Admin sets the business date to "1 April 2024"
+    When Admin makes "REPAYMENT_ADJUSTMENT_CHARGEBACK" chargeback with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 62.86           | 
20.71         | 0.61     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.12           | 
37.17         | 1.16     | 0.0  | 0.0       | 38.33 | 0.0   | 0.0        | 0.0  
| 38.33       |
+      | 5  | 31   | 01 June 2024     |                  | 21.17           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.17         | 0.24     | 0.0  | 0.0       | 21.41 | 0.0   | 0.0        | 0.0  
| 21.41       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 116.43        | 2.96     | 0.0  | 0.0       | 119.39 | 17.01 | 0.0     
   | 0.0  | 102.38     |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+      | 01 April 2024    | Chargeback       | 17.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 100.0        | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.53           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.91           | 
33.05         | 0.97     | 0.0  | 0.0       | 34.02 | 0.0   | 0.0        | 0.0  
| 34.02       |
+      | 5  | 31   | 01 June 2024     |                  | 17.1            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
17.1          | 0.1      | 0.0  | 0.0       | 17.2  | 0.0   | 0.0        | 0.0  
| 17.2        |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 116.43        | 2.83     | 0.0  | 0.0       | 119.26 | 17.01 | 0.0     
   | 0.0  | 102.25     |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
+      | 01 April 2024    | Chargeback       | 17.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 100.0        | false    | false    |
+
+    When Loan Pay-off is made on "1 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4398 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after charge on interest bearing 
loan - Interest calculation: Default Behavior - UC8.3
+    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_NO_CALC_ON_PAST_DUE_TILL_PRECLOSE
 | 01 January 2024   | 100            | 7                      | 
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 "100" 
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.57           | 16.43     
    | 0.58     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 2  | 29   | 01 March 2024    |           | 67.05           | 16.52     
    | 0.49     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 3  | 31   | 01 April 2024    |           | 50.43           | 16.62     
    | 0.39     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 4  | 30   | 01 May 2024      |           | 33.71           | 16.72     
    | 0.29     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 5  | 31   | 01 June 2024     |           | 16.9            | 16.81     
    | 0.2      | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 16.9      
    | 0.1      | 0.0  | 0.0       | 17.0  | 0.0  | 0.0        | 0.0  | 17.0     
   |
+    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.05     | 0.0  | 0.0       | 102.05 | 0.0  | 0.0      
  | 0.0  | 102.05      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | 
Fees | Penalties | Loan Balance | Reverted |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 
0.0  | 0.0       | 100.0        | false    |
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    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.05     | 0.0  | 0.0       | 102.05 | 17.01 | 0.0     
   | 0.0  | 85.04       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+    When Admin sets the business date to "15 March 2024"
+    When Admin creates a Loan re-amortization transaction on current business 
date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 63.23           | 
20.34         | 0.98     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.28           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.21           | 
21.07         | 0.25     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.21         | 0.12     | 0.0  | 0.0       | 21.33 | 0.0   | 0.0        | 0.0  
| 21.33       |
+    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.3      | 0.0  | 0.0       | 102.3 | 17.01 | 0.0      
  | 0.0  | 85.29       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+    When Admin sets the business date to "1 April 2024"
+    And Admin adds "LOAN_SNOOZE_FEE" due date charge with "01 April 2024" due 
date and 10 EUR transaction amount
+    Then Loan Charges tab has the following data:
+      | Name       | isPenalty | Payment due at     | Due as of     | 
Calculation type | Due  | Paid | Waived | Outstanding |
+      | Snooze fee | false     | Specified due date | 01 April 2024 | Flat     
        | 10.0 | 0.0  | 0.0    | 10.0        |
+
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 63.23           | 
20.34         | 0.98     | 10.0 | 0.0       | 31.32 | 0.0   | 0.0        | 0.0  
| 31.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.28           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.21           | 
21.07         | 0.25     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.21         | 0.12     | 0.0  | 0.0       | 21.33 | 0.0   | 0.0        | 0.0  
| 21.33       |
+    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.3      | 10.0 | 0.0       | 112.3 | 17.01 | 0.0      
  | 0.0  | 95.29       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 10.0 | 0.0       | 27.01 | 0.0   | 0.0        | 0.0  
| 27.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    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.05     | 10.0 | 0.0       | 112.05 | 17.01 | 0.0     
   | 0.0  | 95.04       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
+    Then Loan Charges tab has the following data:
+      | Name       | isPenalty | Payment due at     | Due as of     | 
Calculation type | Due  | Paid | Waived | Outstanding |
+      | Snooze fee | false     | Specified due date | 01 April 2024 | Flat     
        | 10.0 | 0.0  | 0.0    | 10.0        |
+    When Loan Pay-off is made on "1 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4399 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after MIR on interest bearing loan 
- Interest handling: EQUAL_AMORTIZATION_INTEREST_SPLIT - UC8.4
+    When Admin sets the business date to "01 January 2024"
+    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
 | 01 January 2024   | 100            | 7                      | 
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 "100" 
amount and expected disbursement date on "01 January 2024"
+    And 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.57           | 16.43     
    | 0.58     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 2  | 29   | 01 March 2024    |           | 67.05           | 16.52     
    | 0.49     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 3  | 31   | 01 April 2024    |           | 50.43           | 16.62     
    | 0.39     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 4  | 30   | 01 May 2024      |           | 33.71           | 16.72     
    | 0.29     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 5  | 31   | 01 June 2024     |           | 16.9            | 16.81     
    | 0.2      | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 16.9      
    | 0.1      | 0.0  | 0.0       | 17.0  | 0.0  | 0.0        | 0.0  | 17.0     
   |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 100.0         | 2.05     | 0.0  | 0.0       | 102.05 | 0.0  | 0.0      
  | 0.0  | 102.05      |
+    And 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    |
+#  --- Repayment on due date ---
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.05     | 0.0  | 0.0       | 102.05 | 17.01 | 0.0     
   | 0.0  | 85.04       |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+#   --- Re-amortization transaction ---
+    When Admin sets the business date to "15 March 2024"
+    And Admin creates a Loan re-amortization transaction on current business 
date with reAmortizationInterestHandling "EQUAL_AMORTIZATION_INTEREST_SPLIT"
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 62.86           | 
20.71         | 0.61     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.03           | 
20.83         | 0.49     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.08           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.08         | 0.24     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.29     | 0.0  | 0.0       | 102.29 | 17.01 | 0.0     
   | 0.0  | 85.28       |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+    When Admin sets the business date to "1 April 2024"
+    When Admin makes "MERCHANT_ISSUED_REFUND" transaction with "AUTOPAY" 
payment type on "01 April 2024" with 34.02 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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    | 01 April 2024    | 62.86           | 
20.71         | 0.61     | 0.0  | 0.0       | 21.32 | 21.32 | 0.0        | 0.0  
| 0.0         |
+      | 4  | 30   | 01 May 2024      |                  | 41.95           | 
20.91         | 0.41     | 0.0  | 0.0       | 21.32 | 13.29 | 13.29      | 0.0  
| 8.03        |
+      | 5  | 31   | 01 June 2024     |                  | 20.99           | 
20.96         | 0.36     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
20.99         | 0.24     | 0.0  | 0.0       | 21.23 | 0.0   | 0.0        | 0.0  
| 21.23       |
+    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.2      | 0.0  | 0.0       | 102.2  | 51.62 | 13.29   
  | 0.0  | 50.58     |
+    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.01  | 16.43     | 0.58  
   | 0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize            | 17.01  | 16.52     | 0.49  
   | 0.0  | 0.0       | 0.0          | false    | false    |
+      | 01 April 2024    | Merchant Issued Refund | 34.02  | 33.41     | 0.61  
   | 0.0  | 0.0       | 50.16        | false    | false    |
+      | 01 April 2024    | Interest Refund        | 0.59   | 0.59      | 0.0   
   | 0.0  | 0.0       | 49.57        | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 01 April 2024    | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 
17.01| 0.0         |
+      | 3  | 31   | 01 April 2024    | 01 April 2024    | 50.53           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 4  | 30   | 01 May 2024      |                  | 33.81           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.6   | 0.6        | 0.0  
| 16.41       |
+      | 5  | 31   | 01 June 2024     |                  | 17.0            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
17.0          | 0.1      | 0.0  | 0.0       | 17.1  | 0.0   | 0.0        | 0.0  
| 17.1        |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late  | Outstanding |
+      | 100.0         | 2.15     | 0.0  | 0.0       | 102.15 | 51.63 | 0.6     
   | 17.01 | 50.52      |
+    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.01  | 16.43     | 0.58  
   | 0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize            | 17.01  | 16.52     | 0.49  
   | 0.0  | 0.0       | 0.0          | true     | false    |
+      | 01 April 2024    | Merchant Issued Refund | 34.02  | 33.04     | 0.98  
   | 0.0  | 0.0       | 50.53        | false    | true     |
+      | 01 April 2024    | Interest Refund        | 0.6    | 0.6       | 0.0   
   | 0.0  | 0.0       | 49.93        | false    | true     |
+
+    When Loan Pay-off is made on "1 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4400 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after 2nd disb on interest bearing 
loan - Interest calculation: Default Behavior - UC8.5
+    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_CHARGEBACK
 | 01 January 2024   | 150            | 7                      | 
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 "150" 
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.57           | 16.43     
    | 0.58     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 2  | 29   | 01 March 2024    |           | 67.05           | 16.52     
    | 0.49     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 3  | 31   | 01 April 2024    |           | 50.43           | 16.62     
    | 0.39     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 4  | 30   | 01 May 2024      |           | 33.71           | 16.72     
    | 0.29     | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 5  | 31   | 01 June 2024     |           | 16.9            | 16.81     
    | 0.2      | 0.0  | 0.0       | 17.01 | 0.0  | 0.0        | 0.0  | 17.01    
   |
+      | 6  | 30   | 01 July 2024     |           | 0.0             | 16.9      
    | 0.1      | 0.0  | 0.0       | 17.0  | 0.0  | 0.0        | 0.0  | 17.0     
   |
+    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.05     | 0.0  | 0.0       | 102.05 | 0.0  | 0.0      
  | 0.0  | 102.05      |
+    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    |
+
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 17.01 
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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.43           | 
16.62         | 0.39     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 4  | 30   | 01 May 2024      |                  | 33.71           | 
16.72         | 0.29     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 5  | 31   | 01 June 2024     |                  | 16.9            | 
16.81         | 0.2      | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
16.9          | 0.1      | 0.0  | 0.0       | 17.0  | 0.0   | 0.0        | 0.0  
| 17.0        |
+    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.05     | 0.0  | 0.0       | 102.05 | 17.01 | 0.0     
   | 0.0  | 85.04       |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+
+    When Admin sets the business date to "15 March 2024"
+    And Admin creates a Loan re-amortization transaction on current business 
date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 63.23           | 
20.34         | 0.98     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 4  | 30   | 01 May 2024      |                  | 42.28           | 
20.95         | 0.37     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 5  | 31   | 01 June 2024     |                  | 21.21           | 
21.07         | 0.25     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
21.21         | 0.12     | 0.0  | 0.0       | 21.33 | 0.0   | 0.0        | 0.0  
| 21.33       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 2.3      | 0.0  | 0.0       | 102.3  | 17.01 | 0.0     
   | 0.0  | 85.29       |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+
+    When Admin sets the business date to "01 April 2024"
+    When Admin successfully disburse the loan on "01 April 2024" with "50" 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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    | 15 March 2024    | 83.57           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 3  | 31   | 01 April 2024    |                  | 63.23           | 
20.34         | 0.98     | 0.0  | 0.0       | 21.32 | 0.0   | 0.0        | 0.0  
| 21.32       |
+      |    |      | 01 April 2024    |                  | 50.0            |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 4  | 30   | 01 May 2024      |                  | 75.61           | 
37.62         | 0.37     | 0.0  | 0.0       | 37.99 | 0.0   | 0.0        | 0.0  
| 37.99       |
+      | 5  | 31   | 01 June 2024     |                  | 37.87           | 
37.74         | 0.25     | 0.0  | 0.0       | 37.99 | 0.0   | 0.0        | 0.0  
| 37.99       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
37.87         | 0.12     | 0.0  | 0.0       | 37.99 | 0.0   | 0.0        | 0.0  
| 37.99       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 150.0         | 2.3      | 0.0  | 0.0       | 152.3  | 17.01 | 0.0     
   | 0.0  | 135.29      |
+    And 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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | false    | false    |
+      | 01 April 2024    | Disbursement     | 50.0   | 0.0       | 0.0      | 
0.0  | 0.0       | 133.57       | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    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.57           | 
16.43         | 0.58     | 0.0  | 0.0       | 17.01 | 17.01 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 29   | 01 March 2024    |                  | 67.05           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      | 3  | 31   | 01 April 2024    |                  | 50.53           | 
16.52         | 0.49     | 0.0  | 0.0       | 17.01 | 0.0   | 0.0        | 0.0  
| 17.01       |
+      |    |      | 01 April 2024    |                  | 50.0            |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 4  | 30   | 01 May 2024      |                  | 67.25           | 
33.28         | 0.59     | 0.0  | 0.0       | 33.87 | 0.0   | 0.0        | 0.0  
| 33.87       |
+      | 5  | 31   | 01 June 2024     |                  | 33.77           | 
33.48         | 0.39     | 0.0  | 0.0       | 33.87 | 0.0   | 0.0        | 0.0  
| 33.87       |
+      | 6  | 30   | 01 July 2024     |                  | 0.0             | 
33.77         | 0.2      | 0.0  | 0.0       | 33.97 | 0.0   | 0.0        | 0.0  
| 33.97       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 150.0         | 2.74     | 0.0  | 0.0       | 152.74 | 17.01 | 0.0     
   | 0.0  | 135.73     |
+    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.01  | 16.43     | 0.58     | 
0.0  | 0.0       | 83.57        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 17.01  | 16.52     | 0.49     | 
0.0  | 0.0       | 0.0          | true     | false    |
+      | 01 April 2024    | Disbursement     | 50.0   | 0.0       | 0.0      | 
0.0  | 0.0       | 133.57       | false    | false    |
+
+    When Loan Pay-off is made on "01 April 2024"
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
+
+  @TestRailId:C4401 @AdvancedPaymentAllocation
+  Scenario: Verify Re-amortization reversal after 2nd disb with downpayment on 
interest bearing loan - Interest handling: EQUAL_AMORTIZATION_INTEREST_SPLIT - 
UC8.6
+    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_RECALCULATION_DAILY_EMI_360_30_MULTIDISBURSE_AUTO_DOWNPAYMENT
 | 01 January 2024   | 150            | 7                      | 
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 "150" 
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 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  | 0    | 01 January 2024  | 01 January 2024 | 75.0            | 
25.0          | 0.0      | 0.0  | 0.0       | 25.0  | 25.0 | 0.0        | 0.0  
| 0.0         |
+      | 2  | 31   | 01 February 2024 |                 | 62.68           | 
12.32         | 0.44     | 0.0  | 0.0       | 12.76 | 0.0  | 0.0        | 0.0  
| 12.76       |
+      | 3  | 29   | 01 March 2024    |                 | 50.29           | 
12.39         | 0.37     | 0.0  | 0.0       | 12.76 | 0.0  | 0.0        | 0.0  
| 12.76       |
+      | 4  | 31   | 01 April 2024    |                 | 37.82           | 
12.47         | 0.29     | 0.0  | 0.0       | 12.76 | 0.0  | 0.0        | 0.0  
| 12.76       |
+      | 5  | 30   | 01 May 2024      |                 | 25.28           | 
12.54         | 0.22     | 0.0  | 0.0       | 12.76 | 0.0  | 0.0        | 0.0  
| 12.76       |
+      | 6  | 31   | 01 June 2024     |                 | 12.67           | 
12.61         | 0.15     | 0.0  | 0.0       | 12.76 | 0.0  | 0.0        | 0.0  
| 12.76       |
+      | 7  | 30   | 01 July 2024     |                 | 0.0             | 
12.67         | 0.07     | 0.0  | 0.0       | 12.74 | 0.0  | 0.0        | 0.0  
| 12.74       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In 
advance | Late | Outstanding |
+      | 100.0         | 1.54     | 0.0  | 0.0       | 101.54 | 25.0 | 0.0      
  | 0.0  | 76.54       |
+    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 January 2024  | Down Payment     | 25.0   | 25.0      | 0.0      | 
0.0  | 0.0       | 75.0         | false    | false    |
+
+    When Admin sets the business date to "01 February 2024"
+    And Customer makes "AUTOPAY" repayment on "01 February 2024" with 12.76 
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  | 0    | 01 January 2024  | 01 January 2024  | 75.0            | 
25.0          | 0.0      | 0.0  | 0.0       | 25.0  | 25.0  | 0.0        | 0.0  
| 0.0         |
+      | 2  | 31   | 01 February 2024 | 01 February 2024 | 62.68           | 
12.32         | 0.44     | 0.0  | 0.0       | 12.76 | 12.76 | 0.0        | 0.0  
| 0.0         |
+      | 3  | 29   | 01 March 2024    |                  | 50.29           | 
12.39         | 0.37     | 0.0  | 0.0       | 12.76 | 0.0   | 0.0        | 0.0  
| 12.76       |
+      | 4  | 31   | 01 April 2024    |                  | 37.82           | 
12.47         | 0.29     | 0.0  | 0.0       | 12.76 | 0.0   | 0.0        | 0.0  
| 12.76       |
+      | 5  | 30   | 01 May 2024      |                  | 25.28           | 
12.54         | 0.22     | 0.0  | 0.0       | 12.76 | 0.0   | 0.0        | 0.0  
| 12.76       |
+      | 6  | 31   | 01 June 2024     |                  | 12.67           | 
12.61         | 0.15     | 0.0  | 0.0       | 12.76 | 0.0   | 0.0        | 0.0  
| 12.76       |
+      | 7  | 30   | 01 July 2024     |                  | 0.0             | 
12.67         | 0.07     | 0.0  | 0.0       | 12.74 | 0.0   | 0.0        | 0.0  
| 12.74       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 1.54     | 0.0  | 0.0       | 101.54 | 37.76 | 0.0     
   | 0.0  | 63.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    |
+      | 01 January 2024  | Down Payment     | 25.0   | 25.0      | 0.0      | 
0.0  | 0.0       | 75.0         | false    | false    |
+      | 01 February 2024 | Repayment        | 12.76  | 12.32     | 0.44     | 
0.0  | 0.0       | 62.68        | false    | false    |
+
+    When Admin sets the business date to "15 March 2024"
+    And Admin creates a Loan re-amortization transaction on current business 
date with reAmortizationInterestHandling "EQUAL_AMORTIZATION_INTEREST_SPLIT"
+    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  |  0   | 01 January 2024  | 01 January 2024  | 75.0            | 
25.0          | 0.0      | 0.0  | 0.0       | 25.0  | 25.0  | 0.0        | 0.0  
| 0.0         |
+      | 2  | 31   | 01 February 2024 | 01 February 2024 | 62.68           | 
12.32         | 0.44     | 0.0  | 0.0       | 12.76 | 12.76 | 0.0        | 0.0  
| 0.0         |
+      | 3  | 29   | 01 March 2024    | 15 March 2024    | 62.68           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 4  | 31   | 01 April 2024    |                  | 47.15           | 
15.53         | 0.46     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+      | 5  | 30   | 01 May 2024      |                  | 31.53           | 
15.62         | 0.37     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+      | 6  | 31   | 01 June 2024     |                  | 15.81           | 
15.72         | 0.27     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+      | 7  | 30   | 01 July 2024     |                  | 0.0             | 
15.81         | 0.18     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 100.0         | 1.72     | 0.0  | 0.0       | 101.72 | 37.76 | 0.0     
   | 0.0  | 63.96       |
+    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 January 2024  | Down Payment     | 25.0   | 25.0      | 0.0      | 
0.0  | 0.0       | 75.0         | false    | false    |
+      | 01 February 2024 | Repayment        | 12.76  | 12.32     | 0.44     | 
0.0  | 0.0       | 62.68        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 12.76  | 12.39     | 0.37     | 
0.0  | 0.0       | 0.0          | false    | false    |
+
+    When Admin sets the business date to "01 April 2024"
+    When Admin successfully disburse the loan on "01 April 2024" with "50" EUR 
transaction amount
+    Then Loan Repayment schedule has 8 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  |  0   | 01 January 2024  | 01 January 2024  | 75.0            | 
25.0          | 0.0      | 0.0  | 0.0       | 25.0  | 25.0  | 0.0        | 0.0  
| 0.0         |
+      | 2  | 31   | 01 February 2024 | 01 February 2024 | 62.68           | 
12.32         | 0.44     | 0.0  | 0.0       | 12.76 | 12.76 | 0.0        | 0.0  
| 0.0         |
+      | 3  | 29   | 01 March 2024    | 15 March 2024    | 62.68           | 
0.0           | 0.0      | 0.0  | 0.0       | 0.0   | 0.0   | 0.0        | 0.0  
| 0.0         |
+      | 4  | 31   | 01 April 2024    |                  | 47.15           | 
15.53         | 0.46     | 0.0  | 0.0       | 15.99 | 12.5  | 0.0        | 0.0  
| 3.49        |
+      |    |      | 01 April 2024    |                  | 50.0            |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 5  |  0   | 01 April 2024    |                  | 84.65           | 
12.5          | 0.0      | 0.0  | 0.0       | 12.5  | 0.0   | 0.0        | 0.0  
| 12.5        |
+      | 6  | 30   | 01 May 2024      |                  | 69.03           | 
15.62         | 0.37     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+      | 7  | 31   | 01 June 2024     |                  | 53.31           | 
15.72         | 0.27     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+      | 8  | 30   | 01 July 2024     |                  | 37.5            | 
15.81         | 0.18     | 0.0  | 0.0       | 15.99 | 0.0   | 0.0        | 0.0  
| 15.99       |
+    And Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 112.5         | 1.72     | 0.0  | 0.0       | 114.22 | 50.26 | 0.0     
   | 0.0  | 63.96      |
+    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 January 2024  | Down Payment     | 25.0   | 25.0      | 0.0      | 
0.0  | 0.0       | 75.0         | false    | false    |
+      | 01 February 2024 | Repayment        | 12.76  | 12.32     | 0.44     | 
0.0  | 0.0       | 62.68        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 12.76  | 12.39     | 0.37     | 
0.0  | 0.0       | 0.0          | false    | false    |
+      | 01 April 2024    | Disbursement     | 50.0   | 0.0       | 0.0      | 
0.0  | 0.0       | 112.68       | false    | false    |
+      | 01 April 2024    | Down Payment     | 12.5   | 12.5      | 0.0      | 
0.0  | 0.0       | 100.18       | false    | false    |
+
+    When Admin undo Loan re-amortization transaction on current business date
+    Then Loan Repayment schedule has 8 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  | 0    | 01 January 2024  | 01 January 2024  | 75.0            | 
25.0          | 0.0      | 0.0  | 0.0       | 25.0  | 25.0  | 0.0        | 0.0  
| 0.0         |
+      | 2  | 31   | 01 February 2024 | 01 February 2024 | 62.68           | 
12.32         | 0.44     | 0.0  | 0.0       | 12.76 | 12.76 | 0.0        | 0.0  
| 0.0         |
+      | 3  | 29   | 01 March 2024    |                  | 50.29           | 
12.39         | 0.37     | 0.0  | 0.0       | 12.76 | 12.5  | 0.0        | 12.5 
| 0.26        |
+      | 4  | 31   | 01 April 2024    |                  | 37.9            | 
12.39         | 0.37     | 0.0  | 0.0       | 12.76 | 0.0   | 0.0        | 0.0  
| 12.76       |
+      |    |      | 01 April 2024    |                  | 50.0            |    
           |          | 0.0  |           | 0.0   | 0.0   |            |      |  
           |
+      | 5  |  0   | 01 April 2024    |                  | 75.4            | 
12.5          | 0.0      | 0.0  | 0.0       | 12.5  | 0.0   | 0.0        | 0.0  
| 12.5        |
+      | 6  | 30   | 01 May 2024      |                  | 50.44           | 
24.96         | 0.44     | 0.0  | 0.0       | 25.4  | 0.0   | 0.0        | 0.0  
| 25.4        |
+      | 7  | 31   | 01 June 2024     |                  | 25.33           | 
25.11         | 0.29     | 0.0  | 0.0       | 25.4  | 0.0   | 0.0        | 0.0  
| 25.4        |
+      | 8  | 30   | 01 July 2024     |                  | 0.0             | 
25.33         | 0.15     | 0.0  | 0.0       | 25.48 | 0.0   | 0.0        | 0.0  
| 25.48       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
+      | 150.0         | 2.06     | 0.0  | 0.0       | 152.06 | 50.26 | 0.0     
   | 12.5 | 101.8       |
+    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 January 2024  | Down Payment     | 25.0   | 25.0      | 0.0      | 
0.0  | 0.0       | 75.0         | false    | false    |
+      | 01 February 2024 | Repayment        | 12.76  | 12.32     | 0.44     | 
0.0  | 0.0       | 62.68        | false    | false    |
+      | 15 March 2024    | Re-amortize      | 12.76  | 12.39     | 0.37     | 
0.0  | 0.0       | 0.0          | true     | false    |
+      | 01 April 2024    | Disbursement     | 50.0   | 0.0       | 0.0      | 
0.0  | 0.0       | 112.68       | false    | false    |
+      | 01 April 2024    | Down Payment     | 12.5   | 12.39     | 0.11     | 
0.0  | 0.0       | 100.29       | false    | true     |
+
+    #When Loan Pay-off is made on "01 April 2024"
+    And Customer makes "AUTOPAY" repayment on "01 April 2024" with 100.92 EUR 
transaction amount
+    Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met


Reply via email to