diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/ChargeProductType.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/ChargeProductType.java index 4ff43ef8a..4eb304dd2 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/ChargeProductType.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/ChargeProductType.java @@ -21,9 +21,9 @@ package org.apache.fineract.test.data; public enum ChargeProductType { LOAN_PERCENTAGE_LATE_FEE(1L), LOAN_PERCENTAGE_PROCESSING_FEE(2L), LOAN_FIXED_LATE_FEE(3L), LOAN_FIXED_RETURNED_PAYMENT_FEE( - 4L), LOAN_SNOOZE_FEE(5L), LOAN_NSF_FEE(6L), LOAN_DISBURSEMENT_PERCENTAGE_FEE( - 7L), LOAN_TRANCHE_DISBURSEMENT_PERCENTAGE_FEE(8L), LOAN_INSTALLMENT_PERCENTAGE_FEE( - 9L), LOAN_PERCENTAGE_LATE_FEE_AMOUNT_PLUS_INTEREST(10L), CLIENT_TEST_CHARGE_FEE(11L); + 4L), LOAN_SNOOZE_FEE(5L), LOAN_NSF_FEE(6L), LOAN_DISBURSEMENT_PERCENTAGE_FEE(7L), LOAN_TRANCHE_DISBURSEMENT_PERCENTAGE_FEE( + 8L), LOAN_INSTALLMENT_PERCENTAGE_FEE(9L), LOAN_PERCENTAGE_LATE_FEE_AMOUNT_PLUS_INTEREST( + 10L), CLIENT_TEST_CHARGE_FEE(11L), LOAN_DISBURSEMENT_CHARGE(12L); public final Long value; diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/TransactionType.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/TransactionType.java index b493da518..418d34684 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/TransactionType.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/TransactionType.java @@ -32,7 +32,8 @@ public enum TransactionType { ACCRUAL("accrual"), // CHARGE_OFF("chargeOff"), // CHARGE_ADJUSTMENT("chargeAdjustment"), // - INTEREST_PAYMENT_WAIVER("interestPaymentWaiver");// + INTEREST_PAYMENT_WAIVER("interestPaymentWaiver"), // + REPAYMENT_AT_DISBURSEMENT("repaymentAtDisbursement"); // public final String value; diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java index fe6b1e8b0..bcdc24d8e 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/data/loanproduct/DefaultLoanProduct.java @@ -108,6 +108,10 @@ public enum DefaultLoanProduct implements LoanProduct { LP2_ADV_PYMNT_ZERO_INTEREST_CHARGE_OFF_DELINQUENT_REASON, // LP2_ADV_DP_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL, // LP2_ADV_DP_IR_CUSTOM_PMT_ALLOC_PROGRESSIVE_LOAN_SCHEDULE_HORIZONTAL, // + LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES, // + LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE, // + LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE, // + LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES, // ; @Override diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/factory/LoanProductsRequestFactory.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/factory/LoanProductsRequestFactory.java index d7df06807..de7b78f79 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/factory/LoanProductsRequestFactory.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/factory/LoanProductsRequestFactory.java @@ -110,6 +110,7 @@ public class LoanProductsRequestFactory { public static final Integer DAYS_IN_MONTH_TYPE = DaysInMonthType.ACTUAL.value; public static final Integer LOAN_ACCOUNTING_RULE = AccountingRule.ACCRUAL_PERIODIC.value; public static final Integer LOAN_ACCOUNTING_RULE_NONE = AccountingRule.NONE.value; + public static final Integer CASH_ACCOUNTING_RULE = AccountingRule.CASH_BASED.value; public static final String OVER_APPLIED_CALCULATION_TYPE = "percentage"; public static final Integer OVER_APPLIED_NUMBER = 50; public static final Integer DELINQUENCY_BUCKET_ID = DelinquencyBucket.BASIC_DELINQUENCY_BUCKET.value; @@ -1372,4 +1373,131 @@ public class LoanProductsRequestFactory { .chargeOffReasonToExpenseAccountMappings(chargeOffReasonToExpenseAccountMappings)// .incomeFromChargeOffPenaltyAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_CHARGE_OFF));// } + + public PostLoanProductsRequest defaultLoanProductsRequestLP2EmiCashAccounting() { + String name = Utils.randomNameGenerator(NAME_PREFIX_LP2_EMI, 4); + String shortName = Utils.randomNameGenerator(SHORT_NAME_PREFIX_EMI, 3); + + List principalVariationsForBorrowerCycle = new ArrayList<>(); + List numberOfRepaymentVariationsForBorrowerCycle = new ArrayList<>(); + List interestRateVariationsForBorrowerCycle = new ArrayList<>(); + List charges = new ArrayList<>(); + List penaltyToIncomeAccountMappings = new ArrayList<>(); + List feeToIncomeAccountMappings = new ArrayList<>(); + + List paymentChannelToFundSourceMappings = new ArrayList<>(); + GetLoanPaymentChannelToFundSourceMappings loanPaymentChannelToFundSourceMappings = new GetLoanPaymentChannelToFundSourceMappings(); + loanPaymentChannelToFundSourceMappings.fundSourceAccountId(accountTypeResolver.resolve(DefaultAccountType.FUND_RECEIVABLES)); + loanPaymentChannelToFundSourceMappings.paymentTypeId(paymentTypeResolver.resolve(DefaultPaymentType.MONEY_TRANSFER)); + paymentChannelToFundSourceMappings.add(loanPaymentChannelToFundSourceMappings); + + Long chargeOffReasonId = codeHelper.retrieveCodeByName(CHARGE_OFF_REASONS).getId(); + + List chargeOffReasonToExpenseAccountMappings = new ArrayList<>(); + PostChargeOffReasonToExpenseAccountMappings chargeOffFraudReason = new PostChargeOffReasonToExpenseAccountMappings(); + PostChargeOffReasonToExpenseAccountMappings chargeOffDelinquentReason = new PostChargeOffReasonToExpenseAccountMappings(); + PostChargeOffReasonToExpenseAccountMappings chargeOffOtherReason = new PostChargeOffReasonToExpenseAccountMappings(); + chargeOffFraudReason.chargeOffReasonCodeValueId(codeValueResolver.resolve(chargeOffReasonId, DefaultCodeValue.FRAUD)); + chargeOffFraudReason.expenseAccountId(accountTypeResolver.resolve(DefaultAccountType.CREDIT_LOSS_BAD_DEBT_FRAUD)); + chargeOffDelinquentReason.chargeOffReasonCodeValueId(codeValueResolver.resolve(chargeOffReasonId, DefaultCodeValue.DELINQUENT)); + chargeOffDelinquentReason.expenseAccountId(accountTypeResolver.resolve(DefaultAccountType.CREDIT_LOSS_BAD_DEBT)); + chargeOffOtherReason.chargeOffReasonCodeValueId(codeValueResolver.resolve(chargeOffReasonId, DefaultCodeValue.OTHER)); + chargeOffOtherReason.expenseAccountId(accountTypeResolver.resolve(DefaultAccountType.CREDIT_LOSS_BAD_DEBT)); + chargeOffReasonToExpenseAccountMappings.add(chargeOffFraudReason); + chargeOffReasonToExpenseAccountMappings.add(chargeOffDelinquentReason); + chargeOffReasonToExpenseAccountMappings.add(chargeOffOtherReason); + + return new PostLoanProductsRequest()// + .name(name)// + .shortName(shortName)// + .description(DESCRIPTION_LP2_EMI)// + .loanScheduleType("PROGRESSIVE") // + .interestCalculationPeriodType(InterestCalculationPeriodTime.DAILY.value)// + .transactionProcessingStrategyCode(ADVANCED_PAYMENT_ALLOCATION.getValue())// + .fundId(FUND_ID)// + .startDate(null)// + .closeDate(null)// + .includeInBorrowerCycle(false)// + .currencyCode(CURRENCY_CODE)// + .digitsAfterDecimal(2)// + .inMultiplesOf(0)// + .useBorrowerCycle(false)// + .minPrincipal(10.0)// + .principal(1000.0)// + .maxPrincipal(10000.0)// + .minNumberOfRepayments(1)// + .numberOfRepayments(4)// + .maxNumberOfRepayments(30)// + .isLinkedToFloatingInterestRates(false)// + .minInterestRatePerPeriod((double) 0)// + .interestRatePerPeriod((double) 12)// + .maxInterestRatePerPeriod((double) 60)// + .interestRateFrequencyType(INTEREST_RATE_FREQUENCY_TYPE_YEAR)// + .repaymentEvery(15)// + .repaymentStartDateType(1)// + .repaymentFrequencyType(REPAYMENT_FREQUENCY_TYPE_DAYS)// + .principalVariationsForBorrowerCycle(principalVariationsForBorrowerCycle)// + .numberOfRepaymentVariationsForBorrowerCycle(numberOfRepaymentVariationsForBorrowerCycle)// + .interestRateVariationsForBorrowerCycle(interestRateVariationsForBorrowerCycle)// + .amortizationType(AMORTIZATION_TYPE)// + .interestType(INTEREST_TYPE_DECLINING_BALANCE)// + .isEqualAmortization(false)// + .interestCalculationPeriodType(INTEREST_CALCULATION_PERIOD_TYPE_DAILY)// + .transactionProcessingStrategyCode(TRANSACTION_PROCESSING_STRATEGY_CODE_ADVANCED)// + .daysInYearType(DAYS_IN_YEAR_TYPE)// + .daysInMonthType(DAYS_IN_MONTH_TYPE)// + .canDefineInstallmentAmount(true)// + .graceOnArrearsAgeing(3)// + .overdueDaysForNPA(179)// + .accountMovesOutOfNPAOnlyOnArrearsCompletion(false)// + .principalThresholdForLastInstallment(50)// + .allowVariableInstallments(false)// + .canUseForTopup(false)// + + .chargeOffBehaviour(ChargeOffBehaviour.ZERO_INTEREST.value) + .chargeOffReasonToExpenseAccountMappings(chargeOffReasonToExpenseAccountMappings) + + .isInterestRecalculationEnabled(false)// + .holdGuaranteeFunds(false)// + .multiDisburseLoan(false)// + .allowAttributeOverrides(new AllowAttributeOverrides()// + .amortizationType(true)// + .interestType(true)// + .transactionProcessingStrategyCode(true)// + .interestCalculationPeriodType(true)// + .inArrearsTolerance(true)// + .repaymentEvery(true)// + .graceOnPrincipalAndInterestPayment(true)// + .graceOnArrearsAgeing(true))// + .allowPartialPeriodInterestCalcualtion(false)// + .maxTrancheCount(10)// + .outstandingLoanBalance(10000.0)// + .charges(charges)// + .accountingRule(CASH_ACCOUNTING_RULE)// + .fundSourceAccountId(accountTypeResolver.resolve(DefaultAccountType.SUSPENSE_CLEARING_ACCOUNT))// + .loanPortfolioAccountId(accountTypeResolver.resolve(DefaultAccountType.LOANS_RECEIVABLE))// + .transfersInSuspenseAccountId(accountTypeResolver.resolve(DefaultAccountType.TRANSFER_IN_SUSPENSE_ACCOUNT))// + .interestOnLoanAccountId(accountTypeResolver.resolve(DefaultAccountType.INTEREST_INCOME))// + .incomeFromFeeAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_INCOME))// + .incomeFromPenaltyAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_INCOME))// + .incomeFromRecoveryAccountId(accountTypeResolver.resolve(DefaultAccountType.RECOVERIES))// + .writeOffAccountId(accountTypeResolver.resolve(DefaultAccountType.WRITTEN_OFF))// + .overpaymentLiabilityAccountId(accountTypeResolver.resolve(DefaultAccountType.OVERPAYMENT_ACCOUNT))// + .dateFormat(DATE_FORMAT)// + .locale(LOCALE_EN)// + .disallowExpectedDisbursements(false)// + .delinquencyBucketId(DELINQUENCY_BUCKET_ID.longValue())// + .goodwillCreditAccountId(accountTypeResolver.resolve(DefaultAccountType.GOODWILL_EXPENSE_ACCOUNT))// + .incomeFromGoodwillCreditInterestAccountId(accountTypeResolver.resolve(DefaultAccountType.INTEREST_INCOME_CHARGE_OFF))// + .incomeFromGoodwillCreditFeesAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_CHARGE_OFF))// + .incomeFromGoodwillCreditPenaltyAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_CHARGE_OFF))// + .paymentChannelToFundSourceMappings(paymentChannelToFundSourceMappings)// + .penaltyToIncomeAccountMappings(penaltyToIncomeAccountMappings)// + .feeToIncomeAccountMappings(feeToIncomeAccountMappings)// + .incomeFromChargeOffInterestAccountId(accountTypeResolver.resolve(DefaultAccountType.INTEREST_INCOME_CHARGE_OFF))// + .incomeFromChargeOffFeesAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_CHARGE_OFF))// + .chargeOffExpenseAccountId(accountTypeResolver.resolve(DefaultAccountType.CREDIT_LOSS_BAD_DEBT))// + .chargeOffFraudExpenseAccountId(accountTypeResolver.resolve(DefaultAccountType.CREDIT_LOSS_BAD_DEBT_FRAUD))// + .incomeFromChargeOffPenaltyAccountId(accountTypeResolver.resolve(DefaultAccountType.FEE_CHARGE_OFF));// + } } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/ChargeGlobalInitializerStep.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/ChargeGlobalInitializerStep.java index 6a59258c8..8cc0a305e 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/ChargeGlobalInitializerStep.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/ChargeGlobalInitializerStep.java @@ -54,6 +54,7 @@ public class ChargeGlobalInitializerStep implements FineractGlobalInitializerSte public static final String CHARGE_LOAN_TRANCHE_DISBURSEMENT_PERCENT_FEE = "Tranche Disbursement percentage fee"; public static final String CHARGE_LOAN_INSTALLMENT_PERCENT_FEE = "Installment percentage fee"; public static final String CHARGE_CLIENT_FIXED_FEE = "Fixed fee for Client"; + public static final String CHARGE_DISBURSEMENT_CHARGE = "Disbursement Charge"; public static final Double CHARGE_AMOUNT_FLAT = 25D; public static final Double CHARGE_AMOUNT_PERCENTAGE = 5D; public static final Double CHARGE_AMOUNT_DISBURSEMENT_PERCENTAGE = 1.5D; @@ -124,7 +125,8 @@ public class ChargeGlobalInitializerStep implements FineractGlobalInitializerSte CHARGE_CALCULATION_TYPE_PERCENTAGE_DISBURSEMENT_AMOUNT, CHARGE_AMOUNT_DISBURSEMENT_PERCENTAGE, true, false); Response responseLoanTrancheDisbursePercent = chargesApi.createCharge(requestLoanTrancheDisbursePercent) .execute(); - TestContext.INSTANCE.set(TestContextKey.CHARGE_FOR_LOAN_DISBURSEMENET_FEE_CREATE_RESPONSE, responseLoanTrancheDisbursePercent); + TestContext.INSTANCE.set(TestContextKey.CHARGE_FOR_LOAN_TRANCHE_DISBURSEMENT_PERCENT_CREATE_RESPONSE, + responseLoanTrancheDisbursePercent); // Loan - Installment % fee ChargeRequest requestLoanInstallmentPercent = defaultChargesRequest(CHARGE_APPLIES_TO_LOAN, CHARGE_LOAN_INSTALLMENT_PERCENT_FEE, @@ -147,6 +149,12 @@ public class ChargeGlobalInitializerStep implements FineractGlobalInitializerSte CHARGE_TIME_TYPE_SPECIFIED_DUE_DATE, CHARGE_CALCULATION_TYPE_FLAT, CHARGE_AMOUNT_FLAT, true, false); Response responseClientFixed = chargesApi.createCharge(requestClientFixed).execute(); TestContext.INSTANCE.set(TestContextKey.CHARGE_FOR_CLIENT_FIXED_FEE_CREATE_RESPONSE, responseClientFixed); + + // Loan - Disbursement fixed fee + ChargeRequest requestDisbursementCharge = defaultChargesRequest(CHARGE_APPLIES_TO_LOAN, CHARGE_DISBURSEMENT_CHARGE, + CHARGE_TIME_TYPE_DISBURSEMENT, CHARGE_CALCULATION_TYPE_FLAT, CHARGE_AMOUNT_FLAT, true, false); + Response responseDisbursementCharge = chargesApi.createCharge(requestDisbursementCharge).execute(); + TestContext.INSTANCE.set(TestContextKey.CHARGE_FOR_LOAN_DISBURSEMENT_CHARGE_CREATE_RESPONSE, responseDisbursementCharge); } public static ChargeRequest defaultChargesRequest(Enum appliesTo, String name, Integer chargeTimeType, diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java index e9274de8a..fc47f6b47 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/initializer/global/LoanProductGlobalInitializerStep.java @@ -2101,6 +2101,132 @@ public class LoanProductGlobalInitializerStep implements FineractGlobalInitializ TestContext.INSTANCE.set( TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADVANCED_DP_IR_CUSTOM_PAYMENT_ALLOCATION_PROGRESSIVE_LOAN_SCHEDULE, responseLoanProductsResponseAdvDPIRCustomPaymentAllocationProgressiveLoanSchedule); + + // LP2 with progressive loan schedule + horizontal + interest EMI + 360/30 + interest recalculation + // Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1 + // charges - Disbursement Charge + // (LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES) + String name86 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES.getName(); + List chargesDisbursement = new ArrayList<>(); + chargesDisbursement.add(new LoanProductChargeData().id(ChargeProductType.LOAN_DISBURSEMENT_CHARGE.value)); + PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyDisbursementCharge = loanProductsRequestFactory + .defaultLoanProductsRequestLP2Emi()// + .name(name86)// + .daysInYearType(DaysInYearType.DAYS360.value)// + .daysInMonthType(DaysInMonthType.DAYS30.value)// + .isInterestRecalculationEnabled(true)// + .preClosureInterestCalculationStrategy(1)// + .rescheduleStrategyMethod(4)// + .interestRecalculationCompoundingMethod(0)// + .recalculationRestFrequencyType(2)// + .recalculationRestFrequencyInterval(1)// + .charges(chargesDisbursement)// + .paymentAllocation(List.of(// + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), // + createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), // + createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), // + createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")));// + Response responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyDisbursementCharge = loanProductsApi + .createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyDisbursementCharge).execute(); + TestContext.INSTANCE.set( + TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES, + responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyDisbursementCharge); + + // LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 + + // multidisbursement + // Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1 + // (LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE) + String name87 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE + .getName(); + PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburse = loanProductsRequestFactory + .defaultLoanProductsRequestLP2Emi()// + .name(name87)// + .daysInYearType(DaysInYearType.DAYS360.value)// + .daysInMonthType(DaysInMonthType.DAYS30.value)// + .isInterestRecalculationEnabled(true)// + .preClosureInterestCalculationStrategy(1)// + .rescheduleStrategyMethod(4)// + .interestRecalculationCompoundingMethod(0)// + .recalculationRestFrequencyType(2)// + .recalculationRestFrequencyInterval(1)// + .paymentAllocation(List.of(// + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), // + createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), // + createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), // + createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))// + .multiDisburseLoan(true)// + .disallowExpectedDisbursements(false)// + .maxTrancheCount(10)// + .outstandingLoanBalance(10000.0);// + Response responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburse = loanProductsApi + .createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburse).execute(); + TestContext.INSTANCE.set( + TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE, + responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburse); + + // LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 + + // multidisbursement + // Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1 + // charges - Disbursement Charge + // (LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE) + String name88 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE.getName(); + PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge = loanProductsRequestFactory + .defaultLoanProductsRequestLP2Emi()// + .name(name88)// + .daysInYearType(DaysInYearType.DAYS360.value)// + .daysInMonthType(DaysInMonthType.DAYS30.value)// + .isInterestRecalculationEnabled(true)// + .preClosureInterestCalculationStrategy(1)// + .rescheduleStrategyMethod(4)// + .interestRecalculationCompoundingMethod(0)// + .recalculationRestFrequencyType(2)// + .recalculationRestFrequencyInterval(1)// + .paymentAllocation(List.of(// + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), // + createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), // + createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), // + createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")))// + .multiDisburseLoan(true)// + .disallowExpectedDisbursements(true)// + .maxTrancheCount(10)// + .outstandingLoanBalance(10000.0);// + Response responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge = loanProductsApi + .createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge) + .execute(); + TestContext.INSTANCE.set( + TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE, + responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyMultiDisburseDisbursementCharge); + + // LP2 with progressive loan schedule + horizontal + interest recalculation daily EMI + 360/30 + cash based + // accounting + // Frequency for recalculate Outstanding Principal: Daily, Frequency Interval for recalculation: 1 + // charges - Disbursement Charge + // (LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES) + String name89 = DefaultLoanProduct.LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES + .getName(); + PostLoanProductsRequest loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyCashAccountingDisbursementCharge = loanProductsRequestFactory + .defaultLoanProductsRequestLP2EmiCashAccounting()// + .name(name89)// + .daysInYearType(DaysInYearType.DAYS360.value)// + .daysInMonthType(DaysInMonthType.DAYS30.value)// + .isInterestRecalculationEnabled(true)// + .preClosureInterestCalculationStrategy(1)// + .rescheduleStrategyMethod(4)// + .interestRecalculationCompoundingMethod(0)// + .recalculationRestFrequencyType(2)// + .recalculationRestFrequencyInterval(1)// + .charges(chargesDisbursement)// + .paymentAllocation(List.of(// + createPaymentAllocation("DEFAULT", "NEXT_INSTALLMENT"), // + createPaymentAllocation("GOODWILL_CREDIT", "LAST_INSTALLMENT"), // + createPaymentAllocation("MERCHANT_ISSUED_REFUND", "REAMORTIZATION"), // + createPaymentAllocation("PAYOUT_REFUND", "NEXT_INSTALLMENT")));// + Response responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyCashAccountingDisbursementCharge = loanProductsApi + .createLoanProduct(loanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyCashAccountingDisbursementCharge) + .execute(); + TestContext.INSTANCE.set( + TestContextKey.DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES, + responseLoanProductsRequestLP2AdvancedpaymentInterestEmi36030InterestRecalcDailyCashAccountingDisbursementCharge); } public static AdvancedPaymentData createPaymentAllocation(String transactionType, String futureInstallmentAllocationRule, diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/JournalEntriesStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/JournalEntriesStepDef.java index f2f74e20d..8216b67f7 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/JournalEntriesStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/JournalEntriesStepDef.java @@ -225,4 +225,58 @@ public class JournalEntriesStepDef extends AbstractStepDef { .isTrue(); } } + + @Then("Loan Transactions tab has a {string} transaction with date {string} has no the Journal entries") + public void journalEntryNoDataCheck(String transactionType, String transactionDate) throws IOException { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_FORMAT); + Response loanResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE); + long loanId = loanResponse.body().getLoanId(); + + Response loanDetailsResponse = loansApi.retrieveLoan(loanId, false, "transactions", "", "").execute(); + ErrorHelper.checkSuccessfulApiCall(loanDetailsResponse); + + TransactionType transactionType1 = TransactionType.valueOf(transactionType); + String transactionTypeExpected = transactionType1.getValue(); + + List transactions = loanDetailsResponse.body().getTransactions(); + List transactionsMatch = transactions.stream() + .filter(t -> transactionDate.equals(formatter.format(t.getDate())) + && transactionTypeExpected.equals(t.getType().getCode().substring(20))) + .collect(Collectors.toList()); + + List> journalLinesActualList = transactionsMatch.stream().map(t -> { + String transactionId = "L" + t.getId(); + Response journalEntryDataResponse = null; + try { + journalEntryDataResponse = journalEntriesApi.retrieveAll1(// + null, // + null, // + null, // + null, // + null, // + null, // + null, // + transactionId, // + null, // + null, // + null, // + null, // + null, // + null, // + null, // + null, // + null, // + null, // + true// + ).execute(); + ErrorHelper.checkSuccessfulApiCall(journalEntryDataResponse); + } catch (IOException e) { + log.error("Exception", e); + } + + return journalEntryDataResponse.body().getPageItems(); + }).collect(Collectors.toList()); + + assertThat(journalLinesActualList.stream().findFirst().get().size()).isZero(); + } } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/ChargeStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/ChargeStepDef.java new file mode 100644 index 000000000..bf66a8e96 --- /dev/null +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/ChargeStepDef.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.test.stepdef.loan; + +import io.cucumber.java.en.When; +import java.io.IOException; +import org.apache.fineract.client.models.ChargeRequest; +import org.apache.fineract.client.models.PutChargesChargeIdResponse; +import org.apache.fineract.client.services.ChargesApi; +import org.apache.fineract.test.data.ChargeCalculationType; +import org.apache.fineract.test.data.ChargeProductType; +import org.apache.fineract.test.helper.ErrorHelper; +import org.apache.fineract.test.stepdef.AbstractStepDef; +import org.springframework.beans.factory.annotation.Autowired; +import retrofit2.Response; + +public class ChargeStepDef extends AbstractStepDef { + + @Autowired + private ChargesApi chargesApi; + + @When("Admin updates charge {string} with {string} calculation type and {double} % of transaction amount") + public void updateCharge(String chargeType, String chargeCalculationType, double amount) throws IOException { + ChargeRequest disbursementChargeUpdateRequest = new ChargeRequest(); + ChargeCalculationType chargeProductTypeValue = ChargeCalculationType.valueOf(chargeCalculationType); + disbursementChargeUpdateRequest.chargeCalculationType(chargeProductTypeValue.value).amount(amount).locale("en"); + + ChargeProductType chargeProductType = ChargeProductType.valueOf(chargeType); + Long chargeId = chargeProductType.getValue(); + + Response responseDisbursementCharge = chargesApi.updateCharge(chargeId, disbursementChargeUpdateRequest) + .execute(); + ErrorHelper.checkSuccessfulApiCall(responseDisbursementCharge); + } +} diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java index 7c1707613..b62cc6f4c 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java @@ -82,12 +82,14 @@ import org.apache.fineract.client.models.InterestPauseRequestDto; import org.apache.fineract.client.models.IsCatchUpRunningDTO; import org.apache.fineract.client.models.PaymentAllocationOrder; import org.apache.fineract.client.models.PostClientsResponse; +import org.apache.fineract.client.models.PostLoansDisbursementData; import org.apache.fineract.client.models.PostLoansLoanIdRequest; import org.apache.fineract.client.models.PostLoansLoanIdResponse; import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest; import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse; import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest; import org.apache.fineract.client.models.PostLoansRequest; +import org.apache.fineract.client.models.PostLoansRequestChargeData; import org.apache.fineract.client.models.PostLoansResponse; import org.apache.fineract.client.models.PutLoanProductsProductIdRequest; import org.apache.fineract.client.models.PutLoanProductsProductIdResponse; @@ -100,6 +102,7 @@ import org.apache.fineract.client.services.LoanTransactionsApi; import org.apache.fineract.client.services.LoansApi; import org.apache.fineract.client.util.JSON; import org.apache.fineract.test.data.AmortizationType; +import org.apache.fineract.test.data.ChargeProductType; import org.apache.fineract.test.data.InterestCalculationPeriodTime; import org.apache.fineract.test.data.InterestRateFrequencyType; import org.apache.fineract.test.data.InterestType; @@ -448,6 +451,24 @@ public class LoanStepDef extends AbstractStepDef { createFullyCustomizedLoanWithInterestRateFrequency(data.get(1)); } + @When("Admin creates a fully customized loan with charges and following data:") + public void createFullyCustomizedLoanWithLoanCharges(final DataTable table) throws IOException { + final List> data = table.asLists(); + createFullyCustomizedLoanWithCharges(data.get(1)); + } + + @When("Admin creates a fully customized loan with charges and disbursement details and following data:") + public void createFullyCustomizedLoanWithChargesAndDisbursementDetails(final DataTable table) throws IOException { + final List> data = table.asLists(); + createFullyCustomizedLoanWithChargesAndExpectedTrancheDisbursementDetails(data.get(1)); + } + + @When("Admin creates a fully customized loan with charges and disbursements details and following data:") + public void createFullyCustomizedLoanWithChargesAndDisbursementsDetails(final DataTable table) throws IOException { + final List> data = table.asLists(); + createFullyCustomizedLoanWithChargesAndExpectedTrancheDisbursementsDetails(data.get(1)); + } + @When("Admin creates a fully customized loan with forced disabled downpayment with the following data:") public void createFullyCustomizedLoanWithForcedDisabledDownpayment(DataTable table) throws IOException { List> data = table.asLists(); @@ -1950,6 +1971,17 @@ public class LoanStepDef extends AbstractStepDef { .as(ErrorMessageHelper.transactionHasNullResourceValue(transaction.getType().getCode(), "external-id")).isNotNull(); } + @Then("Loan Transactions tab has none transaction") + public void loanTransactionsTabNoneTransaction() throws IOException { + Response loanCreateResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE); + long loanId = loanCreateResponse.body().getLoanId(); + + Response loanDetailsResponse = loansApi.retrieveLoan(loanId, false, "transactions", "", "").execute(); + ErrorHelper.checkSuccessfulApiCall(loanDetailsResponse); + List transactions = loanDetailsResponse.body().getTransactions(); + assertThat(transactions.size()).isZero(); + } + @Then("Loan Charges tab has a given charge with the following data:") public void loanChargesGivenChargeDataCheck(DataTable table) throws IOException { Response loanCreateResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE); @@ -3098,6 +3130,192 @@ public class LoanStepDef extends AbstractStepDef { eventCheckHelper.createLoanEventCheck(response); } + public void createFullyCustomizedLoanWithCharges(final List loanData) throws IOException { + final String loanProduct = loanData.get(0); + final String submitDate = loanData.get(1); + final String principal = loanData.get(2); + final BigDecimal interestRate = new BigDecimal(loanData.get(3)); + final String interestTypeStr = loanData.get(4); + final String interestCalculationPeriodStr = loanData.get(5); + final String amortizationTypeStr = loanData.get(6); + final Integer loanTermFrequency = Integer.valueOf(loanData.get(7)); + final String loanTermFrequencyType = loanData.get(8); + final Integer repaymentFrequency = Integer.valueOf(loanData.get(9)); + final String repaymentFrequencyTypeStr = loanData.get(10); + final Integer numberOfRepayments = Integer.valueOf(loanData.get(11)); + final Integer graceOnPrincipalPayment = Integer.valueOf(loanData.get(12)); + final Integer graceOnInterestPayment = Integer.valueOf(loanData.get(13)); + final Integer graceOnInterestCharged = Integer.valueOf(loanData.get(14)); + final String transactionProcessingStrategyCode = loanData.get(15); + final String chargesCalculationType = loanData.get(16); + final BigDecimal chargesAmount = new BigDecimal(loanData.get(17)); + + final Response clientResponse = testContext().get(TestContextKey.CLIENT_CREATE_RESPONSE); + final Long clientId = clientResponse.body().getClientId(); + + final DefaultLoanProduct product = DefaultLoanProduct.valueOf(loanProduct); + final Long loanProductId = loanProductResolver.resolve(product); + + final LoanTermFrequencyType termFrequencyType = LoanTermFrequencyType.valueOf(loanTermFrequencyType); + final Integer loanTermFrequencyTypeValue = termFrequencyType.getValue(); + + final RepaymentFrequencyType repaymentFrequencyType = RepaymentFrequencyType.valueOf(repaymentFrequencyTypeStr); + final Integer repaymentFrequencyTypeValue = repaymentFrequencyType.getValue(); + + final InterestType interestType = InterestType.valueOf(interestTypeStr); + final Integer interestTypeValue = interestType.getValue(); + + final InterestCalculationPeriodTime interestCalculationPeriod = InterestCalculationPeriodTime.valueOf(interestCalculationPeriodStr); + final Integer interestCalculationPeriodValue = interestCalculationPeriod.getValue(); + + final AmortizationType amortizationType = AmortizationType.valueOf(amortizationTypeStr); + final Integer amortizationTypeValue = amortizationType.getValue(); + + final TransactionProcessingStrategyCode processingStrategyCode = TransactionProcessingStrategyCode + .valueOf(transactionProcessingStrategyCode); + final String transactionProcessingStrategyCodeValue = processingStrategyCode.getValue(); + + ChargeProductType chargeProductType = ChargeProductType.valueOf(chargesCalculationType); + Long chargeId = chargeProductType.getValue(); + + List charges = new ArrayList<>(); + charges.add(new PostLoansRequestChargeData().chargeId(chargeId).amount(chargesAmount)); + + final PostLoansRequest loansRequest = loanRequestFactory// + .defaultLoansRequest(clientId)// + .productId(loanProductId)// + .principal(new BigDecimal(principal))// + .interestRatePerPeriod(interestRate)// + .interestType(interestTypeValue)// + .interestCalculationPeriodType(interestCalculationPeriodValue)// + .amortizationType(amortizationTypeValue)// + .loanTermFrequency(loanTermFrequency)// + .loanTermFrequencyType(loanTermFrequencyTypeValue)// + .numberOfRepayments(numberOfRepayments)// + .repaymentEvery(repaymentFrequency)// + .repaymentFrequencyType(repaymentFrequencyTypeValue)// + .submittedOnDate(submitDate)// + .expectedDisbursementDate(submitDate)// + .graceOnPrincipalPayment(graceOnPrincipalPayment)// + .graceOnInterestPayment(graceOnInterestPayment)// + .graceOnInterestPayment(graceOnInterestCharged)// + .transactionProcessingStrategyCode(transactionProcessingStrategyCodeValue)// + .charges(charges);// + + final Response response = loansApi.calculateLoanScheduleOrSubmitLoanApplication(loansRequest, "").execute(); + testContext().set(TestContextKey.LOAN_CREATE_RESPONSE, response); + ErrorHelper.checkSuccessfulApiCall(response); + + eventCheckHelper.createLoanEventCheck(response); + } + + public void createFullyCustomizedLoanWithChargesAndExpectedTrancheDisbursementDetails(final List loanData) throws IOException { + final String expectedDisbursementDate = loanData.get(18); + final Double disbursementPrincipalAmount = Double.valueOf(loanData.get(19)); + + List disbursementDetail = new ArrayList<>(); + disbursementDetail.add( + new PostLoansDisbursementData().expectedDisbursementDate(expectedDisbursementDate).principal(disbursementPrincipalAmount)); + + createFullyCustomizedLoanWithChargesExpectsTrancheDisbursementDetails(loanData, disbursementDetail); + } + + public void createFullyCustomizedLoanWithChargesAndExpectedTrancheDisbursementsDetails(final List loanData) throws IOException { + final String expectedDisbursementDateFirstDisbursal = loanData.get(18); + final Double disbursementPrincipalAmountFirstDisbursal = Double.valueOf(loanData.get(19)); + + final String expectedDisbursementDateSecondDisbursal = loanData.get(20); + final Double disbursementPrincipalAmountSecondDisbursal = Double.valueOf(loanData.get(21)); + + List disbursementDetail = new ArrayList<>(); + disbursementDetail.add(new PostLoansDisbursementData().expectedDisbursementDate(expectedDisbursementDateFirstDisbursal) + .principal(disbursementPrincipalAmountFirstDisbursal)); + disbursementDetail.add(new PostLoansDisbursementData().expectedDisbursementDate(expectedDisbursementDateSecondDisbursal) + .principal(disbursementPrincipalAmountSecondDisbursal)); + + createFullyCustomizedLoanWithChargesExpectsTrancheDisbursementDetails(loanData, disbursementDetail); + } + + public void createFullyCustomizedLoanWithChargesExpectsTrancheDisbursementDetails(final List loanData, + List disbursementDetail) throws IOException { + final String loanProduct = loanData.get(0); + final String submitDate = loanData.get(1); + final String principal = loanData.get(2); + final BigDecimal interestRate = new BigDecimal(loanData.get(3)); + final String interestTypeStr = loanData.get(4); + final String interestCalculationPeriodStr = loanData.get(5); + final String amortizationTypeStr = loanData.get(6); + final Integer loanTermFrequency = Integer.valueOf(loanData.get(7)); + final String loanTermFrequencyType = loanData.get(8); + final Integer repaymentFrequency = Integer.valueOf(loanData.get(9)); + final String repaymentFrequencyTypeStr = loanData.get(10); + final Integer numberOfRepayments = Integer.valueOf(loanData.get(11)); + final Integer graceOnPrincipalPayment = Integer.valueOf(loanData.get(12)); + final Integer graceOnInterestPayment = Integer.valueOf(loanData.get(13)); + final Integer graceOnInterestCharged = Integer.valueOf(loanData.get(14)); + final String transactionProcessingStrategyCode = loanData.get(15); + final String chargesCalculationType = loanData.get(16); + final BigDecimal chargesAmount = new BigDecimal(loanData.get(17)); + + final Response clientResponse = testContext().get(TestContextKey.CLIENT_CREATE_RESPONSE); + final Long clientId = clientResponse.body().getClientId(); + + final DefaultLoanProduct product = DefaultLoanProduct.valueOf(loanProduct); + final Long loanProductId = loanProductResolver.resolve(product); + + final LoanTermFrequencyType termFrequencyType = LoanTermFrequencyType.valueOf(loanTermFrequencyType); + final Integer loanTermFrequencyTypeValue = termFrequencyType.getValue(); + + final RepaymentFrequencyType repaymentFrequencyType = RepaymentFrequencyType.valueOf(repaymentFrequencyTypeStr); + final Integer repaymentFrequencyTypeValue = repaymentFrequencyType.getValue(); + + final InterestType interestType = InterestType.valueOf(interestTypeStr); + final Integer interestTypeValue = interestType.getValue(); + + final InterestCalculationPeriodTime interestCalculationPeriod = InterestCalculationPeriodTime.valueOf(interestCalculationPeriodStr); + final Integer interestCalculationPeriodValue = interestCalculationPeriod.getValue(); + + final AmortizationType amortizationType = AmortizationType.valueOf(amortizationTypeStr); + final Integer amortizationTypeValue = amortizationType.getValue(); + + final TransactionProcessingStrategyCode processingStrategyCode = TransactionProcessingStrategyCode + .valueOf(transactionProcessingStrategyCode); + final String transactionProcessingStrategyCodeValue = processingStrategyCode.getValue(); + + ChargeProductType chargeProductType = ChargeProductType.valueOf(chargesCalculationType); + Long chargeId = chargeProductType.getValue(); + + List charges = new ArrayList<>(); + charges.add(new PostLoansRequestChargeData().chargeId(chargeId).amount(chargesAmount)); + + final PostLoansRequest loansRequest = loanRequestFactory// + .defaultLoansRequest(clientId)// + .productId(loanProductId)// + .principal(new BigDecimal(principal))// + .interestRatePerPeriod(interestRate)// + .interestType(interestTypeValue)// + .interestCalculationPeriodType(interestCalculationPeriodValue)// + .amortizationType(amortizationTypeValue)// + .loanTermFrequency(loanTermFrequency)// + .loanTermFrequencyType(loanTermFrequencyTypeValue)// + .numberOfRepayments(numberOfRepayments)// + .repaymentEvery(repaymentFrequency)// + .repaymentFrequencyType(repaymentFrequencyTypeValue)// + .submittedOnDate(submitDate)// + .expectedDisbursementDate(submitDate)// + .graceOnPrincipalPayment(graceOnPrincipalPayment)// + .graceOnInterestPayment(graceOnInterestPayment)// + .graceOnInterestPayment(graceOnInterestCharged)// + .transactionProcessingStrategyCode(transactionProcessingStrategyCodeValue)// + .disbursementData(disbursementDetail).charges(charges);// + + final Response response = loansApi.calculateLoanScheduleOrSubmitLoanApplication(loansRequest, "").execute(); + testContext().set(TestContextKey.LOAN_CREATE_RESPONSE, response); + ErrorHelper.checkSuccessfulApiCall(response); + + eventCheckHelper.createLoanEventCheck(response); + } + @When("Admin creates a new zero charge-off Loan with interest recalculation and date: {string}") public void createLoanWithInterestRecalculationAndZeroChargeOffBehaviour(final String date) throws IOException { createLoanWithZeroChargeOffBehaviour(date, true); diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java index 8ead25a30..eecb1ab1a 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/support/TestContextKey.java @@ -134,6 +134,10 @@ public abstract class TestContextKey { public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALC_EMI_360_30_CHARGEBACK_INTEREST_PENALTY_FEE_PRINCIPAL = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyInterestRecalcEmi36030ChargebackInterestPenaltyFeePrincipal"; public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALC_EMI_360_30_CHARGEBACK_INTEREST_FEE_PRINCIPAL = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyInterestRecalcEmi36030ChargebackInterestFeePrincipal"; public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALC_EMI_360_30_CHARGEBACK_PRINCIPAL_INTEREST_FEE = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyInterestRecalcEmi36030ChargebackPrincipalInterestFee"; + public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyDisbursementCharge"; + public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyMultidisburseExpectTranche"; + public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE = "loanProductCreateResponseLP2AdvancedPaymentInterestRecalculationDailyEmi36030Multidisburse"; + public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyEmi36030InterestRecalculationDailyCashBasedDisbursementCharge"; public static final String LP2_NO_INTEREST_RECALCULATION_CHARGEBACK_ALLOCATION_INTEREST_FIRST_RESPONSE = "loanProductCreateResponseLP2NoInterestRecalculationChargebackAllocationInterestFirst"; public static final String LP2_NO_INTEREST_RECALCULATION_CHARGEBACK_ALLOCATION_PRINCIPAL_FIRST_RESPONSE = "loanProductCreateResponseLP2NoInterestRecalculationChargebackAllocationPrincipalFirst"; public static final String DEFAULT_LOAN_PRODUCT_CREATE_RESPONSE_LP2_ADV_PYMNT_INTEREST_DAILY_INTEREST_RECALCULATION_ACCELERATE_MATURITY_CHARGE_OFF_BEHAVIOUR_LAST_INSTALLMENT_STRATEGY = "loanProductCreateResponseLP2AdvancedPaymentInterestDailyInterestRecalculationAccelerateMaturityChargeOffBehaviourLastInstallmentStrategy"; @@ -146,8 +150,10 @@ public abstract class TestContextKey { public static final String CHARGE_FOR_LOAN_SNOOZE_FEE_CREATE_RESPONSE = "ChargeForLoanSnoozeFeeCreateResponse"; public static final String CHARGE_FOR_LOAN_NSF_FEE_CREATE_RESPONSE = "ChargeForLoanNsfFeeCreateResponse"; public static final String CHARGE_FOR_LOAN_DISBURSEMENET_FEE_CREATE_RESPONSE = "ChargeForLoanDisbursementCreateResponse"; + public static final String CHARGE_FOR_LOAN_TRANCHE_DISBURSEMENT_PERCENT_CREATE_RESPONSE = "ChargeForLoanTrancheDisbursementPercentCreateResponse"; public static final String CHARGE_FOR_LOAN_INSTALLMENT_FEE_CREATE_RESPONSE = "ChargeForLoanInstallmentCreateResponse"; public static final String CHARGE_FOR_CLIENT_FIXED_FEE_CREATE_RESPONSE = "ChargeForClientFixedFeeCreateResponse"; + public static final String CHARGE_FOR_LOAN_DISBURSEMENT_CHARGE_CREATE_RESPONSE = "ChargeForLoanDisbursementChargeCreateResponse"; public static final String LOAN_RESPONSE = "loanResponse"; public static final String LOAN_REPAYMENT_UNDO_RESPONSE = "loanRepaymentUndoResponse"; public static final String LOAN_TRANSACTION_UNDO_RESPONSE = "loanTransactionUndoResponse"; diff --git a/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature b/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature index dc5381664..9e33a7a89 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/LoanCharge.feature @@ -2746,4 +2746,2007 @@ Feature: LoanCharge Then Loan Transactions tab has a "ACCRUAL" transaction with date "25 March 2025" which has the following Journal entries: | Type | Account code | Account name | Debit | Credit | | ASSET | 112603 | Interest/Fee Receivable | 10.0 | | - | INCOME | 404007 | Fee Income | | 10.0 | \ No newline at end of file + | INCOME | 404007 | Fee Income | | 10.0 | + + @TestRailId:C3546 + Scenario: Verify flat disbursement charge for interest bearing progressive loan - UC1 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "FLAT" calculation type and 10.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY_TILL_PRECLOSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 10.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | Flat | 10.0 | 0.0 | 0.0 | 10.0 | + 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 | | | 10.0 | | 10.0 | 10.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 | 10.0 | 0.0 | 112.05 | 10.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 | + | 01 January 2024 | Repayment (at time of disbursement) | 10.0 | 0.0 | 0.0 | 10.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | Flat | 10.0 | 10.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 10.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 10.0 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 10.0 | | 10.0 | 10.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 | 10.0 | 0.0 | 112.05 | 27.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 January 2024 | Repayment (at time of disbursement) | 10.0 | 0.0 | 0.0 | 10.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 | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | | | 10.0 | | 10.0 | 10.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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 10.0 | 0.0 | 112.05 | 44.02 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 10.0 | 0.0 | 0.0 | 10.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 | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3547 + Scenario: Verify amount disbursement charge for interest bearing progressive loan - UC2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.0 | 0.0 | 0.0 | 1.0 | + 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 | | | 1.0 | | 1.0 | 1.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 | 1.0 | 0.0 | 103.05 | 1.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 | + | 01 January 2024 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.0 | 1.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.0 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 1.0 | | 1.0 | 1.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 | 1.0 | 0.0 | 103.05 | 18.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 January 2024 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.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 | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | | | 1.0 | | 1.0 | 1.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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 1.0 | 0.0 | 103.05 | 35.02 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.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 | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3548 + Scenario: Verify amount+interest disbursement charge for interest bearing progressive loan - UC3 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.02 | 0.0 | 0.0 | 1.02 | + 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 | | | 1.02 | | 1.02 | 1.02 | | | | + | 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 | 1.02 | 0.0 | 103.07 | 1.02 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 1.02 | 0.0 | 0.0 | 1.02 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.02 | 1.02 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.02 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.02 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 1.02 | | 1.02 | 1.02 | | | | + | 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 | 1.02 | 0.0 | 103.07 | 18.03 | 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 January 2024 | Repayment (at time of disbursement) | 1.02 | 0.0 | 0.0 | 1.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | | | 1.02 | | 1.02 | 1.02 | | | | + | 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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 1.02 | 0.0 | 103.07 | 35.04 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 1.02 | 0.0 | 0.0 | 1.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3549 + Scenario: Verify interest disbursement charge for interest bearing progressive loan - UC4 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.0 | 0.0 | 0.02 | + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 0.02 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.02 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.02 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.02 | | +# --- 1st repayment - 1 February, 2024 --- + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 17.03 | 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 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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.02 | | 0.02 | 0.02 | | | | + | 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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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.02 | 0.0 | 102.07 | 34.04 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3550 + Scenario: Verify interest disbursement charge with cash based accounting for interest bearing progressive loan - UC5 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_CASH_ACCOUNTING_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.0 | 0.0 | 0.02 | + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 0.02 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 January 2024 | Accrual | 2.05 | 0.0 | 2.05 | 0.0 | 0.0 | 0.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.02 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.02 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.02 | | + Then Loan Transactions tab has a "ACCRUAL" transaction with date "01 January 2024" has no the Journal entries +# --- 1st repayment - 1 February, 2024 --- + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 17.03 | 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 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 January 2024 | Accrual | 2.05 | 0.0 | 2.05 | 0.0 | 0.0 | 0.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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.02 | | 0.02 | 0.02 | | | | + | 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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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.02 | 0.0 | 102.07 | 34.04 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 January 2024 | Accrual | 2.05 | 0.0 | 2.05 | 0.0 | 0.0 | 0.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3551 + Scenario: Verify interest disbursement charge with accrual based accounting for interest bearing progressive loan - UC6.1 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 0.02 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.0 | 0.0 | 0.0 | 0.0 | + 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 | Replayed | + | 01 January 2024 | Disbursement | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.0 | 0.0 | 0.0 | 0.0 | +# --- 1st repayment - 1 February, 2024 --- + 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 | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | 01 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 34.02 | 0.0 | 0.0 | 68.03 | + 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 | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3552 + Scenario: Verify amount+interest disbursement charge for interest bearing progressive loan - UC6.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.02 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.04 | 0.0 | 0.0 | 1.04 | + 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 | | | 1.04 | | 1.04 | 1.04 | | | | + | 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 | 1.04 | 0.0 | 103.09 | 1.04 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 1.04 | 0.0 | 0.0 | 1.04 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.04 | 1.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.04 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 1.04 | | 1.04 | 1.04 | | | | + | 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 | 1.04 | 0.0 | 103.09 | 18.05 | 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 January 2024 | Repayment (at time of disbursement) | 1.04 | 0.0 | 0.0 | 1.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | | | 1.04 | | 1.04 | 1.04 | | | | + | 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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 1.04 | 0.0 | 103.09 | 35.06 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 1.04 | 0.0 | 0.0 | 1.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | + + @TestRailId:C3553 + Scenario: Verify interest disbursement charge with undo disbursal for interest bearing progressive loan - UC7 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.0 | 0.0 | 0.02 | + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 0.02 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.02 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.02 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.02 | | +# --- 1st repayment - 1 February, 2024 --- + 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.02 | | 0.02 | 0.02 | | | | + | 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.02 | 0.0 | 102.07 | 17.03 | 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 January 2024 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "01 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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.02 | | 0.02 | 0.02 | | | | + | 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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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.02 | 0.0 | 102.07 | 34.04 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 0.02 | 0.0 | 0.0 | 0.02 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | +# --- Undo Disbursement --- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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.02 | | 0.02 | | | | 0.02 | + | 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.02 | 0.0 | 102.07 | 0.0 | 0.0 | 0.0 | 102.07 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.02 | 0.0 | 0.0 | 0.02 | + + @TestRailId:C3578 + Scenario: Verify amount disbursement charge for tranche interest bearing progressive loan that expects one tranche with full disbursement - UC8.1.1 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 | | | 2.0 | | 2.0 | 2.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 | 2.0 | 0.0 | 104.05 | 2.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 | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 2.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.0 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 2.0 | | 2.0 | 2.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 | 2.0 | 0.0 | 104.05 | 19.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 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.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 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 2.0 | 0.0 | 0.0 | + + @TestRailId:C3579 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that expects one tranche with full disbursement - UC8.1.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 | | | 2.04 | | 2.04 | 2.04 | | | | + | 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 | 2.04 | 0.0 | 104.09 | 2.04 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.04 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 2.04 | | 2.04 | 2.04 | | | | + | 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 | 2.04 | 0.0 | 104.09 | 19.05 | 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 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | + + @TestRailId:C3580 + Scenario: Verify interest disbursement charge for tranche interest bearing progressive loan that expects one tranche with full disbursement - UC8.1.3 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.0 | 0.0 | 0.04 | + 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.04 | | 0.04 | 0.04 | | | | + | 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.04 | 0.0 | 102.09 | 0.04 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 0.04 | 0.0 | 0.0 | 0.04 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.04 | | +# --- 1st repayment - 1 February, 2024 --- + 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.04 | | 0.04 | 0.04 | | | | + | 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.04 | 0.0 | 102.09 | 17.05 | 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 January 2024 | Repayment (at time of disbursement) | 0.04 | 0.0 | 0.0 | 0.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.04 | 0.0 | 0.0 | + + @TestRailId:C3581 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that doesn't expect tranches with full disbursement - UC8.1.4 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 | | | 2.0 | | 2.0 | 2.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 | 2.0 | 0.0 | 104.05 | 2.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 | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 2.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.0 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 2.0 | | 2.0 | 2.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 | 2.0 | 0.0 | 104.05 | 19.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 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.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 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 2.0 | 0.0 | 0.0 | + + @Skip + @TestRailId:C3582 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that doesn't expect tranches with full disbursement - UC8.1.5 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 | | | 2.04 | | 2.04 | 2.04 | | | | + | 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 | 2.04 | 0.0 | 104.09 | 2.04 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.04 | | +# --- 1st repayment - 1 February, 2024 --- + 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 | | | 2.04 | | 2.04 | 2.04 | | | | + | 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 | 2.04 | 0.0 | 104.09 | 19.05 | 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 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | + + @TestRailId:C3583 + Scenario: Verify interest disbursement charge for tranche interest bearing progressive loan that doesn't expect tranches with full disbursement - UC8.1.6 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.0 | 0.0 | 0.04 | + 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.04 | | 0.04 | 0.04 | | | | + | 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.04 | 0.0 | 102.09 | 0.04 | 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 | + | 01 January 2024 | Repayment (at time of disbursement) | 0.04 | 0.0 | 0.0 | 0.04 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.04 | | +# --- 1st repayment - 1 February, 2024 --- + 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.04 | | 0.04 | 0.04 | | | | + | 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.04 | 0.0 | 102.09 | 17.05 | 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 January 2024 | Repayment (at time of disbursement) | 0.04 | 0.0 | 0.0 | 0.04 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.04 | 0.0 | 0.0 | + + @Skip + @TestRailId:C3554 + Scenario: Verify amount disbursement charge for tranche interest bearing progressive loan that expects one tranche - UC8.2.1 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 "70" 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.4 | 0.0 | 72.87 | 1.4 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.4 | 1.4 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.4 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.4 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.43 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.67 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + 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.44 | 1.4 | 0.0 | 72.84 | 13.31 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + + @Skip + @TestRailId:C3555 + Scenario: Verify amount disbursement charge for tranche interest bearing progressive loan that expects two tranches with undo last disbursement - UC8.2.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursements details and 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 | charge calculation type | charge amount % | 1st_tranche_disb_expected_date |1st_tranche_disb_principal | 2nd_tranche_disb_expected_date | 2nd_tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 70.0 | 01 February 2024 | 30.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 "70" 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 | | 70.0 | | | 2.0 | | 2.0 | 2.0 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 2.0 | 0.0 | 73.44 | 2.0 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.0 | 2.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.0 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 2.0 | | 2.0 | 2.0 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 76.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 65.29 | 11.67 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 53.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 41.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 30.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 2.0 | 0.0 | 72.84 | 13.91 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# --- 2nd disbursement - 1 February, 2024 --- + When Admin successfully disburse the loan on "01 February 2024" with "30" 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 | | 70.0 | | | 2.0 | | 2.0 | 2.0 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 71.01 | 17.49 | 0.52 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 3 | 31 | 01 April 2024 | | 53.41 | 17.6 | 0.41 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 4 | 30 | 01 May 2024 | | 35.71 | 17.7 | 0.31 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 5 | 31 | 01 June 2024 | | 17.91 | 17.8 | 0.21 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 6 | 30 | 01 July 2024 | | 0.0 | 17.91 | 0.1 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + 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.96 | 2.0 | 0.0 | 103.96 | 13.91 | 0.0 | 0.0 | 90.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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + | 15 February 2024 | Disbursement | 30.0 | 0.0 | 0.0 | 0.0 | 0.0 | 88.5 | false | false | +# -- undo last disbursement ---- + When Admin successfully undo last disbursal + Then Loan status has changed to "Active" + 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 | | 70.0 | | | 2.0 | | 2.0 | 2.0 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.67 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + 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.44 | 2.0 | 0.0 | 73.44 | 13.91 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + + @Skip + @TestRailId:C3556 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that expects two tranches with undo disbursement - UC8.2.3 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursements details and 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 | charge calculation type | charge amount % | 1st_tranche_disb_expected_date |1st_tranche_disb_principal | 2nd_tranche_disb_expected_date | 2nd_tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 70.0 | 01 February 2024 | 30.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 "70" 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 | | 70.0 | | | 2.04 | | 2.04 | 2.04 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 2.04 | 0.0 | 73.48 | 2.04 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 2.04 | + | LIABILITY | 145023 | Suspense/Clearing account | 2.04 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 2.04 | | 2.04 | 2.04 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 76.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 65.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 53.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 41.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 30.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 2.04 | 0.0 | 73.48 | 13.95 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.04 | 0.0 | 0.0 | 2.04 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# --- 2nd disbursement - 1 February, 2024 --- + When Admin successfully disburse the loan on "01 February 2024" with "30" 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 | | 70.0 | | | 2.04 | | 2.04 | 2.04 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 71.01 | 17.49 | 0.52 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 3 | 31 | 01 April 2024 | | 53.41 | 17.6 | 0.41 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 4 | 30 | 01 May 2024 | | 35.71 | 17.7 | 0.31 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 5 | 31 | 01 June 2024 | | 17.91 | 17.8 | 0.21 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 6 | 30 | 01 July 2024 | | 0.0 | 17.91 | 0.1 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + 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.87 | 2.04 | 0.0 | 104.0 | 13.95 | 0.0 | 0.0 | 90.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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + | 15 February 2024 | Disbursement | 30.0 | 0.0 | 0.0 | 0.0 | 0.0 | 88.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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 | | 70.0 | | | 2.04 | | 2.04 | 0.0 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 71.01 | 17.49 | 0.52 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 3 | 31 | 01 April 2024 | | 53.41 | 17.6 | 0.41 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 4 | 30 | 01 May 2024 | | 35.71 | 17.7 | 0.31 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 5 | 31 | 01 June 2024 | | 17.91 | 17.8 | 0.21 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 6 | 30 | 01 July 2024 | | 0.0 | 17.91 | 0.1 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + 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.96 | 2.04 | 0.0 | 104.0 | 0.0 | 0.0 | 0.0 | 104.0 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 2.04 | 0.0 | 0.0 | + + @TestRailId:C3557 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that expects one tranche - UC8.2.4 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 "70" 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 1.43 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.43 | 1.43 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.43 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.43 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 13.34 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + + @Skip + @TestRailId:C3558 + Scenario: Verify interest disbursement charge for tranche interest bearing progressive loan that expects one tranche with undo disbursement - UC8.2.5 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and disbursement details and 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 | charge calculation type | charge amount % | tranche_disb_expected_date | tranche_disb_principal | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE_EXPECT_TRANCHE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | 01 January 2024 | 100.0 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.0 | 0.0 | 0.04 | + 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 "70" 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 0.03 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.03 | 0.03 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.03 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.03 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 11.94 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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.04 | | 0.04 | | | | 0.02 | + | 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.04 | 0.0 | 102.09 | 0.0 | 0.0 | 0.0 | 102.09 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.04 | 0.0 | 0.0 | + + @Skip + @TestRailId:C3560 + Scenario: Verify amount disbursement charge for tranche interest bearing progressive loan that doesn't expect tranches with undo disbursements - UC8.2.6 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 "70" 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.4 | 0.0 | 72.87 | 1.4 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.4 | 1.4 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.4 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.4 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + 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.44 | 1.4 | 0.0 | 72.84 | 13.31 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# --- 2nd disbursement - 1 February, 2024 --- + When Admin successfully disburse the loan on "01 February 2024" with "30" 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 71.01 | 17.49 | 0.52 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 3 | 31 | 01 April 2024 | | 53.41 | 17.6 | 0.41 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 4 | 30 | 01 May 2024 | | 35.71 | 17.7 | 0.31 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 5 | 31 | 01 June 2024 | | 17.91 | 17.8 | 0.21 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 6 | 30 | 01 July 2024 | | 0.0 | 17.91 | 0.1 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + 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.96 | 1.4 | 0.0 | 103.36 | 13.31 | 0.0 | 0.0 | 90.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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 2.0 | 0.0 | 0.0 | 2.0 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + | 15 February 2024 | Disbursement | 30.0 | 0.0 | 0.0 | 0.0 | 0.0 | 88.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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 | | | 2.0 | | 2.0 | | | | 2.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 | 2.0 | 0.0 | 104.05 | 0.0 | 0.0 | 0.0 | 104.05 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 2.0 | 0.0 | 0.0 | 2.0 | + + @Skip + @TestRailId:C3561 + Scenario: Verify amount+interest disbursement charge for tranche interest bearing progressive loan that doesn't expects tranches with undo disbursement - UC8.2.7 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 "70" 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 1.43 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.43 | 1.43 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.43 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.43 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 13.34 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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.02 | | 0.02 | | | | 0.02 | + | 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.02 | 0.0 | 102.07 | 0.0 | 0.0 | 0.0 | 102.07 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + + @Skip + @TestRailId:C3562 + Scenario: Verify interest disbursement charge for tranche interest bearing progressive loan that doesn't expects tranches with undo last disbursement - UC8.2.8 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_MULTIDISBURSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.0 | 0.0 | 0.04 | + 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 "70" 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 0.03 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.03 | 0.03 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.03 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.03 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 11.94 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# --- 2nd disbursement - 1 February, 2024 --- + When Admin successfully disburse the loan on "01 February 2024" with "30" 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | | | 01 February 2024 | | 30.0 | | | 0.0 | | 0.0 | 0.0 | | | | + | 2 | 29 | 01 March 2024 | | 71.01 | 17.49 | 0.52 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 3 | 31 | 01 April 2024 | | 53.41 | 17.6 | 0.41 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 4 | 30 | 01 May 2024 | | 35.71 | 17.7 | 0.31 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 5 | 31 | 01 June 2024 | | 17.91 | 17.8 | 0.21 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + | 6 | 30 | 01 July 2024 | | 0.0 | 17.91 | 0.1 | 0.0 | 0.0 | 18.01 | 0.0 | 0.0 | 0.0 | 18.01 | + 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.96 | 0.03 | 0.0 | 101.99 | 11.94 | 0.0 | 0.0 | 90.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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + | 15 February 2024 | Disbursement | 30.0 | 0.0 | 0.0 | 0.0 | 0.0 | 88.5 | false | false | +# -- undo last disbursement ---- + When Admin successfully undo last disbursal + Then Loan status has changed to "Active" + 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 0.03 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.03 | 0.03 | 0.0 | 0.0 | + + @TestRailId:C3563 + Scenario: Verify amount disbursement charge for interest bearing progressive with partial disbursal and with undo disbursement - UC2.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + 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 "70" 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.4 | 0.0 | 72.84 | 1.4 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.4 | 1.4 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.4 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.4 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.4 | | 1.4 | 1.4 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.4 | 0.0 | 72.84 | 13.31 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.4 | 0.0 | 0.0 | 1.4 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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 | | | 2.0 | | 2.0 | | | | 2.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 | 2.0 | 0.0 | 104.05 | 0.0 | 0.0 | 0.0 | 104.05 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 2.0 | 0.0 | 0.0 | 2.0 | + + @TestRailId:C3564 + Scenario: Verify amount+interest disbursement charge for interest bearing progressive loan with partial disbursal and with undo disbursement - UC3.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_LOAN_AMOUNT_PLUS_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_DAILY_TILL_PRECLOSE | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + 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 "70" 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 1.43 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 1.43 | 1.43 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.43 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.43 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 1.43 | | 1.43 | 1.43 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 1.43 | 0.0 | 72.87 | 13.34 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 1.43 | 0.0 | 0.0 | 1.43 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | +# -- undo disbursement ---- + When Admin successfully undo disbursal + Then Loan status has changed to "Approved" + 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 | | | 2.04 | | 2.04 | | | | 2.04 | + | 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 | 2.04 | 0.0 | 104.09 | 0.0 | 0.0 | 0.0 | 104.09 | + Then Loan Transactions tab has none transaction + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Loan Amount + Interest | 2.04 | 0.0 | 0.0 | 2.04 | + + @TestRailId:C3565 + Scenario: Verify interest disbursement charge for interest bearing progressive loan with partial disbursal - UC4.2 + When Admin sets the business date to "01 January 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_INTEREST" calculation type and 2.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 2 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.04 | 0.0 | 0.0 | 0.04 | + 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 "70" 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 0.03 | 0.0 | 0.0 | 71.44 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Interest | 0.03 | 0.03 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 0.03 | + | LIABILITY | 145023 | Suspense/Clearing account | 0.03 | | +# --- 1st repayment - 1 February, 2024 --- + When Admin sets the business date to "01 February 2024" + And Customer makes "AUTOPAY" repayment on "01 February 2024" with 11.91 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 | | 70.0 | | | 0.03 | | 0.03 | 0.03 | | | | + | 1 | 31 | 01 February 2024 | 01 February 2024 | 58.5 | 11.5 | 0.41 | 0.0 | 0.0 | 11.91 | 11.91 | 0.0 | 0.0 | 0.0 | + | 2 | 29 | 01 March 2024 | | 46.93 | 11.57 | 0.34 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 3 | 31 | 01 April 2024 | | 35.29 | 11.64 | 0.27 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 4 | 30 | 01 May 2024 | | 23.59 | 11.7 | 0.21 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 5 | 31 | 01 June 2024 | | 11.82 | 11.77 | 0.14 | 0.0 | 0.0 | 11.91 | 0.0 | 0.0 | 0.0 | 11.91 | + | 6 | 30 | 01 July 2024 | | 0.0 | 11.82 | 0.07 | 0.0 | 0.0 | 11.89 | 0.0 | 0.0 | 0.0 | 11.89 | + Then Loan Repayment schedule has the following data in Total row: + | Principal due | Interest | Fees | Penalties | Due | Paid | In advance | Late | Outstanding | + | 70.0 | 1.44 | 0.03 | 0.0 | 71.47 | 11.94 | 0.0 | 0.0 | 59.53 | + 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 | 70.0 | 0.0 | 0.0 | 0.0 | 0.0 | 70.0 | false | false | + | 01 January 2024 | Repayment (at time of disbursement) | 0.03 | 0.0 | 0.0 | 0.03 | 0.0 | 70.0 | false | false | + | 01 February 2024 | Repayment | 11.91 | 11.5 | 0.41 | 0.0 | 0.0 | 58.5 | false | false | + + @TestRailId:C3566 + Scenario: Verify amount disbursement charge with reversed repayment for backdated interest bearing progressive loan - UC9 + When Admin sets the business date to "01 March 2024" + When Admin creates a client with random data + When Admin updates charge "LOAN_DISBURSEMENT_CHARGE" with "PERCENTAGE_AMOUNT" calculation type and 1.0 % of transaction amount + When Admin creates a fully customized loan with charges and 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 | charge calculation type | charge amount % | + | LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALC_DAILY_DISBURSEMENT_CHARGES | 01 January 2024 | 100 | 7 | DECLINING_BALANCE | DAILY | EQUAL_INSTALLMENTS | 6 | MONTHS | 1 | MONTHS | 6 | 0 | 0 | 0 | ADVANCED_PAYMENT_ALLOCATION | LOAN_DISBURSEMENT_CHARGE | 1.00 | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.0 | 0.0 | 0.0 | 1.0 | + 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 | | | 1.0 | | 1.0 | 1.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.14 | 16.43 | 0.58 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 3 | 31 | 01 April 2024 | | 50.52 | 16.62 | 0.39 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 4 | 30 | 01 May 2024 | | 33.8 | 16.72 | 0.29 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 5 | 31 | 01 June 2024 | | 16.99 | 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.99 | 0.1 | 0.0 | 0.0 | 17.09 | 0.0 | 0.0 | 0.0 | 17.09 | + 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.14 | 1.0 | 0.0 | 103.14 | 1.0 | 0.0 | 0.0 | 102.14 | + 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 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 100.0 | false | false | + Then Loan Charges tab has the following data: + | Name | isPenalty | Payment due at | Due as of | Calculation type | Due | Paid | Waived | Outstanding | + | Disbursement Charge | false | Disbursement | | % Amount | 1.0 | 1.0 | 0.0 | 0.0 | +# -- REPAYMENT_AT_DISBURSEMENT journal entries ---- + Then Loan Transactions tab has a "REPAYMENT_AT_DISBURSEMENT" transaction with date "01 January 2024" which has the following Journal entries: + | Type | Account code | Account name | Debit | Credit | + | INCOME | 404007 | Fee Income | | 1.0 | + | LIABILITY | 145023 | Suspense/Clearing account | 1.0 | | +# --- 1st repayment - 1 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 | | | 1.0 | | 1.0 | 1.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 | 1.0 | 0.0 | 103.05 | 18.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 January 2024 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.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 | +# --- 2nd repayment - 1 March, 2024 --- + When Admin sets the business date to "02 March 2024" + And Customer makes "AUTOPAY" repayment on "01 March 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 | | | 1.0 | | 1.0 | 1.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 March 2024 | 67.05 | 16.52 | 0.49 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 0.0 | 0.0 | + | 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 | 1.0 | 0.0 | 103.05 | 35.02 | 0.0 | 0.0 | 68.03 | + 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 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.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 | + | 01 March 2024 | Repayment | 17.01 | 16.52 | 0.49 | 0.0 | 0.0 | 67.05 | false | false | +# --- First repayment reversed --- + When Admin sets the business date to "03 March 2024" + When Customer undo "1"th "Repayment" transaction made on "01 February 2024" + 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 | | | 1.0 | | 1.0 | 1.0 | | | | + | 1 | 31 | 01 February 2024 | 01 March 2024 | 83.57 | 16.43 | 0.58 | 0.0 | 0.0 | 17.01 | 17.01 | 0.0 | 17.01 | 0.0 | + | 2 | 29 | 01 March 2024 | | 67.14 | 16.43 | 0.58 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 3 | 31 | 01 April 2024 | | 50.53 | 16.61 | 0.4 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 4 | 30 | 01 May 2024 | | 33.81 | 16.72 | 0.29 | 0.0 | 0.0 | 17.01 | 0.0 | 0.0 | 0.0 | 17.01 | + | 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 | + 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.15 | 1.0 | 0.0 | 103.15 | 18.01 | 0.0 | 17.01 | 85.14 | + 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 | Repayment (at time of disbursement) | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 100.0 | false | false | + | 01 February 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | true | false | + | 01 March 2024 | Repayment | 17.01 | 16.43 | 0.58 | 0.0 | 0.0 | 83.57 | false | true |