105 lines
3.9 KiB
HTML
105 lines
3.9 KiB
HTML
<mat-card>
|
|
<mat-card-title-group>
|
|
<mat-card-title>Daybook</mat-card-title>
|
|
</mat-card-title-group>
|
|
<mat-card-content>
|
|
<form [formGroup]="form" class="flex flex-col">
|
|
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
|
|
<mat-form-field class="flex-auto basis-2/5 mr-5">
|
|
<input
|
|
matInput
|
|
[matDatepicker]="startDate"
|
|
(focus)="startDate.open()"
|
|
placeholder="Start Date"
|
|
formControlName="startDate"
|
|
autocomplete="off"
|
|
/>
|
|
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
|
<mat-datepicker #startDate></mat-datepicker>
|
|
</mat-form-field>
|
|
<mat-form-field class="flex-auto basis-2/5 mr-5">
|
|
<input
|
|
matInput
|
|
[matDatepicker]="finishDate"
|
|
(focus)="finishDate.open()"
|
|
placeholder="Finish Date"
|
|
formControlName="finishDate"
|
|
autocomplete="off"
|
|
/>
|
|
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
|
|
<mat-datepicker #finishDate></mat-datepicker>
|
|
</mat-form-field>
|
|
<button class="flex-auto basis-1/5" mat-raised-button color="primary" (click)="show()">
|
|
Show
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
|
<!-- Date Column -->
|
|
<ng-container matColumnDef="date">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Date</mat-header-cell>
|
|
<mat-cell *matCellDef="let row"
|
|
><a [routerLink]="row.url">{{ row.date }}</a></mat-cell
|
|
>
|
|
</ng-container>
|
|
|
|
<!-- Type Column -->
|
|
<ng-container matColumnDef="type">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.type }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Narration Column -->
|
|
<ng-container matColumnDef="narration">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Narration</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.narration }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- DebitText Column -->
|
|
<ng-container matColumnDef="debitText">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Debit Accounts</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.debitText }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Debit Column -->
|
|
<ng-container matColumnDef="debitAmount">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Amount</mat-header-cell>
|
|
<mat-cell *matCellDef="let row" class="right">{{
|
|
row.debitAmount | currency: 'INR'
|
|
}}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- CreditText Column -->
|
|
<ng-container matColumnDef="creditText">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Credit Accounts</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.creditText }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Credit Column -->
|
|
<ng-container matColumnDef="creditAmount">
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Amount</mat-header-cell>
|
|
<mat-cell *matCellDef="let row" class="right">{{
|
|
row.creditAmount | currency: 'INR'
|
|
}}</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row
|
|
*matRowDef="let row; columns: displayedColumns"
|
|
[class.selected]="selectedRowId === row.id"
|
|
[class.unposted]="!row.posted && selectedRowId !== row.id"
|
|
(click)="selectRow(row.id)"
|
|
></mat-row>
|
|
</mat-table>
|
|
|
|
<mat-paginator
|
|
#paginator
|
|
[length]="dataSource.data.length"
|
|
[pageIndex]="0"
|
|
[pageSize]="50"
|
|
[pageSizeOptions]="[25, 50, 100, 250, 300]"
|
|
>
|
|
</mat-paginator>
|
|
</mat-card-content>
|
|
</mat-card>
|