<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 %}
        {% for currency in account.currencies %}
            <tr>
                <td data-value="{{ account.name }} ({{ currency.currency_name }})">
                    <a href="{{ route('accounts.show', account.id) }}" title="{{ account.iban }}">{{ account.name }} ({{ currency.currency_name }})</a>
                </td>
                <td data-value="{{ currency.spent }}" style="text-align: right;">
                    {{ formatAmountBySymbol(currency.spent, currency.currency_symbol, currency.currency_decimal_places) }}
                </td>
                <td data-value="{{ currency.earned }}" style="text-align: right;">
                    {{ formatAmountBySymbol(currency.earned, currency.currency_symbol, currency.currency_decimal_places) }}
                </td>
                <td data-value="{{ currency.sum }}" style="text-align: right;">
                    {{ formatAmountBySymbol(currency.sum, currency.currency_symbol, currency.currency_decimal_places) }}
                </td>
            </tr>
        {% endfor %}
    {% endfor %}
    </tbody>
    <tfoot>
    {% for sum in sums %}
        <tr>
            <td>{{ 'sum'|_ }} ({{ sum.currency_name }})</td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.spent_sum, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.earned_sum, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
            <td style="text-align: right;">
                {{ formatAmountBySymbol(sum.total_sum, sum.currency_symbol, sum.currency_decimal_places) }}
            </td>
        </tr>
    {% endfor %}
    </tfoot>
</table>
