{% extends 'layout.twig' %}

{% block body %}
<div class="contenu clearfix"  id="archivage_factures">
    <h1>{{ 'Edition des entêtes de factures' | trad }}</h1>
	{{ ariane() }}
    <form class="bg_form padding_form border_form clearfix padding10" method="post" name="edition_entete" id="edition_entete">
		<div>
			<div class="row">
				<div class="colonne3">
					<div class="row">
					</div>
				</div>
				<div class="colonne3">
					<div class="row">
						{{ 'Min' | trad }} : 
					</div>
				</div>
				<div class="colonne3 last">
					<div class="row">
						{{ 'Max' | trad }} : 
					</div>
				</div>
			</div>
			
			{# CODE SOCIETE#}
			<div class="colonne3">
				<div class="row"><label>{{ 'Code Société' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputZoomAdvance("", "SOCIETE_MIN", path('Ajax.liste.societe'), "", 
					post.SOCIETE_MIN, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Societe', 'nomChamp' : '"~ 'Société' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Societe","CODE_STE", "RAIS_SOC", '', '', 'modal_small', 'Liste des sociétés' | trad) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputZoomAdvance("", "SOCIETE_MAX", path('Ajax.liste.societe'), "", 
					post.SOCIETE_MAX, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Societe', 'nomChamp' : '"~ 'Société' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Societe","CODE_STE", "RAIS_SOC", '', '', 'modal_small', 'Liste des sociétés' | trad) }}
				</div>
			</div>
			
			{# N° enregistrement#}
			<div class="colonne3">
				<div class="row"><label>{{  'N° d\'enregistrement' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputText('', 'ENREG_MIN', post.ENREG_MIN, '', path('Ajax.validator.isStringSansEspace'),"{'nomChamp' : '"~  'N° d\'enregistrement' | trad |e('js')|raw ~"', 'sizeMin' : '0', 'sizeMax' : '26'}", '', '', '', 'full' ) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputText('', 'ENREG_MAX', post.ENREG_MAX, '', path('Ajax.validator.isStringSansEspace'),"{'nomChamp' : '"~  'N° d\'enregistrement' | trad |e('js')|raw ~"', 'sizeMin' : '0', 'sizeMax' : '26'}", '', '', '', 'full' ) }}
				</div>
			</div>

			{# Code fournisseur#}
			<div class="colonne3">
				<div class="row"><label>{{ 'Code fournisseur' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputZoomAdvance("", "FOUR_MIN", path('Ajax.liste.fournisseur'), "", 
					post.FOUR_MIN, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Fourniss', 'nomChamp' : '"~ 'Fournisseur' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Fourniss","CODE", "RS", '', '', 'modal_small', 'Liste des fournisseurs' | trad) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputZoomAdvance("", "FOUR_MAX", path('Ajax.liste.fournisseur'), "", 
					post.FOUR_MAX, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Fourniss', 'nomChamp' : '"~ 'Fournisseur' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Fourniss","CODE", "RS", '', '', 'modal_small', 'Liste des fournisseurs' | trad) }}
				</div>
			</div>

			{# Date d’enregistrement #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Date d\'enregistrement' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDate('', 'DATE_ENREG_MIN', post.DATE_ENREG_MIN | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date d\'enregistrement' | trad |e('js')|raw ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDate('', 'DATE_ENREG_MAX', post.DATE_ENREG_MAX | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date d\'enregistrement' | trad |e('js')|raw ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			
			{# Date de période #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Date de période' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDate('', 'DATE_PERIODE_MIN', post.DATE_PERIODE_MIN | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date de période' | trad ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDate('', 'DATE_PERIODE_MAX', post.DATE_PERIODE_MAX | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date de période' | trad ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			
			{# Référence Facture Fournisseur  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Référence Facture Fournisseur' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputText('', 'FAC_FOUR_MIN', post.FAC_FOUR_MIN, '', path('Ajax.validator.isStringSansEspace'),"{'nomChamp' : '"~ 'Référence Facture Fournisseur' | trad ~"','sizeMin' : '0', 'sizeMax' : '26'}", '', '', '', 'full' ) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputText('', 'FAC_FOUR_MAX', post.FAC_FOUR_MAX, '', path('Ajax.validator.isStringSansEspace'),"{'nomChamp' : '"~ 'Référence Facture Fournisseur' | trad ~"','sizeMin' : '0', 'sizeMax' : '26'}", '', '', '', 'full' ) }}
				</div>
			</div>
			
			{# Date Facture Fournisseur  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Date Facture Fournisseur' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDate('', 'DATE_FOUR_MIN', post.DATE_FOUR_MIN | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date Facture Fournisseur' | trad ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDate('', 'DATE_FOUR_MAX', post.DATE_FOUR_MAX | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date Facture Fournisseur' | trad ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
						
			{# Devise #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Devise' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputZoomAdvance("", "DEVISE_MIN", path('Ajax.liste.devise'), "", 
					post.DEVISE_MIN, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Devise', 'nomChamp' : '"~ 'Devise' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Devise","CODE_DEVI", "LIBELLE", '', '', 'modal_small', 'Liste des devises' | trad) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputZoomAdvance("", "DEVISE_MAX", path('Ajax.liste.devise'), "", 
					post.DEVISE_MAX, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Devise', 'nomChamp' : '"~ 'Devise' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Devise","CODE_DEVI", "LIBELLE", '', '', 'modal_small', 'Liste des devises' | trad) }}
				</div>
			</div>		
			
			{# Total HT   #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Total HT' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDevise('', 'TOTAL_HT_MIN', post.TOTAL_HT_MIN, '', path('Ajax.validator.float'), "{'nomChamp' : '"~ 'Total HT' | trad ~"', 'format' : "~getConst('formatMontant')~"}", '','','full','' ) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDevise('', 'TOTAL_HT_MAX', post.TOTAL_HT_MAX, '', path('Ajax.validator.float'), "{'nomChamp' : '"~ 'Total HT' | trad ~"', 'format' : "~getConst('formatMontant')~"}",  '','','full','' ) }}
				</div>
			</div>
						
			{# Total TTC  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Total TTC' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDevise('', 'TOTAL_TTC_MIN', post.TOTAL_TTC_MIN, '', path('Ajax.validator.float'), "{'nomChamp' : '"~ 'Total TTC' | trad ~"', 'format' : "~getConst('formatMontant')~"}", '','','full','' ) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDevise('', 'TOTAL_TTC_MAX', post.TOTAL_TTC_MAX, '', path('Ajax.validator.float'), "{'nomChamp' : '"~ 'Total TTC' | trad ~"', 'format' : "~getConst('formatMontant')~"}",  '','','full','' ) }}
				</div>
			</div>
			
			{# Date d'echéance  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Date d\'échéance' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputDate('', 'ECHEANCE_MIN', post.ECHEANCE_MIN | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date d\'échéance' | trad |e('js')|raw ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputDate('', 'ECHEANCE_MAX', post.ECHEANCE_MAX | dateTrad, '' , path('Ajax.validator.date'), "{'nomChamp' : '"~ 'Date d\'échéance' | trad |e('js')|raw ~"', 'null' : 'true'}",'','', 'full') }}
				</div>
			</div>
			
			{# Mode de règlement  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Mode de règlement' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputZoomAdvance("", "MODE_REG_MIN", path('Ajax.liste.modePaiement'), "", 
					post.MODE_REG_MIN, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Modepaie', 'nomChamp' : '"~ 'Mode de règlement' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Modepaie","CODE_MDP", "LIBELLE", '', '', 'modal_small', 'Liste des modes de règlement' | trad) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputZoomAdvance("", "MODE_REG_MAX", path('Ajax.liste.modePaiement'), "", 
					post.MODE_REG_MAX, 'convertLibelleGlobal', 
					path('Ajax.validator.zoom'), "{'entity' : 'Modepaie', 'nomChamp' : '"~ 'Mode de règlement' | trad ~"', 'null' : true}" , "" , "full",
					path('Ajax.outil.convertLibelle'), "Modepaie","CODE_MDP", "LIBELLE", '', '', 'modal_small', 'Liste des modes de règlement' | trad) }}
				</div>
			</div>		
				
			<div class="row border-top">
				<div class="colonne3">
					<div class="row">
					</div>
				</div>
				<div class="colonne3">
					<div class="row">
						{{ 'Validée ?' | trad }} 
					</div>
				</div>
				<div class="colonne3 last">
					<div class="row">
						{{ 'En comptabilité ?' | trad }}
					</div>
				</div>
			</div>
			
			{# Entête  #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Entête' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputSelect("","ENTETE_VALID", select,post.ENTETE_VALID, '','','','','','','full', false) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputSelect("","ENTETE_COMPT", select, post.ENTETE_COMPT, '','','','','','','full', false) }}
				</div>
			</div>	
			
			{# Affectation #}
			<div class="colonne3">
				<div class="row"><label>{{ 'Affectation' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputSelect("","AFFECT_VALIDE", select,post.AFFECT_VALIDE, '','','','','','','full', false) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputSelect("","AFFECT_COMPT", select, post.AFFECT_COMPT, '','','','','','','full', false) }}
				</div>
			</div>	
				
			{# BAP #}
			<div class="colonne3">
				<div class="row"><label>{{ 'BAP' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputSelect("","BAP_VALIDE", select,post.BAP_VALIDE, '','','','','','','full', false) }}
				</div>
			</div>
			<div class="colonne3 last">
				<div class="row">
					{{ inputSelect("","BAP_COMPT", select, post.BAP_COMPT, '','','','','','','full', false) }}
				</div>
			</div>	

			<div class="row border-top">
			</div>
			<div class="colonne3">
				<div class="row"><label>{{ 'En litige ?' | trad }}</label></div>
			</div>
			<div class="colonne3">
				<div class="row">
					{{ inputSelect("","LITIGE", select, post.LITIGE, '','','','','','','full', false) }}
				</div>
			</div>        	
		</div>
		{{ Button('Valider' | trad, true,'', "openPdf('"~path('Facture.ImpressionFactureController.pdfEnteteFacture')~"', 'edition_entete', '"~path('Ajax.Erreur.popupErreurValid')~"');", false, false, 'button_right') }}
    </form>
</div>

{% endblock %}