{% extends 'layout.twig' %}

{% block body %}

	<div class="contenu clearfix titre_div"  id="Commande">
	
		<h1>
		    {{ 'Commandes' | trad }}</h1>
		    {{ ariane() }}
		
		<h2>
			{% if modeHisto %}
				{{ 'Commande historisée'  | trad  }} : {{ numCde }} {% if idAvenant %} - {{ idAvenant }}{% endif %}
			{% else %}
		    	{{ 'Commande'  | trad  }} : {{ numCde }} {% if commande.AVENANT %} - {{ commande.AVENANT }}{% endif %}
			{% endif %}
		</h2>
		{{ arianeSub() }}

    	<div class="tab-content"  id="tab-content">
        	<div class="padding15">
        	
            	{% include '@Commande/Commande/_entete.twig' %}
                
                <div class="colonne2">
                	<div class="block_edition">
                    	<div class="titre_block">
                        	{{ 'Fournisseur' | trad }}
                        </div>
                        <div class="colonne2">
                        	<div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Fournisseur' | trad }}</span>
                                    <span class="resultat">{{ commande.RS }}  {% if commande.CODE_FOU %}({{ commande.CODE_FOU }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Type d\'achat' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('TypeAchat', '' , commande.COD_TAC) }} {% if commande.COD_TAC | trim %}({{ commande.COD_TAC }}) {% endif %}</span>
                                </p>
                            </div>
                        	<div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Adresse' | trad }}</span>
                                    <span class="resultat">{{ commande.ADCDEFOU }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Pays' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Country', '' , commande.PAYCDEFO, true) }} {% if commande.CODE_PAYS | trim %}({{ commande.CODE_PAYS }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Ville' | trad }}</span>
                                    <span class="resultat">{{ commande.CPCDEFO }} {{ commande.VILLEFOU }}</span>
                                </p>
                            </div>
                        </div>
                        <div class="colonne2 last">
                        	<div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Contact' | trad }}</span>
                                    <span class="resultat">{{ commande.CTCT_FOU }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Tel' | trad }}</span>
                                    <span class="resultat">{{ commande.TEL_CTCT }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Portable' | trad }}</span>
                                    <span class="resultat">{{ commande.PORTCFOU }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                    <span class="resultat">{{ commande.FAX_CTCT }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Email' | trad }}</span>
                                    <span class="resultat">{{ commande.EMA_CTCT }}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    
                	<div class="block_edition">
                    	<div class="titre_block">
                        	{{ 'Détails' | trad }}
                        </div>
                        <div class="colonne2">
                            <div class="informations">
                            {% if not modeHisto %}
                        	    <p>
                                	<span class="champs_label">{{ 'Demandeur' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Hastutil', '',commande.DEMANDEUR) }} {% if commande.DEMANDEUR | trim %}({{ commande.DEMANDEUR }}) {% endif %}</span>
                                </p>
                            {% endif %}
                        	    <p>
                                	<span class="champs_label">{{ 'Acheteur' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Hastutil', '', commande.ACH) }} {% if commande.ACH | trim %}({{ commande.ACH }}) {% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Devise' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Devise', '', commande.DEVISE, true) }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Accord-cadre' | trad }}</span>
                                    <span class="resultat">{{ commande.ACC_CADRE }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'ZL numérique' | trad }}</span>
                                    <span class="resultat">{{ commande.ZNLIBNUM }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Réf. offre fournisseur' | trad }}</span>
                                    <span class="resultat">{{ commande.REFOFFOU }}</span>
                                </p>
                            </div>
                            <div class="informations">
                                {% if commande.AVENANT %}
                                    <p>
                                        <span class="champs_label">{{ 'Motif de l\'avenant' | trad }}</span>
                                        <span class="resultat">{{ commande.MOT_AVNT }}</span>
                                    </p>
                                {% endif %}
                        	    <p>
                                	<span class="champs_label">{{ 'Objet commande' | trad }}</span>
                                    <span class="resultat">{{ commande.OBJET_CA }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Titre commande' | trad }}</span>
                                    <span class="resultat">{{ commande.TITRE }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Langue de la CA' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Langues', '' , commande.COD_LNG) }}</span>
                                </p>
                            </div>
                        </div>
                        <div class="colonne2 last">
                            <div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Centre émetteur' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Centre', '' , commande.CTR_EMETT) }} {% if commande.CTR_EMETT | trim %}({{ commande.CTR_EMETT }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Centre de facturation' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Centre', '' , commande.CTR_FACTU) }} {% if commande.CTR_FACTU | trim %}({{ commande.CTR_FACTU }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Condition de paiement' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Condpaie', '' , commande.COND_PAIE) }} {% if commande.COND_PAIE | trim %}({{ commande.COND_PAIE }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Mode de paiement' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Modepaie', '' , commande.MODE_PAIE) }} {% if commande.MODE_PAIE | trim %}({{ commande.MODE_PAIE }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Mode de livraison' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Modelivr', '' , commande.MODE_LIV) }} {% if commande.MODE_LIV | trim %}({{ commande.MODE_LIV }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Message libre' | trad }}</span>
                                    <span class="resultat">{{ commande.MESSAGE }}</span>
                                </p>                                
                        	    <p>
                                	<span class="champs_label">{{ 'Expédition à la charge du fournisseur' | trad }} ?</span>
                                    <span class="resultat">{{ commande.CDE_EXP | boolTrad }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Date période' | trad }}</span>
                                    <span class="resultat">{{ commande.DTE_PERIO |dateTrad }}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    
                	{% if commande.CDE_EXP | boolSql %}
                	<div class="block_edition">
                    	<div class="titre_block">
                        	{{ 'Transit' | trad }}
                        </div>
                        <div class="colonne2">
                            <div class="informations">
                                <p>
                                	<span class="champs_label">{{ 'Mode de transport' | trad }}</span>
                                    <span class="resultat">{{ commande.MOD_TRS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Transitaire' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Fourniss', '', commande.TRANSIT) }} {% if commande.TRANSIT | trim %}({{ commande.TRANSIT }}){% endif %}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Contact' | trad }}</span>
                                    <span class="resultat">{{ commande.CT_TRANS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'tél.' | trad }}</span>
                                    <span class="resultat">{{ commande.TELCTTRS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                    <span class="resultat">{{ commande.FAXCTTRS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Port.' | trad }}</span>
                                    <span class="resultat">{{ commande.PORCTTRS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Email' | trad }}</span>
                                    <span class="resultat">{{ commande.MAICTTRS }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Devise' | trad }}</span>
                                    <span class="resultat">{{ commande.VALDEVTR | tva }} {{ convertLibelleGlobal('Devise', '', commande.DEVTRS, true) }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Logisticien' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('HASTUTIL', '', commande.LOGIST) }} {% if commande.LOGIST | trim %}({{ commande.LOGIST }}) {% endif %}</span>
                                </p>
                            </div>
                        </div>
                        
						<div class="colonne2 last">
                            <div class="informations">
                                <p>
                                	<span class="champs_label">{{ 'Enlèvement ?' | trad }}</span>
                                    <span class="resultat">{{ commande.PREACH | boolTrad }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Lieu' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Fourniss', '', commande.FOURLIVR) }} {% if commande.FOURLIVR | trim %}({{ commande.FOURLIVR }}){% endif %}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Liv/Enl' | trad }}</span>
                                    <span class="resultat">{{ commande.ADRLIVR }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Pays' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Country', '', commande.PAYLIVR, true) }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Ville' | trad }}</span>
                                    <span class="resultat">{{ commande.VILLIVR }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Tél.' | trad }}</span>
                                    <span class="resultat">{{ commande.TLADLVEN }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                    <span class="resultat">{{ commande.FXADLVEN }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Ré-acheminement ?' | trad }}</span>
                                    <span class="resultat">{{ commande.RE_ACH | boolTrad }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Mode' | trad }}</span>
                                    <span class="resultat">{{ commande.MDTREACH }}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    {% endif %}
                    
                </div>
                
                <div class="colonne2 last">
                	<div class="block_edition">
                    	<div class="titre_block">
                        	{{ 'Valeurs d\'initialisation' | trad }}
                        </div>
                        <div class="colonne2">
                        	<div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Section d\'imputation' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Sectimpu', '' , commande.SECTIMP) }} {% if commande.SECTIMP | trim %}({{ commande.SECTIMP }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Code gestion' | trad }}</span>
                                    <span class="resultat">
                                        {%- if commande.CODGES is not empty -%}
                                            {{ commande.LIBGES }} ({{ commande.CODGES }})
                                        {%- endif -%}
                                    </span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Code complémentaire' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Codecomp', '' , commande.CODECOMP) }} {% if commande.CODECOMP | trim %}({{ commande.CODECOMP }}){% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Sous Compte d\'Analyse' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Sscptana', '' , commande.SSCPTEANA) }} {% if commande.SSCPTEANA | trim %}({{ commande.SSCPTEANA }}){% endif %}</span>
                                </p>
                                {% if modeHisto == false %}
                                    <p>
                                        <span class="champs_label">{{ 'Date de livraison' | trad }}</span>
                                        <span class="resultat">{{ commande.DTE_LIV | dateTrad }}</span>
                                    </p>
                                {% endif %}
                                <p>
                                	<span class="champs_label">{{ 'Présentation de la date' | trad }}</span>
                                    <span class="resultat">{{ tabTypeDate[commande.TYPDATE] }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Remise globale' | trad }}</span>
                                    <span class="resultat">{{ commande.REM_GLOB | tva }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Modèle' | trad }}</span>
                                    <span class="resultat">{{ commande.MODELE }}</span>
                                </p>
                        	</div>
                    	</div>
                    	
                    	<div class="colonne2 last">
                    		<div class="informations">
                        		<p>
                        			<span class="champs_label">{{ 'Saisie de réception' | trad }}</span>
                        			<span class="resultat">{{ commande.SAISIEREC | boolTrad }}</span>
                        		</p>
                        		<p>
                        			<span class="champs_label">{{ 'Réception automatique' | trad }}</span>
                        			<span class="resultat">{{ commande.RECEP_AUTO | boolTrad  }}</span>
                        		</p>
                        		<p>
                        			<span class="champs_label">{{ 'Début contrat' | trad }}</span>
                        			<span class="resultat">{{ commande.DATEDEBCONT | dateTrad }}</span>
                        		</p>
                        		<p>
                        			<span class="champs_label">{{ 'Fin contrat' | trad }}</span>
                        			<span class="resultat">{{ commande.DATEFINCONT | dateTrad }}</span>
                        		</p> 
                        		<p>
                        			<span class="champs_label">{{ 'Période' | trad }}</span>
                        			<span class="resultat">{{ tabPeriode[commande.FIN_DEB_PER] }}</span>
                        		</p>
                        		<p>
                        			<span class="champs_label">{{ 'Périodicité' | trad }}</span>
                        			<span class="resultat">{{ tabPeriodicite[commande.CONTRAT_PERIOD] }}</span>
                        		</p>
                        		<p>
                        			<span class="champs_label">{{ 'Jours d\'application' | trad }}</span>
                        			<span class="resultat">{{ commande.CAEN_RECEPAUTO_JOUR }}</span>
                        		</p>
                    		</div>
                    	</div>
                	</div>
                	
					<div class="block_edition" id='livraisonCde'>
                    	<div class="titre_block">
                        	{{ 'Livraison' | trad }}
                        </div>
                        <div class="colonne2 marginLivraison">
                        	<div class="informations">
                        	    <p>
                                	<span class="champs_label">{{ 'Centre de livraison' | trad }}</span>
                                    <span class="resultat">{{ commande.NOM_LIV }} ({{ commande.CTR_LIV }})</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Adresse' | trad }}</span>
                                    <span class="resultat">{{ commande.ADR_LIV }}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Pays' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Country', '',commande.PAY_LIV) }} {% if commande.PAY_LIV | trim %}({{ commande.PAY_LIV }}) {% endif %}</span>
                                </p>
                        	    <p>
                                	<span class="champs_label">{{ 'Ville' | trad }}</span>
                                   <span class="resultat">{{ commande.VIL_LIV }}</span>
                                </p>
                        	</div>
                    	</div>
                    	
                    	<div class="colonne2 last">
                			<ul class="nav nav-tabs sous_onglet navBarClair">   
                    			<li class="active"><a data-toggle="tab" href="#contact1">{{ 'Contact 1' | trad }}</a></li>
                    			<li><a data-toggle="tab" href="#contact2">{{ 'Contact 2' | trad }}</a></li>
                    		</ul>
                    		<div class="tab-content">
                        		<div class="informations tab-pane active in clearfix" id="contact1">
                            	    <p>
                                    	<span class="champs_label">{{ 'Contact' | trad }}</span>
                                        <span class="resultat">{{ commande.NMCTC1L }}</span>
                                    </p>
                                    <p>
                                    	<span class="champs_label">{{ 'Fonction' | trad }}</span>
                                        <span class="resultat">{{ commande.FTCTC1L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Tel' | trad }} </span>
                                        <span class="resultat">{{ commande.TLCTC1L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Portable' | trad }}</span>
                                        <span class="resultat">{{ commande.PRCTC1L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                        <span class="resultat">{{ commande.FXCTC1L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Email' | trad }}</span>
                                        <span class="resultat">{{ commande.MLCTC1L }}</span>
                                    </p>
                                </div>
                                <div class="informations tab-pane fade clearfix" id="contact2">
                            	    <p>
                                    	<span class="champs_label">{{ 'Contact' | trad }}</span>
                                        <span class="resultat">{{ commande.NMCTC2L }}</span>
                                    </p>
                                    <p>
                                    	<span class="champs_label">{{ 'Fonction' | trad }}</span>
                                        <span class="resultat">{{ commande.FTCTC2L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Tel' | trad }}</span>
                                        <span class="resultat">{{ commande.TLCTC2L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Portable' | trad }}</span>
                                        <span class="resultat">{{ commande.PRCTC2L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                        <span class="resultat">{{ commande.FXCTC2L }}</span>
                                    </p>
                            	    <p>
                                    	<span class="champs_label">{{ 'Email' | trad }}</span>
                                        <span class="resultat">{{ commande.MLCTC2L }}</span>
                                    </p>
                                </div>
                            </div>
                            
                    	</div>
                	</div>
                	
                	{% if commande.CTRLENTR | boolSql %}
                	<div class="block_edition">
                    	<div class="titre_block">
                        	{{ 'Export' | trad }}
                        </div>
                        <div class="colonne2">
                            <div class="informations">
                                <p>
                                	<span class="champs_label">{{ 'Organisme' | trad }}</span>
                                    <span class="resultat">{{ convertLibelleGlobal('Fourniss', '', commande.ORGCTRL) }} {% if commande.ORGCTRL | trim %}({{ commande.ORGCTRL }}){% endif %}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Contact' | trad }}</span>
                                    <span class="resultat">{{ commande.CTORGCT }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'tél.' | trad }}</span>
                                    <span class="resultat">{{ commande.TELCTORG }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Fax' | trad }}</span>
                                    <span class="resultat">{{ commande.FAXCTORG }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Port.' | trad }}</span>
                                    <span class="resultat">{{ commande.PORCTORG }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Email' | trad }}</span>
                                    <span class="resultat">{{ commande.MAICTORG }}</span>
                                </p>
                            </div>
                        </div>
                        
						<div class="colonne2 last">
                            <div class="informations">
                                <p>
                                	<span class="champs_label">{{ 'Prév le ?' | trad }}</span>
                                    <span class="resultat">{{ commande.DTEPRVCTR | dateTrad }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Licence' | trad }}</span>
                                    <span class="resultat">{{ commande.LICIMPORT }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Fournisseur Exportateur ?' | trad }}</span>
                                    <span class="resultat">{{ commande.FRNEXPORT |boolTrad }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Attendu de DAU ?' | trad }}</span>
                                    <span class="resultat">{{ commande.ATTDAU |boolTrad  }}</span>
                                </p>
                                <p>
                                	<span class="champs_label">{{ 'Franchise de TVA ?' | trad }}</span>
                                    <span class="resultat">{{ commande.FRANCTVA |boolTrad  }}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    {% endif %}
                	                	
            	</div>
            	
            	{% if CSExist('CA_ENTET') %}
                    <div class="colonne2 last">
                    	<div class="block_edition">
                            {% if modeHisto %}
                                {{ VisualisationCS('CA_ENTET', idcsAvenant, '','','','' ,'HCA_ENTET') }}
                            {% else  %}
                	            {{ VisualisationCS('CA_ENTET', str_pad(commande.NO_CDE, 9, 0, 'STR_PAD_LEFT')) }}
                            {% endif  %}
            	        </div>
        	        </div>
    	        {% endif %}
    		</div>
    	</div>
		
	</div>
{% endblock %}