diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index 1e8b8c763..203cd97be 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -11295,6 +11295,13 @@ An enumeration that indicates the type of transaction processing strategy to be
be overdue before being classified as a NPA (non performing asset)
+
+ | accountMovesOutOfNPAOnlyOnArrearsCompletion |
+
+
+ | Optional: Boolean - if provided as true, Loan Account moves out of NPA state only when all arrears are cleared
+ |
+
| accountingRule |
@@ -11356,6 +11363,12 @@ An enumeration that indicates the type of transaction processing strategy to be
Specifies rest frequency start date for interest recalculation.
|
+
+ | isArrearsBasedOnOriginalSchedule |
+
+
+ If Specified as true, arrears will be identified based on original schedule.
+ |
@@ -11470,7 +11483,8 @@ GET https://DomainName/api/v1/loanproducts
"id":1,
"code":"interestRecalculationFrequencyType.same.as.repayment.period",
"value":"Same as repayment period"
- }
+ },
+ "isArrearsBasedOnOriginalSchedule" : true
},
"accountingRule": {
"id": 2,
@@ -12598,7 +12612,7 @@ GET https://DomainName/api/v1/loanproducts/{productId}
numberOfRepaymentVariationsForBorrowerCycle,
interestRateVariationsForBorrowerCycle,
multiDisburseLoan,maxTrancheCount,
- outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds
+ outstandingLoanBalance,overdueDaysForNPA,accountMovesOutOfNPAOnlyOnArrearsCompletion,holdGuaranteeFunds
@@ -12631,6 +12645,14 @@ GET https://DomainName/api/v1/loanproducts/{productId}
interestRecalculationCompoundingMethod, rescheduleStrategyMethod, recalculationRestFrequencyType |
+
+
+ Additional Optional Fields if interest recalculation is enabled(true) |
+
+
+ | isArrearsBasedOnOriginalSchedule |
+
+
Additional Optional Fields if interest recalculation is enabled(true) and recalculationRestFrequencyType is not same as repayment period |
diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/ClientLoanIntegrationTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/ClientLoanIntegrationTest.java
index 93afd772e..58f9c8358 100644
--- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/ClientLoanIntegrationTest.java
+++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/ClientLoanIntegrationTest.java
@@ -3584,7 +3584,7 @@ public class ClientLoanIntegrationTest {
final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.MIFOS_STANDARD_STRATEGY,
LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST_AND_FEE,
LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
- LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", REST_START_DATE, null, overdueFeeChargeId.toString());
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", REST_START_DATE, null, overdueFeeChargeId.toString(), false);
final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
REST_START_DATE, LoanApplicationTestBuilder.MIFOS_STANDARD_STRATEGY, null);
@@ -3766,6 +3766,156 @@ public class ClientLoanIntegrationTest {
}
+ @Test
+ public void testLoanScheduleWithInterestRecalculation_WITH_CURRENT_REPAYMENT_BASED_ARREARS_AGEING() {
+ this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
+
+ DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
+
+ Calendar todaysDate = Calendar.getInstance();
+ todaysDate.add(Calendar.DAY_OF_MONTH, -14);
+ final String LOAN_DISBURSEMENT_DATE = dateFormat.format(todaysDate.getTime());
+
+ final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
+ ClientHelper.verifyClientCreatedOnServer(this.requestSpec, this.responseSpec, clientID);
+ final Integer loanProductID = createLoanProductWithInterestRecalculation(LoanProductTestBuilder.RBI_INDIA_STRATEGY,
+ LoanProductTestBuilder.RECALCULATION_COMPOUNDING_METHOD_INTEREST,
+ LoanProductTestBuilder.RECALCULATION_STRATEGY_RESCHEDULE_NEXT_REPAYMENTS,
+ LoanProductTestBuilder.RECALCULATION_FREQUENCY_TYPE_DAILY, "1", LOAN_DISBURSEMENT_DATE, null);
+
+ final Integer loanID = applyForLoanApplicationForInterestRecalculation(clientID, loanProductID, LOAN_DISBURSEMENT_DATE,
+ LOAN_DISBURSEMENT_DATE, LoanApplicationTestBuilder.RBI_INDIA_STRATEGY, new ArrayList(0));
+
+ Assert.assertNotNull(loanID);
+ HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
+ LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
+
+ ArrayList loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
+ List