<table class="table table-bordered table-striped sortable">
    <thead>
    <tr>
        <th data-defaultsort="disabled">&nbsp;</th>
        <th>{{ trans('list.name') }}</th>
        <th>{{ trans('list.matchesOn') }}</th>
        <th colspan="2">{{ trans('list.matchingAmount') }}</th>
        <th>{{ trans('list.lastMatch') }}</th>
        <th>{{ trans('list.expectedMatch') }}</th>
        <th>{{ trans('list.active') }}</th>
        <th>{{ trans('list.automatch') }}</th>
        <th>{{ trans('list.repeat_freq') }}</th>
    </tr></thead>
    <tbody>
    {% for entry in bills %}
    <tr>
        <td>
            <div class="btn-group btn-group-xs">
                <a href="{{route('bills.edit',entry.id)}}" class="btn btn-default btn-xs"><i class="fa fa-fw fa-pencil"></i></a>
                <a href="{{route('bills.delete',entry.id)}}" class="btn btn-danger btn-xs"><i class="fa fa-fw fa-trash-o"></i></a>
            </div>
        </td>
        <td>
            <a href="{{route('bills.show',entry.id)}}" title="{{ entry.name }}">{{ entry.name }}</a>
        </td>
        <td data-value="{{ entry.match }}">
            {% for match in entry.match|split(',') %}
            <span class="label label-info">{{ match }}</span>
            {% endfor %}
        </td>
        <td data-value="{{ entry.amount_min }}">
            {{  entry.amount_min|formatAmount  }}
        </td>
        <td data-value="{{ entry.amount_max }}">
            {{  entry.amount_max|formatAmount  }}
        </td>
            {% if entry.lastFoundMatch %}
            <td data-value="{{ entry.lastFoundMatch.format('U') }}">
                {{entry.lastFoundMatch.formatLocalized(monthAndDayFormat)}}
            </td>
            {% else %}
            <td data-value="0">
                <em>{{ 'unknown'|_ }}</em>
            </td>
            {% endif %}

            {% if entry.nextExpectedMatch%}
            <td data-value="{{entry.nextExpectedMatch.format('U')}}">
                {{entry.nextExpectedMatch.formatLocalized(monthAndDayFormat)}}
            </td>
            {% else %}
            <td data-value="0">
                <em>{{ 'unknown'|_ }}</em>
            </td>
            {% endif %}

        <td data-value="{{ entry.active }}">
            {% if entry.active %}
                <i class="fa fa-fw fa-check"></i>
            {% else %}
                <i class="fa fa-fw fa-ban"></i>
            {% endif %}
        </td>
        <td data-value="{{ entry.automatch }}">
            {% if entry.automatch %}
                 <i class="fa fa-fw fa-check"></i>
            {% else %}
                 <i class="fa fa-fw fa-ban"></i>
             {% endif %}
         </td>
        <td data-value="{{ entry.repeat_freq }}{{ entry.skip }}">
            {{ entry.repeat_freq|_ }}
             {% if entry.skip > 0 %}
                skips over {{entry.skip}}
             {% endif %}
         </td>
    </tr>

    {% endfor %}
    </tbody>
</table>
