%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emtnaeewxm/www/src/EEM/PieceBundle/Resources/views/piece/
Upload File :
Create Path :
Current File : /home/emtnaeewxm/www/src/EEM/PieceBundle/Resources/views/piece/index.html.twig

{% extends 'layout_admin.html.twig' %}

{% block body %}
    <div class="row">
        <div class="col-md-12">
            <h4>Liste des {{ type_piece!='devis' ? typePiece~'s': typePiece }}</h4>
            <hr class="hr_titre">
        </div>
    </div>
    <div class="row m_b_20">
        <div class="col-md-12">
            <ul class="ul_action_bouton">
                <li>
                    <a class="btn btn-primary btn-sm" href="{{ path('piece_new',{'type':type_piece}) }}"><span
                                class="fa fa-plus"></span>
                        {{ typePiece }}</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="row m_t_20">
        <div class="col-md-12">
            <table class="table table-stripped ">
                <thead>
                <tr>
                    <th>N°</th>
                    <th>Date</th>
                    <th>Client</th>
                    <th class="text-right">Total</th>
                    <th class="text-right">Actions</th>
                </tr>
                </thead>
                <tbody>
                {% if pieces|length > 0 %}
                    {% if type_piece=='facture' %}
                        {% set prefix='FCT' %}
                    {% elseif type_piece=='devis' %}
                        {% set prefix='DEV' %}
                    {% elseif type_piece=='bon_livraison' %}
                        {% set prefix='BL' %}
                    {% endif %}
                    {% for piece in pieces %}
                        {% set total_piece=0 %}
                        {% for ligne_piece in piece.lignePieces %}
                            {% set total_piece=total_piece + ligne_piece.totalPrix %}
                        {% endfor %}
                        <tr>
                            <td>{{ prefix~piece.annee~piece.num|numeroPiece }}</td>
                            <td>{% if piece.datePiece %}{{ piece.datePiece|date('d/m/Y') }}{% endif %}</td>
                            <td>{{ piece.client ? piece.client.prenom~' '~piece.client.nom : '' }}</td>
                            <td class="text-right">{{ total_piece|number_format(3,'.',' ') }}</td>
                            <td>
                                <ul class="ul_action_bouton">
                                    <li>
                                        <a class="btn btn-sm btn-warning"
                                           href="{{ path('piece_edit', { 'id': piece.id }) }}"><span
                                                    class="fa fa-info-circle"></span> Modifier</a>
                                    </li>
                                    <li>
                                        <a class="btn btn-sm btn-info"
                                           href="{{ path('piece_show', { 'id': piece.id }) }}"><span
                                                    class="fa fa-edit"></span> Détails</a>
                                    </li>
                                </ul>
                            </td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="5">
                            <div class="alert alert-info">Aucun élément disponible</div>
                        </td>
                    </tr>
                {% endif %}
                </tbody>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="navigation">
                {{ knp_pagination_render(pieces) }}
            </div>
        </div>
    </div>
{% endblock %}

Zerion Mini Shell 1.0