{% extends 'layout.twig' %}

{% block body %}
    <div class="contenu clearfix">
        <H1>{{ 'Bons de sortie' | trad }}</H1>
        {{ ariane() }}
        <div class="tab-content" id="tab-content">
            <H3>
                {{ strBuild('Visualisation du bon de sortie N° @1@' | trad, [bonSortie.NO_BS])  }}
            </H3>

            <details open class="block_edition clearfix">
                <summary class="titre_block">
                    {{ strBuild('Entête du bon de sortie N° @1@' | trad, [bonSortie.NO_BS]) }}
                </summary>
                <div style="padding:15px;">
                    <div class="clearfix mb-0">
                        <div class="colonne3 mb-0">
                            <div class="informations mb-0">
                                <p>
                                    <span class="champs_label">{{ 'N° de bon de sortie' | trad }}</span>
                                    <span class="resultat">{{ bonSortie.NO_BS }}</span>
                                </p>
                                <p>
                                    <span class="champs_label">{{ 'Société' | trad }}</span>
                                    <span class="resultat">{{ societe.RAIS_SOC ~ ' (' ~ bonSortie.CODE_STE ~ ')' }}</span>
                                </p>
                                <p>
                                    <span class="champs_label">{{ 'Origine' | trad }}</span>
                                    <span class="resultat">{{ bonSortie.ORIGINE | visualise }}</span>
                                </p>
                                {% if bonSortie.DTE_VALID != '00000000' and is_prix_visible() %}
                                    <p>
                                        <span class="champs_label">{{ 'Total BS' | trad }}</span>
                                        <span class="resultat text-right">{{ bonSortie.TOT_BS | prix ~ ' ' ~ bonSortie.DEVISE }}</span>
                                    </p>
                                {% endif %}
                            </div>
                        </div>
                        <div class="colonne3 mb-0">
                            <div class="informations mb-0">
                                <p>
                                    <span class="champs_label">{{ 'Créé le' | trad }}</span>
                                    <span class="resultat">{{ bonSortie.DTE_CREAT | dateTrad }}</span>
                                </p>
                                <p>
                                    <span class="champs_label">
                                        {{ 'Validé le' | trad }}
                                    </span>
                                    <span class="resultat">
                                        {{ bonSortie.DTE_VALID | dateTrad }}
                                    </span>
                                </p>
                                <p>
                                    <span class="champs_label">{{ 'Destinataire' | trad }}</span>
                                    <span class="resultat">{{ (destinataire.RS ~ ' (' ~ bonSortie.DEST  | visualise ~ ')') | visualise }}</span>
                                </p>
                            </div>
                        </div>
                        <div class="colonne3 mb-0">
                            <div class="informations mb-0">
                                <p>
                                    <span class="champs_label">{{ 'Magasinier' | trad }}</span>
                                    <span class="resultat">{{ utilisateur.NOM ~ ' (' ~ bonSortie.MAG ~ ')' }}</span>
                                </p>
                                <p>
                                    <span class="champs_label">{{ 'Site' | trad }}</span>
                                    <span class="resultat">{{ siteStock.DESIGN ~ ' (' ~ bonSortie.SITE ~ ')'  }}</span>
                                </p>
                                <p>
                                    <span class="champs_label">{{ 'Taux de marge' | trad }}</span>
                                    <span class="resultat text-right">{{ bonSortie.MARK_UP| prix ~ ' %' }}</span>
                                </p>
                            </div>
                        </div>
                        {% if CSExist('SBS_ENTE') %}
                            {{ VisualisationCS('SBS_ENTE', autoCompletCodeEnr(bonSortie.NO_BS)) }}
                        {% endif %}
                    </div>
                </div>
            </details>
            {{ include('@Stock/LigneBonSortie/Composant/_table.twig', { lignesBonSortie: lignesBonSortie }) }}
        </div>
    </div>
{% endblock %}