Loan Account Creation Fix
This commit is contained in:
@@ -132,8 +132,8 @@ export class CreateLoansAccountComponent implements OnInit {
|
||||
loansAccountData.recalculationRestFrequencyDate = this.datePipe.transform(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
|
||||
}
|
||||
|
||||
if (loansAccountData.recalculationCompoundingFrequencyDate) {
|
||||
loansAccountData.recalculationCompoundingFrequencyDate = this.datePipe.transform(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
|
||||
if (!loansAccountData.recalculationCompoundingFrequencyDate) {
|
||||
delete loansAccountData.recalculationCompoundingFrequencyDate;
|
||||
}
|
||||
|
||||
if (loansAccountData.interestCalculationPeriodType === 0) {
|
||||
|
||||
+23
@@ -92,6 +92,29 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
});
|
||||
}
|
||||
}
|
||||
this.createloansAccountTermsForm();
|
||||
this.setCustomValidators();
|
||||
}
|
||||
|
||||
/** Custom Validators for the form */
|
||||
setCustomValidators() {
|
||||
const repaymentFrequencyNthDayType = this.loansAccountTermsForm.get('repaymentFrequencyNthDayType');
|
||||
const repaymentFrequencyDayOfWeekType = this.loansAccountTermsForm.get('repaymentFrequencyDayOfWeekType');
|
||||
|
||||
this.loansAccountTermsForm.get('repaymentFrequencyType').valueChanges
|
||||
.subscribe(repaymentFrequencyType => {
|
||||
|
||||
if (repaymentFrequencyType === 2) {
|
||||
repaymentFrequencyNthDayType.setValidators([Validators.required]);
|
||||
repaymentFrequencyDayOfWeekType.setValidators([Validators.required]);
|
||||
}else{
|
||||
repaymentFrequencyNthDayType.setValidators(null);
|
||||
repaymentFrequencyDayOfWeekType.setValidators(null);
|
||||
}
|
||||
|
||||
repaymentFrequencyNthDayType.updateValueAndValidity();
|
||||
repaymentFrequencyDayOfWeekType.updateValueAndValidity();
|
||||
});
|
||||
}
|
||||
|
||||
/** Create Loans Account Terms Form */
|
||||
|
||||
Reference in New Issue
Block a user