Merge pull request #2744 from JaySoni1/WEB-373-javascript-error-message-opening-the-first-step-of-create-loans-account

WEB-373 Javascript error message opening the first step of  Create Loans Account
This commit is contained in:
Gopi Kishan
2025-11-04 14:17:46 +05:30
committed by GitHub
@@ -204,7 +204,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
isEqualAmortization: this.loansAccountTermsData.isEqualAmortization, isEqualAmortization: this.loansAccountTermsData.isEqualAmortization,
interestType: this.loansAccountTermsData.interestType.id, interestType: this.loansAccountTermsData.interestType.id,
// TODO: 2025-03-17: Is this correct? // TODO: 2025-03-17: Is this correct?
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : null,
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id, interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation, allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance, inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
@@ -291,12 +291,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
if (this.allowAddDisbursementDetails()) { if (this.allowAddDisbursementDetails()) {
this.loansAccountTermsForm.addControl( this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance', 'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance, Validators.required) new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null, Validators.required)
); );
} else { } else {
this.loansAccountTermsForm.addControl( this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance', '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, amortizationType: this.loansAccountTermsData.amortizationType.id,
isEqualAmortization: this.loansAccountTermsData.isEqualAmortization, isEqualAmortization: this.loansAccountTermsData.isEqualAmortization,
interestType: this.loansAccountTermsData.interestType.id, interestType: this.loansAccountTermsData.interestType.id,
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : null,
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id, interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation, allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance, inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
@@ -358,12 +358,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
this.loansAccountTermsForm.removeControl('maxOutstandingLoanBalance'); this.loansAccountTermsForm.removeControl('maxOutstandingLoanBalance');
this.loansAccountTermsForm.addControl( this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance', 'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance, Validators.required) new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null, Validators.required)
); );
} else { } else {
this.loansAccountTermsForm.addControl( this.loansAccountTermsForm.addControl(
'maxOutstandingLoanBalance', 'maxOutstandingLoanBalance',
new UntypedFormControl(this.loansAccountTermsData.maxOutstandingLoanBalance) new UntypedFormControl(this.loansAccountTermsData?.maxOutstandingLoanBalance ?? null)
); );
} }
} }
@@ -492,7 +492,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
interestChargedFromDate: [''], interestChargedFromDate: [''],
interestRatePerPeriod: [''], interestRatePerPeriod: [''],
interestType: [''], interestType: [''],
isFloatingInterestRate: [''], isFloatingInterestRate: [null],
isEqualAmortization: [''], isEqualAmortization: [''],
amortizationType: [ amortizationType: [
'', '',