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

	<div class="contenu clearfix titre_div"  id="DemandeAchat">
		<h1>{{ 'Demandes d\'achat' | trad }}</h1>
		
		{{ ariane() }}
		
		<h2>
			{{ titreH2 }}			
		</h2>
		
		{{ arianeSub() }}
		
		<div id="demandes" class="tab-pane fade in active clearfix">
			<form method="post" name="form_solder" id="form_solder" class="padding_form bg_form border_form">
				<table class="table table-hover">
					<thead class="thead-dark">
						<tr>
							<th width='5%' ></th>
							<th scope="col">{{ triTable('CODE_ART',  infoPagination.filter.tri_CODE_ART, 'Article' | trad, '', '', 'filtre_demandeAchat') }}</th>
							<th scope="col">{{ triTable('DES_SOMM',  infoPagination.filter.tri_DES_SOMM, 'Désignation article' | trad, '', '', 'filtre_demandeAchat') }}</th>
							<th scope="col">{{ 'Dés. complémentaire' | trad}}</th>
							<th scope="col" width='9%' class="align-right">{{ triTable('QTE_DEM',  infoPagination.filter.tri_QTE_DEM, 'Quantité' | trad, '', '', 'filtre_demandeAchat') }}</th>
							<th scope="col" width='9%' class="align-right">{{ triTable('DEJA_COMM',  infoPagination.filter.tri_DEJA_COMM, 'Déjà cdée' | trad, '', '', 'filtre_demandeAchat') }}</th>					
							<th scope="col" width='8%'>{{ triTable('UNITE',  infoPagination.filter.tri_UNITE, 'Unité' | trad, '', '', 'filtre_demandeAchat') }}</th>
							<th scope="col" width='7%'>{{ triTable('DTELIVSOU',  infoPagination.filter.tri_DTELIVSOU, 'Date Livr.' | trad, '', '', 'filtre_demandeAchat') }}</th>
							<th width='6%' class="align-center">{{ 'Traitée ?' | trad }}</th>
						</tr>
					</thead>
					<tbody>
						{% for ligne in listeLigne  %}
							<tr id="Ligne{{ loop.index }}">
								<td>{{ ligne.NO_PO }}</td>
								<td>{{ ligne.CODE_ART }}</td>
								<td>{{ ligne.DES_SOMM }}</td>
								<td class="white-tooltip">{{ shortLibelle(ligne.designCompl, 20) }}</td>
								{# <td class="white-tooltip">{{ shortLibelle('test designation complémentaire avec plus de 20 caracteres', 20) }}</td> #}
								<td class="montant">{{ ligne.QTE_DEM }}</td>
								<td class="montant">{{ ligne.DEJA_COMM }}</td>
								<td class="montant"> {{ ligne.UNITE }}</td>
								<td>{{ ligne.DTELIVSOU | dateTrad }}</td>
								<td class="align-center"><input type="checkbox" name="{{ ligne.NO_PO }}" value="{{ ligne.TRAITEE }}" class="form-control checkbox" /></td>
							</tr>
						{% endfor %}
					</tbody>
				</table>
				<div class="modal-footer">
					{# {{ Button('Fermer', 0, '', ";") }} #}
					<button type="button" class="button secondaire" data-dismiss="modal" onClick="redirectJSWithPost('{{ path('DemandeAchat.GestionDemandeAchat.index') }}', {{ postGestion }});">{{ 'Fermer' | trad }}</button>   
					{% if typeSolde=='solder' %}
					{{ Button('Solde Complet', 1,'', "popupConfirmation('"~ path('Ajax.Erreur.popupConfirmationGestion') ~"', '', '"~ path('DemandeAchat.SolderDemandeAchat.confirmationSolder', {'idDA' : idDA, 'typeSolde' : typeSolde}) ~"', '"~ strBuild('Voulez-vous vraiment solder complètement la DA n° @1@ ?' | trad, [idDA]) ~"', 'popup', '','true', 'true')") }}
					{% else %}
						{{ Button('Désolde Complet', 1,'', "popupConfirmation('"~ path('Ajax.Erreur.popupConfirmationGestion') ~"', '', '"~ path('DemandeAchat.SolderDemandeAchat.confirmationSolder', {'idDA' : idDA, 'typeSolde' : typeSolde}) ~"', '"~ strBuild('Voulez-vous vraiment désolder complètement la DA n° @1@ ?' | trad, [idDA]) ~"', 'popup', '','true', 'true')") }}
					{% endif %}
				</div> 
			</form>
		</div>            
	</div>

{% endblock %}
