FINERACT-2148: loan charge off behaviour configuration
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* 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.portfolio.loanaccount.domain;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.infrastructure.core.data.StringEnumOptionData;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum LoanChargeOffBehaviour {
|
||||
|
||||
REGULAR("chargeOffBehaviour.regular", "Regular"), //
|
||||
ZERO_INTEREST("chargeOffBehaviour.zeroInterest", "Zero interest after charge-off"), //
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String humanReadableName;
|
||||
|
||||
public static List<StringEnumOptionData> getValuesAsStringEnumOptionDataList() {
|
||||
return Arrays.stream(values()).map(v -> new StringEnumOptionData(v.name(), v.getCode(), v.getHumanReadableName())).toList();
|
||||
}
|
||||
|
||||
public StringEnumOptionData getValueAsStringEnumOptionData() {
|
||||
return new StringEnumOptionData(name(), getCode(), getHumanReadableName());
|
||||
}
|
||||
}
|
||||
+10
-5
@@ -47,6 +47,7 @@ import org.apache.fineract.portfolio.loanaccount.data.DisbursementData;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.HolidayDetailDTO;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsData;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsDataWrapper;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanChargeOffBehaviour;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.AmortizationMethod;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
|
||||
@@ -228,6 +229,7 @@ public final class LoanApplicationTerms {
|
||||
private LoanScheduleProcessingType loanScheduleProcessingType;
|
||||
private boolean enableAccrualActivityPosting;
|
||||
private List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes;
|
||||
private LoanChargeOffBehaviour chargeOffBehaviour;
|
||||
|
||||
private LoanApplicationTerms(Builder builder) {
|
||||
this.currency = builder.currency;
|
||||
@@ -458,7 +460,8 @@ public final class LoanApplicationTerms {
|
||||
final Boolean isAutoRepaymentForDownPaymentEnabled, final RepaymentStartDateType repaymentStartDateType,
|
||||
final LocalDate submittedOnDate, final LoanScheduleType loanScheduleType,
|
||||
final LoanScheduleProcessingType loanScheduleProcessingType, final Integer fixedLength,
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes) {
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes,
|
||||
final LoanChargeOffBehaviour chargeOffBehaviour) {
|
||||
|
||||
final LoanRescheduleStrategyMethod rescheduleStrategyMethod = null;
|
||||
final CalendarHistoryDataWrapper calendarHistoryDataWrapper = null;
|
||||
@@ -477,7 +480,7 @@ public final class LoanApplicationTerms {
|
||||
isInterestToBeRecoveredFirstWhenGreaterThanEMI, fixedPrincipalPercentagePerInstallment,
|
||||
isPrincipalCompoundingDisabledForOverdueLoans, enableDownPayment, disbursedAmountPercentageForDownPayment,
|
||||
isAutoRepaymentForDownPaymentEnabled, repaymentStartDateType, submittedOnDate, loanScheduleType, loanScheduleProcessingType,
|
||||
fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
}
|
||||
|
||||
@@ -551,7 +554,7 @@ public final class LoanApplicationTerms {
|
||||
isPrincipalCompoundingDisabledForOverdueLoans, isDownPaymentEnabled, disbursedAmountPercentageForDownPayment,
|
||||
isAutoRepaymentForDownPaymentEnabled, repaymentStartDateType, submittedOnDate, loanScheduleType, loanScheduleProcessingType,
|
||||
fixedLength, loanProductRelatedDetail.isEnableAccrualActivityPosting(),
|
||||
loanProductRelatedDetail.getSupportedInterestRefundTypes());
|
||||
loanProductRelatedDetail.getSupportedInterestRefundTypes(), loanProductRelatedDetail.getChargeOffBehaviour());
|
||||
}
|
||||
|
||||
private LoanApplicationTerms(final ApplicationCurrency currency, final Integer loanTermFrequency,
|
||||
@@ -581,7 +584,7 @@ public final class LoanApplicationTerms {
|
||||
final BigDecimal disbursedAmountPercentageForDownPayment, final boolean isAutoRepaymentForDownPaymentEnabled,
|
||||
final RepaymentStartDateType repaymentStartDateType, final LocalDate submittedOnDate, final LoanScheduleType loanScheduleType,
|
||||
final LoanScheduleProcessingType loanScheduleProcessingType, final Integer fixedLength, boolean enableAccrualActivityPosting,
|
||||
final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes) {
|
||||
final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes, final LoanChargeOffBehaviour chargeOffBehaviour) {
|
||||
|
||||
this.currency = currency;
|
||||
this.loanTermFrequency = loanTermFrequency;
|
||||
@@ -680,6 +683,7 @@ public final class LoanApplicationTerms {
|
||||
this.loanScheduleProcessingType = loanScheduleProcessingType;
|
||||
this.fixedLength = fixedLength;
|
||||
this.supportedInterestRefundTypes = supportedInterestRefundTypes;
|
||||
this.chargeOffBehaviour = chargeOffBehaviour;
|
||||
}
|
||||
|
||||
public Money adjustPrincipalIfLastRepaymentPeriod(final Money principalForPeriod, final Money totalCumulativePrincipalToDate,
|
||||
@@ -1540,7 +1544,8 @@ public final class LoanApplicationTerms {
|
||||
this.graceOnArrearsAgeing, this.daysInMonthType.getValue(), this.daysInYearType.getValue(),
|
||||
this.interestRecalculationEnabled, this.isEqualAmortization, this.isDownPaymentEnabled,
|
||||
this.disbursedAmountPercentageForDownPayment, this.isAutoRepaymentForDownPaymentEnabled, this.loanScheduleType,
|
||||
this.loanScheduleProcessingType, this.fixedLength, this.enableAccrualActivityPosting, this.supportedInterestRefundTypes);
|
||||
this.loanScheduleProcessingType, this.fixedLength, this.enableAccrualActivityPosting, this.supportedInterestRefundTypes,
|
||||
this.chargeOffBehaviour);
|
||||
}
|
||||
|
||||
public Integer getLoanTermFrequency() {
|
||||
|
||||
+1
@@ -166,5 +166,6 @@ public interface LoanProductConstants {
|
||||
|
||||
String ENABLE_ACCRUAL_ACTIVITY_POSTING = "enableAccrualActivityPosting";
|
||||
String SUPPORTED_INTEREST_REFUND_TYPES = "supportedInterestRefundTypes";
|
||||
String CHARGE_OFF_BEHAVIOUR = "chargeOffBehaviour";
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -321,6 +321,8 @@ final class LoanProductsApiResourceSwagger {
|
||||
}
|
||||
|
||||
public List<String> supportedInterestRefundTypes;
|
||||
@Schema(example = "REGULAR")
|
||||
public String chargeOffBehaviour;
|
||||
}
|
||||
|
||||
@Schema(description = "PostLoanProductsResponse")
|
||||
@@ -604,6 +606,7 @@ final class LoanProductsApiResourceSwagger {
|
||||
public Integer principalThresholdForLastInstalment;
|
||||
public GetLoanProductsResponse.GetLoanProductsRepaymentStartDateType repaymentStartDateType;
|
||||
public List<StringEnumOptionData> supportedInterestRefundTypes;
|
||||
public StringEnumOptionData chargeOffBehaviour;
|
||||
}
|
||||
|
||||
@Schema(description = "GetLoanProductsTemplateResponse")
|
||||
@@ -1088,6 +1091,8 @@ final class LoanProductsApiResourceSwagger {
|
||||
public List<StringEnumOptionData> supportedInterestRefundTypes;
|
||||
public List<StringEnumOptionData> supportedInterestRefundTypesOptions;
|
||||
public List<GetLoanProductsChargeOffReasonOptions> chargeOffReasonOptions;
|
||||
public StringEnumOptionData chargeOffBehaviour;
|
||||
public List<StringEnumOptionData> chargeOffBehaviourOptions;
|
||||
}
|
||||
|
||||
@Schema(description = "GetLoanProductsProductIdResponse")
|
||||
@@ -1374,6 +1379,7 @@ final class LoanProductsApiResourceSwagger {
|
||||
public Boolean enableAccrualActivityPosting;
|
||||
public List<StringEnumOptionData> supportedInterestRefundTypes;
|
||||
public List<GetLoanProductsTemplateResponse.GetLoanProductsChargeOffReasonOptions> chargeOffReasonOptions;
|
||||
public StringEnumOptionData chargeOffBehaviour;
|
||||
}
|
||||
|
||||
@Schema(description = "PutLoanProductsProductIdRequest")
|
||||
@@ -1667,6 +1673,8 @@ final class LoanProductsApiResourceSwagger {
|
||||
}
|
||||
|
||||
public List<String> supportedInterestRefundTypes;
|
||||
@Schema(example = "REGULAR")
|
||||
public String chargeOffBehaviour;
|
||||
}
|
||||
|
||||
public static final class AdvancedPaymentData {
|
||||
|
||||
+19
-6
@@ -46,6 +46,7 @@ import org.apache.fineract.portfolio.delinquency.data.DelinquencyBucketData;
|
||||
import org.apache.fineract.portfolio.floatingrates.data.FloatingRateData;
|
||||
import org.apache.fineract.portfolio.fund.data.FundData;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanInterestRecalculationData;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanChargeOffBehaviour;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.AllocationType;
|
||||
@@ -137,6 +138,7 @@ public class LoanProductData implements Serializable {
|
||||
private final Integer installmentAmountInMultiplesOf;
|
||||
private final EnumOptionData repaymentStartDateType;
|
||||
private final List<StringEnumOptionData> supportedInterestRefundTypes;
|
||||
private final StringEnumOptionData chargeOffBehaviour;
|
||||
|
||||
// charges
|
||||
private final Collection<ChargeData> charges;
|
||||
@@ -195,6 +197,7 @@ public class LoanProductData implements Serializable {
|
||||
private final List<FloatingRateData> floatingRateOptions;
|
||||
private final List<EnumOptionData> repaymentStartDateTypeOptions;
|
||||
private final List<StringEnumOptionData> supportedInterestRefundTypesOptions;
|
||||
private final List<StringEnumOptionData> chargeOffBehaviourOptions;
|
||||
|
||||
private final Boolean multiDisburseLoan;
|
||||
private final Integer maxTrancheCount;
|
||||
@@ -333,6 +336,7 @@ public class LoanProductData implements Serializable {
|
||||
final EnumOptionData loanScheduleProcessingTypeOptions = null;
|
||||
final boolean enableAccrualActivityPosting = false;
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypes = null;
|
||||
final StringEnumOptionData chargeOffBehaviour = null;
|
||||
|
||||
return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance,
|
||||
numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
||||
@@ -353,7 +357,7 @@ public class LoanProductData implements Serializable {
|
||||
fixedPrincipalPercentagePerInstallment, delinquencyBucketOptions, delinquencyBucket, dueDaysForRepaymentEvent,
|
||||
overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment, enableAutoRepaymentForDownPayment,
|
||||
paymentAllocation, creditAllocation, repaymentStartDateType, enableInstallmentLevelDelinquency, loanScheduleType,
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
}
|
||||
|
||||
@@ -455,6 +459,7 @@ public class LoanProductData implements Serializable {
|
||||
final EnumOptionData loanScheduleProcessingType = null;
|
||||
final boolean enableAccrualActivityPosting = false;
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypes = null;
|
||||
final StringEnumOptionData chargeOffBehaviour = null;
|
||||
|
||||
return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance,
|
||||
numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
||||
@@ -475,7 +480,7 @@ public class LoanProductData implements Serializable {
|
||||
fixedPrincipalPercentagePerInstallment, delinquencyBucketOptions, delinquencyBucket, dueDaysForRepaymentEvent,
|
||||
overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment, enableAutoRepaymentForDownPayment,
|
||||
paymentAllocation, creditAllocation, repaymentStartDateType, enableInstallmentLevelDelinquency, loanScheduleType,
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
}
|
||||
|
||||
@@ -584,6 +589,7 @@ public class LoanProductData implements Serializable {
|
||||
final EnumOptionData loanScheduleProcessingType = LoanScheduleProcessingType.HORIZONTAL.asEnumOptionData();
|
||||
final boolean enableAccrualActivityPosting = false;
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypes = null;
|
||||
final StringEnumOptionData chargeOffBehaviour = LoanChargeOffBehaviour.REGULAR.getValueAsStringEnumOptionData();
|
||||
|
||||
return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance,
|
||||
numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
||||
@@ -604,7 +610,7 @@ public class LoanProductData implements Serializable {
|
||||
fixedPrincipalPercentagePerInstallment, delinquencyBucketOptions, delinquencyBucket, dueDaysForRepaymentEvent,
|
||||
overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment, enableAutoRepaymentForDownPayment,
|
||||
paymentAllocation, creditAllocation, repaymentStartDateType, enableInstallmentLevelDelinquency, loanScheduleType,
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
}
|
||||
|
||||
@@ -707,6 +713,7 @@ public class LoanProductData implements Serializable {
|
||||
final EnumOptionData loanScheduleProcessingType = null;
|
||||
final boolean enableAccrualActivityPosting = false;
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypes = null;
|
||||
final StringEnumOptionData chargeOffBehaviour = null;
|
||||
|
||||
return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance,
|
||||
numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
||||
@@ -727,7 +734,7 @@ public class LoanProductData implements Serializable {
|
||||
fixedPrincipalPercentagePerInstallment, delinquencyBucketOptions, delinquencyBucket, dueDaysForRepaymentEvent,
|
||||
overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment, enableAutoRepaymentForDownPayment,
|
||||
paymentAllocation, creditAllocationData, repaymentStartDateType, enableInstallmentLevelDelinquency, loanScheduleType,
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
}
|
||||
|
||||
public static LoanProductData withAccountingDetails(final LoanProductData productData, final Map<String, Object> accountingMappings,
|
||||
@@ -778,7 +785,8 @@ public class LoanProductData implements Serializable {
|
||||
final Collection<AdvancedPaymentData> paymentAllocation, final Collection<CreditAllocationData> creditAllocation,
|
||||
final EnumOptionData repaymentStartDateType, final boolean enableInstallmentLevelDelinquency,
|
||||
final EnumOptionData loanScheduleType, final EnumOptionData loanScheduleProcessingType, final Integer fixedLength,
|
||||
final boolean enableAccrualActivityPosting, final List<StringEnumOptionData> supportedInterestRefundTypes) {
|
||||
final boolean enableAccrualActivityPosting, final List<StringEnumOptionData> supportedInterestRefundTypes,
|
||||
StringEnumOptionData chargeOffBehaviour) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.shortName = shortName;
|
||||
@@ -918,6 +926,8 @@ public class LoanProductData implements Serializable {
|
||||
this.enableAccrualActivityPosting = enableAccrualActivityPosting;
|
||||
this.supportedInterestRefundTypes = supportedInterestRefundTypes;
|
||||
this.supportedInterestRefundTypesOptions = null;
|
||||
this.chargeOffBehaviour = chargeOffBehaviour;
|
||||
this.chargeOffBehaviourOptions = null;
|
||||
this.chargeOffReasonOptions = null;
|
||||
}
|
||||
|
||||
@@ -941,7 +951,8 @@ public class LoanProductData implements Serializable {
|
||||
final List<EnumOptionData> advancedPaymentAllocationTypes, final List<EnumOptionData> loanScheduleTypeOptions,
|
||||
final List<EnumOptionData> loanScheduleProcessingTypeOptions, final List<EnumOptionData> creditAllocationTransactionTypes,
|
||||
final List<EnumOptionData> creditAllocationAllocationTypes,
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypesOptions, final List<CodeValueData> chargeOffReasonOptions) {
|
||||
final List<StringEnumOptionData> supportedInterestRefundTypesOptions,
|
||||
final List<StringEnumOptionData> chargeOffBehaviourOptions, final List<CodeValueData> chargeOffReasonOptions) {
|
||||
|
||||
this.id = productData.id;
|
||||
this.name = productData.name;
|
||||
@@ -1099,6 +1110,8 @@ public class LoanProductData implements Serializable {
|
||||
this.enableAccrualActivityPosting = productData.enableAccrualActivityPosting;
|
||||
this.supportedInterestRefundTypesOptions = supportedInterestRefundTypesOptions;
|
||||
this.supportedInterestRefundTypes = productData.supportedInterestRefundTypes;
|
||||
this.chargeOffBehaviour = productData.chargeOffBehaviour;
|
||||
this.chargeOffBehaviourOptions = chargeOffBehaviourOptions;
|
||||
this.chargeOffReasonOptions = chargeOffReasonOptions;
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -63,6 +63,7 @@ import org.apache.fineract.portfolio.floatingrates.data.FloatingRateDTO;
|
||||
import org.apache.fineract.portfolio.floatingrates.data.FloatingRatePeriodData;
|
||||
import org.apache.fineract.portfolio.floatingrates.domain.FloatingRate;
|
||||
import org.apache.fineract.portfolio.fund.domain.Fund;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanChargeOffBehaviour;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculator;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||
@@ -451,6 +452,15 @@ public class LoanProduct extends AbstractPersistableCustom<Long> {
|
||||
});
|
||||
}
|
||||
|
||||
final LoanChargeOffBehaviour chargeOffBehaviour;
|
||||
if (command.parameterExists(LoanProductConstants.CHARGE_OFF_BEHAVIOUR)) {
|
||||
chargeOffBehaviour = LoanChargeOffBehaviour
|
||||
.valueOf(command.stringValueOfParameterNamed(LoanProductConstants.CHARGE_OFF_BEHAVIOUR));
|
||||
} else {
|
||||
// For backward compatibility
|
||||
chargeOffBehaviour = LoanChargeOffBehaviour.REGULAR;
|
||||
}
|
||||
|
||||
return new LoanProduct(fund, loanTransactionProcessingStrategy, loanProductPaymentAllocationRules, loanProductCreditAllocationRules,
|
||||
name, shortName, description, currency, principal, minPrincipal, maxPrincipal, interestRatePerPeriod,
|
||||
minInterestRatePerPeriod, maxInterestRatePerPeriod, interestFrequencyType, annualInterestRate, interestMethod,
|
||||
@@ -470,7 +480,7 @@ public class LoanProduct extends AbstractPersistableCustom<Long> {
|
||||
allowApprovedDisbursedAmountsOverApplied, overAppliedCalculationType, overAppliedNumber, dueDaysForRepaymentEvent,
|
||||
overDueDaysForRepaymentEvent, enableDownPayment, disbursedAmountPercentageDownPayment, enableAutoRepaymentForDownPayment,
|
||||
repaymentStartDateType, enableInstallmentLevelDelinquency, loanScheduleType, loanScheduleProcessingType, fixedLength,
|
||||
enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
enableAccrualActivityPosting, supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
}
|
||||
|
||||
@@ -688,7 +698,8 @@ public class LoanProduct extends AbstractPersistableCustom<Long> {
|
||||
final boolean enableAutoRepaymentForDownPayment, final RepaymentStartDateType repaymentStartDateType,
|
||||
final boolean enableInstallmentLevelDelinquency, final LoanScheduleType loanScheduleType,
|
||||
final LoanScheduleProcessingType loanScheduleProcessingType, final Integer fixedLength,
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes) {
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes,
|
||||
final LoanChargeOffBehaviour chargeOffBehaviour) {
|
||||
this.fund = fund;
|
||||
this.transactionProcessingStrategyCode = transactionProcessingStrategyCode;
|
||||
|
||||
@@ -738,7 +749,7 @@ public class LoanProduct extends AbstractPersistableCustom<Long> {
|
||||
inArrearsTolerance, graceOnArrearsAgeing, daysInMonthType.getValue(), daysInYearType.getValue(),
|
||||
isInterestRecalculationEnabled, isEqualAmortization, enableDownPayment, disbursedAmountPercentageForDownPayment,
|
||||
enableAutoRepaymentForDownPayment, loanScheduleType, loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting,
|
||||
supportedInterestRefundTypes);
|
||||
supportedInterestRefundTypes, chargeOffBehaviour);
|
||||
|
||||
this.loanProductMinMaxConstraints = new LoanProductMinMaxConstraints(defaultMinPrincipal, defaultMaxPrincipal,
|
||||
defaultMinNominalInterestRatePerPeriod, defaultMaxNominalInterestRatePerPeriod, defaultMinNumberOfInstallments,
|
||||
|
||||
+12
-3
@@ -37,6 +37,7 @@ import org.apache.fineract.portfolio.common.domain.DaysInMonthType;
|
||||
import org.apache.fineract.portfolio.common.domain.DaysInYearType;
|
||||
import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanChargeOffBehaviour;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculator;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||
@@ -159,6 +160,10 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
@Column(name = "supported_interest_refund_types")
|
||||
private List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes = List.of();
|
||||
|
||||
@Column(name = "charge_off_behaviour")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private LoanChargeOffBehaviour chargeOffBehaviour;
|
||||
|
||||
public static LoanProductRelatedDetail createFrom(final MonetaryCurrency currency, final BigDecimal principal,
|
||||
final BigDecimal nominalInterestRatePerPeriod, final PeriodFrequencyType interestRatePeriodFrequencyType,
|
||||
final BigDecimal nominalAnnualInterestRate, final InterestMethod interestMethod,
|
||||
@@ -171,7 +176,8 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
final boolean enableDownPayment, final BigDecimal disbursedAmountPercentageForDownPayment,
|
||||
final boolean enableAutoRepaymentForDownPayment, final LoanScheduleType loanScheduleType,
|
||||
final LoanScheduleProcessingType loanScheduleProcessingType, final Integer fixedLength,
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes) {
|
||||
final boolean enableAccrualActivityPosting, final List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes,
|
||||
final LoanChargeOffBehaviour chargeOffBehaviour) {
|
||||
|
||||
return new LoanProductRelatedDetail(currency, principal, nominalInterestRatePerPeriod, interestRatePeriodFrequencyType,
|
||||
nominalAnnualInterestRate, interestMethod, interestCalculationPeriodMethod, allowPartialPeriodInterestCalcualtion,
|
||||
@@ -179,7 +185,8 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
recurringMoratoriumOnPrincipalPeriods, graceOnInterestPayment, graceOnInterestCharged, amortizationMethod,
|
||||
inArrearsTolerance, graceOnArrearsAgeing, daysInMonthType, daysInYearType, isInterestRecalculationEnabled,
|
||||
isEqualAmortization, enableDownPayment, disbursedAmountPercentageForDownPayment, enableAutoRepaymentForDownPayment,
|
||||
loanScheduleType, loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes);
|
||||
loanScheduleType, loanScheduleProcessingType, fixedLength, enableAccrualActivityPosting, supportedInterestRefundTypes,
|
||||
chargeOffBehaviour);
|
||||
}
|
||||
|
||||
protected LoanProductRelatedDetail() {
|
||||
@@ -198,7 +205,8 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
final boolean enableDownPayment, final BigDecimal disbursedAmountPercentageForDownPayment,
|
||||
final boolean enableAutoRepaymentForDownPayment, final LoanScheduleType loanScheduleType,
|
||||
final LoanScheduleProcessingType loanScheduleProcessingType, final Integer fixedLength,
|
||||
final boolean enableAccrualActivityPosting, List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes) {
|
||||
final boolean enableAccrualActivityPosting, List<LoanSupportedInterestRefundTypes> supportedInterestRefundTypes,
|
||||
final LoanChargeOffBehaviour chargeOffBehaviour) {
|
||||
this.currency = currency;
|
||||
this.principal = defaultPrincipal;
|
||||
this.nominalInterestRatePerPeriod = defaultNominalInterestRatePerPeriod;
|
||||
@@ -233,6 +241,7 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
|
||||
this.loanScheduleProcessingType = loanScheduleProcessingType;
|
||||
this.enableAccrualActivityPosting = enableAccrualActivityPosting;
|
||||
this.supportedInterestRefundTypes = supportedInterestRefundTypes;
|
||||
this.chargeOffBehaviour = chargeOffBehaviour;
|
||||
}
|
||||
|
||||
private Integer defaultToNullIfZero(final Integer value) {
|
||||
|
||||
+1
@@ -45,4 +45,5 @@
|
||||
<include relativeToChangelogFile="true" file="parts/1020_add_re_aged_flag_to_loan_installment.xml"/>
|
||||
<include relativeToChangelogFile="true" file="parts/1021_add_loan_status_change_history.xml"/>
|
||||
<include relativeToChangelogFile="true" file="parts/1022_add_interest_refund_support.xml"/>
|
||||
<include relativeToChangelogFile="true" file="parts/1023_add_charge_off_behaviour.xml"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
|
||||
|
||||
<changeSet author="fineract" id="1023-1">
|
||||
<addColumn tableName="m_product_loan">
|
||||
<column name="charge_off_behaviour" type="varchar(20)" defaultValue="REGULAR"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet author="fineract" id="1023-2">
|
||||
<addColumn tableName="m_loan">
|
||||
<column name="charge_off_behaviour" type="varchar(20)" defaultValue="REGULAR"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user