fix: Loan Product settings day in year custom strategy
This commit is contained in:
+14
@@ -639,6 +639,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
|
|||||||
'chargeOffBehaviour',
|
'chargeOffBehaviour',
|
||||||
new UntypedFormControl(this.loanProductsTemplate.chargeOffBehaviour.id)
|
new UntypedFormControl(this.loanProductsTemplate.chargeOffBehaviour.id)
|
||||||
);
|
);
|
||||||
|
this.validateAdvancedPaymentStrategyControls();
|
||||||
}
|
}
|
||||||
if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) {
|
if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) {
|
||||||
this.setRescheduleStrategies();
|
this.setRescheduleStrategies();
|
||||||
@@ -720,6 +721,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
|
|||||||
|
|
||||||
private validateAdvancedPaymentStrategyControls(): void {
|
private validateAdvancedPaymentStrategyControls(): void {
|
||||||
if (this.isAdvancedTransactionProcessingStrategy) {
|
if (this.isAdvancedTransactionProcessingStrategy) {
|
||||||
|
const daysInYearType: any = this.loanProductSettingsForm.get('daysInYearType').value;
|
||||||
this.loanProductSettingsForm.addControl(
|
this.loanProductSettingsForm.addControl(
|
||||||
'loanScheduleProcessingType',
|
'loanScheduleProcessingType',
|
||||||
new UntypedFormControl(
|
new UntypedFormControl(
|
||||||
@@ -728,8 +730,20 @@ export class LoanProductSettingsStepComponent implements OnInit {
|
|||||||
[Validators.required]
|
[Validators.required]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
this.useDaysInYearCustomStrategy = daysInYearType === 1;
|
||||||
|
if (this.useDaysInYearCustomStrategy) {
|
||||||
|
const daysInYearCustomStrategy: string = this.loanProductsTemplate.daysInYearCustomStrategy?.id
|
||||||
|
? this.loanProductsTemplate.daysInYearCustomStrategy.id
|
||||||
|
: '';
|
||||||
|
this.loanProductSettingsForm.addControl(
|
||||||
|
'daysInYearCustomStrategy',
|
||||||
|
new UntypedFormControl(daysInYearCustomStrategy, Validators.required)
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
this.useDaysInYearCustomStrategy = false;
|
||||||
this.loanProductSettingsForm.removeControl('loanScheduleProcessingType');
|
this.loanProductSettingsForm.removeControl('loanScheduleProcessingType');
|
||||||
|
this.loanProductSettingsForm.removeControl('daysInYearCustomStrategy');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user