diff --git a/Js/fonctions.js b/Js/fonctions.js index 3a677b7..1f0ec37 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -1568,6 +1568,7 @@ function creer_avenant() window.location.assign($("#racineWeb" ).val()+"Creeravenant/"); } +/* function enregistrer_avenant() { codeTypeAvenant=$("#codeTypeAvenant").val(); @@ -1593,13 +1594,6 @@ function enregistrer_avenant() dt_effet = Math.round(Date.parse(d_effet)/(1000*3600*24)); dt_fin = Math.round(Date.parse(d_fin)/(1000*3600*24)); dt_avenant = Math.round(Date.parse(d_avenant)/(1000*3600*24)); - - /* - alert("dt_effet => "+dt_effet); - alert("dt_fin => "+dt_fin); - alert("dt_avenant => "+dt_avenant); - return; - */ if (dt_avenant>dt_fin || dt_avenant dt_fin || dt_avenant < dt_effet) { + let v_msg = "Veuillez revoir la date ! Elle doit être comprise dans la période de validité du contrat."; + let v_msgEng = "Please review the date! It must be within the contract validity period."; + alert_ebene(v_msg, v_msgEng); + return; + } + + // 4. Vérification du Motif + motifavenant=$("#motifavenant").val(); + + if ($("#motifavenant").val()<" ") + { + v_msg="Veuillez fournir le motif!"; + v_msgEng="Please provide the reason"; + + alert_ebene(v_msg, v_msgEng); + return; + } + + // 5. Confirmation de l'avenant + + v_msg="Confirmez-vous cet avenant?"; + v_msgEng="Do you confirm this amendment to the contract?"; + + confirm_ebene(v_msg, v_msgEng).then(isConfirmed => { + if (isConfirmed) { + var div_attente = $('#div_attente'); + + div_attente.html(` +
+
+ Loading... +
+ + Veuillez patienter... / Please wait... + +
+ `); + + document.getElementById("formAvenant").submit(); + + } + }); +} function pop_afficher_selection_retrait() { const div_selection_assure = $('#div_selection_assure'); @@ -1805,6 +1886,7 @@ function liste_avenant() window.location.assign($("#racineWeb" ).val()+"Listeavenant/"); } +/* function controle_date_avenant() { let codeTypeAvenant = $("#codeTypeAvenant").val(); $("#div_periodidite").html(""); @@ -1812,6 +1894,20 @@ function controle_date_avenant() { //$("#dateAvenant").prop("readonly", true); //$("#motifavenant").prop("readonly", true); } +*/ + +function controle_date_avenant() { + let codeTypeAvenant = $("#codeTypeAvenant").val(); + let codesRestrictifs = ['INC', 'RET', 'INCORPORATION', 'RETRAIT']; + + if (codesRestrictifs.includes(codeTypeAvenant.toUpperCase())) { + // Restreindre le calendrier à partir d'aujourd'hui + $("#dateAvenant").datepicker("option", "minDate", 0); + } else { + // Autoriser les dates passées (selon les bornes du contrat) + $("#dateAvenant").datepicker("option", "minDate", null); + } +} function init_import_assures() { diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 2e0b665..7158695 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -707,7 +707,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; - +