diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html index 8bc3a8d34..94bde8d64 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.html @@ -3,16 +3,6 @@
- - - {{ 'labels.inputs.Number of Installments' | translate }} @@ -80,6 +70,30 @@ {{ 'labels.inputs.Note' | translate }} + +
+ + +
+ {{ 'labels.inputs.Transaction Amount' | translate }} +
+
+
+
+ + +
diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts index feec42f4b..b5b8514c7 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts @@ -11,6 +11,7 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; import { ReAgePreviewDialogComponent } from './re-age-preview-dialog/re-age-preview-dialog.component'; import { InputAmountComponent } from 'app/shared/input-amount/input-amount.component'; import { LoanTransactionTemplate } from 'app/loans/models/loan-transaction-type.model'; +import { MatSlideToggle } from '@angular/material/slide-toggle'; @Component({ selector: 'mifosx-loan-reaging', @@ -18,7 +19,8 @@ import { LoanTransactionTemplate } from 'app/loans/models/loan-transaction-type. styleUrls: ['./loan-reaging.component.scss'], imports: [ ...STANDALONE_SHARED_IMPORTS, - InputAmountComponent + InputAmountComponent, + MatSlideToggle ] }) export class LoanReagingComponent implements OnInit { @@ -38,6 +40,7 @@ export class LoanReagingComponent implements OnInit { maxDate = new Date(); loanTransactionData: LoanTransactionTemplate | null = null; + addTransactionAmount = false; constructor( private formBuilder: UntypedFormBuilder, @@ -84,7 +87,7 @@ export class LoanReagingComponent implements OnInit { this.reAgeInterestHandlingOptions[0] ], transactionAmount: [ - this.loanTransactionData.amount, + , [Validators.max(this.loanTransactionData.amount)] ], note: '', @@ -143,10 +146,10 @@ export class LoanReagingComponent implements OnInit { } submit(): void { - if (this.reagingLoanForm.invalid) { - return; - } const data = this.prepareReagingData(); + if (data['transactionAmount'] === null) { + delete data['transactionAmount']; + } this.loanService.submitLoanActionButton(this.loanId, data, 'reAge').subscribe({ next: (response: any) => { this.router.navigate(['../../transactions'], { relativeTo: this.route }); diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.html b/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.html index e33efb236..2a2c9d3db 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.html +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.html @@ -1,4 +1,4 @@ -

{{ 'labels.heading.Repayment Schedule Preview' | translate }}

+

{{ 'labels.heading.Repayment Schedule Preview' | translate }}

- - diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.ts index aa5a63de3..dfa621e9b 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/re-age-preview-dialog/re-age-preview-dialog.component.ts @@ -1,11 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { - MAT_DIALOG_DATA, - MatDialogRef, - MatDialogTitle, - MatDialogContent, - MatDialogActions -} from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { MatButton } from '@angular/material/button'; import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; import { RepaymentSchedule } from 'app/loans/models/loan-account.model'; @@ -22,7 +16,6 @@ export interface ReAgePreviewDialogData { styleUrls: ['./re-age-preview-dialog.component.scss'], imports: [ ...STANDALONE_SHARED_IMPORTS, - MatDialogTitle, MatDialogContent, MatDialogActions, MatButton,