Skip to content

Commit 60526f0

Browse files
Jose Alberto Hernandezadamsaghy
authored andcommitted
FINERACT-2389: Negative amount is shown on repayment schedule
1 parent 9a16a26 commit 60526f0

File tree

7 files changed

+218
-9
lines changed

7 files changed

+218
-9
lines changed

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ public enum DefaultLoanProduct implements LoanProduct {
175175
LP1_NO_OVERRIDES, //
176176
LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL, //
177177
LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL, //
178+
LP1_INTEREST_FLAT_DAILY_RECALCULATION_SAR_MULTIDISB_EXPECT_TRANCHES, //
179+
LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES, //
178180
;
179181

180182
@Override

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4196,6 +4196,48 @@ public void initialize() throws Exception {
41964196
TestContext.INSTANCE.set(
41974197
TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL,
41984198
responseLoanProductsResponseAdvCustomPaymentAllocationProgressiveLoanInterestDailyEmiActualInterestRecalcZeroChargeOffChargebackAccruals);
4199+
4200+
// LP1 with 12% Flat interest, interest period: Daily, Interest recalculation- Same as repayment
4201+
// Multi-disbursement that expects tranches
4202+
PostLoanProductsRequest loanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementExpectsTranches = loanProductsRequestFactory
4203+
.defaultLoanProductsRequestLP1InterestDecliningBalanceDailyRecalculationCompoundingNone()//
4204+
.name(DefaultLoanProduct.LP1_INTEREST_FLAT_DAILY_RECALCULATION_SAR_MULTIDISB_EXPECT_TRANCHES.getName())//
4205+
.interestType(INTEREST_TYPE_FLAT)//
4206+
.interestCalculationPeriodType(InterestCalculationPeriodTime.DAILY.value)//
4207+
.allowPartialPeriodInterestCalcualtion(false)//
4208+
.recalculationRestFrequencyType(RecalculationRestFrequencyType.SAME_AS_REPAYMENT.value)//
4209+
.recalculationRestFrequencyInterval(1)//
4210+
.installmentAmountInMultiplesOf(null)//
4211+
.multiDisburseLoan(true)//
4212+
.disallowExpectedDisbursements(false)//
4213+
.maxTrancheCount(10)//
4214+
.outstandingLoanBalance(10000.0);//
4215+
Response<PostLoanProductsResponse> responseLoanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementExpectsTranches = loanProductsApi
4216+
.createLoanProduct(loanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementExpectsTranches)
4217+
.execute();
4218+
TestContext.INSTANCE.set(TestContextKey.LP1_INTEREST_FLAT_DAILY_RECALCULATION_SAR_MULTIDISB_EXPECT_TRANCHES,
4219+
responseLoanProductsRequestInterestFlatSaRRecalculationSameAsRepaymentMultiDisbursementExpectsTranches);
4220+
4221+
// LP1 with 12% Flat interest, interest period: Daily, Interest recalculation- Actual
4222+
// Multi-disbursement that expects tranches
4223+
PostLoanProductsRequest loanProductsRequestInterestFlatActualActualMultiDisbursementExpectsTranches = loanProductsRequestFactory
4224+
.defaultLoanProductsRequestLP1InterestFlat()//
4225+
.name(DefaultLoanProduct.LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES.getName())//
4226+
.interestType(INTEREST_TYPE_FLAT)//
4227+
.interestCalculationPeriodType(InterestCalculationPeriodTime.DAILY.value)//
4228+
.allowPartialPeriodInterestCalcualtion(false)//
4229+
.recalculationRestFrequencyType(RecalculationRestFrequencyType.DAILY.value)//
4230+
.interestRecalculationCompoundingMethod(0)//
4231+
.recalculationRestFrequencyInterval(1)//
4232+
.installmentAmountInMultiplesOf(null)//
4233+
.multiDisburseLoan(true)//
4234+
.disallowExpectedDisbursements(false)//
4235+
.maxTrancheCount(10)//
4236+
.outstandingLoanBalance(10000.0);//
4237+
Response<PostLoanProductsResponse> responseLoanProductsRequestInterestFlatActualActualMultiDisbursementExpectsTranches = loanProductsApi
4238+
.createLoanProduct(loanProductsRequestInterestFlatActualActualMultiDisbursementExpectsTranches).execute();
4239+
TestContext.INSTANCE.set(TestContextKey.LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES,
4240+
responseLoanProductsRequestInterestFlatActualActualMultiDisbursementExpectsTranches);
41994241
}
42004242

42014243
public static AdvancedPaymentData createPaymentAllocation(String transactionType, String futureInstallmentAllocationRule,

fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,6 @@ public abstract class TestContextKey {
282282
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP1_NO_OVERRIDES = "loanProductCreateResponseLP1NoOverrides";
283283
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OF_ACCRUAL = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmiActualInterestRecalcChargeOffAccruals";
284284
public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_CUSTOM_PMT_ALLOC_INTEREST_DAILY_EMI_ACTUAL_ACTUAL_INTEREST_RECALC_ZERO_CHARGE_OFF_ACCRUAL = "loanProductCreateResponseLP2AdvancedPaymentCustomAllocationInterestDailyEmiActualInterestRecalcChargeOffAccruals";
285+
public static final String LP1_INTEREST_FLAT_DAILY_RECALCULATION_SAR_MULTIDISB_EXPECT_TRANCHES = "loanProductCreateResponseLP1InterestFlatDailyRecalculationSameAsRepaymentMultiDisbursementExpectTranches";
286+
public static final String LP1_INTEREST_FLAT_DAILY_ACTUAL_ACTUAL_MULTIDISB_EXPECT_TRANCHES = "loanProductCreateResponseLP1InterestFlatDailyActualActualMultiDisbursementExpectTranches";
285287
}

0 commit comments

Comments
 (0)