<ejs-grid #invoicesGrid id="Grid" [dataSource]="invoices" [allowSorting]="true" [allowMultiSorting]="true"
[allowGrouping]="true" [groupSettings]="groupOptions"
[allowFiltering]="true" [filterSettings]="filterOptions"
[allowExcelExport]="true" [toolbar]="toolbarOptions" (toolbarClick)="onToolbarClick($event)" height="300">
<e-columns>
<e-column field="invoiceCode" headerText="Factura"></e-column>
<e-column field="invoiceDate" headerText="Fecha" format="{ type: 'date', format: 'dd/MM/yyyy' }"></e-column>
<e-column field="partner" headerText="Partner"></e-column>
<e-column field="customer" headerText="Cliente"></e-column>
<e-column field="salesman" headerText="Comercial"></e-column>
<e-column field="projectCode" headerText="Proyecto"></e-column>
<e-column field="quotationCode" headerText="Presupuesto"></e-column>
<e-column field="quotationVersion" headerText="Ver." width="80"></e-column>
<e-column field="amount" headerText="Importe" textAlign="Right">
<ng-template #template let-data>{{ data.amount | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gp" headerText="GP" textAlign="Right">
<ng-template #template let-data>{{ data.gp | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gpPercentage" headerText="GP %" textAlign="Right" format="P2">
<ng-template #template let-data>{{ data.gpPercentage | percent : '1.2-2' }}</ng-template>
</e-column>
</e-columns>
<e-aggregates>
<e-aggregate>
<e-columns>
<e-column field="amount" type="sum">
<ng-template #groupCaptionTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="amount" type="sum">
<ng-template #footerTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gp" type="sum">
<ng-template #groupCaptionTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gp" type="sum">
<ng-template #footerTemplate let-data>{{ data.sum | currency : 'EUR' : 'symbol' : '.2' }}</ng-template>
</e-column>
<e-column field="gpPercentage" type="average">
<ng-template #groupCaptionTemplate let-data>{{ data.average | percent : '1.2-2' }}</ng-template>
</e-column>
<e-column field="gpPercentage" type="average">
<ng-template #footerTemplate let-data>{{ data.average | percent : '1.2-2' }}</ng-template>
</e-column>
</e-columns>
</e-aggregate>
</e-aggregates>
</ejs-grid>