2017-01-15 16:27:22 +01:00
% title 'Accounts';
<table class="accounts">
<col class="account"><col class="even_until"><col class="arrears"><col><col><col class="transfer"><col class="available"><col><col><col class="earned"><col class="promised"><col class="history"><col class="report">
<tr><th>Account</th><th>Even until</th><th colspan="3">Arrears</th><th>Transfer</th><th colspan="3">Available</th><th>Earned</th><th>Promised</th><th>History</th><th>Report</th></tr>
% my ($type) = q{};
% my $inter_header = begin
2017-01-25 22:38:39 +01:00
% my $group = shift;
2017-02-06 08:12:56 +01:00
<tr class="group-heading"><th colspan="11"><%= $group || 'Club management accounts' %></th>
<th colspan="2"><a class="add-item-btn" href="/debit?group=<%= $group %>"><img class="icon" src="/add-debit.svg" alt="Charge"> all at once</a></th></tr>
2017-01-15 16:27:22 +01:00
% end
% while ( my $account = $accounts->next ) {
% my $bal = $account->balance;
% my $t = $account->type // q{};
% if ( $type ne $t ) {
% $type = $t;
<%= $inter_header->($t) %>
% }
% my $u = $account->ID;
2017-02-02 22:23:23 +01:00
<tr><th><a href="/account/<%= $u %>" title="<%= $account->name %>"><%= $u %></a></th>
2017-01-28 14:00:20 +01:00
<td class="even_until"><%= $bal->even_until // "never" %></td><td class="number"><%== money $bal->arrears %></td><td><a href="<%= $u %>/debits"><img class="icon" alt="List" src="/list.svg" alt="List"></td><td><a title="Add a debit" href="<%= $u %>/out"><img class="icon" src="/add-debit.svg" alt="Charge"></a></td>
2017-01-15 16:27:22 +01:00
<td class="centered">
% my $which = ($bal->arrears && 1) + ($bal->available && 1);
% if ( $which == 2 ) {
2017-02-06 08:12:56 +01:00
› <a href="<%= $u %>/transfer"><img class="icon" src="/transfer.svg" alt="ready"></a> ‹
2017-01-15 16:27:22 +01:00
% }
% elsif ( $which ) {
2017-01-28 14:00:20 +01:00
<%== $bal->arrears ? q{› } : q{ } %>
2017-02-06 08:12:56 +01:00
<img class="icon" src="/wait.svg" style="cursor:not-allowed;" alt="wait">
2017-01-28 14:00:20 +01:00
<%== $bal->available ? q{‹ } : q{ } %>
2017-01-15 16:27:22 +01:00
% }
% else {
2017-02-06 08:12:56 +01:00
<img class="icon" src="/even.svg" style="cursor:not-allowed;" alt="even">
2017-01-15 16:27:22 +01:00
% }
2017-01-28 14:00:20 +01:00
</td><td class="number"><%== money $bal->available %></td><td><a href="<%= $u %>/credits"><img class="icon" alt="List" src="/list.svg" alt="List"></a></td><td><a title="Add a credit" href="<%= $u %>/in"><img class="icon" src="/add-credit.svg" alt="Credit"></a></td><td class="number"><%== money $bal->earned %></td><td class="number"><%== money $bal->promised %></td><td><a href="<%= $u %>/history">History</a></td><td><a href="<%= $u %>/report">Report</a></td></tr>
2017-01-15 16:27:22 +01:00
% } # while
</table>
2017-01-28 14:00:20 +01:00
% stash links => [ '/account' => "Create account", '/bankStatement' => "Reconstructed bank statement" ];
2017-02-06 08:12:56 +01:00
% stash help => $_ for begin
2017-01-15 16:27:22 +01:00
<h2>Column explanation</h2>
<dl>
2017-02-06 08:12:56 +01:00
<dt>Even until</dt>
<dd>Date of the debt/bill up to and including which all is settled. Within each group (i.e. account type), accounts are ordered by this ascending date.</dd>
<dt>Arrears</dt>
<dd>Debits or partial amounts of which are still outstanding</dd>
<dt>Transfer</dt>
<dd>View of credit and debit for you to match and have the software transfer money in between automatically. <img class="icon" src="/transfer.svg" alt="ready"> means you need to take action. <img class="icon" src="/wait.svg" style="cursor:not-allowed;" alt="wait"> means there is no money to transfer as either credit or debit is 0, or <img class="icon" src="/even.svg" style="cursor:not-allowed;" alt="even"> if the account is even.</dd>
<dt>Available</dt>
<dd>Credits that have not been used or not to full extent, yet</dd>
<dt>Earned</dt>
<dd>Paid debits targetting credits of that account.</dd>
<dt>Promised</dt>
<dd>Unpaid or not fully paid debits targetting credits of that account.</dd>
2017-01-15 16:27:22 +01:00
</dl>
2017-01-28 14:00:20 +01:00
% end