<div class="blocFrs" id="blocFrs__{{frs.ID_BLOC}}">
    <h3>
    
        {% if frs.COD_FOURN == getConst('fournisseurStock') %}
            {{ 'Site de stock' | trad }} : {{ infoSiteStock.DESIGN }} ({{ infoSiteStock.SITE }})
        {% elseif frs.COD_FOURN != '' %}
            {{ frs.RS }} ({{ frs.COD_FOURN }})
        {% endif %}
    </h3>

    {% if listeErrorFraisPort %}
        <span class="error">{{ 'Article de frais de port indisponible' | trad }} : {{ listeErrorFraisPort[frs.CRITERE_REGROUP] |join(' ')  }}</span>
    {% endif %}

    <div class="ligneFrs">
        <div class="sectionFrs">
            {% if frs.COD_FOURN != getConst('fournisseurStock') and frs.COD_FOURN != '' %}
                <a href="{{ path('RechercheArticles.fournisseur.fiche', {idFourn : frs.COD_FOURN, codRegroup:frs.ID_BLOC}) }}">
                    <span class="icon-fournisseur hover"></span>
                </a>
                {% if frs.ARTFRPORT %}
                    {# <span style="width: 25px;   height: 25px;   margin-left: 10px;" class="icon-postage"></span> #}
                    <span class="white-tooltip tooltipsFraisPort">
                        <span class="infos_tooltip right">
                                <ul class="dataWrapper">
                                    <li><div>{{ trad['Frais de port'] }} :</div><div>{{ frs.PRIX_ARTPORT |prixUnitaire  }}</div></li>
                                    {% if frs.MNTMINFRA > 0 %}
                                        <li><div>{{ trad['Minimum franco'] }} :</div><div> {{ frs.MNTMINFRA |prixUnitaire  }} {{ frs.DEV_FOU }}</div></li>
                                    {% endif %}
                                    {% if frs.FRPOBLIG | boolSql %}<li class="articleFraisPort"><div>{{ trad['Port obligatoire'] }}</div></li>{% endif %}
                                </ul>
                        </span>
                        <span style="width:25px; height:25px;margin-left:10px;" class="icon-postage"></span>
                    </span>
                {% endif %}
                <div class="row sectionAdr" id="adressCde{{ frs.ID_BLOC }}">
                    {{ inputAdvance('SELECT', {
                        'name' : 'ADR'~spliter()~frs.ID_BLOC,
                        'titre' : trad['Adresse de commande'],
                        'listeValue' : frs.listeAdresse,
                        'value' : frs.CODE_ADR,
                        'option' : frs.listeAdresse|lengthTable>1? '':'disabled',
                        'inputAttr' : {
                            'data-updatevalue' : 'on',
                        },
                    }) }}
                </div>
            {% endif %} 
        </div>

        {% if panier.flg_panier_modele == 0 %}
            <div class="sectionLivraison">
                {% if frs.COD_FOURN != '' and frs.COD_FOURN !='RESERVESTOCK' %}
                    <div class="row">
                        {{ inputAdvance('SELECT', {
                            'name' : 'TYP_ACH'~spliter()~frs.ID_BLOC,
                            'listeValue' : listeTacFyfo[frs.COD_FOURN],
                            'titre' : trad['Type d\'achat'],
                            'value' : frs.TYP_ACH??typeAchatParDefautByFrs[frs.COD_FOURN],
                            'option' : (listeTacFyfo[frs.COD_FOURN] | length == 1) and (frs.TYP_ACH??typeAchatParDefautByFrs[frs.COD_FOURN]) != ''? 'readOnly':'',
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div>
                

                    <div class="">
                        {{ inputAdvance('SWITCH', {
                            'name' : 'TYP_ACH_CONF'~spliter()~frs.ID_BLOC,
                            'value' : (frs.TYP_ACH? true:false),
                            'styleText': 'display:none',
                            'option' : (listeTacFyfo[frs.COD_FOURN] | length == 1) and (frs.TYP_ACH??typeAchatParDefautByFrs[frs.COD_FOURN]) != ''? 'readOnly':'',
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div>
                {% endif %}

                {% if frs.COD_FOURN != getConst('fournisseurStock') %}
                    <span class="spliter"></span>

                    <a href="{{ path('Panier.Fournisseur.popupContactLivraison', {idBlocFrs:frs.ID_BLOC}) }}">{{ trad['Contact de livraison'] }}</a>
                {% endif %}

                <span class="spliter"></span>

                {% if frs.RECEP_AUTO | boolSql == false %}
                    <div class="row">
                        {{ inputAdvance('DATE', {
                            'name' : 'DATELIVR'~spliter()~frs.ID_BLOC,
                            'titre' : trad['Date de livraison'],
                            'value' : frs.DATELIVR |dateTrad,
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-refreshliv' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div> 
                {% endif %}
            </div>

            {% if frs.RECEP_AUTO | boolSql %}
                <div class="sectionRecepAuto">  
                    <div class="row">
                        {{ inputAdvance('SELECT', {
                            'name' : 'PER_REC_AUTO'~spliter()~frs.ID_BLOC,
                            'titre' : trad['Périodicité'],
                            'listeValue' : listePeriodicite(),
                            'value' : frs.PER_REC_AUTO,
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-refreshliv' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div> 
                    <div class="row">
                        {{ inputAdvance('DATE', {
                            'name' : 'DATEDEBCONT'~spliter()~frs.ID_BLOC,
                            'titre' : trad['Date début'],
                            'value' : frs.DATEDEBCONT |dateTrad,
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-refreshliv' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div> 
                    <div class="row" >
                        {{ inputAdvance('DATE', {
                            'name' : 'DATEFINCONT'~spliter()~frs.ID_BLOC,
                            'titre' : trad['Date fin'],
                            'value' : frs.DATEFINCONT |dateTrad,
                            'inputAttr' : {
                                'data-updatevalue' : 'on',
                                'data-refreshliv' : 'on',
                                'data-critere' : frs.ID_BLOC
                            },
                        }) }}
                    </div> 
                </div>
            {% endif %}
        {% endif %}
        
        {% if parametrage.BONNE_PRATIQUE %}
            <div class="dossierAchat">
                <span class="spliter"></span>
                {{ inputAdvance('SWITCH', {
                    'titre' : trad['Dossier achat complet ?'],
                    'name' : 'DOSSIER_ACHAT_COMP'~spliter()~frs.ID_BLOC,
                    'value' : frs.DOSSIER_ACHAT_COMP,
                    'styleText': 'display:none',
                    'inputAttr' : {
                        'data-updatevalue' : 'on',
                    },
                }) }}
                <span   style="width:25px; height:25px;margin-left:10px;" 
                        class="blocNote pointer" 
                        onClick="ajaxPopup('{{ path('Panier.Panier.popupBonnePratique' , {idBlocFrs:frs.ID_BLOC}) }}', '{{ 'Commentaire du suivi achat' | trad }}');"
                ></span>
            </div>
        {% endif %}
    </div>

    <ul class="nav nav-tabs" role="tablist" id="tablist{{frs.ID_BLOC}}" data-divmodule="DivModulable{{frs.ID_BLOC}}">
        <li id="ongletdetailPanier{{frs.ID_BLOC}}" role="presentation" class="perma active">
            <a 
                id="triggerOngletdetailPanier{{frs.ID_BLOC}}"
                href="#detailPanier{{frs.ID_BLOC}}" 
                aria-controls="data" 
                role="tab" 
                data-toggle="tab" 
                class="mainTabFrs"
            >
                {{ trad['Détail Panier'] }}
            </a>
        </li>
        {% if parametrage.AFFICHAGE_ONGLET_INSTRUCT_FRS %}
            <li id="ongletinstruction{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletinstruction{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#instruction{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'instruction_frs', idBlocFrs: frs.ID_BLOC}) }}"
                >
                    {{ trad['Instructions Frs'] }}
                    </a>
            </li>
        {% endif %}
        {% if parametrage.AFFICHAGE_ONGLET_CLAUSES %}
            <li id="ongletclause{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletclause{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#clause{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'clauses', idBlocFrs: frs.ID_BLOC}) }}"
                >
                    {{ trad['Clauses'] }}
                    </a>
            </li>
        {% endif %}
        {% if parametrage.AFFICHAGE_ONGLET_PJ %}
            <li id="ongletpj{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletpj{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#pj{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'pieces_jointes', idBlocFrs: frs.ID_BLOC}) }}"
                    data-refreshbloc="on"
                >
                    {{ trad['Pièces Jointes'] }}
                </a>
            </li>
        {% endif %}
        {% if parametrage.AFFICHAGE_ONGLET_DOC_RATT %}
            <li id="ongletdoc{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletdoc{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#doc{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'documents', idBlocFrs: frs.ID_BLOC}) }}"
                    data-refreshbloc="on"
                >
                    {{ trad['Docs. rattachés'] }}
                </a>
            </li>
        {% endif %}
        {% if parametrage.AFFICHAGE_ONGLET_LIVRAISON %}
            <li id="ongletlivraison{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletlivraison{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#livraison{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'livraison', idBlocFrs: frs.ID_BLOC}) }}"
                >
                    {% if frs.RECEP_AUTO | boolSql or frs.artRecepAuto > 0 %}
                        <span class="white-tooltip">
                            <img style="width: 20px;  height: 20px;" src='{{ baseUrl('IconeV2/Global/supplier-automatic-delivery.svg') }}'>
                            <span class="infos_tooltip top-left ">
                                {{ 'Réception automatique' }}		
                            </span>
                        </span>
                    {% endif %}
                    {{ trad['Livraison'] }}
                </a>
            </li>
        {% endif %}
        <li id="ongletimputation{{frs.ID_BLOC}}" 
            role="presentation" 
            class="perma tabImputation" 
            {% if eclatementImputation %}style="display:none;"{% endif %}
        >
            <a 
                id="triggerOngletimputation{{frs.ID_BLOC}}"
                href="#imputation{{frs.ID_BLOC}}" 
                aria-controls="data" 
                role="tab" 
                data-toggle="tab"
                data-idbloc="{{frs.ID_BLOC}}"
                data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'imputation', idBlocFrs: frs.ID_BLOC}) }}"
            >
                {{ trad['Imputations'] }}
            </a>
        </li>
        {% if frs.BDD_PRESENT > 0 %}
            <li id="ongletinfoFrs{{frs.ID_BLOC}}" role="presentation" class="perma">
                <a 
                    id="triggerOngletinfoFrs{{frs.ID_BLOC}}"
                    class="chargeTab"
                    href="#infoFrs{{frs.ID_BLOC}}" 
                    aria-controls="data" 
                    role="tab" 
                    data-toggle="tab"
                    data-idbloc="{{frs.ID_BLOC}}"
                    data-path="{{ path('Panier.TabBlocFrs.chargeTabFrs', {tab: 'info_frs', idBlocFrs: frs.ID_BLOC}) }}"
                >
                    {{ trad['Infos Frs'] }}
                </a>
            </li>
        {% endif %}
        <li id="onglet_DivModulable{{frs.ID_BLOC}}" style="display:none">
            <a data-toggle="tab" href="#DivModulable{{frs.ID_BLOC}}" class="ephemere"></a>
        </li>  
    </ul>

    <div class="tab-content">
        <div id="detailPanier{{frs.ID_BLOC}}" class="tab-pane clearfix active">
            {% include '@Panier/Panier/tab_frs/_liste_articles.twig' %}
        </div>
        <div id="instruction{{frs.ID_BLOC}}" class="tab-pane clearfix box-form fade">
        </div>
        <div id="clause{{frs.ID_BLOC}}" class="tab-pane clearfix box-form fade">
        </div>
        <div id="pj{{frs.ID_BLOC}}" class="tab-pane clearfix box-form fade">
        </div>
        <div id="doc{{frs.ID_BLOC}}" class="tab-pane clearfix bg_form padding_form fade">
        </div>
        <div id="imputation{{frs.ID_BLOC}}" class="tab-pane clearfix fade divImpuLigne">
        </div>
        <div id="livraison{{frs.ID_BLOC}}" class="tab-pane clearfix border_form fade">
        </div>
        <div id="infoFrs{{frs.ID_BLOC}}" class="tab-pane clearfix box-form fade">
        </div>
        <div id="DivModulable{{frs.ID_BLOC}}" class="tab-pane fade clearfix">
        </div>
    </div>
</div>