Enhancement in loan payment views (#1667)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-01-31 18:36:36 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent ffea817f76
commit b9a9a8694c
12 changed files with 73 additions and 25 deletions
@@ -37,6 +37,8 @@ export class PrepayLoanComponent implements OnInit {
/** Prepay Loan form. */
prepayLoanForm: FormGroup;
prepayData: any;
/**
* @param {FormBuilder} formBuilder Form Builder.
* @param {LoansService} loanService Loan Service.
@@ -61,6 +63,7 @@ export class PrepayLoanComponent implements OnInit {
this.maxDate = this.settingsService.businessDate;
this.createprepayLoanForm();
this.setPrepayLoanDetails();
this.prepayData = this.dataObject;
}
/**
@@ -84,6 +87,17 @@ export class PrepayLoanComponent implements OnInit {
this.prepayLoanForm.patchValue({
transactionAmount: this.dataObject.amount
});
this.prepayLoanForm.get('transactionDate').valueChanges.subscribe((transactionDate: string) => {
const prepayDate = this.dateUtils.formatDate(transactionDate, this.settingsService.dateFormat);
this.loanService.getLoanPrepayLoanActionTemplate(this.loanId, prepayDate)
.subscribe((response: any) => {
this.prepayData = response;
this.prepayLoanForm.patchValue({
transactionAmount: this.prepayData.amount
});
});
});
}
/**