/
invoice-list.php
53 lines (48 loc) · 1.29 KB
/
invoice-list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php namespace ProcessWire;
/** @var PageArray $items */
$total = 0.0;
?>
<table class='invoice-list uk-table uk-table-divider uk-table-small'>
<thead>
<tr>
<th><?=_('Invoice ID')?></th>
<th><?=_('Client')?></th>
<th><?=_('Date')?></th>
<th><?=_('Subtotal')?></th>
<th><?=_('Status')?></th>
</tr>
</thead>
<tbody>
<?php
foreach($items as $item):
/** @var InvoicePage $item */
$subtotal = $item->getSubtotal();
$total += $subtotal;
?>
<tr>
<td><a href="<?=$item->url?>"><?=$item->title?></a></td>
<td><a class="uk-link-text" href="<?=$item->client->url?>"><?=$item->client->title?></a></td>
<td><?=$item->date?></td>
<td><?=price($subtotal)?></td>
<td><a class="uk-link-text" href="<?=$item->invoice_status->url?>"><?=$item->invoice_status->title?></a></td>
</tr>
<?php endforeach; ?>
<?php if(!$items->count()): ?>
<tr>
<td colspan="5" class="uk-text-left"><?=_('no invoices to list')?></td>
</tr>
<?php endif; ?>
<tr class="separate">
<td colspan="2">
<a href="<?=newInvoiceUrl()?>">
<?=icon('plus-circle')?>
<?=_('new')?>
</a>
</td>
<th class="uk-text-top"><?=_('Total')?></th>
<td colspan="2" class="uk-text-left">
<strong><?=price($total)?></strong>
</td>
</tr>
</tbody>
</table>