{% do setAriane(2, 'Importation article' | trad, getRouteName()) %}
{% extends 'layout.twig' %}

{% block body %}

<section class="contenu">

	<h1>{{ 'Consultations' | trad }}</h1>
	
	{{ ariane() }}
	
	<form method="POST" action="{{ path('Consultation.Articles.import', {idAO: idAO}) }}" 
		class="bg_form padding_form border_form"
		onsubmit="return ajaxSubmit(event)"
		data-onsuccess="arianePop"
	>
		<header class="bs-row">
			<h2 class="bs-col">
				{{ consultation.OBJET_AO }}
				{{ 'créé le' | trad }}
				{{ consultation.DTE_AO | dateTrad }}
				{% if AOEventCreat.NOM %}
					{{ 'par' | trad }} {{ AOEventCreat.NOM }}
				{% endif %}
			</h2>
			<div class="bs-col-auto ml-auto">
				<button type="submit" class="button principal">
					{{- 'Importer' | trad -}}
				</button>
				{{ arianeAnnuler() }}
			</div>
		</header>
		<div class="bs-row gutter-x-base">
{#____________________________________________________________________________#}
			<div class="bs-col-half">
				{{ inputAdvance('FILE', {
					name: 'import',
					format: 'excel',
				}) }}
			</div>
{#____________________________________________________________________________#}
			<div class="bs-col-half">
				<p>
					{{ 'La lecture se fait à partir de la première ligne' | trad }},
					<strong>{{ 'par conséquent le fichier ne doit pas contenir de titre de colonne' | trad }}</strong>.
				</p>
				<p>
					{{ 'Le fichier attendu est au format .xls ou .xlsx et doit comporter les colonnes ci-dessous.' | trad }}
				</p>
				{% include '@GlobalApplication/Component/_tableImportFormat.twig' with {
					listCol: [
						{
							label: 'Code article' | trad,
							format: 'A',
							formatMask: 13,
						},
						{
							label: 'Sous-famille' | trad,
							format: 'A',
							formatMask: 7,
							mandatory: true,
						},
						{
							label: 'Désignation' | trad,
							format: 'M',
							formatMask: 60,
							mandatory: true,
						},
						{
							label: 'Désignation compl.' | trad,
							format: 'M',
							formatMask: 3000,
						},
						{
							label: 'Fabricant' | trad,
							format: 'A',
							formatMask: 12,
						},
						{
							label: 'Code gamme' | trad,
							format: 'A',
							formatMask: 7,
						},
						{
							label: 'Réf. fabricant' | trad,
							format: 'A',
							formatMask: 30,
						},
						{
							label: 'Quantité' | trad,
							format: 'N',
							formatMask: formatQTE,
						},
						{
							label: 'Unité' | trad,
							format: 'A',
							formatMask: 7,
							mandatory: true,
						},
						{
							label: 'Prix référence' | trad,
							format: 'N',
							formatMask: formatPU,
						},
						{
							label: 'Budget' | trad,
							format: 'N',
							formatMask: formatMontant,
						},
						{
							label: 'Délai' | trad,
							format: 'D',
							formatMask: dateFormat,
						},
					],
				} only %}
			</div>
		</div>
	</form>
</section>
	
{% endblock %}