/
unpaid.tt
48 lines (46 loc) · 1.53 KB
/
unpaid.tt
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
<h1>Biodiesel Un-paid Transactions</h1>
[% IF txns.size %]
[% IF !params.printable %]<p><a href="/unpaid?printable=1">Printable version of this page.</a></p>[% END %]
<p>Biodiesel transactions that are currently unpaid as of [% now %]:</p>
<p><strong>Grand Total Un-paid: $[% grand_total %]</strong></p>
<form action="/unpaid/mark-as-paid" method="POST">
<table class="common-table zebra-striped">
<thead>
<tr>
<th>Member</th>
<th>Time</th>
<th>Price</th>
<th>Paid?</th>
<th>Notes</th>
</tr>
</thead>
[% FOREACH member_txns IN txns %]
[% SET total = 0 %]
[% FOREACH txn IN member_txns %]
<tr class="unpaid_txn">
<td align="right"><a href="/members/[% txn.member_id %]">[% txn.member_id %]</a></td>
<td>[% txn.pretty_date %]</td>
<td>$[% txn.price %]</td>
<td><input type="checkbox" name="txns" value="[% txn.txn_id %]" /></td>
<td><input type="text" name="notes-[% txn.txn_id %]" value="[% txn.payment_notes %]" /></td>
[% SET total = total + txn.price %]
</tr>
[% END %]
<tr class="unpaid_total">
<td></td>
<td><strong>Total<strong></td>
<td><strong>$[% total %]</strong></td>
<td></td>
</tr>
[% END %]
</table>
<div class="actions">
<p>
Send an email receipt? <input type="checkbox" name="send_receipt" value="1" />
</p>
<input class="btn primary" type="submit" value="Mark these transactions as paid" />
</div>
</form>
[% ELSE %]
<p>There are no-unpaid transactions at this time.</p>
[% END %]