
{% extends '@ajax-layout/layout.twig' %}

{% block body %}
<div id="tableau">
	<center>
	<div>
		<form method="POST" id='formulaireAccadre'>
			<input type="hidden" name="divCode" value="{{ post.divCode }}" />
			<input type="hidden" name="divLibelle" value="{{ post.divLibelle }}" />
			<input type="hidden" name="byId" value="{{ post.byId }}" />
			<input type="hidden" name="onlyCata" value="{{ post.onlyCata }}" />

			<table class="table">
				<thead class="thead-dark">
    				<tr>
    					<th>{{ triTable('DESCRIPTION_CATA',  infoPagination.filter.tri_DESCRIPTION_CATA, 'Catalogue' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('DESIGNCRT',  infoPagination.filter.tri_DESIGNCRT, 'désignation' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('CODEARTI',  infoPagination.filter.tri_CODEARTI, 'Article' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('RS_FOUR',  infoPagination.filter.tri_RS_FOUR, 'Fournisseur' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('RS_FAB',  infoPagination.filter.tri_RS_FAB, 'Fabricant' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('UNITE',  infoPagination.filter.tri_UNITE, 'Unité' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('DESIGNAT',  infoPagination.filter.tri_DESIGNAT, 'Sous-famille' | trad, 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
    					<th>{{ triTable('REFARTFOU',  infoPagination.filter.tri_REFARTFOU, 'Ref. Fou.' | trad,'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ triTable('REFARTFAB',  infoPagination.filter.tri_REFARTFAB, 'Ref. fab.' | trad,'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr>
    					<th>{{ filterTable('DESCRIPTION_CATA', infoPagination.filter.filter_DESCRIPTION_CATA, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('DESIGNCRT', infoPagination.filter.filter_DESIGNCRT, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('CODEARTI', infoPagination.filter.filter_CODEARTI, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('CODEFOUR'~spliter()~'RS_FOUR', infoPagination.filter['filter_CODEFOUR'~spliter()~'RS_FOUR'], '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('FABRICANT'~spliter()~'RS_FAB', infoPagination.filter['filter_FABRICANT'~spliter()~'RS_FAB'], '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('UNITE', infoPagination.filter.filter_UNITE, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('DESIGNAT', infoPagination.filter.filter_DESIGNAT, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('REFARTFOU', infoPagination.filter.filter_REFARTFOU, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>
						<th>{{ filterTable('REFARTFAB', infoPagination.filter.filter_REFARTFAB, '', 'tableau', path('Ajax.liste.articlesCatalogue'), 'formulaireAccadre') }}</th>

    				</tr>
    				{% for article in listes %}
						<tr onclick='changeCodeLibelle("{{ post.divCode }}","{{ article.ID | convert_encoding('UTF-8', 'ISO-8859-1')  }}", "{{ post.divLibelle }}", "{{ article.DESIGNCRT }}");desactivePopup ()'>
							<td id ="{{article.ID}}">{{ article.DESCRIPTION_CATA }} {% if article.ID_CATAL%}({{ article.ID_CATAL  }}){% endif %}</td>
							<td>{{ article.DESIGNCRT }}</td>
							<td>{{ article.CODEARTI }}</td>
							<td>{{ article.RS_FOUR }} {% if article.CODEFOUR %}({{ article.CODEFOUR }}){% endif %}</td>
							<td>{{ article.RS_FAB }} {% if article.FABRICANT %}({{ article.FABRICANT }}){% endif %}</td>
							<td>{{ article.UNITE }}</td>
							<td>{{ article.DESIGNAT}} ({{ article.SOUSFAMI}})</td>
							<td>{{ article.REFARTFOU }}</td>
							<td>{{ article.REFARTFAB }}</td>
						</tr>
    				{% endfor %}
    			</tbody>
			</table>
			
		</form>
		
	{{ paginations(path('Ajax.liste.articlesCatalogue'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'modal-body') }}
	</div>

	</center>
	</div>
{% endblock %}