WEB-373 Javascript error message opening the first step of Create Loans Account

This commit is contained in:
JaySoni1
2025-11-04 05:48:37 +05:30
parent 0fdf1fdf86
commit 1d16295e8f
@@ -204,7 +204,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
isEqualAmortization: this.loansAccountTermsData.isEqualAmortization,
interestType: this.loansAccountTermsData.interestType.id,
// TODO: 2025-03-17: Is this correct?
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '',
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : null,
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
@@ -291,12 +291,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
if (this.allowAddDisbursementDetails()) {
this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance, Validators.required)
new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null, Validators.required)
);
} else {
this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance)
new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null)
);
}
}
@@ -330,7 +330,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
amortizationType: this.loansAccountTermsData.amortizationType.id,
isEqualAmortization: this.loansAccountTermsData.isEqualAmortization,
interestType: this.loansAccountTermsData.interestType.id,
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '',
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : null,
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
@@ -358,12 +358,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
this.loansAccountTermsForm.removeControl('maxOutstandingLoanBalance');
this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance, Validators.required)
new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null, Validators.required)
);
} else {
this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance)
new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null)
);
}
}
@@ -492,7 +492,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
interestChargedFromDate: [''],
interestRatePerPeriod: [''],
interestType: [''],
isFloatingInterestRate: [''],
isFloatingInterestRate: [null],
isEqualAmortization: [''],
amortizationType: [
'',