{% extends 'layout.twig' %}
     
{% block body %}


    	<div class="contenu clearfix titre_div"  id="fournisseurs">
        	<h1>{{ 'Fournisseurs' | trad }}</h1>
        	
        	{{ ariane() }}
        	
        	<h2>
        	    {{ 'Fournisseurs' | trad }} : {{ libelle_fournisseur??libelle }} ({{ code_fournisseur??id }})
        		{# <button class="button secondaire export" onClick="exportCSV('{{ path('Fournisseur.Facture.exportFactureCSV', {id: code_fournisseur}) }}', 'FormFactureFournisseur');">{{'Export Facture' | trad}}</button> #}
				{{ ButtonExport(path('Fournisseur.Facture.exportFactureCSV', {id: code_fournisseur}), 'FormFactureFournisseur' , path('Ajax.Erreur.popupInformation') , path('Ajax.Outil.appelAsync'), 'Export' ) }}
        	</h2>
        	
            {{ arianeSub() }}
			<div class="tab-content">
			<form method='POST' id='FormFactureFournisseur' name='FormFactureFournisseur'>
					<div id="historique_facture" class="tab-pane pad-15 fade in active clearfix">
						<table class="table table-hover">
                        	<thead class="thead-dark">
                            	<tr>
                                	<th scope="col" width="130px">{{ triTable('NUM_FACT',  infoPagination.filter.tri_NUM_FACT, 'N° Enregistrement' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                	<th scope="col" width="120px">{{ triTable('DATE_ENR',  infoPagination.filter.tri_DATE_ENR, 'Enreg. le' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                	<th scope="col" width="120px">{{ triTable('DATE_FAFO',  infoPagination.filter.tri_DATE_FAFO, 'Emise le' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                	<th scope="col" width="120px">{{ triTable('DTAE_ECH',  infoPagination.filter.tri_DTAE_ECH, 'Echéance' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                	<th scope="col" class="align-right">{{ triTable('TOTAL_HT',  infoPagination.filter.tri_TOTAL_HT, 'Total HT' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                	<th scope="col" class="align-right">{{ triTable('TOTAL_TTC',  infoPagination.filter.tri_TOTAL_TTC, 'Total TTC' | trad, '', '', 'FormFactureFournisseur') }}</th>
                                    <th scope="col" width="40px" >{{ 'Actions' | trad }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="recherche">
                                	<td>{{ filterTable("NUM_FACT", infoPagination.filter.filter_NUM_FACT, "", "", "", "FormFactureFournisseur") }}</td>
                                	<td>{{ filterTable("DATE_ENR", infoPagination.filter.filter_DATE_ENR, "", "", "", "FormFactureFournisseur", "date") }}</td>
                                	<td>{{ filterTable("DATE_FAFO", infoPagination.filter.filter_DATE_FAFO, "", "", "", "FormFactureFournisseur", "date") }}</td>
                                	<td>{{ filterTable("DTAE_ECH", infoPagination.filter.filter_DTAE_ECH, "", "", "", "FormFactureFournisseur", "date") }}</td>
                                	<td>{{ filterTable("TOTAL_HT", infoPagination.filter.filter_TOTAL_HT, "", "", "", "FormFactureFournisseur") }}</td>
                                	<td>{{ filterTable("TOTAL_TTC", infoPagination.filter.filter_TOTAL_TTC, "", "", "", "FormFactureFournisseur") }}</td>
                                	<td></td>
                                </tr>
                                {% for facture in listeFacture %}
                                <tr id="historique_facture{{ facture.NUM_FACT }}">
                                	<td class="toggleSlide" onclick="toggleSlide('{{ path('Fournisseur.Facture.ajaxFacture', {id:facture.NUM_FACT}) }}', 'historique_facture{{ facture.NUM_FACT }}detail');">{{ facture.NUM_FACT }}</td>
                                	<td>{{ facture.DATE_ENR | dateTrad }}</td>
                                	<td>{{ facture.DATE_FAFO | dateTrad }}</td>
                                	<td>{{ facture.DTAE_ECH | dateTrad }}</td>
                                	<td class="montant">{{ facture.TOTAL_HT | prix}}</td>
                                	<td class="montant">{{ facture.TOTAL_TTC | prix}}</td>
                                	<td class="parametrage">
                                        {{ menuContextuel('historique_facture' ~ facture.NUM_FACT, false, facture.menuContextuel, 6) }}
                                    </td>
                                </tr>
                                <tr id="historique_facture{{ facture.NUM_FACT }}detail" class="detail_ligne hide_detail">
                                </tr>
                                {% endfor %}
                            </tbody>
                         </table>
                         {{ paginations(path('Fournisseur.Facture.facture', {id: code_fournisseur}),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, '') }}
					</div>	
				</div>
			</form>
			</div>
{% endblock %}