{% trans_default_domain 'customer' %}
{{ form_start(list_form) }}

<div class="box pad">
    <div class="box-header">
        <i class="fa fa-list-ul"></i>
        <h3 class="box-title">Transportistas</h3>
        <!-- tools box -->
        &nbsp;
        <div class="btn-group">

            <button type="submit" name="delete" class="btn btn-default"
                    title="{% trans %}list.bulk_delete{% endtrans %}"
                    data-confirm="¿Estás seguro de eliminar el transportista?"><span
                        class="glyphicon glyphicon-trash"></span></button>

            {#<button type="submit" name="print" class="btn btn-default" title="{% trans %}list.bulk_print{% endtrans %}">
                <span class="glyphicon glyphicon-print"></span></button>
            <button type="submit" name="pdf" class="btn btn-default" title="{% trans %}list.bulk_pdf{% endtrans %}">
                <span class="glyphicon glyphicon-download-alt"></span></button>#}
        </div>
    </div>
    <div class="box-body">
        <table class="table table-condensed table-striped align-middle" data-type="customers">
            <thead>
            <tr>
                <th class="cell-size-tiny cell-align-center">
                    <input type="checkbox" name="all"/>
                </th>
                <th class="cell-size-medium">
                    {{ knp_pagination_sortable(transportistas, 'list.name'|trans, 'c.name') }}
                </th>
                <th>
                    {{ knp_pagination_sortable(transportistas, 'list.identification'|trans, 'c.identification') }}
                </th>
                <th>
                    {{ knp_pagination_sortable(transportistas, 'Placa', 'c.placa') }}
                </th>

            </tr>
            </thead>
            <tbody>
            {% if transportistas|length == 0 %}
                <tr>
                    <td colspan="6">No se encontraron transportistas</td>
                </tr>
            {% endif %}
            {% for key, result in transportistas %}
                {% set entity = result %}
                <tr data-link="{{ path('transportista_edit', { 'slug': entity.slug, 'id':entity.id }) }}">
                    <td class="table-action cell-align-center no-link">
                        {{ form_row(list_form.invoices[key]) }}
                    </td>
                    <td class="cell-size-medium">{{ entity.name }}</td>
                    <td>{{ entity.identification }}</td>
                    <td>{{ entity.placa }}</td>
                    {#<td class="cell-align-right">{{ result.due_amount|localizedcurrency(currency, app.request.locale) }}</td>
                    <td class="cell-align-right">{{ result.gross_amount|localizedcurrency(currency, app.request.locale) }}</td>
                    <td class="cell-align-right"><a
                                href="{{ path('invoice_index', {'search_invoice': {'customer': entity.name}}) }}"
                                class="btn btn-info"><span
                                    class="glyphicon glyphicon-book"></span> {% trans %}
                            list.invoices{% endtrans %}</a></td>#}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="box-footer clearfix">
        <div class="navigation">
            {{ knp_pagination_render(transportistas) }}
        </div>
    </div>
</div>
{{ form_end(list_form) }}
