{% 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">Comprobantes</h3>
        <!-- tools box -->
        &nbsp;
        <div class="btn-group">

            <a id="search-reset" href="{{ path('descarga_documentos') }}" class="btn btn-default" title="Descargar Excel ">
                <span class="fa fa-file-excel-o"></span>
            </a>

            <button type="submit" name="delete" class="btn btn-default"
                    title="{% trans %}list.bulk_delete{% endtrans %}"
                    data-confirm="{% trans %}list.bulk_delete_confirm{% endtrans %}"><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(comprobantes, 'list.name'|trans, 'c.razonsocial') }}
                </th>
                <th class="cell-size-medium">
                    {{ knp_pagination_sortable(comprobantes, 'Fecha', 'c.emision') }}
                </th>
                <th>
                    {{ knp_pagination_sortable(comprobantes, 'Documento', 'c.tipoDoc') }}
                </th>
                <th>
                    {{ knp_pagination_sortable(comprobantes, 'Numero', 'c.numero') }}
                </th>
                <th class="cell-size-medium cell-align-right">

                </th>
            </tr>
            </thead>
            <tbody>
            {% if  comprobantes|length == 0 %}
                <tr>
                    <td colspan="6">No se encontraron comprobantes</td>
                </tr>
            {% endif %}
            {% for key, result in comprobantes %}
                {% set entity = result %}
                <tr data-link="{{ path('customer_edit', { 'id': entity.id }) }}">
                    <td class="table-action cell-align-center no-link">
                        {{ form_row(list_form.comprobantes[key]) }}
                    </td>
                    <td class="cell-size-medium">{{ entity.razonSocial }}</td>
                    <td class="cell-size-medium">{{ entity.emision | date("m/d/Y") }}</td>
                    <td class="cell-size-medium text-center"><div class="text-center">{{ entity.tipoDoc}}</div></td>
                    <td>{{ entity.numero }}</td>
                    <td class="cell-align-right"><a
                                href="{{ path('descarga_index', {'search_comprobante': {'comprobante': entity.claveAcceso}}) }}"
                                class="btn"><span class="fa fa-file-pdf-o"></span>&nbsp; PDF</a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="box-footer clearfix">
        <div class="navigation">
            {{ knp_pagination_render(comprobantes) }}
        </div>
    </div>

</div>
{{ form_end(list_form) }}



