
{% extends 'layout.twig' %}

{% block body %}

    <div class="contenu clearfix"  id="factures">
    	<h1>{{ 'Factures et avoirs' | trad }}</h1>
        {{ ariane() }}
        
        <div class="tab-content">
            <div id="visualisation_facture" class="tab-pane fade in active">
				<h2>
                    {{ H2 }}
                    
    		        {{ Button('Enregistrer' | trad, 1, '', 'validationDemandeCommandeRegul(\''~path('Specifique56.Facture.validationDemandeCommandeRegul', {numFact : numFact})~'\')') }}
                    {{ Button('Annuler' | trad, 0, path('Specifique56.Index.menuIntermediaireFactureSpecifique', {numFact : numFact})) }}
                </h2>
                <script>
                    function validationDemandeCommandeRegul(path)
                    {
                        // activeLoader();
                        $.ajax({
                            url: path,
                            type: 'POST',
                            dataType: 'JSON',
                            data: $('#form_demandeCommandeRegul').serialize(),
                            success: function(data) {
                                if(data.statut == 'redirect'){
                                    redirectJSWithPost(data.path);
                                }
                            }, 
                            error: function (data){
                                desactiveLoader();
                                $("#modal-content").addClass("modal_small");
                                $("#modal-body").html(data.responseText);
                                activePopup();
                            } 
                        });
                    }
                </script>            	
                
                <form action="" method="post" name="form_demandeCommandeRegul" id="form_demandeCommandeRegul" class="padding15" >
                    <div class="clearfix">                        
                        <div class="colonne2">
                            {{ inputCSAdvance({'codTab' : 'FAC_ENT', 'codeEnr' : codeEnr, 'numFixe' : CSDemandeur.NUM_FIX, 'validator' : 'demandeur', 'postParams' : "{'CODE_STE' : '"~ facture.CODE_STE ~"', 'withEmail' : 1}" }) }} 
                        </div>                            
                    </div>
                </form>
            </div>
        </div>
    </div>   
{% endblock %}