2018-05-25 13:49:00 +00:00
|
|
|
<mat-card>
|
|
|
|
<mat-card-title-group>
|
|
|
|
<mat-card-title>Ledger</mat-card-title>
|
|
|
|
<button mat-button mat-icon-button *ngIf="dataSource.data.length" (click)="exportCsv()">
|
|
|
|
<mat-icon>save_alt</mat-icon>
|
|
|
|
</button>
|
|
|
|
</mat-card-title-group>
|
|
|
|
<mat-card-content>
|
|
|
|
<form [formGroup]="form" fxLayout="column">
|
2020-10-01 15:21:22 +00:00
|
|
|
<div
|
|
|
|
fxLayout="row"
|
|
|
|
fxLayout.lt-md="column"
|
|
|
|
fxLayoutGap="20px"
|
|
|
|
fxLayoutGap.lt-md="0px"
|
|
|
|
fxLayoutAlign="space-around start"
|
|
|
|
>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-form-field fxFlex>
|
2020-10-01 15:21:22 +00:00
|
|
|
<input
|
|
|
|
matInput
|
|
|
|
[matDatepicker]="startDate"
|
|
|
|
(focus)="startDate.open()"
|
|
|
|
placeholder="Start Date"
|
|
|
|
formControlName="startDate"
|
|
|
|
autocomplete="off"
|
|
|
|
/>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #startDate></mat-datepicker>
|
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field fxFlex>
|
2020-10-01 15:21:22 +00:00
|
|
|
<input
|
|
|
|
matInput
|
|
|
|
[matDatepicker]="finishDate"
|
|
|
|
(focus)="finishDate.open()"
|
|
|
|
placeholder="Finish Date"
|
|
|
|
formControlName="finishDate"
|
|
|
|
autocomplete="off"
|
|
|
|
/>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #finishDate></mat-datepicker>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
2020-10-01 15:21:22 +00:00
|
|
|
<div
|
|
|
|
fxLayout="row"
|
|
|
|
fxLayout.lt-md="column"
|
|
|
|
fxLayoutGap="20px"
|
|
|
|
fxLayoutGap.lt-md="0px"
|
|
|
|
fxLayoutAlign="space-around start"
|
|
|
|
>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-form-field fxFlex="80">
|
2020-10-01 15:21:22 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
matInput
|
|
|
|
#accountElement
|
|
|
|
placeholder="Account"
|
|
|
|
[matAutocomplete]="auto"
|
|
|
|
formControlName="account"
|
|
|
|
autocomplete="off"
|
|
|
|
/>
|
|
|
|
<mat-autocomplete
|
|
|
|
#auto="matAutocomplete"
|
|
|
|
autoActiveFirstOption
|
|
|
|
[displayWith]="displayFn"
|
|
|
|
(optionSelected)="selected($event)"
|
|
|
|
>
|
|
|
|
<mat-option *ngFor="let account of accounts | async" [value]="account">{{
|
|
|
|
account.name
|
|
|
|
}}</mat-option>
|
2018-05-25 13:49:00 +00:00
|
|
|
</mat-autocomplete>
|
|
|
|
</mat-form-field>
|
|
|
|
<button fxFlex="20" 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>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row">{{ row.date }}</mat-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Particulars Column -->
|
|
|
|
<ng-container matColumnDef="particulars">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Particulars</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row"
|
|
|
|
><a [routerLink]="row.url">{{ row.name }}</a></mat-cell
|
|
|
|
>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-footer-cell *matFooterCellDef>Closing Balance</mat-footer-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Type Column -->
|
|
|
|
<ng-container matColumnDef="type">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row">{{ row.type }}</mat-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-footer-cell *matFooterCellDef>Closing Balance</mat-footer-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Narration Column -->
|
|
|
|
<ng-container matColumnDef="narration">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Narration</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row">{{ row.narration }}</mat-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Debit Column -->
|
|
|
|
<ng-container matColumnDef="debit">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Debit</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row" class="right">{{
|
|
|
|
row.debit | currency: 'INR' | clear
|
|
|
|
}}</mat-cell>
|
|
|
|
<mat-footer-cell *matFooterCellDef class="right">{{
|
|
|
|
debit | currency: 'INR'
|
|
|
|
}}</mat-footer-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Credit Column -->
|
|
|
|
<ng-container matColumnDef="credit">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Credit</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row" class="right">{{
|
|
|
|
row.credit | currency: 'INR' | clear
|
|
|
|
}}</mat-cell>
|
|
|
|
<mat-footer-cell *matFooterCellDef class="right">{{
|
|
|
|
credit | currency: 'INR'
|
|
|
|
}}</mat-footer-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Running Column -->
|
|
|
|
<ng-container matColumnDef="running">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Running</mat-header-cell>
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-cell *matCellDef="let row" class="right">{{
|
|
|
|
row.running | currency: 'INR' | accounting
|
|
|
|
}}</mat-cell>
|
|
|
|
<mat-footer-cell *matFooterCellDef class="right">{{
|
|
|
|
running | currency: 'INR' | accounting
|
|
|
|
}}</mat-footer-cell>
|
2018-05-25 13:49:00 +00:00
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
2020-10-01 15:21:22 +00:00
|
|
|
<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>
|
2018-05-25 13:49:00 +00:00
|
|
|
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
|
|
|
|
</mat-table>
|
|
|
|
|
2020-10-01 15:21:22 +00:00
|
|
|
<mat-paginator
|
|
|
|
#paginator
|
|
|
|
[length]="dataSource.data.length"
|
|
|
|
[pageIndex]="0"
|
|
|
|
[pageSize]="50"
|
|
|
|
[pageSizeOptions]="[25, 50, 100, 250, 300, 5000]"
|
|
|
|
>
|
2018-05-25 13:49:00 +00:00
|
|
|
</mat-paginator>
|
|
|
|
</mat-card-content>
|
|
|
|
</mat-card>
|