{% extends 'layout.twig' %}

{% block body %}

<div class="contenu clearfix" id="fournisseurs">
	<h1>
		{{ 'Fournisseurs' | trad }}
	</h1>

	{{ ariane() }}

	<div class="tab-content">
		<div id="detail_fournisseur" class="clearfix">
			<h2 style="position:relative;">
				{{ 'Fournisseur' | trad }} {{ infoFrs.RS }} ({{ infoFrs.CODE }})
			</h2>

			{{ arianeSub() }}

			<div id="fiche_fournisseur" class="tab-pane pad-15 fade in active clearfix">
				<div class="colonne2">
					<div class="block_edition">
						<div class="titre_block">
							{{ 'Identité' | trad }}
						</div>
						<div class="colonne2">
							<div class="informations">
								<a href="{{ googleMap(infoFrs.ADR, infoFrs.CPOSTAL) }}" target="_blank" class="infos_google"></a>
								<p class="gras">{{ (infoFrs.ENSCOMM) }}</p>
								<p class="gras">{{ (infoFrs.RS) }}</p>
								<p class="gras">{{ (infoFrs.ADR) }}</p>
								<p class="gras">{{ (infoFrs.CPOSTAL) }}
									{{ (infoFrs.VILLE1) }}</p>
								<p class="gras">{{ (infoFrs.LIB_PAYS) }} ({{ (infoFrs.CODE_PAYS) }})</p>
							</div>
							<div class="informations identite">
								<p>
									<span class="champs_label">{{ 'Tél' | trad }}</span>
									<span class="resultat">{{ (infoFrs.TEL) }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Télex' | trad }}</span>
									<span class="resultat">{{ (infoFrs.TELEX) }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Fax' | trad }}</span>
									<span class="resultat">{{ (infoFrs.FAX) }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'E-mail' | trad }}</span>
									<span class="resultat">
										<a href="mailto:{{ infoFrs.EMAIL }}">{{ (infoFrs.EMAIL) }}</a>
									</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Adresse de Cde.' | trad }}</span>
									<span class="resultat">{{ (infoFrs.ADR_COMMANDE | boolTrad)  }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Disponible sur mobile ?' | trad }}</span>
									<span class="resultat">{{ (infoFrs.DISPO_MOBILITY | boolTrad)  }}</span>
								</p>
							</div>
						</div>
						<div class="colonne2">
							<div class="informations">
								{% if infoFrs.CODE_PAYS == 'FR' %}
									<p>
										<span class="champs_label">{{ 'N° Siret' | trad }}</span>
										<span class="resultat">{{ (infoFrs.NO_SIRET) }}</span>
									</p>
								{% elseif infoFrs.NO_SIRET != ''%}
									{% if (paramTaxe[1][0] == 0 and infoFrs.NO_SIRET != '') or paramTaxe[1][0] > 0 %}
										<p>
											<span class="champs_label">{{ paramTaxe[0] ? paramTaxe[0] | trad }}</span>
											<span class="resultat">{{(infoFrs.NO_SIRET) }}</span>
										</p>
									{% endif %}
								{% endif %}

								{% if  paramTaxe[2] != ''  %}
									{% if (paramTaxe[3][0] == 0 and infoFrs.TAXE2 != '') or paramTaxe[3][0] > 0 %}
										<p>
											<span class="champs_label">{{ paramTaxe[2] | trad }}</span>
											<span class="resultat">{{ (infoFrs.TAXE2) }}</span>
										</p>
									{% endif %}
								{% endif %}

								{% if paramTaxe[4] != '' %}
									{% if (paramTaxe[5][0] == 0 and infoFrs.TAXE3 != '') or paramTaxe[5][0] > 0 %}
										<p>
											<span class="champs_label">{{ paramTaxe[4] | trad }}</span>
											<span class="resultat">{{ (infoFrs.TAXE3) }}</span>
										</p>
									{% endif %}
								{% endif %}

								{% if  paramTaxe[6] != ''  %}
									{% if (paramTaxe[7][0] == 0 and infoFrs.TAXE4 != '') or paramTaxe[7][0] > 0 %}
										<p>
											<span class="champs_label">{{ paramTaxe[6] | trad }}</span>
											<span class="resultat">{{ (infoFrs.TAXE4) }}</span>
										</p>
									{% endif %}
								{% endif %}
								<p>
									<span class="champs_label">{{ 'TVA Intra-communautaire' | trad }}</span>
									<span class="resultat">{{ (infoFrs.NO_TVA_IC) }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'DUNS Number' | trad }}</span>
									<span class="resultat">{{ (infoFrs.NO_DUNS) }}</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Identifiant externe' | trad }}</span>
									<span class="resultat">{{ (infoFrs.ID_EXT) }}</span>
								</p>
								<p>
									{# DATE #}
									<span class="champs_label">{{  'Validité' | trad }}</span>
									{% if infoFrs.DTEVALMAX != '00000000'  %}
										<span class="resultat">{{ (infoFrs.DTEVALMIN | dateTrad) }}
											-
											{{ (infoFrs.DTEVALMAX |dateTrad) }}</span>
									{% elseif infoFrs.DTEVALMAX == '00000000' and  infoFrs.DTEVALMIN != '00000000' %}
										<span class="resultat">{{ 'À partir du' | trad }}
											{{ (infoFrs.DTEVALMIN |dateTrad) }}
										</span>
										{% else %}

									{% endif %}
								</p>
							</div>
							<div class="informations identite">
								<p>
									<span class="champs_label">{{ 'Site web' | trad }}</span>
									<span class="resultat">
										<a target="_blank" href="{{ infoFrs.SITEWEB | lienExterieur}}">{{ (infoFrs.SITEWEB) }}</a>
									</span>
								</p>
								<p>
									<span class="champs_label">{{ 'Langue' | trad }}</span>
									{#  #}
									<span class="resultat">{{ (infoFrs.LIB_LANGUE) }} ({{ (infoFrs.COD_LNG) }})</span>
								</p>
								{% if infoFrs.FOUPPAL!=''  %}
									<p>
										<span class="champs_label">{{ 'Groupement' | trad }}</span>
										<span class="resultat">{{ (infoFrs.FOUPPAL) }}</span>
									</p>
								{% endif %}
							</div>

						</div>
					</div>
					{% if parametrageOnglet.DETAIL_NONVISIBLE != true %}
						<div class="block_edition details">
							<div class="titre_block">
								{{ 'Détail' | trad }}
							</div>
							<div class="colonne2">
								<div class="informations">
									<p>
										<span class="champs_label">{{ 'Catégorie fournisseur' | trad }}</span>
										<span class="resultat">{{ (infoFrs.LIB_REGROUP)   }} ({{ (infoFrs.CODE_REGR)   }})</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Achat systématique en franchise de TVA ?' | trad }}</span>
										<span class="resultat">{{ (infoFrs.FRANCTVA ) | boolTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Notation manuelle systématique ?' | trad }}
										</span>
										<span class="resultat">{{ (infoFrs.NOT_MANU)| boolTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Pas d\'alimentation automatique des Sous-familles ?' | trad }}</span>
										<span class="resultat">{{ (infoFrs.NAUTOSFA)| boolTrad  }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Date d\'agrément' | trad }}</span>
										<span class="resultat" style="word-break: break-word;white-space:nowrap;">{{ (infoFrs.DTE_AGREM) | dateTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Certification' | trad }}</span>
										<span class="resultat">{{ (infoFrs.CERTIF)  }}</span>
									</p>
								</div>
							</div>
							<div class="colonne2">
								<div class="informations">
									<p>
										<span class="champs_label">{{ 'Indice qualité' | trad }}</span>
										<span class="resultat">{{ (infoFrs.IND_QUALI) | boolTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Réception automatique des Cdes ?' | trad }}
										</span>
										<span class="resultat">{{ (infoFrs.RECEP_AUTO) | boolTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Périodicité du contrat' | trad }}
										</span>
										<span class="resultat">{{ tabPeriodicite[(infoFrs.PER_REC_AUTO)] }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Classe (ABC)' | trad }}</span>
										<span class="resultat">{{ infoFrs.CLASSE }}</span>
									</p>
									<p>
										<span class="champs_label">{{ 'Accès au portail fournisseur ?' | trad }}</span>
										<span class="resultat">{{  (infoFrs.GEREPORTAIL) | boolTrad }}</span>
									</p>
									<p>
										<span class="champs_label">{{'Zone libre 3' | trad }}</span>
										<span class="resultat">{{  (infoFrs.MOTCLE) }}</span>
									</p>
								</div>
							</div>
						</div>
					{% endif %}
					{% if CSExist('FOURNISS') and parametrageOnglet.CS_NONVISIBLE != true %}
						<div class="block_edition">

							<div class="titre_block">
								{{ 'Champs supplémentaires' | trad }}
							</div>

                            {{ VisualisationCS('FOURNISS', idFrs) }}

						</div>
					{% endif %}

				</div>
				<div class="colonne2">
					{% if parametrageOnglet.CONTACTS_NONVISIBLE != true %}
						<div class="block_edition">
							<div class="titre_block">
								{{ 'Contact' | trad }}
							</div>

							{% for Contact in listeCtc %}
								<div class="colonne2">
									<div class="informations">
										{%- if  Contact.NOM -%}
											<span class="initiale">{{ Contact.NOM | firstLettre}}</span>
										{%- endif -%}
										{{ (Contact.NOM) }}
										{% if Contact.attributes().Etat=='S' -%}
											<a style='color:var(--error);'>
												-
												{{ 'Supprimer' | trad }}</a>
										{%- endif %}
									</div>
									<div class="informations">
										<p>
											<span class="champs_label">{{ 'Fonction' | trad }}</span>
											<span class="resultat">{{ (Contact.FONCTION)  }}</span>
										</p>
										<p>
											<span class="champs_label">{{ 'E-mail' | trad }}</span>
											<span class="resultat">
												<a href='mailto:{{ Contact.EMAIL }}'>{{ (Contact.EMAIL) }}</a>
											</span>
										</p>
										<p>
											<span class="champs_label">{{ 'Tél' | trad }}</span>
											<span class="resultat">{{ (Contact.TEL) }}</span>
										</p>
										<p>
											<span class="champs_label">{{ 'Fax' | trad }}</span>
											<span class="resultat">{{ (Contact.FAX) }}</span>
										</p>
										<p>
											<span class="champs_label">{{ 'Tél. portable' | trad }}</span>
											<span class="resultat">{{ (Contact.TELPORT) }}</span>
										</p>
										<p>
											<span class="champs_label">{{ 'E-proc' | trad }}</span>
											<span class="resultat">{{ (Contact.VIBOXAP | boolTrad) }}</span>
										</p>
										<p>
											<span class="champs_label">{{ 'Contact Consultation' | trad }}</span>
											<span class="resultat">{{ (Contact.CTC_CONSULT | boolTrad) }}</span>
										</p>
										{% if fournisseur.Fournisseur.OXALINK.GEREPORTAIL==1 %}
											<p>
												<span class="champs_label">{{ 'Util. OXA.LINK' | trad }}</span>
												{% if suiviDemande %} 
													<span class="resultat">{{ (Contact.OXALINK_ID | convertStr) }}</span>
												{% else %}
													<span class="resultat">{{ oxalinkUserStatut(Contact.OXALINK_ID | convertStr) }}</span>
												{% endif %}
											</p>
										{% endif %}
									</div>
								</div>
							{% endfor %}
						</div>
					{% endif %}
					{% if parametrageOnglet.CHIFFAFF_NONVISIBLE != true %}
						<div class="block_edition CA">
							<div class="titre_block">
								{{  'Chiffre d\'affaires' | trad }}
    
                        {% if chiffreAffaire | length > 5 %}
                        	<button class="principal ajout" onClick="ajaxPopup('{{ path('Fournisseur.Fournisseur.popupChiffreAffaire', {id:code_fournisseur}) }}', '{{ 'Détail chiffre d\'affaire' | trad }}');">{{ 'Voir plus' | trad }}</button>
                        {% endif %}
                    </div>
                    <div class="informations">
                        <table class="table" id='tabble_CA'>
                        	<thead>
                            	<tr>
                                	<th scope="col">{{ 'Année' | trad }}</th>
                                    <th scope="col">{{ 'Chiffre d\'affaire (en K)' | trad }}</th>
                                    <th scope="col">{{ 'Devise' | trad }}</th>
                 				</tr>
                            </thead>
                            <tbody>                              
                            	{% for CA in chiffreAffaire %}
                            		{% if CA.ANNEE %}
                                    	<tr>
                                        	<td>{{ (CA.ANNEE) }}</td>
                                            <td align="right">{{ (CA.CHIFF_AFF | prix) }}</td>
                                            <td class="no_parametrage">{{ (CA.DEVISE) }}</td>
                         				</tr>
                     				{% endif %}
                 				{% endfor %}
                            </tbody>
                        </table>
                    </div>
            	</div>
        	{% endif %}

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