From 8fe04b08a341061ff93eac596366e898d1fadfb8 Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Fri, 9 May 2025 20:59:35 -0500 Subject: [PATCH] Capitalized Income - Adjustment Transaction --- .../make-repayment.component.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts index 538ae9b32..10554c94c 100644 --- a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts @@ -65,7 +65,6 @@ export class MakeRepaymentComponent implements OnInit { if (this.dataObject.currency) { this.currency = this.dataObject.currency; } - this.command = this.dataObject.type.code.split('.')[1]; } /** @@ -82,12 +81,22 @@ export class MakeRepaymentComponent implements OnInit { note: '' }); - this.repaymentLoanForm.addControl( - 'transactionAmount', - new UntypedFormControl('', [ - Validators.required, - Validators.min(0.001)]) - ); + if (this.isCapitalizedIncome()) { + this.repaymentLoanForm.addControl( + 'transactionAmount', + new UntypedFormControl('', [ + Validators.required, + Validators.min(0.001), + Validators.max(this.dataObject.amount)]) + ); + } else { + this.repaymentLoanForm.addControl( + 'transactionAmount', + new UntypedFormControl('', [ + Validators.required, + Validators.min(0.001)]) + ); + } } setRepaymentLoanDetails() {