{% extends 'layout.twig' %}

{% block body %}

	<div class="contenu clearfix"  id="fournisseurs">
	<h1>
    	{{ (type=='F'? 'Fournisseurs':'Groupements de fournisseur') | trad }}
    </h1>
    

        {{ ariane() }}

    	<div class="tab-content">
          <div id="detail_fournisseur" class="clearfix">
          	<h2>
          	    {{ (type=='F'? 'Fournisseur':'Groupement')  | trad }} : {{ libelle_fournisseur??libelle }} ({{ code_fournisseur??id }})
                {% if listeArticles | length %}
            		{{ ButtonExport(path('GlobalApplication.ArticlesAssocies.exportArticles', {type:type,id: id}), 'filtre_articleAssocies', path('Ajax.Erreur.popupInformation') , path('Ajax.Outil.appelAsync')) }}
            	{% endif %}
                {{ Button('Nouvel Article' | trad, true, path('GlobalApplication.ArticlesAssocies.creationArticlesAssocies', {type:type,id: id}), '', {}, false, 'ajout') }}
            </h2>
		
        <div class="tab-content">
			<div id="articleAssocies" class="clearfix padding15">
				<form method="post" name="filtre_articleAssocies" id="filtre_articleAssocies">
    				<table class="table table-hover">
                    	<thead class="thead-dark">
                        	<tr>
                            	<th scope="col" width="15%">{{ triTable('CODE_ART',  infoPagination.filter.tri_CODE_ART, 'Code article' | trad, '', '', '') }}</th>
                                <th scope="col" >{{ triTable('DESIGN',  infoPagination.filter.tri_DESIGN, 'Désignation' | trad, '', '', '') }}</th>
                                <th scope="col" width="10%">{{ 'Coefficient' | trad }}</th>
                                <th scope="col" >{{ 'Obligatoire ?' | trad }}</th>
                                <th scope="col" width="6%">{{ 'Actions' | trad }}</th>
                            </tr>
                         </thead>
                         <tbody>
                            <tr class="recherche">
                                <td>{{ filterTable('CODE_ART',  infoPagination.filter.filter_CODE_ART, '', '', '', '', '') }}</td>
                                <td>{{ filterTable('DESIGN',  infoPagination.filter.filter_DESIGN, '', '', '', '', '') }}</td>
                                <td>{{ filterTable('COEFF',  infoPagination.filter.filter_COEFF, '', '', '', '', '') }}</td>
                                <td>{{ filterSelect('OBLIG', infoPagination.filter.filter_OBLIG, { T : 'Oui' | trad, F : 'Non' | trad}) }}</td>
                                <td></td>
                            </tr>        
                            {% for articles in listeArticles %}
                             	<tr id="{{ loop.index }}">
                                	<td>{{ articles.CODE_ART }}</td>
                                    <td>{{ articles.DESIGN }}</td>
                                    <td>{{ articles.COEFF }}</td>
                                    <td>{{ articles.OBLIG  | boolSql |boolTrad }}</td>
                                    <td class="parametrage no-float">
                                    	{{ menuContextuel(loop.index, false, articles.menuContextuel, 6) }}
                                    </td>
                                </tr>
                            {% endfor %}
                            
                         </tbody>
                     </table>
            	 </form>
           </div>
         </div>
         </div>
         </div>
         </div>
{% endblock %}

