WEB-232: Reset overAppliedCalculationType and overAppliedNumber fields when 'Allow approval / disbursal above loan applied amount' is unchecked
This commit is contained in:
+8
-4
@@ -202,6 +202,8 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges {
|
|||||||
maxNumberOfRepayments: [''],
|
maxNumberOfRepayments: [''],
|
||||||
isLinkedToFloatingInterestRates: [false],
|
isLinkedToFloatingInterestRates: [false],
|
||||||
allowApprovedDisbursedAmountsOverApplied: [false],
|
allowApprovedDisbursedAmountsOverApplied: [false],
|
||||||
|
overAppliedCalculationType: [{ value: null, disabled: true }],
|
||||||
|
overAppliedNumber: [{ value: null, disabled: true }],
|
||||||
minInterestRatePerPeriod: [''],
|
minInterestRatePerPeriod: [''],
|
||||||
interestRatePerPeriod: [
|
interestRatePerPeriod: [
|
||||||
'',
|
'',
|
||||||
@@ -236,12 +238,14 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges {
|
|||||||
.get('allowApprovedDisbursedAmountsOverApplied')
|
.get('allowApprovedDisbursedAmountsOverApplied')
|
||||||
.valueChanges.subscribe((allowApprovedDisbursedAmountsOverApplied) => {
|
.valueChanges.subscribe((allowApprovedDisbursedAmountsOverApplied) => {
|
||||||
if (allowApprovedDisbursedAmountsOverApplied) {
|
if (allowApprovedDisbursedAmountsOverApplied) {
|
||||||
this.loanProductTermsForm.addControl('overAppliedCalculationType', new UntypedFormControl(''));
|
this.loanProductTermsForm.get('overAppliedCalculationType').enable();
|
||||||
this.loanProductTermsForm.addControl('overAppliedNumber', new UntypedFormControl(''));
|
this.loanProductTermsForm.get('overAppliedNumber').enable();
|
||||||
this.loanProductTermsForm.addControl('disallowExpectedDisbursements', new UntypedFormControl('true'));
|
this.loanProductTermsForm.addControl('disallowExpectedDisbursements', new UntypedFormControl('true'));
|
||||||
} else {
|
} else {
|
||||||
this.loanProductTermsForm.removeControl('overAppliedCalculationType');
|
this.loanProductTermsForm.get('overAppliedCalculationType').disable();
|
||||||
this.loanProductTermsForm.removeControl('overAppliedNumber');
|
this.loanProductTermsForm.get('overAppliedCalculationType').patchValue(null);
|
||||||
|
this.loanProductTermsForm.get('overAppliedNumber').disable();
|
||||||
|
this.loanProductTermsForm.get('overAppliedNumber').patchValue(null);
|
||||||
this.loanProductTermsForm.removeControl('disallowExpectedDisbursements');
|
this.loanProductTermsForm.removeControl('disallowExpectedDisbursements');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user