Fixes and more attractive form style

This commit is contained in:
Florian "flowdy" Heß 2017-02-01 21:34:01 +01:00
parent 6c43accd5f
commit ba30ec40a2
3 changed files with 23 additions and 13 deletions

View File

@ -69,13 +69,24 @@ table.history p.linked-credit {
font-size: smaller;
}
dl dd + dt {
border-top: 1px solid lightgrey;
margin-top: 1em;
input, textarea {
border: 1px solid #ddd;
}
dl dt {
float: left;
clear: left;
width: 7em;
text-align: right;
font-weight: bold;
}
dl dd {
margin: 0 0 0 8em;
padding: 0 0 0.5em 0;
}
select {
border:none;
border: 1px solid #ddd;
background-color:transparent;
}

View File

@ -9,7 +9,7 @@
<input id="date" name="date" value="<%= $credit->date %>"> (Format: YYYY-MM-DD)
% end
% $r{purpose} = begin
<input id="purpose" name="purpose" style="width:100%" value="<%= $credit->purpose %>">
<textarea id="purpose" name="purpose" style="width:100%"><%= $credit->purpose %></textarea>
% end
% $r{category} = begin
% my $category = $credit->category // '';
@ -26,7 +26,7 @@
<input id="value" name="value" value="<%= $credit->value %>"> Cent (declare target credit with "0")
% end
% $r{account} = begin
<input id="account" name="account" value="<%= $credit->account->ID %>">
<%= $credit->account->ID %>
% end
<dl class="upsert">
@ -72,11 +72,10 @@
% if ( $account //= $credit->account ) {
<h2>Spend for arrears</h2>
% my $arrears = ( ref $account ? $account : app->db->resultset("Account")->find($account) )->current_arrears;
% if ( $arrears->first() ) {
<p><%= $credit->value == $credit->spent ? "The credit is already spent. Unless you revoke any outgoings above, there is no point in checking" : "Check" %> <%= %paid_debits ? "other" : "" %> debits you want to <strong>spend this credit</strong> for:</p>
<p>Check arrears you want to <strong>use this credit</strong> for.</p>
% if ( $arrears->count() ) {
<p><%= $credit->value && $credit->value == $credit->spent ? "The credit is already spent. Unless you revoke any outgoings above, there is no point in checking" : "Check" %> <%= %paid_debits ? "other" : "" %> debits you want to <strong>spend this credit</strong> for:</p>
<table>
<tr><th>S</th><th>date</th><th>purpose</th><th>to pay</th></tr>
<tr><th>S</th><th>date</th><th>purpose</th><th>to pay</th><th>note</th></tr>
% while ( my $d = $arrears->next ) {
% next if $paid_debits{ $d->billId };
<tr><td><input type="checkbox" name="spendFor" value="<%= $d->billId %>"></td>

View File

@ -12,7 +12,7 @@
<input id="date" name="date" value="<%= $debit->date %>"> (Format: YYYY-MM-DD)
% end
% $r{purpose} = begin
<input id="purpose" name="purpose" style="width:100%" value="<%= $debit->purpose %>">
<textarea id="purpose" name="purpose" style="width:100%"><%= $debit->purpose %></textarea>
% end
% $r{category} = begin
% my $category = $debit->category // '';
@ -102,8 +102,8 @@ oops
% if ( $account ||= $debit->debtor ) {
<h2>Pay with credits</h2>
% my $credits = app->db->resultset("Account")->find($account)->available_credits;
% if ( $credits->first() ) {
<p><%= $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>
% 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>
<table>
<tr><th>S</th><th>date</th><th>purpose</th><th>to spend</th><th>note</th></tr>
% while ( my $c = $credits->next ) {