You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ad...@apache.org on 2025/08/01 13:31:56 UTC

(fineract) branch develop updated (bd8b4fedf4 -> cb4c66302a)

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

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


    from bd8b4fedf4 FINERACT-2326: Set precision of 6 for the audit fields of the datatables (mysql)
     new bbe3ead849 FINERACT-1968: Progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)
     new cb4c66302a FINERACT-1968: added e2e test cases for progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../test/resources/features/EMICalculation.feature | 124 +++++++++++++++
 .../calc/ProgressiveEMICalculatorTest.java         | 174 ++++++++++++++++++++-
 2 files changed, 296 insertions(+), 2 deletions(-)


(fineract) 02/02: FINERACT-1968: added e2e test cases for progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)

Posted by ad...@apache.org.
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

commit cb4c66302ae8e0203c251f8f989b519d0a4ffa90
Author: Rustam Zeinalov <tr...@gmail.com>
AuthorDate: Thu Jul 31 15:11:56 2025 +0200

    FINERACT-1968: added e2e test cases for progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)
---
 .../test/resources/features/EMICalculation.feature | 124 +++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/fineract-e2e-tests-runner/src/test/resources/features/EMICalculation.feature b/fineract-e2e-tests-runner/src/test/resources/features/EMICalculation.feature
index 94f9652c2f..61828b35ad 100644
--- a/fineract-e2e-tests-runner/src/test/resources/features/EMICalculation.feature
+++ b/fineract-e2e-tests-runner/src/test/resources/features/EMICalculation.feature
@@ -9632,3 +9632,127 @@ Feature: EMI calculation and repayment schedule checks for interest bearing loan
       | ASSET     | 112601       | Loans Receivable          |        | 906.25 |
       | ASSET     | 112603       | Interest/Fee Receivable   |        | 16.87  |
       | LIABILITY | 145023       | Suspense/Clearing account | 923.12 |        |
+
+  @TestRailId:С3893
+  Scenario: Progressive loan - flat interest DAILY, multi-disbursement, actual/actual, second disbursement in the middle of installment period
+    When Admin sets the business date to "01 June 2024"
+    And 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_INTEREST_FLAT_ADV_PMT_ALLOC_MULTIDISBURSE | 01 January 2024   | 3000           | 12                     | FLAT          | DAILY                       | EQUAL_INSTALLMENTS | 3                 | MONTHS                | 1              | MONTHS                 | 3                  | 0                       | 0                      | 0                    | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "01 June 2024" with "3000" amount and expected disbursement date on "01 June 2024"
+    And Admin successfully disburse the loan on "01 June 2024" with "1000" EUR transaction amount
+    Then Loan Repayment schedule has 3 periods, with the following data for periods:
+      | Nr | Days | Date              | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | Outstanding |
+      |    |      | 01 June 2024      |           | 1000.0          |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 1  | 30   | 01 July 2024      |           | 666.45          | 333.55        | 9.84     | 0.0  | 0.0       | 343.39 | 0.0  | 0.0        | 0.0  | 343.39      |
+      | 2  | 31   | 01 August 2024    |           | 333.22          | 333.23        | 10.16    | 0.0  | 0.0       | 343.39 | 0.0  | 0.0        | 0.0  | 343.39      |
+      | 3  | 31   | 01 September 2024 |           | 0.0             | 333.22        | 10.16    | 0.0  | 0.0       | 343.38 | 0.0  | 0.0        | 0.0  | 343.38      |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due     | Paid | In advance | Late | Outstanding |
+      | 1000          | 30.16    | 0.0  | 0.0       | 1030.16 | 0.0  | 0.0        | 0.0  | 1030.16     |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 June 2024     | Disbursement     | 1000.0 | 0.0       | 0.0      | 0.0  | 0.0       | 1000.0       |
+    When Admin sets the business date to "15 July 2024"
+    When Admin successfully disburse the loan on "15 July 2024" with "250" EUR transaction amount
+    Then Loan Repayment schedule has 3 periods, with the following data for periods:
+      | Nr | Days | Date              | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | Outstanding |
+      |    |      | 01 June 2024      |           | 1000.0          |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 1  | 30   | 01 July 2024      |           | 666.45          | 333.55        | 9.84     | 0.0  | 0.0       | 343.39 | 0.0  | 0.0        | 0.0  | 343.39      |
+      |    |      | 15 July 2024      |           | 250.0           |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 2  | 31   | 01 August 2024    |           | 457.65          | 458.8         | 11.56    | 0.0  | 0.0       | 470.36 | 0.0  | 0.0        | 0.0  | 470.36      |
+      | 3  | 31   | 01 September 2024 |           | 0.0             | 457.65        | 12.7     | 0.0  | 0.0       | 470.35 | 0.0  | 0.0        | 0.0  | 470.35      |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | Outstanding |
+      | 1250          | 34.1     | 0.0  | 0.0       | 1284.1 | 0.0  | 0.0        | 0.0  | 1284.1      |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 June 2024     | Disbursement     | 1000.0 | 0.0       | 0.0      | 0.0  | 0.0       | 1000.0       |
+      | 15 July 2024     | Disbursement     | 250.0  | 0.0       | 0.0      | 0.0  | 0.0       | 1250.0       |
+
+  @TestRailId:С3894
+  Scenario: Progressive loan - flat interest DAILY, down-payment, multi-disbursement, actual/actual, second disbursement on the due date of installment period
+    When Admin sets the business date to "01 June 2024"
+    And 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_DOWNPAYMENT_INTEREST_FLAT_ADV_PMT_ALLOC_MULTIDISBURSE | 01 January 2024   | 3000           | 12                     | FLAT          | DAILY                      | EQUAL_INSTALLMENTS | 3                 | MONTHS                | 1              | MONTHS                 | 3                  | 0                       | 0                      | 0                    | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "01 June 2024" with "3000" amount and expected disbursement date on "01 June 2024"
+    And Admin successfully disburse the loan on "01 June 2024" with "1000" EUR transaction amount
+    Then Loan Repayment schedule has 4 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 June 2024      |           | 1000.0          |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 1  | 0    | 01 June 2024      |           | 750.0           | 250.0         | 0.0      | 0.0  | 0.0       | 250.0  | 0.0  | 0.0        | 0.0  | 250.0       |
+      | 2  | 30   | 01 July 2024      |           | 499.84          | 250.16        | 7.38     | 0.0  | 0.0       | 257.54 | 0.0  | 0.0        | 0.0  | 257.54      |
+      | 3  | 31   | 01 August 2024    |           | 249.92          | 249.92        | 7.62     | 0.0  | 0.0       | 257.54 | 0.0  | 0.0        | 0.0  | 257.54      |
+      | 4  | 31   | 01 September 2024 |           | 0.0             | 249.92        | 7.62     | 0.0  | 0.0       | 257.54 | 0.0  | 0.0        | 0.0  | 257.54      |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due     | Paid | In advance | Late | Outstanding |
+      | 1000          | 22.62    | 0.0  | 0.0       | 1022.62 | 0.0  | 0.0        | 0.0  | 1022.62     |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 June 2024     | Disbursement     | 1000.0 | 0.0       | 0.0      | 0.0  | 0.0       | 1000.0       |
+    When Admin sets the business date to "01 August 2024"
+    When Admin successfully disburse the loan on "01 August 2024" with "250" EUR transaction amount
+    Then Loan Repayment schedule has 5 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 June 2024      |           | 1000.0          |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 1  | 0    | 01 June 2024      |           | 750.0           | 250.0         | 0.0      | 0.0  | 0.0       | 250.0  | 0.0  | 0.0        | 0.0  | 250.0       |
+      | 2  | 30   | 01 July 2024      |           | 499.84          | 250.16        | 7.38     | 0.0  | 0.0       | 257.54 | 0.0  | 0.0        | 0.0  | 257.54      |
+      | 3  | 31   | 01 August 2024    |           | 249.92          | 249.92        | 7.62     | 0.0  | 0.0       | 257.54 | 0.0  | 0.0        | 0.0  | 257.54      |
+      |    |      | 01 August 2024    |           | 250.0           |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 4  | 0    | 01 August 2024    |           | 437.42          | 62.5          | 0.0      | 0.0  | 0.0       | 62.5   | 0.0  | 0.0        | 0.0  | 62.5        |
+      | 5  | 31   | 01 September 2024 |           | 0.0             | 437.42        | 9.53     | 0.0  | 0.0       | 446.95 | 0.0  | 0.0        | 0.0  | 446.95      |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due     | Paid | In advance | Late | Outstanding |
+      | 1250          | 24.53    | 0.0  | 0.0       | 1274.53 | 0.0  | 0.0        | 0.0  | 1274.53     |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 June 2024     | Disbursement     | 1000.0 | 0.0       | 0.0      | 0.0  | 0.0       | 1000.0       |
+      | 01 August 2024   | Disbursement     | 250.0  | 0.0       | 0.0      | 0.0  | 0.0       | 1250.0       |
+
+  @TestRailId:C3897
+  Scenario: Progressive loan - flat interest DAILY, actual/actual, 4% interest rate
+    When Admin sets the business date to "01 January 2024"
+    And 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_INTEREST_FLAT_ADV_PMT_ALLOC_MULTIDISBURSE  | 01 January 2024   | 100            | 4                      | FLAT          | DAILY                      | EQUAL_INSTALLMENTS | 3                 | MONTHS                | 1              | MONTHS                 | 3                  | 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 3 periods, with the following data for periods:
+      | Nr | Days | Date            | Paid date | Balance of loan | Principal due | Interest | Fees | Penalties | Due   | Paid | In advance | Late | Outstanding |
+      |    |      | 01 January 2024 |           | 100.0           |               |          | 0.0  |           | 0.0   | 0.0  |            |      |             |
+      | 1  | 31   | 01 February 2024|           | 66.67           | 33.33         | 0.34     | 0.0  | 0.0       | 33.67 | 0.0  | 0.0        | 0.0  | 33.67       |
+      | 2  | 29   | 01 March 2024   |           | 33.32           | 33.35         | 0.32     | 0.0  | 0.0       | 33.67 | 0.0  | 0.0        | 0.0  | 33.67       |
+      | 3  | 31   | 01 April 2024   |           | 0.0             | 33.32         | 0.34     | 0.0  | 0.0       | 33.66 | 0.0  | 0.0        | 0.0  | 33.66       |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due   | Paid | In advance | Late | Outstanding |
+      | 100           | 1.0      | 0.0  | 0.0       | 101.0 | 0.0  | 0.0        | 0.0  | 101.0       |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 January 2024  | Disbursement     | 100.0  | 0.0       | 0.0      | 0.0  | 0.0       | 100.0        |
+
+  @TestRailId:C3898
+  Scenario: Progressive loan with downpayment - flat interest DAILY, actual/actual, 4% interest rate
+    When Admin sets the business date to "01 January 2024"
+    And 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_DOWNPAYMENT_INTEREST_FLAT_ADV_PMT_ALLOC_MULTIDISBURSE | 01 January 2024   | 1000           | 4                      | FLAT          | DAILY                      | EQUAL_INSTALLMENTS | 3                 | MONTHS                | 1              | MONTHS                 | 3                  | 0                       | 0                      | 0                    | ADVANCED_PAYMENT_ALLOCATION |
+    And Admin successfully approves the loan on "01 January 2024" with "1000" amount and expected disbursement date on "01 January 2024"
+    And Admin successfully disburse the loan on "01 January 2024" with "1000" EUR transaction amount
+    Then Loan Repayment schedule has 4 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 |           | 1000.0          |               |          | 0.0  |           | 0.0    | 0.0  |            |      |             |
+      | 1  | 0    | 01 January 2024 |           | 750.0           | 250.0         | 0.0      | 0.0  | 0.0       | 250.0  | 0.0  | 0.0        | 0.0  | 250.0       |
+      | 2  | 31   | 01 February 2024|           | 500.05          | 249.95        | 2.54     | 0.0  | 0.0       | 252.49 | 0.0  | 0.0        | 0.0  | 252.49      |
+      | 3  | 29   | 01 March 2024   |           | 249.94          | 250.11        | 2.38     | 0.0  | 0.0       | 252.49 | 0.0  | 0.0        | 0.0  | 252.49      |
+      | 4  | 31   | 01 April 2024   |           | 0.0             | 249.94        | 2.54     | 0.0  | 0.0       | 252.48 | 0.0  | 0.0        | 0.0  | 252.48      |
+    Then Loan Repayment schedule has the following data in Total row:
+      | Principal due | Interest | Fees | Penalties | Due    | Paid | In advance | Late | Outstanding |
+      | 1000          | 7.46     | 0.0  | 0.0       | 1007.46| 0.0  | 0.0        | 0.0  | 1007.46     |
+    Then Loan Transactions tab has the following data:
+      | Transaction date | Transaction Type | Amount | Principal | Interest | Fees | Penalties | Loan Balance |
+      | 01 January 2024  | Disbursement     | 1000.0 | 0.0       | 0.0      | 0.0  | 0.0       | 1000.0       |


(fineract) 01/02: FINERACT-1968: Progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)

Posted by ad...@apache.org.
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

commit bbe3ead849a16e0bda5c2e3f57e74ea2140fc9dc
Author: Soma Sörös <so...@dpc.hu>
AuthorDate: Mon Jul 28 14:12:54 2025 +0200

    FINERACT-1968: Progressive Loan schedule handling - interest handling (FLAT interest, Daily, Equal installments)
---
 .../calc/ProgressiveEMICalculatorTest.java         | 174 ++++++++++++++++++++-
 1 file changed, 172 insertions(+), 2 deletions(-)

diff --git a/fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculatorTest.java b/fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculatorTest.java
index 8ee3018bb8..ae11225e3e 100644
--- a/fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculatorTest.java
+++ b/fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculatorTest.java
@@ -3235,7 +3235,178 @@ class ProgressiveEMICalculatorTest {
     }
 
     @Nested
-    public class InterestTypeFlat {
+    public class InterestTypeFlatAndCalculationPeriodDaily {
+
+        @BeforeEach
+        public void setupTestDefaults() {
+            Mockito.when(loanProductRelatedDetail.isInterestRecognitionOnDisbursementDate()).thenReturn(false);
+            Mockito.when(loanProductRelatedDetail.getDaysInYearCustomStrategy()).thenReturn(null);
+            Mockito.when(loanProductRelatedDetail.getInterestMethod()).thenReturn(InterestMethod.FLAT);
+            Mockito.when(loanProductRelatedDetail.getCurrencyData()).thenReturn(currency);
+            Mockito.when(loanProductRelatedDetail.getInterestCalculationPeriodMethod()).thenReturn(InterestCalculationPeriodMethod.DAILY);
+            Mockito.when(loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation()).thenReturn(true);
+
+        }
+
+        @Test
+        public void testFlatDaily_1_Month_Actual_Actual() {
+
+            final BigDecimal interestRate = BigDecimal.valueOf(12.0);
+            final LocalDate disbursementDate = LocalDate.of(2024, 1, 1);
+
+            Mockito.when(loanProductRelatedDetail.getAnnualNominalInterestRate()).thenReturn(interestRate);
+            Mockito.when(loanProductRelatedDetail.getRepaymentPeriodFrequencyType()).thenReturn(PeriodFrequencyType.MONTHS);
+            Mockito.when(loanProductRelatedDetail.getNumberOfRepayments()).thenReturn(4);
+            Mockito.when(loanProductRelatedDetail.getRepayEvery()).thenReturn(1);
+
+            Mockito.when(loanProductRelatedDetail.getDaysInYearType()).thenReturn(DaysInYearType.ACTUAL.getValue());
+            Mockito.when(loanProductRelatedDetail.getDaysInMonthType()).thenReturn(DaysInMonthType.ACTUAL.getValue());
+
+            final List<LoanScheduleModelRepaymentPeriod> expectedRepaymentPeriods = generateExpectedRepaymentPeriods(disbursementDate);
+            final Integer installmentAmountInMultiplesOf = null;
+
+            final ProgressiveLoanInterestScheduleModel interestSchedule = emiCalculator.generatePeriodInterestScheduleModel(
+                    expectedRepaymentPeriods, loanProductRelatedDetail, List.of(), installmentAmountInMultiplesOf, mc);
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(700.0));
+            checkPeriod(interestSchedule, 0, 181.94, 7.11, 174.83, 525.17, false); //
+            checkPeriod(interestSchedule, 1, 181.94, 6.66, 175.28, 349.89, false); //
+            checkPeriod(interestSchedule, 2, 181.94, 7.11, 174.83, 175.06, false); //
+            checkPeriod(interestSchedule, 3, 181.95, 6.89, 175.06, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(300.0));
+            checkPeriod(interestSchedule, 0, 259.92, 10.16, 249.76, 750.24, false); //
+            checkPeriod(interestSchedule, 1, 259.92, 9.51, 250.41, 499.83, false); //
+            checkPeriod(interestSchedule, 2, 259.92, 10.16, 249.76, 250.07, false); //
+            checkPeriod(interestSchedule, 3, 259.91, 9.84, 250.07, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(1000.0));
+            checkPeriod(interestSchedule, 0, 519.84, 20.33, 499.51, 1500.49, false); //
+            checkPeriod(interestSchedule, 1, 519.84, 19.02, 500.82, 999.67, false); //
+            checkPeriod(interestSchedule, 2, 519.84, 20.33, 499.51, 500.16, false); //
+            checkPeriod(interestSchedule, 3, 519.83, 19.67, 500.16, 0.00, false); //
+        }
+
+        @Test
+        public void testFlatDaily_1_Month_360_30() {
+
+            final BigDecimal interestRate = BigDecimal.valueOf(12.0);
+            final LocalDate disbursementDate = LocalDate.of(2024, 1, 1);
+
+            Mockito.when(loanProductRelatedDetail.getAnnualNominalInterestRate()).thenReturn(interestRate);
+            Mockito.when(loanProductRelatedDetail.getRepaymentPeriodFrequencyType()).thenReturn(PeriodFrequencyType.MONTHS);
+            Mockito.when(loanProductRelatedDetail.getNumberOfRepayments()).thenReturn(4);
+            Mockito.when(loanProductRelatedDetail.getRepayEvery()).thenReturn(1);
+
+            Mockito.when(loanProductRelatedDetail.getDaysInYearType()).thenReturn(DaysInYearType.DAYS_360.getValue());
+            Mockito.when(loanProductRelatedDetail.getDaysInMonthType()).thenReturn(DaysInMonthType.DAYS_30.getValue());
+
+            final List<LoanScheduleModelRepaymentPeriod> expectedRepaymentPeriods = generateExpectedRepaymentPeriods(disbursementDate);
+            final Integer installmentAmountInMultiplesOf = null;
+
+            final ProgressiveLoanInterestScheduleModel interestSchedule = emiCalculator.generatePeriodInterestScheduleModel(
+                    expectedRepaymentPeriods, loanProductRelatedDetail, List.of(), installmentAmountInMultiplesOf, mc);
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(750.0));
+            checkPeriod(interestSchedule, 0, 195.00, 7.50, 187.50, 562.50, false); //
+            checkPeriod(interestSchedule, 1, 195.00, 7.50, 187.50, 375.00, false); //
+            checkPeriod(interestSchedule, 2, 195.00, 7.50, 187.50, 187.50, false); //
+            checkPeriod(interestSchedule, 3, 195.00, 7.50, 187.50, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(250.0));
+            checkPeriod(interestSchedule, 0, 260.00, 10.00, 250.00, 750.00, false); //
+            checkPeriod(interestSchedule, 1, 260.00, 10.00, 250.00, 500.00, false); //
+            checkPeriod(interestSchedule, 2, 260.00, 10.00, 250.00, 250.00, false); //
+            checkPeriod(interestSchedule, 3, 260.00, 10.00, 250.00, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate.plusMonths(1).plusDays(5), toMoney(250.0));
+            checkPeriod(interestSchedule, 0, 260.00, 10.00, 250.00, 750.00, false); //
+            checkPeriod(interestSchedule, 1, 345.69, 12.07, 333.62, 666.38, false); //
+            checkPeriod(interestSchedule, 2, 345.69, 12.50, 333.19, 333.19, false); //
+            checkPeriod(interestSchedule, 3, 345.69, 12.50, 333.19, 0.00, false); //
+        }
+
+        @Test
+        public void testFlatDaily_1_week_Actual_Actual() {
+
+            final BigDecimal interestRate = BigDecimal.valueOf(12.0);
+            final LocalDate disbursementDate = LocalDate.of(2024, 1, 1);
+
+            Mockito.when(loanProductRelatedDetail.getAnnualNominalInterestRate()).thenReturn(interestRate);
+            Mockito.when(loanProductRelatedDetail.getRepaymentPeriodFrequencyType()).thenReturn(PeriodFrequencyType.WEEKS);
+            Mockito.when(loanProductRelatedDetail.getNumberOfRepayments()).thenReturn(4);
+            Mockito.when(loanProductRelatedDetail.getRepayEvery()).thenReturn(1);
+
+            Mockito.when(loanProductRelatedDetail.getDaysInYearType()).thenReturn(DaysInYearType.ACTUAL.getValue());
+            Mockito.when(loanProductRelatedDetail.getDaysInMonthType()).thenReturn(DaysInMonthType.ACTUAL.getValue());
+
+            final List<LoanScheduleModelRepaymentPeriod> expectedRepaymentPeriods = generateExpectedRepaymentPeriods(disbursementDate);
+            final Integer installmentAmountInMultiplesOf = null;
+
+            final ProgressiveLoanInterestScheduleModel interestSchedule = emiCalculator.generatePeriodInterestScheduleModel(
+                    expectedRepaymentPeriods, loanProductRelatedDetail, List.of(), installmentAmountInMultiplesOf, mc);
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(600.0));
+            checkPeriod(interestSchedule, 0, 151.38, 1.38, 150.00, 450.00, false); //
+            checkPeriod(interestSchedule, 1, 151.38, 1.38, 150.00, 300.00, false); //
+            checkPeriod(interestSchedule, 2, 151.38, 1.38, 150.00, 150.00, false); //
+            checkPeriod(interestSchedule, 3, 151.38, 1.38, 150.00, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(400.0));
+            checkPeriod(interestSchedule, 0, 252.30, 2.30, 250.00, 750.00, false); //
+            checkPeriod(interestSchedule, 1, 252.30, 2.30, 250.00, 500.00, false); //
+            checkPeriod(interestSchedule, 2, 252.30, 2.30, 250.00, 250.00, false); //
+            checkPeriod(interestSchedule, 3, 252.30, 2.30, 250.00, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate.plusDays(3), toMoney(1000.0));
+            checkPeriod(interestSchedule, 0, 504.34, 3.61, 500.73, 1499.27, false); //
+            checkPeriod(interestSchedule, 1, 504.34, 4.59, 499.75, 999.52, false); //
+            checkPeriod(interestSchedule, 2, 504.34, 4.59, 499.75, 499.77, false); //
+            checkPeriod(interestSchedule, 3, 504.36, 4.59, 499.77, 0.00, false); //
+        }
+
+        @Test
+        public void testFlatDaily_30_Days_Actual_Actual() {
+
+            final BigDecimal interestRate = BigDecimal.valueOf(12.0);
+            final LocalDate disbursementDate = LocalDate.of(2024, 1, 1);
+
+            Mockito.when(loanProductRelatedDetail.getAnnualNominalInterestRate()).thenReturn(interestRate);
+            Mockito.when(loanProductRelatedDetail.getRepaymentPeriodFrequencyType()).thenReturn(PeriodFrequencyType.DAYS);
+            Mockito.when(loanProductRelatedDetail.getNumberOfRepayments()).thenReturn(4);
+            Mockito.when(loanProductRelatedDetail.getRepayEvery()).thenReturn(30);
+
+            Mockito.when(loanProductRelatedDetail.getDaysInYearType()).thenReturn(DaysInYearType.ACTUAL.getValue());
+            Mockito.when(loanProductRelatedDetail.getDaysInMonthType()).thenReturn(DaysInMonthType.ACTUAL.getValue());
+
+            final List<LoanScheduleModelRepaymentPeriod> expectedRepaymentPeriods = generateExpectedRepaymentPeriods(disbursementDate);
+            final Integer installmentAmountInMultiplesOf = null;
+
+            final ProgressiveLoanInterestScheduleModel interestSchedule = emiCalculator.generatePeriodInterestScheduleModel(
+                    expectedRepaymentPeriods, loanProductRelatedDetail, List.of(), installmentAmountInMultiplesOf, mc);
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(400.0));
+            checkPeriod(interestSchedule, 0, 103.93, 3.93, 100.00, 300.00, false); //
+            checkPeriod(interestSchedule, 1, 103.93, 3.93, 100.00, 200.00, false); //
+            checkPeriod(interestSchedule, 2, 103.93, 3.93, 100.00, 100.00, false); //
+            checkPeriod(interestSchedule, 3, 103.93, 3.93, 100.00, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate, toMoney(600.0));
+            checkPeriod(interestSchedule, 0, 259.84, 9.84, 250.00, 750.00, false); //
+            checkPeriod(interestSchedule, 1, 259.84, 9.84, 250.00, 500.00, false); //
+            checkPeriod(interestSchedule, 2, 259.84, 9.84, 250.00, 250.00, false); //
+            checkPeriod(interestSchedule, 3, 259.84, 9.84, 250.00, 0.00, false); //
+
+            emiCalculator.addDisbursement(interestSchedule, disbursementDate.plusDays(15), toMoney(500.0));
+            checkPeriod(interestSchedule, 0, 389.14, 12.30, 376.84, 1123.16, false); //
+            checkPeriod(interestSchedule, 1, 389.14, 14.75, 374.39, 748.77, false); //
+            checkPeriod(interestSchedule, 2, 389.14, 14.75, 374.39, 374.38, false); //
+            checkPeriod(interestSchedule, 3, 389.13, 14.75, 374.38, 0.00, false); //
+        }
+    }
+
+    @Nested
+    public class InterestTypeFlatAndCalculationPeriodSameAsRepaymentPeriod {
 
         @BeforeEach
         public void setupTestDefaults() {
@@ -3243,7 +3414,6 @@ class ProgressiveEMICalculatorTest {
             Mockito.when(loanProductRelatedDetail.getDaysInYearCustomStrategy()).thenReturn(null);
             Mockito.when(loanProductRelatedDetail.getInterestMethod()).thenReturn(InterestMethod.FLAT);
             Mockito.when(loanProductRelatedDetail.getCurrencyData()).thenReturn(currency);
-            // InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD
             Mockito.when(loanProductRelatedDetail.getDaysInYearType()).thenReturn(DaysInYearType.ACTUAL.getValue());
             Mockito.when(loanProductRelatedDetail.getDaysInMonthType()).thenReturn(DaysInMonthType.ACTUAL.getValue());
             Mockito.when(loanProductRelatedDetail.getInterestCalculationPeriodMethod())