Feature: Added feature to click a name in receive payment to fill in the amount in that column
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||
|
||||
@ -99,4 +99,10 @@ export class ReceivePaymentComponent {
|
||||
accept(): void {
|
||||
this.dialogRef.close({ choices: this.choices, reason: this.reason });
|
||||
}
|
||||
|
||||
maxAmount(row: ReceivePaymentItem, index: number) {
|
||||
const array = this.form.get('amounts') as FormArray;
|
||||
const ctrl = array.controls[index].get('amount') as FormControl;
|
||||
ctrl.setValue('' + (row.amount + this.balance));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user