diff --git a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts index 9d43097a9..dbcc72eb8 100644 --- a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts +++ b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts @@ -116,5 +116,4 @@ export class EditLoanProductComponent implements OnInit { }); } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html index f6a8e32f9..3680ba666 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html @@ -71,6 +71,17 @@ {{ loanProduct.principal + ' (Min: ' + (loanProduct.minPrincipal ? loanProduct.minPrincipal : loanProduct.principal) + ', Max: ' + (loanProduct.maxPrincipal ? loanProduct.maxPrincipal : loanProduct.principal) + ')' }} +
+ Allow Approved / Disbursed Amounts Over Applied: + {{ loanProduct.allowApprovedDisbursedAmountsOverApplied ? 'Yes' : 'No' }} +
+ +
+ Over Applied: + {{ loanProduct.overAppliedNumber }} % + {{ loanProduct.overAppliedNumber }} {{ loanProduct.currencyCode }} +
+
Number of Repayments: {{ loanProduct.numberOfRepayments + ' (Min: ' + (loanProduct.minNumberOfRepayments ? loanProduct.minNumberOfRepayments : loanProduct.numberOfRepayments) + ', Max: ' + (loanProduct.maxNumberOfRepayments ? loanProduct.maxNumberOfRepayments : loanProduct.numberOfRepayments) + ')' }} diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html index 75cd87737..fb7e6da33 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html @@ -22,6 +22,24 @@ + + Allow approval / disbursal above loan applied amount? + + + + Over Amount Calculation Type + + + {{ overAppliedCalculationType.value }} + + + + + + Over Amount + + +

Number of repayments

diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts index c59034083..2c0390157 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts @@ -23,6 +23,7 @@ export class LoanProductTermsStepComponent implements OnInit { valueConditionTypeData: any; floatingRateData: any; interestRateFrequencyTypeData: any; + overAppliedCalculationTypeData: any; repaymentFrequencyTypeData: any; displayedColumns: string[] = ['valueConditionType', 'borrowerCycleNumber', 'minValue', 'defaultValue', 'maxValue', 'actions']; @@ -38,6 +39,7 @@ export class LoanProductTermsStepComponent implements OnInit { this.floatingRateData = this.loanProductsTemplate.floatingRateOptions; this.interestRateFrequencyTypeData = this.loanProductsTemplate.interestRateFrequencyTypeOptions; this.repaymentFrequencyTypeData = this.loanProductsTemplate.repaymentFrequencyTypeOptions; + this.overAppliedCalculationTypeData = [{id: 'percentage', value: 'Percentage'}, {id: 'flat', value: 'Fixed Amount'}]; this.loanProductTermsForm.patchValue({ 'minPrincipal': this.loanProductsTemplate.minPrincipal, @@ -54,6 +56,7 @@ export class LoanProductTermsStepComponent implements OnInit { 'floatingRatesId': this.loanProductsTemplate.floatingRateId, 'interestRateDifferential': this.loanProductsTemplate.interestRateDifferential, 'isFloatingInterestRateCalculationAllowed': this.loanProductsTemplate.isFloatingInterestRateCalculationAllowed, + 'allowApprovedDisbursedAmountsOverApplied': this.loanProductsTemplate.allowApprovedDisbursedAmountsOverApplied, 'minDifferentialLendingRate': this.loanProductsTemplate.minDifferentialLendingRate, 'defaultDifferentialLendingRate': this.loanProductsTemplate.defaultDifferentialLendingRate, 'maxDifferentialLendingRate': this.loanProductsTemplate.maxDifferentialLendingRate, @@ -63,6 +66,13 @@ export class LoanProductTermsStepComponent implements OnInit { 'minimumDaysBetweenDisbursalAndFirstRepayment': this.loanProductsTemplate.minimumDaysBetweenDisbursalAndFirstRepayment }); + if (this.loanProductsTemplate.allowApprovedDisbursedAmountsOverApplied) { + this.loanProductTermsForm.patchValue({ + 'overAppliedCalculationType': this.loanProductsTemplate.overAppliedCalculationType, + 'overAppliedNumber': this.loanProductsTemplate.overAppliedNumber, + }); + } + this.loanProductTermsForm.setControl('principalVariationsForBorrowerCycle', this.formBuilder.array(this.loanProductsTemplate.principalVariationsForBorrowerCycle.map((variation: any) => ({ ...variation, valueConditionType: variation.valueConditionType.id })))); this.loanProductTermsForm.setControl('numberOfRepaymentVariationsForBorrowerCycle', @@ -81,6 +91,7 @@ export class LoanProductTermsStepComponent implements OnInit { 'numberOfRepayments': ['', Validators.required], 'maxNumberOfRepayments': [''], 'isLinkedToFloatingInterestRates': [false], + 'allowApprovedDisbursedAmountsOverApplied': [false], 'minInterestRatePerPeriod': [''], 'interestRatePerPeriod': ['', Validators.required], 'maxInterestRatePerPeriod': [''], @@ -92,6 +103,20 @@ export class LoanProductTermsStepComponent implements OnInit { } setConditionalControls() { + this.loanProductTermsForm.get('allowApprovedDisbursedAmountsOverApplied').valueChanges + .subscribe(allowApprovedDisbursedAmountsOverApplied => { + if (allowApprovedDisbursedAmountsOverApplied) { + this.loanProductTermsForm.addControl('overAppliedCalculationType', new FormControl('')); + this.loanProductTermsForm.addControl('overAppliedNumber', new FormControl('')); + this.loanProductTermsForm.addControl('disallowExpectedDisbursements', new FormControl('true')); + } else { + this.loanProductTermsForm.removeControl('overAppliedCalculationType'); + this.loanProductTermsForm.removeControl('overAppliedNumber'); + this.loanProductTermsForm.removeControl('disallowExpectedDisbursements'); + } + } + ); + this.loanProductTermsForm.get('isLinkedToFloatingInterestRates').valueChanges .subscribe(isLinkedToFloatingInterestRates => { if (isLinkedToFloatingInterestRates) { diff --git a/src/app/products/loan-products/view-loan-product/view-loan-product.component.html b/src/app/products/loan-products/view-loan-product/view-loan-product.component.html index eec70813e..84c5d64e8 100644 --- a/src/app/products/loan-products/view-loan-product/view-loan-product.component.html +++ b/src/app/products/loan-products/view-loan-product/view-loan-product.component.html @@ -84,6 +84,17 @@ {{ loanProduct.principal + ' (Min: ' + (loanProduct.minPrincipal ? loanProduct.minPrincipal : loanProduct.principal) + ', Max: ' + (loanProduct.maxPrincipal ? loanProduct.maxPrincipal : loanProduct.principal) + ')' }}
+
+ Allow Approved / Disbursed Amounts Over Applied: + {{ loanProduct.allowApprovedDisbursedAmountsOverApplied ? 'Yes' : 'No' }} +
+ +
+ Over Applied Amount: + {{ loanProduct.overAppliedNumber }} % + {{ loanProduct.overAppliedNumber }} {{ loanProduct.currencyCode }} +
+
Number of Repayments: {{ loanProduct.numberOfRepayments + ' (Min: ' + (loanProduct.minNumberOfRepayments ? loanProduct.minNumberOfRepayments : loanProduct.numberOfRepayments) + ', Max: ' + (loanProduct.maxNumberOfRepayments ? loanProduct.maxNumberOfRepayments : loanProduct.numberOfRepayments) + ')' }}