66 lines
2.2 KiB
HTML
66 lines
2.2 KiB
HTML
<h2 class="row-container space-between">
|
|
<span>Customers</span>
|
|
<a mat-button [routerLink]="['/customers', 'new']">
|
|
<mat-icon>add_box</mat-icon>
|
|
Add
|
|
</a>
|
|
</h2>
|
|
<form [formGroup]="form" class="flex-col">
|
|
<div class="flex-row">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Filter</mat-label>
|
|
<input type="text" matInput #filterElement formControlName="filter" autocomplete="off" />
|
|
</mat-form-field>
|
|
</div>
|
|
</form>
|
|
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
|
<!-- Name Column -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
|
<mat-cell *matCellDef="let row"
|
|
><a [routerLink]="['/customers', row.id]">{{ row.name }}</a></mat-cell
|
|
>
|
|
</ng-container>
|
|
|
|
<!-- Phone Column -->
|
|
<ng-container matColumnDef="phone">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Phone</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.phone }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Address Column -->
|
|
<ng-container matColumnDef="address">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Address</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.address }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Print In Bill Column -->
|
|
<ng-container matColumnDef="printInBill">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Print in Bill</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.printInBill }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Discounts Column -->
|
|
<ng-container matColumnDef="discounts">
|
|
<mat-header-cell *matHeaderCellDef>Discounts</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<ul>
|
|
@for (discount of row.discounts; track discount) {
|
|
<li>{{ discount.name }} - {{ discount.discount | percent: '1.2-2' }}</li>
|
|
}
|
|
</ul>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
|
</mat-table>
|
|
<mat-paginator
|
|
#paginator
|
|
[length]="dataSource.data.total"
|
|
[pageIndex]="0"
|
|
[pageSize]="50"
|
|
[pageSizeOptions]="[25, 50, 100, 250, 5000]"
|
|
>
|
|
</mat-paginator>
|