<ejs-grid #collectionsGrid id="collectionsGrid" [dataSource]="collections" [allowSorting]="true" [allowMultiSorting]="true"
[allowGrouping]="true" [allowFiltering]="true" [filterSettings]="filterOptions"
[allowExcelExport]="true" [toolbar]="toolbarOptions" (toolbarClick)="onToolbarClick($event)"
[showColumnChooser]="true" width="auto" height="300">
<e-columns>
<e-column headerText="Factura" width="150">
<ng-template #template let-data>
<a [routerLink]="['/project-edit', data.projectId, 0]" target="_blank">{{ data.invoiceCode }}</a>
</ng-template>
</e-column>
<e-column field="invoiceDate" headerText="Fecha" type="date" format="yMd" [allowFiltering]="false" width="150"></e-column>
<e-column field="dueDate" headerText="Fecha Vto." type="date" format="yMd" [allowFiltering]="false" width="150"></e-column>
<e-column field="description" headerText="Descripción" width="200"></e-column>
<e-column field="paid" headerText="Cobrada" [displayAsCheckBox]="true" textAlign="Center" width="125"></e-column>
<e-column field="company" headerText="Compañía" width="150"></e-column>
<e-column field="customer" headerText="Cliente" width="150"></e-column>
<e-column field="salesman" headerText="Comercial" width="150"></e-column>
<e-column field="amount" headerText="Importe" type="number" format="C" textAlign="Right" width="150"></e-column>
<e-column field="gp" headerText="GP" type="number" format="C" textAlign="Right" width="150"></e-column>
<e-column field="gpPercentage" headerText="GP %" type="number" format="P2" textAlign="Right" width="100"></e-column>
</e-columns>
<e-aggregates>
<e-aggregate>
<e-columns>
<e-column field="amount" type="sum" textAlign="Right">
<ng-template #groupCaptionTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="amount" type="sum" textAlign="Right">
<ng-template #footerTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gp" type="sum" textAlign="Right">
<ng-template #groupCaptionTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gp" type="sum" textAlign="Right">
<ng-template #footerTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gpPercentage" type="Custom" [customAggregate]="customAggregateFn" textAlign="Right">
<ng-template #groupCaptionTemplate let-data>{{ data.Custom | percent : '1.2-2' }}</ng-template>
</e-column>
<e-column field="gpPercentage" type="Custom" [customAggregate]="customAggregateFn" textAlign="Right">
<ng-template #footerTemplate let-data>{{ data.Custom | percent : '1.2-2' }}</ng-template>
</e-column>
</e-columns>
</e-aggregate>
</e-aggregates>
</ejs-grid>