<table class="table table-hover sortable">
    <thead>
    <tr>
        <th data-defaultsign="az">{{ 'name'|_ }}</th>
        <th data-defaultsign="_19" style="text-align: right;">{{ 'spent'|_ }}</th>
        <th data-defaultsign="_19" style="text-align: right;">{{ 'earned'|_ }}</th>
        <th data-defaultsign="_19" style="text-align: right;">{{ 'sum'|_ }}</th>
    </tr>
    </thead>
    <tbody>
    {% for account in report %}
        <tr>
            <td>
                <a href="{{ route('accounts.show', [account.account_id]) }}" title="{{ account.account_name }}">{{ account.account_name }}</a>
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(account.spent, account.currency_symbol, account.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(account.earned, account.currency_symbol, account.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(account.sum, account.currency_symbol, account.currency_decimal_places) }}
            </td>
        </tr>
    {% endfor %}
    </tbody>
    <tfoot>
    {% for sum in sums %}
        <tr>
            <td>{{ 'sum'|_ }} ({{ sum.currency_name }})</td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.spent, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.earned, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
        </tr>
    {% endfor %}
    </tfoot>
</table>
