{% extends 'layout.twig' %}

{% block body %}

<div class="contenu clearfix"  id="demandeAchats">

	<h1>
		{{ 'Liste DA' | trad }}

		{{ Button('Edition' | trad, false, '', '', '') }}
		{# {{ Button('Edition', false, '', 'ajaxPopup(\''~path('Commande.GestionCommande.popupExport')~'\', \'Export commande\', \'\', \'\', \'\', \'modal_export \')', '') }} #}
	</h1>
	
	{{ ariane() }}
	
	<div class="tab-content padding-Vert15">
		<form method="post" name="filtre_demandeAchat" id="filtre_demandeAchat">
											
			<table class="table table-hover">
				<thead class="thead-dark">
					<tr>
						<th scope="col">{{ triTable('NO_DA',  infoPagination.filter.tri_NO_DA, 'Numéro' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('NO_DEM',  infoPagination.filter.tri_NO_DEM, 'Demandeur' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('SECTIMP',  infoPagination.filter.tri_SECTIMP, 'SI' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('CODECOMP',  infoPagination.filter.tri_CODECOMP, 'CDC' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('SSCPTEANA',  infoPagination.filter.tri_SSCPTEANA, 'SCA' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('FOU',  infoPagination.filter.tri_FOU, 'Fournisseur' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col">{{ triTable('CTR_LIV',  infoPagination.filter.tri_CTR_LIV, 'Centre livraison' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th class="align-center" scope="col">{{ triTable('DTE_EMISS',  infoPagination.filter.tri_DTE_EMISS, 'Date émission' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th class="align-right" scope="col">{{ triTable('TOTAL_DA',  infoPagination.filter.tri_TOTAL_DA, 'Total HT' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th class="align-right" scope="col">{{ triTable('TOTAL_DA_TTC',  infoPagination.filter.tri_TOTAL_DA_TTC, 'Total TTC' | trad, '', '', 'filtre_demandeAchat') }}</th>
						<th scope="col" width="40px">{{ 'Actions' | trad }}</th>
					</tr>
				</thead>
				<tbody>
					<tr class="recherche">
						<td>{{ filterTable('NO_DA', infoPagination.filter.filter_NO_DA, '', '', '', 'filtre_demandeAchat', '', '') }}</td>
						<td>{{ zoomFilter('NO_DEM', infoPagination.filter['filter_NO_DEM'], '', 'filtre_demandeAchat', path('Ajax.liste.demandeur'),'Liste des demandeurs' | trad, '','', '','','','Hastutil') }}</td>
						<td>{{ zoomFilter('SECTIMP', infoPagination.filter['filter_SECTIMP'], '', 'filtre_demandeAchat', path('Ajax.liste.si'),'Liste des sections d\imputation' | trad |e('js')|raw, '','','','','','Sectimpu') }}</td>
						<td>{{ zoomFilter('CODECOMP', infoPagination.filter['filter_CODECOMP'], '', 'filtre_demandeAchat', path('Ajax.liste.cdc'),'Liste des codes complémentaires' | trad, '','','','','','Codecomp') }}</td>
						<td>{{ zoomFilter('SSCPTEANA', infoPagination.filter['filter_SSCPTEANA'], '', 'filtre_demandeAchat', path('Ajax.liste.sca'),'Liste des sous comptes d\'analyse' | trad |e('js')|raw, '','','','','','Sscptana') }}</td>
						<td>{{ zoomFilter('FOU', infoPagination.filter['filter_FOU'], '', 'filtre_demandeAchat', path('Ajax.liste.sca'),'Liste des fournisseurs' | trad, '','','','','','Fourniss') }}</td>
						<td>{{ zoomFilter('CTR_LIV', infoPagination.filter['filter_CTR_LIV'], '', 'filtre_demandeAchat', path('Ajax.liste.centre'),'Liste des centres de livraison' | trad, '','','','','','Centre', null, null, null, "{'filter_LIVRAISON' : 'T'}") }}</td>
						<td>{{ filterTable('date_DTE_EMISS', infoPagination.filter.filter_date_DTE_EMISS, '', '', '', 'filtre_demandeAchat', 'date', '') }}</td>
						<td>{{ filterTable('TOTAL_DA', infoPagination.filter.filter_TOTAL_DA, '', '', '', 'filtre_demandeAchat', '', '') }}</td>
						<td>{{ filterTable('TOTAL_DA_TTC', infoPagination.filter.filter_TOTAL_DA_TTC, '', '', '', 'filtre_demandeAchat', '', '') }}</td>
						<td></td>
					</tr>
				{% for demandeAchat in listeDA %}
					<tr id="demandeAchat{{ loop.index }}">
						<td class="toggleSlide" onclick="toggleSlide('{{ path('DemandeAchat.Liste.detailListeEntete', {'typeListe' : typeListe , 'idDA' : demandeAchat.NO_DA}) }}' , 'demandeAchat{{ loop.index }}detail');">{{ demandeAchat.NO_DA }}</td>
						<td>{{ demandeAchat.demandeur }} {% if demandeAchat.NO_DEM | trim %}({{ demandeAchat.NO_DEM }}){% endif %}</td>
						<td>{{ demandeAchat.libelleSI }} {% if demandeAchat.SECTIMP | trim %}({{ demandeAchat.SECTIMP }}){% endif %}</td>
						<td>{{ demandeAchat.libelleCDC }} {% if demandeAchat.CODECOMP | trim %}({{ demandeAchat.CODECOMP }}){% endif %}</td>
						<td>{{ demandeAchat.libelleSCA }} {% if demandeAchat.SSCPTEANA | trim %}({{ demandeAchat.SSCPTEANA }}){% endif %}</td>
						<td>{{ demandeAchat.RS }} {% if demandeAchat.FOU | trim %}({{ demandeAchat.FOU }}){% endif %}</td>
						<td>
							{%- if demandeAchat.CTR_LIV is not empty -%}
								{{ demandeAchat.LIB_CTR_LIV }} ({{ demandeAchat.CTR_LIV }})
							{%- endif -%}
						</td>
						<td class="align-center">{{ demandeAchat.DTE_EMISS| dateTrad }}</td>
						<td class="align-right">{{ demandeAchat.TOTAL_DA | prix }}</td>
						<td class="align-right">{{ demandeAchat.TOTAL_DA_TTC | prix }}</td>
						<td class="parametrage">
							<span class="parametre ferme"></span>
							<ul {% if loop.index <6 %}class="ss_parametres"{% else %}class="ss_parametres"{% endif %}>
								{{ liAl (path('DemandeAchat.ArticleDemandeAchat.article', {'idDA' : demandeAchat.NO_DA, 'MODULE' : 'ListeDA' }), '', 'visualiser',  'Visualiser' | trad ) }}
								{{ liAl ('', '', 'imprimer', 'Imprimer' | trad ) }}
							</ul>
						</td>
					</tr>
					<tr id="demandeAchat{{ loop.index }}detail" class="detail_ligne hide_detail">
					</tr>
				{% endfor %}
				</tbody>
			</table>
			
			{{ paginations(path('DemandeAchat.Liste.listeEntete', {'typeListe': typeListe}),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, '') }} 

		</form>
	</div>
</div>

{% endblock %}