Project

General

Profile

1
<p-table [value]="_journalEntries?.slice(first, first+rows)"
2
         [lazy]="true"
3
         (onLazyLoad)="onPagination($event)"
4
         [paginator]="true"
5
         [rows]="rows"
6
         [totalRecords]="journalEntries?.length"
7
         styleClass="p-datatable-gridlines"
8
         [rowHover]="true"
9
         [loading]="loading"
10
         [autoLayout]="true">
11
  <ng-template pTemplate="header">
12
    <tr>
13
      <th>Document No.</th>
14
      <th>Account Type</th>
15
      <th>Account No.</th>
16
      <th>Description</th>
17
      <th>Amount</th>
18
      <th>Currency ID</th>
19
      <th>VatBusiness</th>
20
      <th>Status</th>
21
      <!-- TODO: Fix hacky way of locking the icon-columns in place -->
22
      <th class="three-buttons"></th>
23
    </tr>
24
  </ng-template>
25
  <ng-template pTemplate="body" let-rowIndex="rowIndex" let-entry>
26
    <tr>
27
      <td>{{entry.documentNo}}</td>
28
      <td>{{entry.accountType}}</td>
29
      <td>{{entry.accountNo}}</td>
30
      <td>{{entry.description}}</td>
31
      <td>{{entry.amount}}</td>
32
      <td>{{entry.currencyCode}}</td>
33
      <td>{{entry.vatBusPostingGroup}}</td>
34
      <td>{{entry.journalEntriesStatus.name}}</td>
35
      <!-- Preview, Edit & Post Icons -->
36
      <td>
37
        <button pButton
38
                (click)="previewJournalEntry(entry, rowIndex)"
39
                icon="pi pi-list"
40
                class="p-button-secondary p-button-rounded p-button-outlined">
41
        </button>
42
        <button *ngIf="buttonHoldingEntriesIDsArray?.includes(entry.id)"
43
                pButton
44
                (click)="editJournalEntry(entry)"
45
                icon="pi pi-pencil"
46
                class="p-button-secondary p-button-rounded p-button-outlined p-ml-2">
47
        </button>
48
        <button *ngIf="buttonHoldingEntriesIDsArray?.includes(entry.id)"
49
                pButton
50
                (click)="viewJournalEntry(entry)"
51
                icon="pi pi-eye"
52
                class="p-button-secondary p-button-rounded p-button-outlined p-ml-2">
53
        </button>
54
        <button *ngIf="buttonHoldingEntriesIDsArray?.includes(entry.id)"
55
                pButton
56
                (click)="postJournalEntry(entry)"
57
                icon="pi pi-external-link"
58
                class="p-button-secondary p-button-rounded p-button-outlined p-ml-2">
59
        </button>
60
      </td>
61
    </tr>
62
  </ng-template>
63
</p-table>
(1-1/4)