
{% extends '@ajax-layout/layout.twig' %}

{% block body %}
    <div id="genetableau">
        <center>
            <div>
                {% set formName = "formVisualisationParArticle" %}
                <form method="POST" id="{{ formName }}">
                    <input type="hidden" name="filter_egal_SM#point#CODE_ART" value="{{ post['filter_egal_SM#point#CODE_ART'] }}" />
                    <input type="hidden" name="filter_egal_SM#point#SITE" value="{{ post['filter_egal_SM#point#SITE'] }}" />
                    <table class="table" id="tableau">
                        <thead class="thead-dark">
                            <tr>
                                <th>{{ triTable('DTE_MVT',  infoPagination.filter.tri_DTE_MVT, 'Date'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('NO_MVT',  infoPagination.filter.tri_NO_MVT, 'N° de Mvt'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('TYPE_MVT',  infoPagination.filter.tri_TYPE_MVT, 'Type'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('TYPE_ENT',  infoPagination.filter.tri_TYPE_ENT, 'Entité'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('QTE_MVT',  infoPagination.filter.tri_QTE_MVT, 'Quantité'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('UNITE_STK',  infoPagination.filter.tri_UNITE_STK, 'Unité'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('PU',  infoPagination.filter.tri_PU, 'Prix unitaire'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('DEVISE',  infoPagination.filter.tri_DEVISE, 'Devise'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                                <th>{{ triTable('TIERS',  infoPagination.filter.tri_TIERS, 'Tiers'| trad, 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <th>{{ filterTable('date_SM#point#DTE_MVT', post['filter_date_SM#point#DTE_MVT'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle') ,formName, 'datepicker') }}</th>
                            <th>{{ filterTable('egal_SM#point#NO_MVT', post['filter_egal_SM#point#NO_MVT'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            <th>{{ filterSelect('egal_SM#point#TYPE_MVT', post['filter_egal_SM#point#TYPE_MVT'], listeChoixTypesMvt, formName, '', 'genetableau', path('Stock.Mouvement.visualisationParArticle')) }}</th>
                            <th>{{ filterSelect('egal_SM#point#TYPE_ENT', post['filter_egal_SM#point#TYPE_ENT'], listeChoixTypeEnt, formName, '', 'genetableau', path('Stock.Mouvement.visualisationParArticle')) }}</th>
                            <th>{{ filterTable('egal_SM#point#QTE_MVT', post['filter_egal_SM#point#QTE_MVT'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            <th>{{ filterTable('egal_SM#point#UNITE_STK', post['filter_egal_SM#point#UNITE_STK'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            <th>{{ filterTable('egal_SM#point#PU', post['filter_egal_SM#point#PU'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            <th>{{ filterTable('egal_SM#point#DEVISE', post['filter_egal_SM#point#DEVISE'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                            <th>{{ filterTable('egal_SM#point#TIERS', post['filter_egal_SM#point#TIERS'], '', 'genetableau', path('Stock.Mouvement.visualisationParArticle'), formName) }}</th>
                        </tr>
                        {% for mouvement in mouvements %}
                            <tr id="smouveme{{ mouvement.NO_MVT }}" class="{% if loop.index is divisible by(2) %}even{% else %}odd{% endif %}">
                                <td
                                        class="code toggleSlide"
                                        onclick="toggleSlide('{{ path('Stock.Mouvement.ligne', { noMvt: mouvement.NO_MVT }) }}','smouveme{{ mouvement.NO_MVT }}detail', {id : {{ mouvement.NO_MVT }}});"
                                >
                                    {{ mouvement.DTE_MVT | dateTrad }}
                                </td>
                                <td>{{ mouvement.NO_MVT }}</td>
                                <td>{{ listeChoixTypesMvt[mouvement.TYPE_MVT] }}</td>
                                <td>{{ listeChoixTypeEnt[mouvement.TYPE_ENT] }}</td>
                                <td class="text-right">{{ mouvement.QTE_MVT | qte }}</td>
                                <td>{{ mouvement.UNITE_STK }}</td>
                                <td class="text-right">{{ mouvement.PU | prixUnitaire }}</td>
                                <td>{{ mouvement.DEVISE }}</td>
                                <td>{{ mouvement.TIERS }}</td>
                            </tr>
                            <tr class="detail_ligne hide_detail" id="smouveme{{ mouvement.NO_MVT }}detail"></tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </form>
                {{ paginations(path('Stock.Mouvement.visualisationParArticle'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'modal-body') }}
            </div>
        </center>
    </div>
{% endblock %}