{% set modeSecondNiveau = true %}
<div id="sousDocument">
    {% if source != 'Consult' and listeConsult %}
        <div id="tableConsult{{idDoc}}" class="border_form" {% if parametrage.COLOR_SUIVI %}style="background-color:#ffb30015;"{% endif %}>
            <h5>{{ 'Liste des consultations' | trad }}</h5>
            <table class="table table-hover" id="mainTableConsult{{idDoc}}">
                <thead>
                    <tr>
                        <th scope="col" width="110px">{{ 'N° de consultation' | trad }}</th>
                        <th scope="col" width="100px">{{ 'Société' | trad }}</th>
                        <th scope="col">{{ 'Centre émetteur' | trad }}</th>
                        <th scope="col">{{ 'Acheteur' | trad }}</th>
                        <th scope="col">{{ 'Date de création' | trad }}</th>
                        <th scope="col">{{ 'Date limite de réponse' | trad }}</th>
                        <th scope="col" colspan="2">{{ 'Actions' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for consult in listeConsult %}
                        {% include '@suivi/Consultations/_enteteConsult.twig' %}
                    {% endfor %}
                </tbody>
            </table>    
        </div>
    {% endif %}
    
    {% if source != 'DA' and listeDa %}
        <div id="tableDa{{idDoc}}" class="border_form" {% if parametrage.COLOR_SUIVI %}style="background-color:#ff000015;"{% endif %}>
            <h5>{{ 'Liste des demandes d\'achat' | trad }}</h5>
            <table class="table table-hover" id="mainTableDa{{idDoc}}">
                <thead>
                    <tr>
                        <th scope="col" width="110px">{{ 'N° Demande' | trad }}</th>
                        <th scope="col">{{ 'Type' | trad }}</th>
                        <th scope="col" width="100px">{{ 'Société' | trad }}</th>
                        <th scope="col">{{ 'Fournisseur' | trad }}</th>
                        <th scope="col">{{ 'Demandeur' | trad }}</th>
                        <th scope="col">{{ 'Section d\'imputation' | trad }}</th>
                        <th scope="col">{{ 'Objet' | trad }}</th>
                        <th scope="col">{{ 'Date livraison' | trad }}</th>
                        {% if parametrage.AFFTTC %}
                            <th scope="col">{{ 'Total TTC' | trad }}</th>
                        {% else %}
                            <th scope="col">{{'Total HT' | trad }}</th>
                        {% endif %}
                        <th scope="col">{{ 'Statut' | trad }}</th>
                        <th scope="col" colspan="2">{{ 'Actions' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for da in listeDa %}
                        {% include '@suivi/DemandesAchats/_enteteDa.twig' %}
                    {% endfor %}
                </tbody>
            </table>    
        </div>
    {% endif %}
    {% if source != 'CDE' and listeCde %}    
        <div id="tableCde{{idDoc}}" class="border_form" {% if parametrage.COLOR_SUIVI %}style="background-color:#0087ff15;"{% endif %}>
            <h5>{{ 'Liste des commandes' | trad }}</h5>
            <table class="table table-hover" id="mainTableCde{{idDoc}}">
                <thead>
                    <tr>
                        <th scope="col" width="110px">{{  'N° Commande' | trad }}</th>
                        <th scope="col" width="100px">{{ 'Société' | trad }}</th>
                        <th scope="col">{{ 'Fournisseur' | trad }}</th>
                        <th scope="col">{{ 'Acheteur' | trad }}</th>
                        <th scope="col">{{ 'Section d\'imputation' | trad }}</th>
                        <th scope="col">{{ 'Objet' | trad }}</th>
                        <th scope="col">{{ 'Date Création' | trad }}</th>
                        <th scope="col">{{ 'Date livraison' | trad }}</th>
                        {% if parametrage.AFFTTC %}
                            <th scope="col">{{ 'Total TTC' | trad }}</th>
                        {% else %}
                            <th scope="col">{{'Total HT' | trad }}</th>
                        {% endif %}
                        <th scope="col">{{ 'Statut' | trad }}</th>
                        <th scope="col" colspan="3">{{ 'Actions' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for cde in listeCde %}
                        {% include '@suivi/Commandes/_enteteCde.twig' %}
                    {% endfor %}
                </tbody>
            </table>  
        </div>  
    {% endif %}
    {% if source != 'Recep' and listeRecep %}
        <div id="tableRecep{{idDoc}}" class="border_form" {% if parametrage.COLOR_SUIVI %}style="background-color:#38ff0015;"{% endif %}>
            <h5>{{ 'Liste des réceptions' | trad }}</h5>
            <table class="table table-hover" id="mainTableRecep{{idDoc}}">
                <thead>
                    <tr>
                        <th scope="col" width="110px">{{ 'N° BR' | trad }}</th>
                        <th scope="col">{{ 'Type' | trad }}</th>
                        <th scope="col">{{ 'N° Commande' | trad }}</th>
                        <th scope="col" width="100px">{{ 'Société' | trad }}</th>
                        <th scope="col">{{ 'Fournisseur' | trad }}</th>
                        <th scope="col">{{ 'Créateur' | trad }}</th>
                        <th scope="col">{{ 'Date de création' | trad }}</th>
                        <th scope="col">{{ 'N° de BL' | trad }}</th>
                        <th scope="col">{{ 'Date de BL' | trad }}</th>
                        {% if parametrage.AFFTTC %}
                            <th scope="col">{{'Total TTC' | trad }}</th>
                        {% else %}
                            <th scope="col">{{'Total HT' | trad }}</th>
                        {% endif %}
                        <th scope="col" colspan="2">{{ 'Actions' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for recep in listeRecep %}
                        {% include '@suivi/Receptions/_enteteRecep.twig' %}
                    {% endfor %}
                </tbody>
            </table>    
        </div>
    {% endif %}
    {% if source != 'Fac' and listeFac %}
        <div id="tableFac{{idDoc}}" class="bg_form" {% if parametrage.COLOR_SUIVI %}style="background-color:#ff00a715;"{% endif %}>
            <h5>{{ 'Liste des factures' | trad }}</h5>
            <table class="table table-hover" id="mainTableFac{{idDoc}}">
                <thead>
                    <tr>
                        <th scope="col" width="110px">{{ 'N° Facture' | trad }}</th>
                        <th scope="col" width="100px">{{ 'Société' | trad }}</th>
                        <th scope="col">{{ 'Fournisseur' | trad }}</th>
                        <th scope="col">{{ 'Ref. Fac. Frs.' | trad }}</th>
                        <th scope="col">{{ 'Libellé comptable' | trad }}</th>
                        <th scope="col">{{ 'Date enregistrement' | trad }}</th>
                        <th scope="col">{{ 'N° Commande' | trad }}</th>
                        <th scope="col">{{ 'Total HT' | trad }}</th>
                        {% if parametrage.AFFTTC %}
                            <th scope="col">{{ 'Total TTC' | trad }}</th>
                        {% endif %}
                        <th scope="col" colspan="2">{{ 'Actions' | trad }}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for fac in listeFac %}
                        {% include '@suivi/Factures/_enteteFac.twig' %}
                    {% endfor %}
                </tbody>
            </table>    
        </div>
    {% endif %}
</div>
<style>
    #sousDocument > div {
        margin-bottom:10px;
        border-radius:6px;
        box-shadow:var(--box-shadow);
        padding:10px;
        background-color: white;
    }
    {% if parametrage.COLOR_SUIVI %}{% else %}
        #sousDocument h5 {
            color : var(--main-color-client2-opac50);
        }
    {% endif %}
</style>