Various fixes; added full name to account data; do never transfer unchecked

This commit is contained in:
Florian "flowdy" Heß
2017-02-02 22:23:23 +01:00
parent ba30ec40a2
commit 8b1a68f07b
12 changed files with 66 additions and 31 deletions

View File

@@ -6,7 +6,14 @@
<tr><th>Id</th><th>Date</th><th>Purpose</th><th>value</th><th>paid</th><th>to</th></tr>
% while ( my $debit = $debits->next ) {
% my $tgt = $debit->target;
<tr><td><a href="/debit/<%= $debit->billId %>"><%= $debit->billId %></a></td><td><%= $debit->date %></td><td><%== nl2br $debit->purpose %></td><td class="number"><%== money $debit->value %></td><td class="number <%= $debit->paid < $debit->value ? "mark" : "" %>"><%== money $debit->paid %><td><a href="/credit/<%= $tgt->credId %>"><%= $tgt->account->ID %></a></tr>
<tr><td><a href="/debit/<%= $debit->billId %>"><%= $debit->billId %></a></td><td><%= $debit->date %></td><td><%== nl2br $debit->purpose %></td><td class="number"><%== money $debit->value %></td><td class="number <%= $debit->paid < $debit->value ? "mark" : "" %>"><%== money $debit->paid %><td>
% if ( $tgt ) {
<a href="/credit/<%= $tgt->credId %>"><%= $tgt->account->ID %></a>
% }
% else {
(outgoing)
% }
</td></tr>
% }
</table>

View File

@@ -30,9 +30,8 @@
% end
% $r{targetCredit} = begin
% if ( !@$targets ) {
<p style="color:red;">There are no target credits available. Target credits are credits of other accounts that either still have a value of 0, or which have already been targetted. Please create a target credit record first, because all debits must refer to one so settlements can be fulfilled.</p>
<div style="color:red;">There are no target credits available. Target credits are credits of other accounts that either still have a value of 0, or which have already been targetted. Please create a target credit record first, because all debits must refer to one so settlements can be fulfilled.</div>
% $targets = [ ['', '', ''] ];
oops
% }
% my $cmpacc = $targets->[0][1];
% my $target = $debit->targetCredit // '';
@@ -103,7 +102,7 @@ oops
<h2>Pay with credits</h2>
% my $credits = app->db->resultset("Account")->find($account)->available_credits;
% if ( $credits->count() ) {
<p><%= $debit->value && $debit->value == $debit->value ? "The debt is already settled. Unless you revoke any incomings above, there is no point in checking" : "Check" %> <%= %used_credits ? "other" : "" %> credits you want to <strong>pay this debit</strong> with:</p>
<p><%= $debit->value && $debit->value == $debit->paid ? "The debt is already settled. Unless you revoke any incomings above, there is no point in checking" : "Check" %> <%= %used_credits ? "other" : "" %> credits you want to <strong>pay this debit</strong> with:</p>
<table>
<tr><th>S</th><th>date</th><th>purpose</th><th>to spend</th><th>note</th></tr>
% while ( my $c = $credits->next ) {
@@ -122,6 +121,6 @@ oops
% }
% }
<button type="submit">Submit</button>
<p><button type="submit">Submit</button></p>
</form>