WEB-290: Introduce classification field on loan transactions

This commit is contained in:
Jose Alberto Hernandez
2025-08-25 08:32:34 -05:00
parent 464d60921b
commit c67fca5f90
3 changed files with 21 additions and 0 deletions
@@ -68,6 +68,15 @@
<input matInput formControlName="externalId" /> <input matInput formControlName="externalId" />
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="isCapitalizedIncome()">
<mat-label>{{ 'labels.inputs.Classification' | translate }}</mat-label>
<mat-select formControlName="classificationId">
<mat-option *ngFor="let classificationOption of classificationOptions" [value]="classificationOption.id">
{{ classificationOption.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label> <mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId"> <mat-select formControlName="paymentTypeId">
@@ -47,6 +47,8 @@ export class MakeRepaymentComponent implements OnInit {
command: string | null = null; command: string | null = null;
classificationOptions: any[] = [];
/** /**
* @param {FormBuilder} formBuilder Form Builder. * @param {FormBuilder} formBuilder Form Builder.
* @param {LoansService} loanService Loan Service. * @param {LoansService} loanService Loan Service.
@@ -102,6 +104,7 @@ export class MakeRepaymentComponent implements OnInit {
Validators.min(0.001), Validators.min(0.001),
Validators.max(this.dataObject.amount)]) Validators.max(this.dataObject.amount)])
); );
this.repaymentLoanForm.addControl('classificationId', new UntypedFormControl(''));
} else { } else {
this.repaymentLoanForm.addControl( this.repaymentLoanForm.addControl(
'transactionAmount', 'transactionAmount',
@@ -114,6 +117,7 @@ export class MakeRepaymentComponent implements OnInit {
setRepaymentLoanDetails() { setRepaymentLoanDetails() {
this.paymentTypes = this.dataObject.paymentTypeOptions; this.paymentTypes = this.dataObject.paymentTypeOptions;
this.classificationOptions = this.dataObject.classificationOptions;
this.repaymentLoanForm.patchValue({ this.repaymentLoanForm.patchValue({
transactionAmount: this.dataObject.amount transactionAmount: this.dataObject.amount
}); });
@@ -82,6 +82,14 @@
></mifosx-external-identifier> ></mifosx-external-identifier>
</div> </div>
<div class="flex-50 mat-body-strong" *ngIf="transactionData.classification">
{{ 'Classification' | translateKey: 'catalogs' }}
</div>
<div class="flex-50" *ngIf="transactionData.classification">
{{ transactionData.classification.name }}
</div>
<mat-divider *ngIf="existTransactionRelations" [inset]="true"></mat-divider> <mat-divider *ngIf="existTransactionRelations" [inset]="true"></mat-divider>
<div class="mat-body-strong flex-100" *ngIf="existTransactionRelations"> <div class="mat-body-strong flex-100" *ngIf="existTransactionRelations">