<mat-expansion-panel [expanded]="active" (afterExpand)="afterExpand()">
	<mat-expansion-panel-header>
		<mat-panel-description>
			<h4>{{account.account.name}}</h4>
			<h4>
				{{account.rest | number: '1.2-6'}}
				({{account.account.currencyId}})
			</h4>
		</mat-panel-description>
	</mat-expansion-panel-header>
	<form [formGroup]="form!" (ngSubmit)="onSubmitClick()">
		<div class="row">
			<div class="col-md-6">
				<mat-form-field class="example-full-width" appearance="fill">
					<mat-label>From</mat-label>
					<input matInput [matDatepicker]="pickerFrom" (focus)="pickerFrom.open()" formControlName="dateFrom" required>
					<mat-hint>YYYY/MM/DD</mat-hint>
					<mat-datepicker-toggle tabindex="-1" matSuffix [for]="pickerFrom"></mat-datepicker-toggle>
					<mat-datepicker #pickerFrom></mat-datepicker>
					<mat-error *ngIf="form.controls?.['dateFrom']?.hasError('required')">
						Please enter rate date
					</mat-error>
				</mat-form-field>
			</div>
			<div class="col-md-6">
				<mat-form-field class="example-full-width" appearance="fill">
					<mat-label>To</mat-label>
					<input matInput [matDatepicker]="pickerTo" (focus)="pickerTo.open()" formControlName="dateTo" required>
					<mat-hint>YYYY/MM/DD</mat-hint>
					<mat-datepicker-toggle tabindex="-1" matSuffix [for]="pickerTo"></mat-datepicker-toggle>
					<mat-datepicker #pickerTo></mat-datepicker>
					<mat-error *ngIf="form.controls?.['dateTo']?.hasError('required')">
						Please enter rate date
					</mat-error>
				</mat-form-field>
			</div>
		</div>
	</form>
	<hr />
	<account-motion [motion]="newMotion" [account]="account.account" (onAdd)="handlerOnAdd($event)">
	</account-motion>
	<account-motion *ngFor="let motion of motions"
					[motion]="motion"
					[account]="account.account"
					(onDelete)="handlerOnDelete($event)">
	</account-motion>
</mat-expansion-panel>
