Fixes to avoid a warning when IBAN is null, in look and redirection
This commit is contained in:
@@ -9,12 +9,15 @@
|
||||
% my $that = $hr->that_credit;
|
||||
% my $this = $hr->this_credit;
|
||||
% my $credit_ref = begin
|
||||
%== sprintf q{<strong>%s</strong><a href="/credit/%2$d">%d</a>}, shift() ? ($that->account->ID.q{.}, $that->credId) : (q{}, $this->credId)
|
||||
% my $that_acc = $that && $that->account;
|
||||
% my $that_account_id = $that ? $that_acc->ID : q{(out)};
|
||||
% my $that_credit_id = $that ? $that->credId : "";
|
||||
%== sprintf q{<strong>%s</strong><a href="/credit/%2$d">%d</a>}, shift() ? ($that_account_id.q{:}, $that_credit_id) : (q{}, $this->credId)
|
||||
% end
|
||||
<p><strong><a href="/debit/<%= $hr->billId %>"><%= $hr->billId %></a>:</strong> <%= $hr->purpose %> → <%== $credit_ref->($hr->debit) %></p>
|
||||
<p class="linked-credit">from <%= $credit_ref->($hr->credit) %>, <%= $hr->credit ? $that->purpose : $this->purpose %>
|
||||
<p><strong><a href="/debit/<%= $hr->billId %>"><%= $hr->billId %></a>:</strong> <%== nl2br $hr->purpose %> → <%== $credit_ref->($hr->debit) %></p>
|
||||
<p class="linked-credit">↑ <%= $credit_ref->($hr->credit) =%>, <%= $hr->credit ? $that->purpose : $this->purpose %>
|
||||
% if ( $hr->note ) {
|
||||
<br>Note: <%= $hr->note %>
|
||||
<br><em>Note: <%= $hr->note %></em>
|
||||
% }
|
||||
</p>
|
||||
</td><td class="number"><%== money $hr->debit %></td><td class="number"><%== money $hr->credit %></td></tr>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
% 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>
|
||||
<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>
|
||||
% end
|
||||
% while ( my $account = $accounts->next ) {
|
||||
% my $bal = $account->balance;
|
||||
@@ -22,36 +22,35 @@
|
||||
<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> ‹
|
||||
› <a href="<%= $u %>/transfer"><img class="icon" src="/transfer.svg" alt="ready"></a> ‹
|
||||
% }
|
||||
% elsif ( $which ) {
|
||||
<%== $bal->arrears ? q{›} : q{ } %>
|
||||
<img class="icon" src="/wait.svg" style="cursor:not-allowed;">
|
||||
<img class="icon" src="/wait.svg" style="cursor:not-allowed;" alt="wait">
|
||||
<%== $bal->available ? q{‹} : q{ } %>
|
||||
% }
|
||||
% else {
|
||||
<img class="icon" src="/even.svg" style="cursor:not-allowed;">
|
||||
<img class="icon" src="/even.svg" style="cursor:not-allowed;" alt="even">
|
||||
% }
|
||||
</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
|
||||
% stash help => $_ for 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>
|
||||
<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>
|
||||
</dl>
|
||||
% end
|
||||
% stash help => $help;
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
% $total += $record->value;
|
||||
<tr><td><%= $record->date %></td><td class="number"><%== money $record->value %></td><td><%== nl2br $record->purpose %></td></tr>
|
||||
% }
|
||||
<tr><td style="text-align:right;">In total:</td><td class="number"><%== money $total %></td></tr>
|
||||
<tr style="border-top: 2px solid black"><td style="text-align:right;">In total:</td><td class="number"><%== money $total %></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<input id="IBAN" name="IBAN" value="<%= $account->IBAN %>"> (may also be empty or '*' – s. help)
|
||||
% end
|
||||
|
||||
<form method="post">
|
||||
<form action="<%= url_for %>" method="post">
|
||||
|
||||
<dl class="upsert">
|
||||
% for my $f ( $account->result_source->columns ) {
|
||||
|
||||
@@ -6,9 +6,17 @@
|
||||
% while ( my $record = $records->next ) {
|
||||
% $total_credit += $record->credit;
|
||||
% $total_debit += $record->debit;
|
||||
<tr><td><%= $record->date %></td><td><%= $record->purpose %></td><td><%= $record->account %></td><td class="number"><%== money $record->debit %></td><td class="number"><%== money $record->credit %></td></tr>
|
||||
% $total_credit -= $total_debit;
|
||||
% if ( $total_credit > 0 ) {
|
||||
% $total_debit = 0;
|
||||
% }
|
||||
% if ( $total_credit < 0 ) {
|
||||
% $total_debit = abs $total_credit;
|
||||
% $total_credit = 0;
|
||||
% }
|
||||
<tr><td><%= $record->date %></td><td><%== nl2br $record->purpose %></td><td><%= $record->account %></td><td class="number"><%== money $record->debit %></td><td class="number"><%== money $record->credit %></td></tr>
|
||||
% }
|
||||
<tr><td colspan="3" style="text-align:right;">Current balance:</td><td class="number"><%== $total_debit ? money $total_debit : '' %></td><td class="number"><%== $total_credit ? money $total_credit : '' %></td>
|
||||
<tr style="border-top:2px solid black;"><td colspan="3" style="text-align:right;">Current balance:</td><td class="number" style="color:red;"><%== $total_debit ? money $total_debit : '' %></td><td class="number"><%== $total_credit ? money $total_credit : '' %></td>
|
||||
</table>
|
||||
|
||||
%= include 'filter-widget'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
% title 'Income of ' . $account;
|
||||
|
||||
<a class="add-item-btn" href="/<%= $account %>/in"><img src="/add-credit.svg" class="icon" alt=""> Add credit</a>
|
||||
<p>Listed in reverse order:</p>
|
||||
|
||||
<table class="income">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
% my $id = stash 'id';
|
||||
% title $id ? "Change credit $id" : "Enter new credit";
|
||||
|
||||
<form method="post">
|
||||
<form class="<%= url_for %>" method="post">
|
||||
<h2>Essentials</h2>
|
||||
|
||||
% my %r;
|
||||
@@ -23,7 +23,7 @@
|
||||
</select>
|
||||
% end
|
||||
% $r{value} = begin
|
||||
<input id="value" name="value" value="<%= $credit->value %>"> Cent (declare target credit with "0")
|
||||
<input id="value" name="value" value="<%= $credit->value %>"> Cent (target credit? See <a href="#help">help</a>)
|
||||
% end
|
||||
% $r{account} = begin
|
||||
<%= $credit->account->ID %>
|
||||
@@ -95,3 +95,8 @@
|
||||
<p><button type="submit">Submit</button></p>
|
||||
|
||||
</form>
|
||||
|
||||
% stash help => $_ for begin
|
||||
<h2>How to declare a target credit?</h2>
|
||||
<p>A target credit can be declared by assigning it an initial value of 0 (zero).</p>
|
||||
% end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
% title 'Outcome of ' . $account;
|
||||
|
||||
<a class="add-item-btn" href="/<%= $account %>/out"><img src="/add-debit.svg" class="icon" alt=""> Add debit</a>
|
||||
<p>Listed in reverse order:</p>
|
||||
|
||||
<table class="income">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
% my $id = stash 'id';
|
||||
% title $id ? "Change debit $id" : "Enter new debit";
|
||||
|
||||
<form method="post">
|
||||
<form action="<%= url_for %>" method="post">
|
||||
<h2>Essentials</h2>
|
||||
|
||||
% my %r;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
% }
|
||||
% if ( defined $sql ) {
|
||||
<div class="targettable" id="sql">
|
||||
<p>Please note that, to run the SQL commands directly in another tool, you might need to resolve the prepared statements manually. Just replace all question marks by the values listed after the colon in each line.</p>
|
||||
<p>Please note that if you want to run the SQL commands directly in another tool, you might need to resolve the prepared statements manually. Just replace all question marks by the values listed after the colon in each line.</p>
|
||||
<textarea rows="5" style="width:100%;border:1px inset lightgrey;" readonly="readonly">
|
||||
%== $$sql
|
||||
</textarea></div>
|
||||
|
||||
Reference in New Issue
Block a user