treasuredb/templates/account/list.html.ep

58 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

% 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
% my $group = shift;
<tr><th colspan="11"><%= $group || 'Club management accounts' %></th>
<th colspan="2"><a href="/debit?group=<%= $group %>"><img class="icon" src="/add-debit.svg" alt="Charge"> all at once</a></th></tr>
% 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;
<tr><th><a href="/account/<%= $u %>"><%= $u %></a></th>
<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>
<td class="centered">
% my $which = ($bal->arrears && 1) + ($bal->available && 1);
% if ( $which == 2 ) {
<a href="<%= $u %>/transfer"><img class="icon" src="/transfer.svg"></a>
% }
% elsif ( $which ) {
<%== $bal->arrears ? q{} : q{&nbsp;} %>
<img class="icon" src="/wait.svg" style="cursor:not-allowed;">
<%== $bal->available ? q{} : q{&nbsp;} %>
% }
% else {
<img class="icon" src="/even.svg" style="cursor:not-allowed;">
% }
</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>
% } # while
</table>
% stash links => [ '/account' => "Create account", '/bankStatement' => "Reconstructed bank statement" ];
% my $help = begin
<h2>Column explanation</h2>
<dl>
<dt>Even till:</dt>
<dd><p>Date of debt up to and including which all is settled.</p></dd>
<dt>Arrears:</dt>
<dd><p>Unpaid debits</p></dd>
<dt>Transfer:</dt>
<dd><p>Link to a view where you can match credit and debit and have the software transfer money in between automatically. Yellow "N/A" means there is no money to transfer as either credit or debit is 0. Green "N/A" means there is no money to transfer because the account is even.</p></dd>
<dt>Available:</dt>
<dd><p>Credits that have not been used or not to full extent, yet</p></dd>
<dt>Earned:</dt>
<dd><p>Paid debits targetting credits of that account.</p></dd>
<dt>Promised:</dt>
<dd><p>Unpaid or not fully paid debits targetting credits of that account.</p></dd>
</dl>
% end
% stash help => $help;