-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount__transactions.tpl
107 lines (102 loc) · 3.28 KB
/
account__transactions.tpl
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{*
* Account Transactions - show the user their wallet account transactions.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2014-2017 Jacques Marneweck. All rights strictly reserved.
*}
{include file="header.tpl" title="Account Transactions Page" nav="accounts"}
<h1 class="hidden-print">Account Transactions</h1>
<table class="table table-bordered">
<thead>
<tr>
<th>Account Number</th>
<th>Description</th>
<th>Account Type</th>
<th>Available Balance</th>
</tr>
</thead>
<tbody>
<tr>
<td>{$account.account_number}</td>
<td>{$account.description|escape}</td>
<td>{if $account.account_type == 'wallet'}Diamond Account{elseif $account.account_type == 'business'}Business Account{/if}</td>
<td>R {($account.balance/100)|string_format:"%.2f"}</td>
</tr>
</tbody>
</table>
<form method="POST" class="form-inline">
<input name="utf8" type="hidden" value="✓" />
{include file="_partials/csrf.tpl"}
{include file="_partials/reports-filter-month.tpl"}
<button type="submit" class="btn btn-info">Filter</button>
</form>
<table class="table table-striped">
<thead>
<tr>
<th>Action Date</th>
<th>Reference</th>
<th>Description</th>
<th> </th>
{if $smarty.session.is_admin}
<th>Debit</th>
<th>Credit</th>
<th>Balance</th>
{else}
<th>Amount</th>
{/if}
</tr>
</thead>
<tbody>
{if isset($closing_balance)}
{assign var=running_total value=$closing_balance}
{else}
{assign var=running_total value=0}
{/if}
<tr>
<td></td>
<td></td>
<td>CLOSING BALANCE</td>
<td></td>
{if $smarty.session.is_admin}
<td><div class="pull-right"></div></td>
<td><div class="pull-right"></div></td>
<td><div class="pull-right">R {($running_total/100)|string_format:"%.2f"}</div></td>
{else}
<td><div class="pull-right">R {($running_total/100)|string_format:"%.2f"}</div></td>
{/if}
</tr>
{foreach $transactions item=row}
<tr>
<td>{$row.action_date}</td>
<td>{$row.transaction_reference}</td>
<td>{$row.reference1|escape}</td>
<td>{$row.reference2|escape}</td>
{if $smarty.session.is_admin}
<td><div class="pull-right">{if $row.amount < 0}R {($row.amount/100*-1)|string_format:"%.2f"}{else}—{/if}</div></td>
<td><div class="pull-right">{if $row.amount > 0}R {($row.amount/100)|string_format:"%.2f"}{else}—{/if}</div></td>
<td><div class="pull-right">R {($running_total/100)|string_format:"%.2f"}</div></td>
{else}
<td><div class="pull-right">R {($row.amount/100)|string_format:"%.2f"}</div></td>
{/if}
</tr>
{assign var=running_total value=$running_total+($row.amount*-1)}
{/foreach}
<tr>
<td></td>
<td></td>
<td>OPENING BALANCE</td>
<td></td>
{if $smarty.session.is_admin}
<td><div class="pull-right"></div></td>
<td><div class="pull-right"></div></td>
<td><div class="pull-right">R {($running_total/100)|string_format:"%.2f"}</div></td>
{else}
<td><div class="pull-right">R {($running_total/100)|string_format:"%.2f"}</div></td>
{/if}
</tr>
</tbody>
</table>
{include file="footer.tpl"}