Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Expand list of bills for #1102
James Coledd16e1b784fc
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex e9c24d484a..99bc758bd0 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -170,7 +170,9 @@ return ['want_to_login' => 'I want to login','button_register' => 'Register','authorization' => 'Authorization',-+ 'active_bills_only' => 'active bills only',+ 'average_per_bill' => 'average per bill',+ 'expected_total' => 'expected total',// API access'authorization_request' => 'Firefly III v:version Authorization Request','authorization_request_intro' => '<strong>:client</strong> is requesting permission to access your financial administration. Would you like to authorize <strong>:client</strong> to access these records?',diff --git a/resources/views/list/bills.twig b/resources/views/list/bills.twigindex 2a107273ed..0d37fddde7 100644--- a/resources/views/list/bills.twig+++ b/resources/views/list/bills.twig@@ -16,7 +16,17 @@</tr></thead><tbody>+ {% set sum_min =0 %}+ {% set sum_max =0 %}+ {% set expected_total = 0 %}+ {% set count = 0 %}{% for entry in bills %}+ {% if entry.active %}+ {% set count = count + 1 %}+ {% set sum_min = sum_min + entry.amount_min %}+ {% set sum_max = sum_min + entry.amount_max %}+ {% set expected_total = expected_total + ((entry.amount_min + entry.amount_max) / 2) %}+ {% endif %}<tr><td class="hidden-sm hidden-xs"><div class="btn-group btn-group-xs edit_tr_buttons"><a href="{{ route('bills.edit',entry.id) }}" class="btn btn-default btn-xs"><i@@ -82,7 +92,7 @@{% if entry.paid_dates|length > 0 and entry.active %}<td class="paid_in_period text-success" data-value="{{ entry.paid_dates[0] }}">{% for date in entry.paid_dates %}- {{ formatDate(date, monthAndDayFormat) }}<br />+ {{ formatDate(date, monthAndDayFormat) }}<br/>{% endfor %}</td><td class="expected_in_period hidden-sm hidden-xs" data-value="{{ entry.next_expected_match }}">@@ -119,9 +129,57 @@{% endif %}</td></tr>-{% endfor %}</tbody>+ <tfoot>+ <tr>+ <td style="text-align:right;" colspan="3">{{ 'sum'|_ }} ({{ 'active_bills_only'|_ }})</td>+ <td style="text-align:right;" colspan="1">+ <span style="margin-right:5px;">+ {{ sum_min|formatAmount }}+ </span>+ </td>+ <td style="text-align:right;" colspan="1">+ <span style="margin-right:5px;">+ {{ sum_max|formatAmount }}+ </span>+ </td>+ <td colspan="5"> </td>+ </tr>++ {# calculate total#}+ {% if count > 0 %}+ {% set avg_min = (sum_min / count) %}+ {% set avg_max = (sum_max / count) %}+ {% else %}+ {% set avg_min = 0 %}+ {% set avg_max = 0 %}+ {% endif %}++ <tr>+ <td style="text-align:right;" colspan="3">{{ 'average_per_bill'|_ }} ({{ 'active_bills_only'|_ }})</td>+ <td style="text-align:right;" colspan="1">+ <span style="margin-right:5px;">+ {{ avg_min|formatAmount }}+ </span>+ </td>+ <td style="text-align:right;" colspan="1">+ <span style="margin-right:5px;">+ {{ avg_max|formatAmount }}+ </span>+ </td>+ <td colspan="6"> </td>+ </tr>+ <tr>+ <td style="text-align:right;" colspan="3">{{ 'expected_total'|_ }} ({{ 'active_bills_only'|_ }})</td>+ <td style="text-align:right;" colspan="1">+ <span style="margin-right:5px;">+ {{ expected_total|formatAmount }}+ </span>+ </td>+ <td colspan="6"> </td>+ </tr>+ </tfoot></table><div style="padding-left:8px;">{{ paginator.render|raw }}