From 17e5910a6ed2f4df258ace3e7b80321983533c1c Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Wed, 25 Mar 2026 22:02:35 +0000 Subject: [PATCH] a --- Js/fonctions.js | 36634 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 36633 insertions(+), 1 deletion(-) diff --git a/Js/fonctions.js b/Js/fonctions.js index 40267d5b..1c6eecd1 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -55541,4 +55541,36636 @@ function enregistrer_changementcollege() confirm_ebene(v_msg, v_msgEng) - .then \ No newline at end of file + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Fichechangementcollege/enregistrerchangementcollege/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } + }); + +} + +function choix_beneficiaire_changementcollege(p_choix, p_id_beneficiaire) +{ + + + donnees = 'idBeneficiaire='+p_id_beneficiaire; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/selectionner/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function pop_changementcollege() +{ + var div_changementcollege = $('#div_changementcollege'); + + div_changementcollege.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/afficherlistemixtechangementcollegebeneficiaire/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + div_changementcollege.html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + complete: function() { + $("#btn_changementcollege").click(); + + + + } + }); +} + +function init_changementcollege_un_adhrent(p_id_beneficiaire) +{ + donnees = 'idBeneficiaire='+p_id_beneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/afficherbeneficiairechangementcollegeunadherent/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_maj_changementcollegetemp').html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function init_changementcollege_un_beneficiaire(p_id_beneficiaire) +{ + donnees = 'idBeneficiaire='+p_id_beneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/afficherbeneficiairechangementcollegeunbeneficiaire/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_maj_changementcollegetemp').html(data); + $('#div_changementcollege').html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function changer_college_adherent_lien_parente_temp() +{ + idBeneficiaire = $("#idBeneficiaire").val(); + idCollegeOld = $("#idCollegeOld").val(); + idCollegeNew = $("#idCollegeNew").val(); + + + if (idBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner un assuré!"; + v_msgEng="Please select one person!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (idCollegeNew<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (idCollegeNew==idCollegeOld) + { + v_msg="Veuillez changer de collège!"; + v_msgEng="Please change college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idBeneficiaire='+idBeneficiaire; + donnees += '&idCollegeNew='+idCollegeNew; + + $("#div_maj_changementcollegetemp").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/changercollegeadherentlienparentetemp/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_maj_changementcollegetemp").html(''); + $('#div_changementcollege').html(data); + }, + complete: function() { + } + }); +} + +function changer_college_beneficiaire_lien_parente_temp() +{ + idBeneficiaire = $("#idBeneficiaire").val(); + idCollegeOld = $("#idCollegeOld").val(); + idCollegeNew = $("#idCollegeNew").val(); + + + if (idBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner un assuré!"; + v_msgEng="Please select one person!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (idCollegeNew<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (idCollegeNew==idCollegeOld) + { + v_msg="Veuillez changer de collège!"; + v_msgEng="Please change college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idBeneficiaire='+idBeneficiaire; + donnees += '&idCollegeNew='+idCollegeNew; + + // $("#div_maj_changementcollegetemp").html('
' + '
'); + $("#div_changementcollege").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/changercollegebeneficiairelienparentetemp/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + // $("#div_maj_changementcollegetemp").html(''); + $('#div_changementcollege').html(data); + }, + complete: function() { + } + }); +} + + +function init_maj_detail_rejet_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/detailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + $("#codeMotifRejetPop").selectpicker(); + $("#codeMotifExclusionPop").selectpicker(); + $("#div_selection_acte").hide(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajdetailrejetrbcl").click(); + return; + + } + }); +} + +function init_maj_detail_rejet_decompte_obs(numeroDecompte) +{ + + donnees = 'numeroDecompte='+numeroDecompte; + + //var idFacture = $('#idFacture').val(); + //var idAdherent = $('#idAdherent').val(); + // + $("#div_patienter").html('
' + '
'); + + + //donnees = 'idFacture='+idFacture+'&idAdherent='+idAdherent; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexclusiondecompteobs/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + //$("#codeMotifRejet").selectpicker(); + $('#div_motif_exclusion_obs').html(data); + $('#div_motif_exclusion_obs').modal("show"); + + //afficherdecompte(); + }, + complete: function() { + + } + }); +} + +function init_maj_detail_rejet_decompte(idFacture) +{ + + donnees = 'idFacture='+idFacture; + + //var idFacture = $('#idFacture').val(); + //var idAdherent = $('#idAdherent').val(); + // + $("#div_patienter").html('
' + '
'); + + + //donnees = 'idFacture='+idFacture+'&idAdherent='+idAdherent; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexclusiondecompte/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + //$("#codeMotifRejet").selectpicker(); + $('#div_exclusion_actes').html(data); + $('#div_exclusion_actes').modal("show"); + + //afficherdecompte(); + }, + complete: function() { + + } + }); +} + + +function enregistrer_motif_decompte_obs() +{ + // + codeMotifRejet=$("#codeMotifRejet").val(); + idFacture=$("#idFacture").val(); + numeroLotDecompte=$("#numeroLotDecompte").val(); + numeroDecompte=$("#numeroDecompte").val(); + motifManuel=$("#motifManuel").val(); + + if (codeMotifRejet<=" ") + { + v_msg="Veuillez revoir le motif!"; + v_msgEng="Please review the motif!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMotifRejet").focus(); + + return; + } + + v_msg="Confirmez-vous ce motif?"; + v_msgEng="Do you confirm this reason?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'codeMotifRejet='+codeMotifRejet+'&numeroDecompte='+numeroDecompte+'&numeroLotDecompte='+numeroLotDecompte+'&motifManuel='+motifManuel; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexclusiondecompteobs/majmotifdecompteobs/", + type: 'POST', + data: donnees, + success: function(data) { + afficherdecompte(); + }, + error: function(data) { + }, + complete: function(data) { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrer_motif_decompte() +{ + // + codeMotifRejet=$("#codeMotifRejet").val(); + idFacture=$("#idFacture").val(); + numeroLotDecompte=$("#numeroLotDecompte").val(); + motifManuel=$("#motifManuel").val(); + + if (codeMotifRejet<=" ") + { + v_msg="Veuillez revoir le motif!"; + v_msgEng="Please review the motif!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMotifRejet").focus(); + + return; + } + + v_msg="Confirmez-vous ce motif?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'codeMotifRejet='+codeMotifRejet+'&idFacture='+idFacture+'&numeroLotDecompte='+numeroLotDecompte+'&motifManuel='+motifManuel; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexclusiondecompte/majmotifdecompte/", + type: 'POST', + data: donnees, + success: function(data) { + afficherdecompte(); + }, + error: function(data) { + }, + complete: function(data) { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_motifs(idMotifDecompte) +{ + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexclusiondecompte/supprimermotifDecompte/", + type : 'post', + data: "idMotifDecompte="+idMotifDecompte, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + $("#close_pop_motifs").click(); + afficherdecompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function enregistrer_detail_rejet_rbcl() +{ + idPrestation=$("#idPrestationRejete").val(); + detailRejet=$("#detailRejet").val(); + + if (detailRejet<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailRejet").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailRejet='+detailRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majdetailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_rejet").click(); + $("#div_selection_acte").hide(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function enregistrer_detail_rejet_rbcl() +{ + idPrestation=$("#idPrestationRejete").val(); + detailRejet=$("#detailRejet").val(); + + if (detailRejet<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailRejet").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailRejet='+detailRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majdetailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_rejet").click(); + $("#div_selection_acte").hide(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function enregistrer_detail_exclusion_rbcl() +{ + idPrestation=$("#idPrestationexclusion").val(); + detailExclusion=$("#detailExclusion").val(); + + if (detailExclusion<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailExclusion").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailExclusion='+detailExclusion; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majdetailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_exclusion").click(); + $("#div_selection_acte").hide(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function enregistrer_detail_exclusion_rbcl() +{ + idPrestation=$("#idPrestationexclusion").val(); + detailExclusion=$("#detailExclusion").val(); + + if (detailExclusion<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailExclusion").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailExclusion='+detailExclusion; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majdetailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_exclusion").click(); + $("#div_selection_acte").hide(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function init_maj_detail_exclusion_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/detailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + $("#div_selection_acte").hide(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajdetailexclusionrbcl").click(); + return; + + } + }); +} + + +function consulter_detail_rejet_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/consulterdetailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + + $("#div_selection_acte").hide(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popconsulterdetailrejetrbcl").click(); + return; + + } + }); +} + + +function consulter_detail_exclusion_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/consulterdetailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + + $("#div_selection_acte").hide(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popconsulterdetailexclusionrbcl").click(); + return; + + } + }); +} + + +function editionpieceavenant(idAvenant, numeroAvenant, codeTypeAvenant) +{ + donnees = 'idAvenant='+idAvenant+'&numeroAvenant='+numeroAvenant+'&codeTypeAvenant='+codeTypeAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextditionpieceavenant/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + if(codeTypeAvenant=="QTM"){ + window.location.assign($("#racineWeb" ).val()+"Fichequittancemanuelle/"+idAvenant); + }else{ + window.location.assign($("#racineWeb" ).val()+"Editionpieceavenant/"); + } + } + }); +} +//08/09 ajout des parametres date + +function imprimerpieceavenant(idAvenant, codeTypeAvenant, codeEtat) +{ + // + var td2 = $("#debutStat").datepicker("getDate"); + var td3 = $("#finStat").datepicker("getDate"); + + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutStat + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); // finStat + + if (dt3' + ''); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxeditionpieceavenant/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_deatil_pop").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // + } + }); +} + +function exporterpieceavenant(idAvenant, codeTypeAvenant, codeEtat) +{ + donnees = 'idAvenant='+idAvenant+'&codeTypeAvenant='+codeTypeAvenant+'&codeEtat='+codeEtat; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxeditionpieceavenant/exporter/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_deatil_pop").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // + } + }); +} + +//10/05/2021 + +function affiche_effet_avenant() +{ + var idAvenant = $('#idAvenant').val(); + + donnees = 'idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/affichereffetavenant/", + type: 'POST', + data: donnees, + success: function(data) + { + var fromDate = new Date(data); + var date = new Date(fromDate).toLocaleDateString(); + $("#debut").val(date); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // + } + }); + +} + +// 15/05/2021 + +function mail_detail_stat_adherent_facture() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + + emailAdherent = emailAdherent.trim(); + + if (emailAdherent<=" ") + { + v_msg="Veuillez indiquer les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailAdherent").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailAdherent.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent+"&emailAdherent="+emailAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureadhmail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function mail_detail_stat_adherent_garantie() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + + emailAdherent = emailAdherent.trim(); + + if (emailAdherent<=" ") + { + v_msg="Veuillez indiquer les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailAdherent").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailAdherent.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent+"&emailAdherent="+emailAdherent; + + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspgarantieadhmail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// 17/05/2021 + +function reinitialiser_email_adherent() +{ + emailAdherent = $("#emailAdherent_0").val(); + $("#emailAdherent").val(emailAdherent); +} + +function etat_rapport_sp_adherent() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeEtat=$("#codeEtat").val(); + + if (codeEtat<=" ") + { + v_msg="Veuillez sélectionner un état!"; + v_msgEng="Please select a state!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeEtat").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxetat"+codeEtat+"/"; + + $("#div_detail_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_requete").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +// 18/05/2021 +function etat_rapport_sp_adherent_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeEtat=$("#codeEtat").val(); + + if (codeEtat<=" ") + { + v_msg="Veuillez sélectionner un état!"; + v_msgEng="Please select a state!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeEtat").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxetat"+codeEtat+"export/"; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_detail_requete').html(""); + $('#div_export_a').html(donnees_retour); + } + }); +} + +function imprimer_liste_assures_periode() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + if (debut<=" ") + { + v_msg="Veuillez indiquer une date de début!"; + v_msgEng="Please enter a start date!"; + alert_ebene(v_msg, v_msgEng); + + $("#debut").focus(); + return; + } + + if (fin<=" ") + { + v_msg="Veuillez indiquer une date de fin!"; + v_msgEng="Please enter a end date!"; + alert_ebene(v_msg, v_msgEng); + + $("#fin").focus(); + return; + } + + donnees = 'debut='+debut+'&fin='+fin; + + var div_export = $('#div_export_assures'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlisteassureperiode/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function imprimer_liste_assures_retrait() +{ + + debutSortie = $("#debutSortie").val(); + finSortie = $("#finSortie").val(); + + retirer = $("#retirer").val(); + + + if (retirer<=" ") + { + retirer = "R" + } + + if (debutSortie<=" ") + { + v_msg="Veuillez indiquer une date de début!"; + v_msgEng="Please enter a start date!"; + alert_ebene(v_msg, v_msgEng); + + $("#debutSortie").focus(); + return; + } + + if (finSortie<=" ") + { + v_msg="Veuillez indiquer une date de fin!"; + v_msgEng="Please enter a end date!"; + alert_ebene(v_msg, v_msgEng); + + $("#finSortie").focus(); + return; + } + + donnees = 'debutSortie='+debutSortie+'&finSortie='+finSortie+'&retirer='+retirer; + + var div_export = $('#div_export_assures'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlisteassureretrait/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + + +function listeapprobationsubstitutionpha() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxapprobationsubstitutionpha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +// 01/06/2021 +function listedemandesubstitution_pha() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablessubstitutionpha/"); +} + +function consulter_approbation_pha(idDemandesubstitution) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterapprobationsubstitutionpha/"+idDemandesubstitution+"/"); +} + +function accepter_substitution_pha(idDemandesubstitution) +{ + + window.location.assign($("#racineWeb" ).val()+"Acceptersubstitutionpha/"+idDemandesubstitution+"/"); +} + +function enregistrerapprobation_pha() +{ + idDemandesubstitution = $("#idDemandesubstitution").val(); + motifReel = $("#motifReel").val(); + + if (motifReel<=" ") + { + v_msg="Veuillez saisir le motif!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifReel").focus(); + return; + } + + + v_msg="Confirmez-vous cet accord?"; + v_msgEng="Do you confirm this agreement?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + codePrestataire = $("#codePrestataire").val(); + + donnees = 'idDemandesubstitution='+idDemandesubstitution+'&motifReel='+motifReel; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='accordsubstitutionpha'; + typeSms ="accordsubstitutionpha"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxapprobationsubstitutionbenficiaire/enregistrerapprobationsubstitutionpha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + preparesms(typeSms); + }, + complete: function() { + v_msg="Accord envoyé avec succès!"; + v_msgEng="Agreement sent successfully!"; + alert_ebene(v_msg, v_msgEng); + + listedemandesubstitution_pha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function refuser_substitution_pha(idDemandesubstitution) +{ + window.location.assign($("#racineWeb" ).val()+"Refusersubstitutionpha/"+idDemandesubstitution+"/"); +} + +function enregistrerrefussubstitution_pha() +{ + idDemandesubstitution = $("#idDemandesubstitution").val(); + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + + if (motifReel<=" ") + { + v_msg="Veuillez saisir le motif réel!"; + v_msgEng="Please enter the real reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifReel").focus(); + return; + } + + if (motifRefusAssure<=" ") + { + v_msg="Veuillez saisir un motif pour l\'assuré!"; + v_msgEng="Please enter a reason for the insured!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + return; + } + + v_msg="Confirmez-vous ce refus?"; + v_msgEng="Do you confirm this refusal?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + codePrestataire = $("#codePrestataire").val(); + + donnees = 'idDemandesubstitution='+idDemandesubstitution+'&motifReel='+motifReel+'&motifRefusAssure='+motifRefusAssure; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='refussubstitutionpha'; + typeSms= "refussubstitutionpha"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxapprobationsubstitutionbenficiaire/enregistrerrefussubstitutionpha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + preparesms(typeSms); + }, + complete: function() { + + v_msg="Refus envoyé avec succès!"; + v_msgEng="Disagreement sent successfully!"; + alert_ebene(v_msg, v_msgEng); + + listedemandesubstitution_pha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +// 05/06/2021 +function tarifCentre(controle){ + + var idPolice = $("#idPolice option:selected").text(); + var idPoliceVal = $("#idPolice").val(); + var codePrestataire = $("#codePrestataire").val(); + + + + $('select[name=codeGroupePrestataire]').val(0); + $('.selectpicker').selectpicker('refresh'); + + var libelle = controle.options[controle.selectedIndex].text.split(' ('); + + if(idPoliceVal ==""){ + $('#libelle').val('TARIF '+libelle[0]); + $('#libelleEng').val(libelle[0]+' RATE'); + donnees = 'codeTypeTarifActe=TN&idPolice=0&codePrestataire='+codePrestataire; + }else{ + $('#libelle').val('TARIF '+idPolice+' <=> '+libelle[0]); + $('#libelleEng').val(idPolice+' <=> '+libelle[0]+' RATE'); + donnees = 'codeTypeTarifActe=TPC&idPolice='+idPoliceVal+'&codePrestataire='+codePrestataire; + } + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifcentre/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_type_tarif').html(data); + var msgErreur = $('#div_type_tarif #msgErreur').val(); + if (msgErreur > " "){ + var str = msgErreur.split('/'); + alert_ebene(str[0],str[1]); + $('select[name=codePrestataire]').val(0); + $('.selectpicker').selectpicker('refresh'); + $('#libelle').val(""); + $('#libelleEng').val(""); + $('select[name=codeTypeTarifActe]').val(0); + } + }, + complete: function(){ + } + }); + +} + +function tarifPolice(controle){ + + var codePrestataire = $("#codePrestataire option:selected").text(); + var codePrestataireVal = $("#codePrestataire").val(); + var idPolice = $("#idPolice").val(); + var idCollege = $("#idCollege").val(); + + $('select[name=codeGroupePrestataire]').val(0); + $('.selectpicker').selectpicker('refresh'); + + var libelle = controle.options[controle.selectedIndex].text.split(' ('); + + if(codePrestataireVal ==""){ + if(idCollege=="" || idCollege=="0" || idCollege==undefined){ + $('#libelle').val('TARIF '+libelle[0]); + $('#libelleEng').val(libelle[0]+' RATE'); + }else{ + $('#libelle').val('TARIF COLLEGE '+libelle[0]); + $('#libelleEng').val(libelle[0]+' COLLEGE RATE'); + } + donnees = 'codeTypeTarifActe=TP&idPolice='+idPolice+'&codePrestataire='+'&idCollege='+idCollege; + }else{ + if(idCollege=="" || idCollege=="0" || idCollege==undefined){ + $('#libelle').val('TARIF '+codePrestataire+' <=> '+libelle[0]); + $('#libelleEng').val(codePrestataire+' <=> '+libelle[0]+' RATE'); + }else{ + $('#libelle').val('TARIF COLLEGE '+codePrestataire+' <=> '+libelle[0]); + $('#libelleEng').val(codePrestataire+' <=> '+libelle[0]+' COLLEGE RATE'); + } + donnees = 'codeTypeTarifActe=TPC&idPolice='+idPolice+'&codePrestataire='+codePrestataireVal+'&idCollege='+idCollege;; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifpolice/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_type_tarif').html(data); + var msgErreur = $('#div_type_tarif #msgErreur').val(); + if (msgErreur > " "){ + var str = msgErreur.split('/'); + alert_ebene(str[0],str[1]); + $('select[name=idPolice]').val(0); + $('.selectpicker').selectpicker('refresh'); + $('#libelle').val(""); + $('#libelleEng').val(""); + $('select[name=codeTypeTarifActe]').val(0); + } + }, + complete: function(){ + } + }); + +} + +function tarifGroupe(controle){ + + $('select[name=codePrestataire]').val(1); + $('.selectpicker').selectpicker('refresh'); + + $('select[name=idPolice]').val(0); + $('.selectpicker').selectpicker('refresh'); + + + $('#libelle').val('TARIF '+controle.options[controle.selectedIndex].text); + $('#libelleEng').val(controle.options[controle.selectedIndex].text+' RATE'); + + donnees =''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifcentre/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_type_tarif').html(data); + }, + complete: function(){ + } + }); + +} + + +function filtreListetarifacte(codeTypeTarifActe){ + + donnees = "codeTypeTarifActe="+codeTypeTarifActe; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrelistetarifacte/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + $("#div_lister_table").html(data); + appliquerDataTable(); + }, + complete: function() { + + } + }); + +} + + +// 10/06/2021 + +function etat_rapport_sp_periode() +{ + var td0 = $("#debutExercice").datepicker("getDate"); + var td1 = $("#dateAnalyse").datepicker("getDate"); + var td2 = $("#debutStat").datepicker("getDate"); + var td3 = $("#finStat").datepicker("getDate"); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); // debutExercice + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); // dateAnalyse + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutStat + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); // finStat + + if (dt2dt1) + { + v_msg="Période a extraire hors de la période d\'analyse!"; + v_msgEng="Period to extract out of the analysis period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (dt3dt1) + { + v_msg="Période a extraire hors de la période d\'analyse!"; + v_msgEng="Period to extract out of the analysis period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (dt3' + ''); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_requete").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + appliquerDataTable(); + } + }); +} + +// 11/06/2021 +function ajaxfiltrepolice() +{ + + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrepolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_police").html(data); + } + }); +} + +function ajax_composante_tarif_police() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe =$("#codeTarifActe").val(); + codeFamilleActe =$("#codeFamilleActe").val(); + idPolice =$("#idPolice").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir une police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + donnees += '&idPolice='+idPolice; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpolice/affichercomposantetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_actes_fam_au_tarif_police() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + idPolice=$("#idPolice").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir une police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + donnees += '&idPolice='+idPolice; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpolice/ajoutertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_actes_fam_du_tarifpolice() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + idPolice=$("#idPolice").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir un police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + donnees += '&idPolice='+idPolice; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpolice/retirertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_acte_au_tarif_police(idActe) +{ + codeTarifActe=$("#codeTarifActe").val(); + idPolice=$("#idPolice").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir un police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe; + donnees += '&idPolice='+idPolice+'&idActe='+idActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpolice/ajouterunacteautarif/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police(); + } + }); +} + +// 14/06/2021 +function ajaxfiltreprestataire() +{ + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataire").html(data); + } + }); +} + +function ajaxfiltreclientprestataire() +{ + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe; + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreclientprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_groupe").html(data); + } + }); +} + + +// 17/06/2021 + +function afficher_liste_carteassure() +{ + donnees = ""; + donnees_retour = ""; + + codeGcAssureur = $("#codeGcAssureur").val(); + + if (codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + idPolice =$("#idPolice").val(); + if(idPolice<=' ') + { + v_msg="Veuillez saisir une police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + + idCollege=$("#idCollege").val(); + + $("#div_export_a").html(""); + + $("#div_liste_carte").html('
' + '
'); + + donnees = 'codeGcAssureur='+codeGcAssureur+'&idPolice='+idPolice+'&idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte").html(donnees_retour); + appliquerDataTable(); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function imprimer_liste_carteassure() +{ + nbligne_info = $("#nbligne_info").val(); + donnees = ""; + + + codeLienParente = $("#codeLienParente").val(); + codeEtatCarte = $("#codeEtatCarte").val(); + + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees += 'codeLienParente=' + codeLienParente; + donnees += '&codeEtatCarte=' + codeEtatCarte; + + donnees += '&debut=' + debut; + donnees += '&fin=' + fin; + + if (nbligne_info>"0") + { + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/imprimerlistecarteassure", + type: 'POST', + data: donnees, + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + }else{ + v_msg="Rien à imprimer!"; + v_msgEng="Nothing to print!"; + alert_ebene(v_msg, v_msgEng); + + return; + } +} + + +// 03/07/2021 + +function etat_rapport_sp_periode_export() +{ + var td0 = $("#debutExercice").datepicker("getDate"); + var td1 = $("#dateAnalyse").datepicker("getDate"); + var td2 = $("#debutStat").datepicker("getDate"); + var td3 = $("#finStat").datepicker("getDate"); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); // debutExercice + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); // dateAnalyse + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutStat + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); // finStat + + if (dt2dt1) + { + v_msg="Période a extraire hors de la période d\'analyse!"; + v_msgEng="Period to extract out of the analysis period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (dt3dt1) + { + v_msg="Période a extraire hors de la période d\'analyse!"; + v_msgEng="Period to extract out of the analysis period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (dt3' + ''); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_detail_requete').html(""); + $('#div_export_a').html(donnees_retour); + } + }); +} + + +function charger_detail_stat_periode_police_pdf() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +// 04-07-2021 + +function charger_detail_stat_periode_police() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiode/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + + +function mail_detail_stat_periode_police() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + emailRapport = $("#emailRapport").val(); + + emailRapport = emailRapport.trim(); + + if (emailRapport<=" ") + { + v_msg="Veuillez indiques les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailRapport").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailRapport.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idPolice="+idPolice+"&emailRapport="+emailRapport; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportperiodemail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_stat_periode_police_facture_pdf() +{ + + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodefacturepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function charger_detail_stat_periode_police_facture() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodefacture/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + + +function mail_detail_stat_periode_police_facture() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + emailRapport = $("#emailRapport").val(); + + emailRapport = emailRapport.trim(); + + if (emailRapport<=" ") + { + v_msg="Veuillez indiques les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailRapport").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailRapport.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idPolice="+idPolice+"&emailRapport="+emailRapport; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodefacturemail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_stat_periode_police_garantie_pdf() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodegarantiepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + + +function charger_detail_stat_periode_police_garantie() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + donnees = "idPolice="+idPolice; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodegarantie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + + +function mail_detail_stat_periode_police_garantie() +{ + $('#div_export_b').html(""); + idPolice = $("#idPolice").val(); + emailRapport = $("#emailRapport").val(); + + emailRapport = emailRapport.trim(); + + if (emailRapport<=" ") + { + v_msg="Veuillez indiques les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailRapport").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailRapport.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idPolice="+idPolice+"&emailRapport="+emailRapport; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspperiodegarantiemail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_stat_adherent_periode_facture_pdf() +{ + + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + donnees = "idAdherent="+idAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureadhperiodepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function charger_detail_stat_adherent_periode_facture() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + donnees = "idAdherent="+idAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureadhperiode/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function mail_detail_stat_adherent_periode_facture() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + + emailAdherent = emailAdherent.trim(); + + if (emailAdherent<=" ") + { + v_msg="Veuillez indiquer les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailAdherent").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailAdherent.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent+"&emailAdherent="+emailAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureadhperiodemail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_stat_adherent_periode_garantie_pdf() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + donnees = "idAdherent="+idAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspgarantieadhperiodepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function charger_detail_stat_adherent_periode_garantie() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + donnees = "idAdherent="+idAdherent; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspgarantieadhperiode/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function mail_detail_stat_adherent_periode_garantie() +{ + $('#div_export_b').html(""); + idAdherent = $("#idAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + + emailAdherent = emailAdherent.trim(); + + if (emailAdherent<=" ") + { + v_msg="Veuillez indiquer les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailAdherent").focus(); + return; + } + + mauvais_mail=false; + + email_err = ""; + + var addr = emailAdherent.split(";"); + + addr.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err = element; + mauvais_mail = true; + // break; + return; + } + }); + + if(mauvais_mail==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err; + v_msgEng="Please review this address : "+email_err ; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous cet envoi?"; + v_msgEng="Do you confirm this sending?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent+"&emailAdherent="+emailAdherent; + + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspgarantieadhperiodemail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + div_export.html(" "); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function ajaxfiltrepoliceprestataire() +{ + + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrepoliceprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_police").html(data); + } + }); +} + +// 19-07-2021 +function filtreListePoliceTarif() +{ + donnees = "codePrestataire="+$("#codePrestataire").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrelistepolicetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_police").html(data); + } + }); + +} + +function filtreListePrestataireTarif() +{ + donnees = "idPolice="+$("#codePrestataire").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrelisteprestatairetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataire").html(data); + } + }); +} + +function ajaxfiltretarifpolice() +{ + + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltretarifpolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_police").html(data); + } + }); +} + +function ajaxfiltretarifprestataire() +{ + + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltretarifprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataire").html(data); + } + }); +} + +function ajax_composante_tarif_client_prestataire() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifclientprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_un_acte_au_tarif_police_prestataire(idActe) +{ + codeTarifActe=$("#codeTarifActe").val(); + idPolice=$("#idPolice").val(); + + codePrestataire=$("#codePrestataire").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir un police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codePrestataire<=' ') + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe; + donnees += '&idPolice='+idPolice+'&idActe='+idActe; + donnees += '&codePrestataire='+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/ajouterunacteautarif/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police_prestataire(); + } + }); +} + +function ajouter_tous_actes_fam_au_tarif_police_prestataire() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + idPolice=$("#idPolice").val(); + codePrestataire=$("#codePrestataire").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir une police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + + if(codePrestataire<=' ') + { + v_msg="Veuillez saisir un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + donnees += '&idPolice='+idPolice; + donnees += '&codePrestataire='+codePrestataire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/ajoutertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police_prestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_actes_fam_du_tarifpolice_prestataire() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + idPolice=$("#idPolice").val(); + codePrestataire=$("#codePrestataire").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez saisir un police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codePrestataire<=' ') + { + v_msg="Veuillez saisir un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + donnees += '&idPolice='+idPolice; + donnees += '&codePrestataire='+codePrestataire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/retirertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_police_prestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficher_pop_recherche_prestataire_type_prestataire(codeTypePrestataire) +{ + codesearch = $("#codesearch").val(); + nomsearch = $("#nomsearch").val(); + + if(codesearch+nomsearch<=" ") + return; + + donnees = "valid=1&codesearch="+codesearch+"&nomsearch="+nomsearch; + donnees += "&codeTypePrestataire="+codeTypePrestataire; + + // alert(donnees); + // return; + + $("#div_listeprestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataires/getlistepypeprestatairelike/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires").html(data); + } + }); +} + + +function afficher_pop_recherche_prestataire_rbcl() +{ + codesearch = $("#codesearch").val(); + nomsearch = $("#nomsearch").val(); + + if(codesearch+nomsearch<=" ") + return; + + donnees = "valid=1&codesearch="+codesearch+"&nomsearch="+nomsearch; + + // alert("afficher_pop_recherche_prestataire_rbcl => "+donnees); + // return; + + $("#div_listeprestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataires/getlisteprestatairerbcl/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires").html(data); + } + }); +} + +function ajax_maj_montant_rejete(idPrestation, montantRejete, controle) +{ + montantRejete=montantRejete.replace(/ /g,""); + controle.value=montantRejete; + + if(controle_numerique(controle)) + { + donnees = 'idPrestation='+idPrestation+"&montantRejete="+montantRejete; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majmontantrejete/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + $("#div_selection_acte").hide(); + } + }); + } +} + + +function maj_montant_rejete(idPrestation, montantRejete, controle) +{ + donnees = 'idPrestation='+idPrestation+"&montantRejete="+montantRejete; + + montantRejete=montantRejete.replace(",","."); + controle.value=montantRejete; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majmontantrejete/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#prestataire").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + } + }); + } +} + + +function ajax_maj_montant_exclu(idPrestation, montantExclu, controle) +{ + montantExclu=montantExclu.replace(/ /g,""); + controle.value=montantExclu; + + if(controle_numerique(controle)) + { + donnees = 'idPrestation='+idPrestation+"&montantExclu="+montantExclu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majmontanteclu/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + $("#div_selection_acte").hide(); + } + }); + } +} + + +function maj_montant_exclu(idPrestation, montantExclu, controle) +{ + donnees = 'idPrestation='+idPrestation+"&montantExclu="+montantExclu; + + montantExclu=montantExclu.replace(",","."); + controle.value=montantExclu; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majmontanteclu/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#prestataire").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + } + }); + } +} + +function init_maj_motif_rejet_rbcl(idPrestation, codeMotifRejet, libellemotifRejet) +{ + donnees = 'idPrestation='+idPrestation+"&codeMotifRejet="+codeMotifRejet+"&libellemotifRejet="+libellemotifRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmajmotifrbcl/motifrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_motif_rejet").html(data); + $("#codeMotifRejetPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajmotifrejetrbcl").click(); + return; + + } + }); +} + +function init_maj_motif_exclusion_rbcl(idPrestation, codeMotifExclusion, libelleMotifExclusion) +{ + donnees = 'idPrestation='+idPrestation+"&codeMotifExclusion="+codeMotifExclusion+"&libelleMotifExclusion="+libelleMotifExclusion; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmajmotifrbcl/motifexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_motif_exclusion").html(data); + $("#codeMotifExclusionPop").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajmotifexclusionrbcl").click(); + return; + + } + }); +} + + +function enregistrer_motif_rejet_rbcl() +{ + idPrestation=$("#idPrestationRejete").val(); + codeMotifRejet=$("#codeMotifRejetPop").val(); + codeMotifRejetOld=$("#codeMotifRejetOld").val(); + + if (codeMotifRejet==codeMotifRejetOld) + { + v_msg="Veuillez revoir le motif!"; + v_msgEng="Please review the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMotifRejetPop").focus(); + + return; + } + + v_msg="Confirmez-vous cet motif?"; + v_msgEng="Do you confirm this reason?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&codeMotifRejet='+codeMotifRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majmotifrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#prestataire").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_motif_rejet").click(); + $("#div_selection_acte").hide(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function enregistrer_motif_exclusion_rbcl() +{ + idPrestation=$("#idPrestationExclu").val(); + codeMotifExclusion=$("#codeMotifExclusionPop").val(); + codeMotifexclusiontOld=$("#codeMotifexclusiontOld").val(); + + if (codeMotifExclusion==codeMotifexclusiontOld) + { + v_msg="Veuillez revoir le motif!"; + v_msgEng="Please review the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMotifExclusionPop").focus(); + + return; + } + + v_msg="Confirmez-vous cet motif?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&codeMotifExclusion='+codeMotifExclusion; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majmotifexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + $("#div_facture").html(data); + $(".datepicker").datepicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_motif_exclusion").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ctrlkeypresstype_prestataire(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + codeTypePrestataire = $("#codeTypePrestataire").val(); + afficher_pop_recherche_prestataire_type_prestataire(codeTypePrestataire); + } +} + + +function remboursement_classique_police() +{ + window.location.assign($("#racineWeb" ).val()+"Remboursementclassiquepolice/"); +} + +function afficher_non_facture_sin() +{ + adminDiv = $("#adminDiv").val(); + + if (adminDiv!="1") + { + v_msg="Accès refusé!"; + v_msgEng="Access denied!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb").val()+"Nonfacturesin/"); +} + +function lister_feuille_nonfacture() +{ + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + if(debutAnalyse > dateAnalyse){ + + v_msg="La date de début est supérieur à la date de fin d'analyse!"; + v_msgEng="The start date is greater than the end date of analysis!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + var div_lister = $('#div_lister'); + div_lister.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxlisternonfacturesin/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_lister.html(donnees_retour); + appliquerDataTable(); + } + }); +} + +function facturertousfeuillenonfacture() +{ + // + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + if(debutAnalyse > dateAnalyse){ + + v_msg="La date de début est supérieur à la date de fin d'analyse!"; + v_msgEng="The start date is greater than the end date of analysis!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $('#div_export_a').html(""); + donnees_retour = ""; + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + $("#div_patienter").html('
' + '
'); + + //div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxlistertousnonfacturesin/facturer/"; + + v_msg="Confirmez-vous la facturation des feuilles maladies?"; + v_msgEng="Do you confirm the invoicing of this prescription sheet?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + lister_feuille_nonfacture(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function facturerfeuillenonfacture(numeroFeuilleMaladie) +{ + donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie; + + v_url = $("#racineWeb").val()+"Ajaxlisternonfacturesin/facturer/"; + + v_msg="Confirmez-vous la facturation de cette feuille de prescription?"; + v_msgEng="Do you confirm the invoicing of this prescription sheet?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + lister_feuille_nonfacture(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function lister_feuille_nonfacture_pdf() +{ + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + if(debutAnalyse > dateAnalyse){ + + v_msg="La date de début est supérieur à la date de fin d'analyse!"; + v_msgEng="The start date is greater than the end date of analysis!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $('#div_export_a').html(""); + donnees_retour = ""; + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxlisternonfacturesinpdf/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + + } + }); +} + +function ajax_maj_tm_acte_rbcl(idPrestation, tm, controle) +{ + donnees = 'idPrestation='+idPrestation+"&tm="+tm; + + tm=tm.replace(",","."); + controle.value=tm; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majtmuneprestation/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + //$("#codeMotifRejetPop").selectpicker(); + //$("#codeMotifExclusionPop").selectpicker(); + + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + $("#div_selection_acte").hide(); + } + }); + } +} + + +function maj_tm_acte_rbcl(idPrestation, tm, controle) +{ + donnees = 'idPrestation='+idPrestation+"&tm="+tm; + + tm=tm.replace(",","."); + controle.value=tm; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majtmuneprestation/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#prestataire").selectpicker(); + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + } + }); + } +} + +function ajax_cout_lettrecle_tarif(reinitialiser) +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe =$("#codeTarifActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez saisir un tarif standard!"; + v_msgEng="Please enter a standard rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe; + donnees += '&reinitialiser='+reinitialiser; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/affichercout/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_une_lettre_cle_tarif(idLettre) +{ + codeTarifActe=$("#codeTarifActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez selectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&idLettre='+idLettre; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/ajouterunelettrecletarif/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ajax_cout_lettrecle_tarif("0"); + } + }); +} + +function retirer_une_lettre_cle_tarif(idDetail) +{ + donnees = 'idDetail='+idDetail; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/retirerunelettrecle/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_cout_lettrecle_tarif("0"); + } + }); +} + + +function etatstatsmaladiefichetechique(numero){ + + + var td0 = $("#debutExercice").datepicker("getDate"); + var td1 = $("#dateAnalyse").datepicker("getDate"); + var td2 = $("#debutStat").datepicker("getDate"); + var td3 = $("#finStat").datepicker("getDate"); + + if (numero=="dixhuit"){ + alert("Désolé car l'état n'est pas encore disponible. Soyez indulgent ! Dès que possible nous le mettrons en ligne. Merci pour votre compréhension!"); + return; + } + + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); // debutExercice + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); // dateAnalyse + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutStat + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); // finStat + + if (dt2dt1) + { + v_msg="Période a extraire hors de la période d\'analyse!"; + v_msgEng="Period to extract out of the analysis period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (dt3' + ''); + //alert(donnees); + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + + }, + success: function(data) { + //donnees_retour = data; + $('#div_export_a').html(data); + }, + complete: function() { + + } + }); +} + + +function envoiestatistiqueswhatsapp(){ + + + + // marc 03 07 2023 + debutStat = $("#debutStat").val(); + finStat = $("#finStat").val(); + + idPolice = $("#idPolice").val(); + + idCollege = $("#idCollege").val(); + + codeGcAssureur = $("#codeGcAssureur").val(); + + chargeravantapres = $("#chargeravantapres").val(); + + $('#div_export_a').html(""); + + donnees = 'debutStat='+debutStat+"&finStat="+finStat+"&idPolice="+idPolice+"&idCollege="+idCollege+"&codeGcAssureur="+codeGcAssureur+"&chargeravantapres="+chargeravantapres; + depenses = parseInt($('#depenses').val().replace(/ /g,""),10); + donnees += "&depenses="+depenses; + Chargement = parseFloat($('#Chargement').val().replace(/ /g,""),10); + donnees += "&Chargement="+Chargement; + + $('#div_export_a').html(""); + + + v_url = $("#racineWeb").val()+"Ajaxstatsmaladiefichetechniquewhatsapppdf/envoiewhatsapp/"; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + + }, + success: function(data) { + //donnees_retour = data; + $('#div_export_a').html(data); + }, + complete: function() { + + } + }); +} + + +function filtrespolicegarantstatistique(){ + + + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees = 'codeGcAssureur='+codeGcAssureur; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrespolicegarantstatistique/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + $('#div_policegarant').html(data); + + $("#idPolice" ).selectpicker(); + }, + complete: function() { + + } + }); + +} + +function filtrescollegepolice() { + + donnees = "idPolice=" + $("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxfiltrescollegepolice/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_college").html(data); + $("#div_effetpolice").html(data); + $(".datepicker").datepicker(); + $("#idCollege").selectpicker(); + }, + complete: function () { + + } + }); +} + + +function filtreseffetpolice() { + ////// + donnees = "idPolice=" + $("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxfiltreseffetpolice/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_effetpolice").html(data); + $(".datepicker").datepicker(); + + $("#idCollege").selectpicker(); + }, + complete: function () { + + } + }); +} + + +function filtrespolicegarant(){ + + + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees = 'codeGcAssureur='+codeGcAssureur; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrespolicegarant/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + $('#div_policegarant').html(data); + + $("#idPolice").selectpicker(); + + }, + complete: function() { + + } + }); + + + + +} + +function enregistrer_motif_rejet_classique(idPrestation, codeMotifRejet) +{ + + donnees = 'idPrestation='+idPrestation+'&codeMotifRejet='+codeMotifRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majmotifrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#codeMotifRejetPop").selectpicker(); + $("#codeMotifExclusionPop").selectpicker(); + + }, + error: function(data) { + }, + complete: function(data) { + $("#div_selection_acte").hide(); + } + }); + +} + + +function enregistrer_motif_exclusion_classique(idPrestation, codeMotifExclusion) +{ + donnees = 'idPrestation='+idPrestation+'&codeMotifExclusion='+codeMotifExclusion; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majmotifexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#codeMotifRejetPop").selectpicker(); + $("#codeMotifExclusionPop").selectpicker(); + + }, + error: function(data) { + }, + complete: function(data) { + //$("#close_pop_maj_motif_exclusion").click(); + $("#div_selection_acte").hide(); + } + }); + +} + + +function supprimer_facture_classique(idFacture) +{ + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idFacture=' + idFacture; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesdossierclassique/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + //afficher_liste_facture_dossier_classique(); + afficher_dossier_classique(); + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function afficher_liste_facture_dossier_classique() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesdossierclassique/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_facture").html(data); + }, + complete: function() { + + } + }); +} + +function afficheBeneficiaire(numeroBeneficiaire){ + //var nomForm = $('#nomForm').val(); + + + donnees = "numeroBeneficiaire="+numeroBeneficiaire; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_infos_beneficiaire").html(data); + $("#div_infos_beneficiaire").modal("show"); + $("#div_patienter").empty(); + }, + complete: function() { + afficherMasquerAdherent(); + afficherMasquerGaranties(); + afficherMasquerDepenses(); + afficherMasquerBareme(); + } + }); + +} + + +function afficherMasquerBareme() +{ + masquerBareme = $("#masquerBareme").val(); + + const element = document.getElementById("chevron-bareme"); + + if(masquerBareme=="1"){ + $('#div_bareme').hide(); + $("#masquerBareme").val("0"); + $("#span_bareme").text("Voir"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + }else{ + $('#div_bareme').show(); + $("#masquerBareme").val("1"); + $("#span_bareme").text("Masquer"); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + } +} + + + +function afficherMasquerGaranties() +{ + masquerGarantie = $("#masquerGarantie").val(); + + let d = document.getElementById("div_benef"); + + + const element = document.getElementById("chevron-garantie"); + + + if(masquerGarantie=="1"){ + $('#div_garantie').hide(); + $("#masquerGarantie").val("0"); + $("#span_garantie").text("Afficher"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + $('#div_garantie').css('margin-bottom', '0px'); + + + }else{ + $('#div_garantie').show(); + $("#masquerGarantie").val("1"); + $("#span_garantie").text("Masquer"); + //$('#div_benef').hide(); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + + $('#div_garantie').css('margin-bottom', '180px'); + + + } + +} + +function afficherMasquerDepenses() +{ + masquerDepenses = $("#masquerDepenses").val(); + + const element = document.getElementById("chevron-prestation"); + + if(masquerDepenses=="1"){ + $('#div_depenses').hide(); + $("#masquerDepenses").val("0"); + $("#span_depenses").text("Voir"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + }else{ + $('#div_depenses').show(); + $("#masquerDepenses").val("1"); + $("#span_depenses").text("Masquer"); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + } + +} + + +function afficherMasquerAdherent() +{ + masquerAdherent = $("#masquerAdherent").val(); + + const element = document.getElementById("chevron-adherent"); + + if(masquerAdherent=="1"){ + $('#div_adherent').hide(); + $("#masquerAdherent").val("0"); + $("#span_adherent").text("Afficher"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + }else{ + $('#div_adherent').show(); + $("#masquerAdherent").val("1"); + $("#span_adherent").text("Masquer"); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + } +} + +function maj_detail_rejet_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/detailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajdetailrejetrbcl").click(); + return; + + } + }); +} + + +function modifier_detail_rejet_rbcl() +{ + idPrestation=$("#idPrestationRejete").val(); + detailRejet=$("#detailRejet").val(); + + if (detailRejet<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailRejet").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailRejet='+detailRejet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majdetailrejet/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_rejet").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function maj_detail_exclusion_rbcl(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/detailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_detail_rejet").html(data); + }, + error: function(data) { + }, + complete: function(data) { + $("#btn_popmajdetailexclusionrbcl").click(); + return; + + } + }); +} + + +function modifier_detail_exclusion_rbcl() +{ + idPrestation=$("#idPrestationexclusion").val(); + detailExclusion=$("#detailExclusion").val(); + + if (detailExclusion<=" ") + { + v_msg="Veuillez revoir le détail!"; + v_msgEng="Please review the détail!"; + alert_ebene(v_msg, v_msgEng); + + $("#detailExclusion").focus(); + + return; + } + + v_msg="Confirmez-vous cet détail?"; + v_msgEng="Do you confirm this reason?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPrestation='+idPrestation+'&detailExclusion='+detailExclusion; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majdetailexclusion/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + }, + error: function(data) { + }, + complete: function(data) { + $("#close_pop_maj_detail_exclusion").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficherExamensPrescrits(numeroFeuilleMaladie) { + + + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie; + donnees += "&codeReponseEntentePrealable=" + codeReponseEntentePrealable; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxexamensprescrits/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_examens_prescrits").html(data); + appliquerDataTable(); + $("#div_examens_prescrits").modal({backdrop: 'static', keyboard: false, show: true }); + $("#div_examens_prescrits").modal("show"); + $("#div_patienter").empty(); + + //Ajaxmedicamentsprescrits + + var motifReel = document.getElementById('motifReel'); + var motifRefusPrestataire = document.getElementById('motifRefusPrestataire'); + motifReel.value = ""; + //motifReel.focus(); + //motifReel.setSelectionRange(field, 1, 2); + + motifRefusPrestataire.value = ""; + //motifRefusPrestataire.focus(); + //motifRefusPrestataire.setSelectionRange(field, 1, 2); + + }, + complete: function () { + + } + }); + +} + +// 07/02/2022 + +function ajax_maj_qte_prescrit_act_exam(idExamen, quantite, controle) +{ + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantit\u00e9!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idExamen='+idExamen+"&quantite="+quantite; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteacteexamen/majquantite/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_examens_prescrits").html(data); + //controle.focus(); + }, + error: function(data) { + }, + complete: function() { + affiche_liste_act_exam_provisoire(); + } + }); + } +} + +function supprimer_examen(idExamen) +{ + v_msg="Confirmez-vous la suppression de cet examen?"; + v_msgEng="Do you confirm the removal of this exam?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idExamen='+idExamen; + + $("#div_examens").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexamensprescrits/supprimer/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_examens").html(data); + }, + error: function(data) { + }, + complete: function() { + //prescription_examen(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function afficherMedicamentsPrescrits(numeroFeuilleMaladie){ + + + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie; + donnees += "&codeReponseEntentePrealable=" + codeReponseEntentePrealable; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedicamentsprescrits/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + + $("#div_medicaments_prescrits").html(data); + $("#div_medicaments_prescrits").modal("show"); + $("#div_patienter").empty(); + + + var motifReel = document.getElementById('motifReel'); + var motifRefusPrestataire = document.getElementById('motifRefusPrestataire'); + motifReel.value = ""; + motifRefusPrestataire.value = ""; + + + + + + }, + complete: function() { + + } + }); + +} + +function appliquerDataTableMini(){ + var oTable = $('#tablistemini'); + + // Détruire l'instance existante si elle existe + if ($.fn.DataTable.isDataTable(oTable)) { + table.DataTable().destroy(); + table.empty(); // Optionnel : vider le contenu si nécessaire + } + + try{ + oTable.DataTable({ + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "34vh", + "pagingType": "full_numbers", + "autoWidth": false, + "language": { + "lengthMenu":"Affiche _MENU_ par page", + "zeroRecords": "Désolé - Aucune donnée trouvée", + "info": "_PAGE_ sur _PAGES_ pages", + "infoEmpty": "Pas d'enregistrement", + "search": "Recherche:", + "paginate": { + "next": "►", + "previous": "◄", + "first": "|◄", + "last": "►|" + }, + "infoFiltered": "(filtré de _MAX_ total enregistrements)" + } + }); + + } + catch(err){ + return false; + } +} + +function maj_composante_tauxappliquepolice_prestataire_acte(idActe, tauxApplique) +{ + donnees = 'idActe='+idActe+"&tauxApplique="+tauxApplique; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/majtauxapplique/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function(data) + { + } + }); +} + +function affiche_actes_plafonnes_beneficiaire(){ + + var idBeneficiaire = $('#idBeneficiaire').val(); + var idAdherent = $('#idAdherent').val(); + + $("#div_patienter").html('
' + '
'); + + + donnees = 'idAdherent='+idAdherent+'&idBeneficiaire='+idBeneficiaire; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesplafonnesbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_actes_bareme').html(data); + $('#div_actes_bareme').modal("show"); + }, + complete: function() { + + } + }); +} + +function affiche_reseau_prestatairessoins_beneficiaire(){ + + var idPolice = $('#idPolice').val(); + var idCollege = $('#idCollege').val(); + + var numeroBeneficiaire = $('#numeroBeneficiaire').val(); + var numeroAdherent = $('#numeroAdherent').val(); + + $("#div_patienter").html('
' + '
'); + + donnees = 'idPolice='+idPolice+'&idCollege='+idCollege; + donnees += '&numeroAdherent='+numeroAdherent+'&numeroBeneficiaire='+numeroBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairessoinsbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_prestataires_soins').html(data); + //appliquerDataTable(); + $('#div_prestataires_soins').modal("show"); + + setTimeout(function() { + //your datatable code + functionDataTable(); + + }, 500); + + }, + complete: function() { + + } + }); + +} + +function afficherHistoriquePrestataion(numeroBeneficiaire,numeroBonExamen){ + + donnees = "numeroBeneficiaire="+numeroBeneficiaire+"&numeroBonExamen="+numeroBonExamen; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriqueprestation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_historique_prestation").html(data); + $("#div_historique_prestation").modal("show"); + + }, + complete: function() { + afficherhistoriquegarantie(numeroBeneficiaire); + + $("#div_patienter").empty(); + } + }); + +} +function afficherhistoriquegarantie(numeroBeneficiaire){ + + d1=$("#d1").val(); + d2=$("#d2").val(); + + codeGarantie=$("#codeGarantie").val(); + + donnees = "numeroBeneficiaire="+numeroBeneficiaire+"&codeGarantie="+codeGarantie; + donnees += '&d1='+d1+'&d2='+d2; + + $("#div_prestation").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriqueprestation/prestations/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestation").html(data); + + setTimeout(function() { + functionDataTable(); + }, 500); + + + }, + complete: function() { + + } + }); + +} + +function afficherHistoriqueMedicament(numeroBeneficiaire){ + + + donnees = "numeroBeneficiaire="+numeroBeneficiaire; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriquemedicament/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_historique_medicament").html(data); + appliquerDataTable(); + $("#div_historique_medicament").modal("show"); + $("#div_patienter").empty(); + + }, + complete: function() { + + } + }); + +} + +function functionDataTable(){ + var tab = ''; + + tab = $('#tableLister'); + var codeLangue = $("#codeLangue").val(); + + // Détruire l'instance existante si elle existe + if ($.fn.DataTable.isDataTable(tab)) { + table.DataTable().destroy(); + table.empty(); // Optionnel : vider le contenu si nécessaire + } + + try{ + if(codeLangue=="en_US") + { + tab.DataTable({ + responsive: true, + "lengthMenu": [ 25, 50, 100], + "scrollX": true, + "scrollY": "55vh", + "pagingType": "full_numbers", + "autoWidth": false, + "language": { + "lengthMenu":"Display _MENU_ records per page", + "zeroRecords": "Nothing found - sorry", + "info": "Showing page _PAGE_ of _PAGES_", + "infoEmpty": "No records available", + "search": "Search:", + "paginate": { + "next": "►", + "previous": "◄", + "first": "|◄", + "last": "►|" + }, + "infoFiltered": "(filtered from _MAX_ total records)" + } + }); + } + else + { + tab.DataTable({ + responsive: true, + "lengthMenu": [ 25, 50, 100], + "scrollX": true, + "scrollY": "55vh", + "pagingType": "full_numbers", + "autoWidth": false, + "language": { + "lengthMenu":"Affiche _MENU_ par page", + "zeroRecords": "D\u00e9sol\u00e9 - Aucune donn\u00e9e trouv\u00e9e", + "info": "_PAGE_ sur _PAGES_ pages", + "infoEmpty": "Pas d'enregistrement", + "search": "Recherche:", + "paginate": { + "next": "►", + "previous": "◄", + "first": "|◄", + "last": "►|" + }, + "infoFiltered": "(filtr\u00e9 de _MAX_ total enregistrements)" + } + }); + } + + + + } + catch(err){ + return false; + } + +} + +function recapituler_quittance_manuelle() +{ + //accesoireTotal = $("#accesoireTotal").val(); + + accessoireGarant = $("#accessoireGarant").val(); + accessoireGestion = $("#accessoireGestion").val(); + accessoireCourtier = $("#accessoireCourtier").val(); + + accessoireGarant = accessoireGarant.replace(/ /g,""); + accessoireGarant = parseInt(accessoireGarant.replace(",","."),10); + + accessoireGestion = accessoireGestion.replace(/ /g,""); + accessoireGestion = parseInt(accessoireGestion.replace(",","."),10); + + accessoireCourtier = accessoireCourtier.replace(/ /g,""); + accessoireCourtier = parseInt(accessoireCourtier.replace(",","."),10); + + //donnees = 'accesoireTotal='+accesoireTotal; + + donnees = 'accessoireGarant='+accessoireGarant; + donnees += '&accessoireGestion='+accessoireGestion; + donnees += '&accessoireCourtier='+accessoireCourtier; + + // $("#div_test_gabarit").html(""); + + //alert(donnees);return; + + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailquittancemanuelle/recapituler/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_test_gabarit").html(data); + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function pop_afficher_selection_quittance_manuelle() +{ + var div_selection_assure = $('#div_selection_assure'); + var div_patienter = $('#div_patienter'); + div_selection_assure.html('
' + '
'); + $("#btn_pop").click(); + + div_patienter.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionquittancemanuelle/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + div_selection_assure.html(data); + //appliquerDataTable(); + + div_patienter.html(''); + }, + complete: function() { + // $("#btn_pop").click(); + } + }); +} + +function enregistrer_quittance_manuelle() +{ + // + + dateemission = $("#dateemission").val(); + accessoireGarant = $("#accessoireGarant").val(); + accessoireGestion = $("#accessoireGestion").val(); + accessoireCourtier = $("#accessoireCourtier").val(); + + accessoireGarant = accessoireGarant.replace(/ /g,""); + accessoireGarant = parseInt(accessoireGarant.replace(",","."),10); + + accessoireGestion = accessoireGestion.replace(/ /g,""); + accessoireGestion = parseInt(accessoireGestion.replace(",","."),10); + + accessoireCourtier = accessoireCourtier.replace(/ /g,""); + accessoireCourtier = parseInt(accessoireCourtier.replace(",","."),10); + + //donnees = 'accesoireTotal='+accesoireTotal; + + donnees = 'accessoireGarant='+accessoireGarant; + donnees += '&accessoireGestion='+accessoireGestion; + donnees += '&accessoireCourtier='+accessoireCourtier; + donnees += '&dateemission='+dateemission; + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailquittancemanuelle/recapituler/", + type: 'POST', + data: donnees, + success: function(data) { + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + nbAliment=$("#nbAliment").val(); + + if (nbAliment<"1") + { + v_msg="Veuillez sélectionner les personnes conernées!"; + v_msgEng="Please select the persons concerned!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette nouvelle prime?"; + v_msgEng="Do you confirm this new premium?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Fichequittancemanuelle/enregistrerquittancemanuelle/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } + }); + + +} + +function beneficiaire_a_selectionner(p_choix, p_id_beneficiaire) +{ + donnees = 'idBeneficiaire='+p_id_beneficiaire; + donnees += '&choix='+p_choix; + + //alert(donnees);return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionquittancemanuelle/selectionner/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + //recapituler_quittance_manuelle(); + } + }); +} + +function ajax_maj_prime_beneficiaire_temp(idPrime, prime, controle) +{ + prime=prime.replace(",","."); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&prime="+prime; + + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailquittancemanuelle/majprime/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_test_gabarit").html(data); + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} +//27-10-2022 + +function verifierQuantiteModifier() +{ + + + quantitePrescrite = $('#quantitePrescrite').val(); + quantiteModifiee = $('#quantiteModifiee').val(); + + codeTypePrestation = $('#codeTypePrestation').val(); + prixSeance = $('#prixSeance').val(); + + quantiteHospit = $('#quantiteHospit').val(); + quantiteModifieeHospit = $('#quantiteModifieeHospit').val(); + + if(quantiteModifiee != undefined){ + if(parseInt(quantiteModifiee) > parseInt(quantitePrescrite)){ + $('#quantiteModifiee').val(0); + } + + + } + + if(quantiteModifieeHospit != undefined){ + if(parseInt(quantiteModifieeHospit) > parseInt(quantitePrescrite)){ + $('#quantiteModifieeHospit').val(0); + } + } + + if(codeTypePrestation=="SEA" && quantiteModifiee > "0"){ + quantiteModifiee = parseInt(quantiteModifiee); + prixSeance = parseInt(prixSeance.replace(/ /g,"")); + + $('#prixTotalSeance').val(formatCurrency(quantiteModifiee*prixSeance)); + } +} + +//26-10-2022 +function formatNumerique(controle){ + controle.value = controle.value.replace(/ /g,""); + return; + +} + + +function tarifSouscripteur(controle) +{ + var idSouscripteur = $("#idSouscripteur").val(); + + $('select[name=codePrestataire]').val(0); + $('select[name=codeGroupePrestataire]').val(0); + $('select[name=idPolice]').val(0); + $('.selectpicker').selectpicker('refresh'); + + var souscripteur = controle.options[controle.selectedIndex].text; + + $('#libelle').val('TARIF '+souscripteur); + $('#libelleEng').val(souscripteur+' RATE'); + + var libelle = $('#libelle').val(); + var libelleEng = $('#libelleEng').val(); + + donnees = 'codeTypeTarifActe=TSS&idSouscripteur='+idSouscripteur+'&libelle='+libelle; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifsouscripteur/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_type_tarif').html(data); + var msgErreur = $('#div_type_tarif #msgErreur').val(); + if (msgErreur > " "){ + var str = msgErreur.split('/'); + alert_ebene(str[0],str[1]); + $('select[name=idSouscripteur]').val(0); + $('.selectpicker').selectpicker('refresh'); + $('#libelle').val(""); + $('#libelleEng').val(""); + $('select[name=codeTypeTarifActe]').val(0); + } + }, + complete: function(){ + } + }); + +} + +function ajax_composante_tarif_souscripteur() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifsouscripteur/affichercomposantetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_actes_fam_au_tarif_souscripteur() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifsouscripteur/ajoutertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_souscripteur(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function ajouter_un_acte_au_tarif_souscripteur(idActe) +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'idActe='+idActe+'&codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifsouscripteur/ajouterunacteautarif/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_souscripteur(); + } + }); +} + +//31-12-2022 + +function filtrepolicesgarant() +{ + + donnees = "codeGcAssureur="+$("#codeGcAssureur").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrepolicegarant/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_police").html(data); + $("#idPolice").selectpicker(); + } + }); +} + +function filtrecollegepolice() +{ + donnees = "idPolice="+$("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrecollegepolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_college").html(data); + $("#idCollege").selectpicker(); + } + }); +} + +function filtreproduitgarant(){ + // + + var codeGcAssureur = $('#codeGcAssureur').val(); + + var codeGcAssureur = $('#codeGcAssureur').val(); + + + donnees = 'codeGcAssureur='+codeGcAssureur; + + if(codeGcAssureur !=""){ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreproduitgarant/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_produit').html(data); + $("#codeProduit").selectpicker(); + }, + complete: function() { + + } + }); + + + } +} + +function afficher_adherent_bascule() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + idPolice = $('#idPolice').val(); + idCollege = $('#idCollege').val(); + + + idCollegePolice = $('#idCollegePolice').val(); + + + if(codeGcAssureur<=' ') + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeProduit<=' ') + { + v_msg="Veuillez sélectionner un produit!!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select an insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select an insurance college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&idPolice='+idPolice; + donnees += '&idCollege='+idCollege; + donnees += '&idCollegePolice='+idCollegePolice; + + var div_attente = $('#div_adherents'); + + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherentsbacules/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_attente.html(data); + appliquerDataTable(); + $("#idCollegePolice").selectpicker(); + + }, + complete: function() { + + } + }); + +} + +function ajouter_adherent_bascule(numeroAdherent) +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + idPolice = $('#idPolice').val(); + idCollege = $('#idCollege').val(); + idOption = $('#idOption').val(); + dateEffet = $('#dateEffet').val(); + + if(codeGcAssureur<=' ') + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeProduit<=' ') + { + v_msg="Veuillez sélectionner un produit!!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select an insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select an insurance college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + /* + if(idOption=="2"){ + v_msg="Cette option n'est pas encore prise en compte!"; + v_msgEng="This option is not yet taken into account!"; + alert_ebene(v_msg, v_msgEng); + + return; + + } + */ + + if(dateEffet<=' ') + { + v_msg="Veuillez sélectionner une date d'effet!"; + v_msgEng="Please select an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&idPolice='+idPolice; + donnees += '&idCollege='+idCollege; + donnees += '&idOption='+idOption; + donnees += '&numeroAdherent='+numeroAdherent; + donnees += '&dateEffet='+dateEffet; + + var div_attente = $('#div_adherents'); + + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherentsbacules/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + afficher_adherent_bascule(); + + }, + complete: function() { + + } + }); +} + +function ajouter_tous_adherents_basculer() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + idPolice = $('#idPolice').val(); + idCollege = $('#idCollege').val(); + idOption = $('#idOption').val(); + dateEffet = $('#dateEffet').val(); + + idCollegePolice = $('#idCollegePolice').val(); + + //alert(idCollegePolice);return; + + if(codeGcAssureur<=' ') + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeProduit<=' ') + { + v_msg="Veuillez sélectionner un produit!!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select an insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select an insurance college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + /* + if(idOption=="2"){ + v_msg="Cette option n'est pas encore prise en compte!"; + v_msgEng="This option is not yet taken into account!"; + alert_ebene(v_msg, v_msgEng); + + return; + + } + */ + + if(dateEffet<=' ') + { + v_msg="Veuillez sélectionner une date d'effet!"; + v_msgEng="Please select an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&idPolice='+idPolice; + donnees += '&idCollege='+idCollege; + donnees += '&idOption='+idOption; + donnees += '&dateEffet='+dateEffet; + donnees += '&idCollegePolice='+idCollegePolice; + + //alert(donnees); die(); + + var div_attente = $('#div_adherents'); + + + div_attente.html('
' + '
'); + + + v_msg="Attention, cela va ajouter tous les adhérents disponibles à cette autre police! Confirmez-vous?"; + v_msgEng="Be careful, this will add all available members to this other policy! Can you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherentsbacules/ajoutertous/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + afficher_adherent_bascule(); + + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function filtreadherentcollege() +{ + var idCollegePolice = $('#idCollegePolice').val(); + + donnees = 'idCollegePolice='+idCollegePolice; + + //alert(donnees); return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreadherentcollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + //$('#div_college_police').html(data); + afficher_adherent_bascule(); + //appliquerDataTable(); + + }, + complete: function() { + + } + }); + +} + +//05-01-2023 + +function filtrecollegepolicetarif() +{ + + donnees = "idPolice="+$("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrecollegepolicetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_college").html(data); + $("#idCollege").selectpicker(); + } + }); +} + +// 09-01-2023 + +function ajax_maj_garantie_tm(idPrestation, codeGarantie, controle) +{ + donnees = 'idPrestation='+idPrestation+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/majgarantie/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + +} + +function ajax_maj_affection_tm(idPrestation, codeAffection, controle) +{ + donnees = 'idPrestation='+idPrestation+"&codeAffection="+codeAffection; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/majaffection/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + +} + +// 10-01-2023 + +function afficher_affection_tm() +{ + idCollege = $("#idCollege").val(); + + + var div_attente = $('#div_complet'); + + + div_attente.html('
' + '
'); + + + donnees = 'idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffectioncollegetm/", + type: 'POST', + data: donnees, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + //$("#codeGarantie").selectpicker(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajouter_une_affection_tm(codeAffection) +{ + var idCollege = $('#idCollege').val(); + var tm = $('#tm').val(); + + var appliquerPlafond = $('#appliquerPlafond').val(); + + if(tm==undefined){ + tm = "0"; + } + + if(tm<=' ') + { + v_msg="Veuillez entrer la valeur du Ticket Modérateur!"; + v_msgEng="Please enter the value of the Moderator Ticket!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + return; + } + + + if(appliquerPlafond<=' ') + { + v_msg="Le plafond s'applique oui ou non ?"; + v_msgEng="Does the cap apply or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#appliquerPlafond").focus(); + return; + } + + + + donnees = 'codeAffection='+codeAffection+'&idCollege='+idCollege+'&tm='+tm+'&appliquerPlafond='+appliquerPlafond; + + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffectioncollegetm/ajouter/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + afficher_affection_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function retirer_une_affection_tm(idAffection) +{ + donnees = 'idAffection='+idAffection; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffectioncollegetm/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + + + +function ajax_maj_tm_affection(idAffection, tm, controle) +{ + + tm=tm.replace(",","."); + controle.value=tm; + + donnees = 'idAffection='+idAffection+"&tm="+tm; + + if(controle_numerique(controle)) + { + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffectioncollegetm/majtm/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } +} + +function retirer_adherent_bascule(numeroAdherent) +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + idPolice = $('#idPolice').val(); + idCollege = $('#idCollege').val(); + idOption = $('#idOption').val(); + dateEffet = $('#dateEffet').val(); + + if(codeGcAssureur<=' ') + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeProduit<=' ') + { + v_msg="Veuillez sélectionner un produit!!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select an insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select an insurance college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + + donnees = 'numeroAdherent='+numeroAdherent; + + var div_attente = $('#div_adherents'); + + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherentsbacules/retirer/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + afficher_adherent_bascule(); + + }, + complete: function() { + + } + }); +} + +function retirer_tous_adherent_bascule() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + idPolice = $('#idPolice').val(); + idCollege = $('#idCollege').val(); + + + //alert(idCollegePolice);return; + + if(codeGcAssureur<=' ') + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeProduit<=' ') + { + v_msg="Veuillez sélectionner un produit!!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select an insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select an insurance college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&idPolice='+idPolice; + donnees += '&idCollege='+idCollege; + + //alert(donnees); die(); + + var div_attente = $('#div_adherents'); + + + div_attente.html('
' + '
'); + + + v_msg="Attention cela va annuler le basculement de tous les adhérents de cette police! Confirmez-vous?"; + v_msgEng="Please note that this will cancel the switch for all members of this policy! You confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherentsbacules/retirertous/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + afficher_adherent_bascule(); + + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// 18-01-2023 +function afficher_remboursement_garantie() +{ + idCollege = $("#idCollege").val(); + + + var div_attente = $('#div_complet'); + + + div_attente.html('
' + '
'); + + + donnees = 'idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremboursementgarantie/", + type: 'POST', + data: donnees, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + //$("#codeGarantie").selectpicker(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajouter_une_garantie_police(codeGarantie) +{ + + donnees = 'codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremboursementgarantie/ajouter/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + afficher_remboursement_garantie(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +//19-01-2023 +function ajax_maj_limite(idGarantie, nbreLimiteGarantie, controle) +{ + idCollege = $("#idCollege").val(); + nbreLimiteGarantie=nbreLimiteGarantie.replace(",","."); + controle.value=nbreLimiteGarantie; + + donnees = 'idGarantie='+idGarantie+"&nbreLimiteGarantie="+nbreLimiteGarantie+"&idCollege="+idCollege; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremboursementgarantie/majlimite/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } +} + + +function ajax_maj_typeremboursement(idGarantie, codeTypeRemboursement, controle) +{ + idCollege = $("#idCollege").val(); + + donnees = 'idGarantie='+idGarantie+"&codeTypeRemboursement="+codeTypeRemboursement+"&idCollege="+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremboursementgarantie/majtyperemboursement/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + +} + + +// 23-01-2023 +function filtreadherentparcollege() +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if(idCollegePolice ==""){ + idCollegePolice = "0"; + } + + donnees = 'idCollegePolice='+idCollegePolice; + + //alert(donnees); return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreadherentparcollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + //$('#div_college_police').html(data); + afficher_adherents_police(); + //appliquerDataTable(); + + }, + complete: function() { + + } + }); + +} + +// 27-01-2023 + +function augmenteAnnee(){ + + var an = $("#an").val(); + + $("#an").val(parseInt(an)+1); + + afficher_garanties_bareme(); +} + +function diminueAnnee(){ + + var an = $("#an").val(); + $("#an").val(parseInt(an-1)); + + afficher_garanties_bareme(); + +} + +// 31-01-2023 + +function ajouterunactebareme(){ + + var codeActe = $("#codeActe").val(); + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = "codeActe="+codeActe+"&codeGarantie="+codeGarantie+"&idBaremePriseEnCharge="+idBaremePriseEnCharge; + + //alert(donnees); + //return; + + $("#div_corpsacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsactebareme/ajouteracte/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_corpsacte").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function ajouterunactebareme(){ + + var codeActe = $("#codeActe").val(); + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = "codeActe="+codeActe+"&codeGarantie="+codeGarantie+"&idBaremePriseEnCharge="+idBaremePriseEnCharge; + + //alert(donnees); + //return; + + $("#div_corpsacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsactebareme/ajouteracte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_corpsacte").html(data); + + affichertoutactebareme(); + afficher_actes_horsbareme(idBaremePriseEnCharge, codeGarantie); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function afficher_actes_horsbareme(idBaremePriseEnCharge, codeGarantie){ + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxacteshorsbareme/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actehorsbareme').html(data); + $("#codeActe").selectpicker(); + + }, + complete: function() { + + } + }); +} + + +// 06-02-2023 + +function detail_baremepriseencharge(idBaremePriseEnCharge) +{ + window.location.assign($("#racineWeb" ).val()+"Detailbaremepriseencharge/"+idBaremePriseEnCharge+"/"); +} + +// 20-02-2022 +function afficherMasquerGarantiesBareme() +{ + + masquerGarantie = $("#masquerGarantie").val(); + + + if(masquerGarantie == undefined){ + masquerGarantie = "1"; + } + + if(masquerGarantie=="1"){ + $('#div_garanties_masquer').hide(); + $("#masquerGarantie").val("0"); + $("#span_garantie").text("[+]"); + + }else{ + $('#div_garanties_masquer').show(); + $("#masquerGarantie").val("1"); + + intit_saisie_garantiebareme(); + actualiser_bareme_garantie(); + $("#span_garantie").text("[-]"); + + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeLienParente(); + afficherMasquerActeBareme(); + afficherMasquerActeBaremeLienParente(); + } + + afficheNombreLigneBareme('garantiesbaremepriseencharge'); + + +} + + +function afficherMasquerGarantiesBaremeLienParente() +{ + + masquerGarantieLienParente = $("#masquerGarantieLienParente").val(); + + + if(masquerGarantieLienParente == undefined){ + masquerGarantieLienParente = "1"; + } + + if(masquerGarantieLienParente=="1"){ + $('#div_garanties_lienparente_masquer').hide(); + $("#masquerGarantieLienParente").val("0"); + $("#span_garantie_lienparente").text("[+]"); + + }else{ + $('#div_garanties_lienparente_masquer').show(); + $("#masquerGarantieLienParente").val("1"); + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente(); + $("#span_garantie_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBareme(); + afficherMasquerActeBareme(); + afficherMasquerActeBaremeLienParente(); + } + + afficheNombreLigneBareme('garantiesbaremepriseenchargelienparente'); +} + + +function afficherMasquerActeBareme() +{ + masquerActe = $("#masquerActe").val(); + + if(masquerActe == undefined){ + masquerActe = "1"; + } + + if(masquerActe=="1"){ + $('#div_acte_masquer').hide(); + $("#masquerActe").val("0"); + $("#span_acte").text("[+]"); + + }else{ + $('#div_acte_masquer').show(); + $("#masquerActe").val("1"); + actualiser_bareme_acte(); + intit_saisie_actebareme(); + $("#span_acte").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBareme(); + afficherMasquerGarantiesBaremeLienParente(); + afficherMasquerActeBaremeLienParente(); + } + + afficheNombreLigneBareme('actesbaremepriseencharge'); +} + +function afficherMasquerActeBaremeLienParente() +{ + + masquerActeLienParente = $("#masquerActeLienParente").val(); + + if(masquerActeLienParente == undefined){ + masquerActeLienParente = "1"; + } + + if(masquerActeLienParente=="1"){ + $('#div_acte_lienparente_masquer').hide(); + $("#masquerActeLienParente").val("0"); + $("#span_acte_lienparente").text("[+]"); + + }else{ + $('#div_acte_lienparente_masquer').show(); + $("#masquerActeLienParente").val("1"); + actualiser_bareme_acte_lienparente(); + intit_saisie_actebareme_lienparente(); + $("#span_acte_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + + afficherMasquerGarantiesBareme(); + afficherMasquerGarantiesBaremeLienParente(); + afficherMasquerActeBareme(); + } + + afficheNombreLigneBareme('actesbaremepriseenchargelienparente'); +} + +function appliquerDataTableBareme(){ + var oTable = $('#tabbareme'); + + // Détruire l'instance existante si elle existe + if ($.fn.DataTable.isDataTable(oTable)) { + table.DataTable().destroy(); + table.empty(); // Optionnel : vider le contenu si nécessaire + } + + try{ + oTable.DataTable({ + "lengthMenu": [3, 6, 10], + "scrollX": true, + "scrollY": "20vh", + "pagingType": "full_numbers", + "autoWidth": true, + "bFilter": false, + "bLengthChange": false, + "orderMulti": false, + "orderCellsTop": true, + "language": { + "lengthMenu":"Affiche _MENU_ par page", + "zeroRecords": "Désolé - Aucune donnée trouvée", + "info": "_PAGE_ sur _PAGES_ pages", + "infoEmpty": "Pas d'enregistrement", + "search": "Recherche:", + "paginate": { + "next": "►", + "previous": "◄", + "first": "|◄", + "last": "►|" + }, + "infoFiltered": "(filtré de _MAX_ total enregistrements)" + } + }); + + } + catch(err){ + return false; + } +} + +//22-02-2023 + +function actualiser_bareme_garantie() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantie/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +// inserer_bareme() + +function inserer_bareme_garantie() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantie = $("#dateEffetGarantie").val(); + forfaitPlafondGarantieAdherent = $("#forfaitPlafondGarantieAdherent").val(); + codePeriodicitePlafondGarantieAdherent = $("#codePeriodicitePlafondGarantieAdherent").val(); + nbreTransactionGarantieAdherent = $("#nbreTransactionGarantieAdherent").val(); + codePeriodiciteGarantieAdherent = $("#codePeriodiciteGarantieAdherent").val(); + forfaitPlafondGarantie = $("#forfaitPlafondGarantie").val(); + codePeriodicitePlafondGarantie = $("#codePeriodicitePlafondGarantie").val(); + nbreTransactionGarantie = $("#nbreTransactionGarantie").val(); + codePeriodiciteGarantie = $("#codePeriodiciteGarantie").val(); + //codeObservationFamilleActe = $("#codeObservationFamilleActe").val(); + codeTypeRemboursement = $("#codeTypeRemboursement").val(); + delaiCarenceFamilleActe = $("#delaiCarenceFamilleActe").val(); + ticketModerateurFamilleActe = $("#ticketModerateurFamilleActe").val(); + + forfaitTmGarantie = $("#forfaitTmGarantie").val(); + + ageMinimumFamilleActe = $("#ageMinimumFamilleActe").val(); + ageMaximumFamilleActe = $("#ageMaximumFamilleActe").val(); + actifFamilleActe = $("#actifFamilleActe").val(); + + + forfaitPlafondGarantieAdherent = forfaitPlafondGarantieAdherent.replace(/ /g,""); + forfaitPlafondGarantie = forfaitPlafondGarantie.replace(/ /g,""); + + forfaitTmGarantie = forfaitTmGarantie.replace(/ /g,""); + + + if(dateEffetGarantie <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantie").focus(); + return; + + } + + if(actifFamilleActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActe").focus(); + return; + + } + + $("#div_garanties_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetGarantie='+dateEffetGarantie; + donnees += '&forfaitPlafondGarantieAdherent='+forfaitPlafondGarantieAdherent; + donnees += '&codePeriodicitePlafondGarantieAdherent='+codePeriodicitePlafondGarantieAdherent; + donnees += '&nbreTransactionGarantieAdherent='+nbreTransactionGarantieAdherent; + donnees += '&codePeriodiciteGarantieAdherent='+codePeriodiciteGarantieAdherent; + donnees += '&forfaitPlafondGarantie='+forfaitPlafondGarantie; + donnees += '&codePeriodicitePlafondGarantie='+codePeriodicitePlafondGarantie; + donnees += '&nbreTransactionGarantie='+nbreTransactionGarantie; + donnees += '&codePeriodiciteGarantie='+codePeriodiciteGarantie; + //donnees += '&codeObservationFamilleActe='+codeObservationFamilleActe; + donnees += '&codeTypeRemboursement='+codeTypeRemboursement; + donnees += '&delaiCarenceFamilleActe='+delaiCarenceFamilleActe; + donnees += '&ticketModerateurFamilleActe='+ticketModerateurFamilleActe; + donnees += '&ageMinimumFamilleActe='+ageMinimumFamilleActe; + donnees += '&ageMaximumFamilleActe='+ageMaximumFamilleActe; + donnees += '&actifFamilleActe='+actifFamilleActe; + + donnees += '&forfaitTmGarantie='+forfaitTmGarantie; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantie/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_garantiebareme(); + actualiser_bareme_garantie(); + + }, + complete: function() { + afficheNombreLigneBareme('garantiesbaremepriseencharge'); + + } + }); +} + +function intit_saisie_garantiebareme() +{ + $("#dateEffetGarantie").val(""); + $("#forfaitPlafondGarantieAdherent").val("0"); + + $("#codePeriodicitePlafondGarantieAdherent").val("A"); + $("#nbreTransactionGarantieAdherent").val("0"); + $("#codePeriodiciteGarantieAdherent").val("A"); + $("#forfaitPlafondGarantie").val("0"); + + $("#forfaitTmGarantie").val("0"); + + $("#codePeriodicitePlafondGarantie").val("A"); + $("#nbreTransactionGarantie").val("0"); + $("#codePeriodiciteGarantie").val("A"); + //$("#codeObservationFamilleActe").val("VD"); + $("#codeTypeRemboursement").val("RDTP"); + $("#delaiCarenceFamilleActe").val("0"); + //$("#ticketModerateurFamilleActe").val("0"); + $("#ageMinimumFamilleActe").val("0"); + $("#ageMaximumFamilleActe").val("0"); + $("#actifFamilleActe").val("1"); +} + +// 23-02-20233 + +function actualiser_bareme_garantie_lienparente() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function inserer_bareme_garantie_lienparente() +{ + + + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + codeLienParente = $("#codeLienParente").val(); + forfaitPlafondGarantieLienParente = $("#forfaitPlafondGarantieLienParente").val(); + codePeriodicitePlafondGarantieLienParente = $("#codePeriodicitePlafondGarantieLienParente").val(); + nbreTransactionGarantieLienParente = $("#nbreTransactionGarantieLienParente").val(); + codePeriodiciteGarantieLienParente = $("#codePeriodiciteGarantieLienParente").val(); + //codeObservationFamilleActeLienParente = $("#codeObservationFamilleActeLienParente").val(); + codeTypeRemboursementLienParente = $("#codeTypeRemboursementLienParente").val(); + delaiCarenceFamilleActeLienParente = $("#delaiCarenceFamilleActeLienParente").val(); + ticketModerateurFamilleActeLienParente = $("#ticketModerateurFamilleActeLienParente").val(); + + + forfaitTmGarantieLienParente = $("#forfaitTmGarantieLienParente").val(); + + ageMinimumFamilleActeLienParente = $("#ageMinimumFamilleActeLienParente").val(); + ageMaximumFamilleActeLienParente = $("#ageMaximumFamilleActeLienParente").val(); + actifFamilleActeLienParente = $("#actifFamilleActeLienParente").val(); + + + forfaitPlafondGarantieLienParente = forfaitPlafondGarantieLienParente.replace(/ /g,""); + forfaitTmGarantieLienParente = forfaitTmGarantieLienParente.replace(/ /g,""); + + if(dateEffetGarantieLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").focus(); + return; + + } + + if(codeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParente").focus(); + return; + + } + + if(actifFamilleActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActeLienParente").focus(); + return; + + } + + $("#div_garanties_bareme_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&dateEffetGarantieLienParente='+dateEffetGarantieLienParente; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&forfaitPlafondGarantieLienParente='+forfaitPlafondGarantieLienParente; + donnees += '&codePeriodicitePlafondGarantieLienParente='+codePeriodicitePlafondGarantieLienParente; + donnees += '&nbreTransactionGarantieLienParente='+nbreTransactionGarantieLienParente; + donnees += '&codePeriodiciteGarantieLienParente='+codePeriodiciteGarantieLienParente; + + + //donnees += '&codeObservationFamilleActeLienParente='+codeObservationFamilleActeLienParente; + donnees += '&codeTypeRemboursementLienParente='+codeTypeRemboursementLienParente; + donnees += '&delaiCarenceFamilleActeLienParente='+delaiCarenceFamilleActeLienParente; + donnees += '&ticketModerateurFamilleActeLienParente='+ticketModerateurFamilleActeLienParente; + donnees += '&ageMinimumFamilleActeLienParente='+ageMinimumFamilleActeLienParente; + donnees += '&ageMaximumFamilleActeLienParente='+ageMaximumFamilleActeLienParente; + donnees += '&actifFamilleActeLienParente='+actifFamilleActeLienParente; + + donnees += '&forfaitTmGarantieLienParente='+forfaitTmGarantieLienParente; + + + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparente/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente(); + + }, + complete: function() { + afficheNombreLigneBareme('garantiesbaremepriseenchargelienparente'); + + } + }); +} + +function intit_saisie_garantiebareme_lienparente() +{ + $("#dateEffetGarantieLienParente").val(""); + $("#codeLienParente").val(""); + $("#forfaitPlafondGarantieLienParente").val("0"); + $("#codePeriodicitePlafondGarantieLienParente").val("A"); + $("#nbreTransactionGarantieLienParente").val("0"); + $("#codePeriodiciteGarantieLienParente").val("A"); + + //$("#codeObservationFamilleActeLienParente").val("VD"); + $("#codeTypeRemboursementLienParente").val("RDTP"); + $("#delaiCarenceFamilleActeLienParente").val("0"); + //$("#ticketModerateurFamilleActeLienParente").val("0"); + $("#ageMinimumFamilleActeLienParente").val("0"); + $("#ageMaximumFamilleActeLienParente").val("0"); + $("#actifFamilleActeLienParente").val("1"); + + $("#forfaitTmGarantieLienParente").val("0"); + + +} + + +function actualiser_bareme_acte() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeacte/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function inserer_bareme_acte() +{ + + + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActe = $("#codeActe").val(); + + dateEffetActe = $("#dateEffetActe").val(); + forfaitPlafondActeAdherent = $("#forfaitPlafondActeAdherent").val(); + codePeriodicitePlafondActeAdherent = $("#codePeriodicitePlafondActeAdherent").val(); + nbreTransactionActeAdherent = $("#nbreTransactionActeAdherent").val(); + codePeriodiciteActeAdherent = $("#codePeriodiciteActeAdherent").val(); + forfaitPlafondActe = $("#forfaitPlafondActe").val(); + codePeriodicitePlafondActe = $("#codePeriodicitePlafondActe").val(); + nbreTransactionActe = $("#nbreTransactionActe").val(); + codePeriodiciteActe = $("#codePeriodiciteActe").val(); + codeTypeRemboursementActe = $("#codeTypeRemboursementActe").val(); + delaiCarenceActe = $("#delaiCarenceActe").val(); + ticketModerateurActe = $("#ticketModerateurActe").val(); + ageMinimumActe = $("#ageMinimumActe").val(); + ageMaximumActe = $("#ageMaximumActe").val(); + actifActe = $("#actifActe").val(); + + + forfaitTmActe = $("#forfaitTmActe").val(); + + + forfaitPlafondActeAdherent = forfaitPlafondActeAdherent.replace(/ /g,""); + forfaitPlafondActe = forfaitPlafondActe.replace(/ /g,""); + forfaitTmActe = forfaitTmActe.replace(/ /g,""); + + if(codeActe <= " "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + + } + + if(dateEffetActe <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").focus(); + return; + + } + + if(actifActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActe").focus(); + return; + + } + + $("#div_actes_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&codeActe='+codeActe; + + donnees += '&dateEffetActe='+dateEffetActe; + donnees += '&forfaitPlafondActeAdherent='+forfaitPlafondActeAdherent; + donnees += '&codePeriodicitePlafondActeAdherent='+codePeriodicitePlafondActeAdherent; + donnees += '&nbreTransactionActeAdherent='+nbreTransactionActeAdherent; + donnees += '&codePeriodiciteActeAdherent='+codePeriodiciteActeAdherent; + + donnees += '&forfaitPlafondActe='+forfaitPlafondActe; + donnees += '&codePeriodicitePlafondActe='+codePeriodicitePlafondActe; + donnees += '&nbreTransactionActe='+nbreTransactionActe; + donnees += '&codePeriodiciteActe='+codePeriodiciteActe; + donnees += '&codeTypeRemboursementActe='+codeTypeRemboursementActe; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + donnees += '&ticketModerateurActe='+ticketModerateurActe; + donnees += '&ageMinimumActe='+ageMinimumActe; + donnees += '&ageMaximumActe='+ageMaximumActe; + donnees += '&actifActe='+actifActe; + + donnees += '&forfaitTmActe='+forfaitTmActe; + + + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeacte/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme(); + actualiser_bareme_acte(); + + }, + complete: function() { + afficheNombreLigneBareme('actesbaremepriseencharge'); + + } + }); +} + +function intit_saisie_actebareme() +{ + $("#codeActe").selectpicker('val', ''); + + + $("#codeActe").val(''); + $("#searchInputActe").val(''); + $("#zone").val(''); + + + $("#dateEffetActe").val(""); + $("#forfaitPlafondActeAdherent").val("0"); + $("#codePeriodicitePlafondActeAdherent").val("A"); + $("#nbreTransactionActeAdherent").val("0"); + $("#codePeriodiciteActeAdherent").val("A"); + $("#forfaitPlafondActe").val("0"); + $("#codePeriodicitePlafondActe").val("A"); + $("#nbreTransactionActe").val("0"); + $("#codePeriodiciteActe").val("A"); + //$("#codeObservationActe").val("VD"); + $("#delaiCarenceActe").val("0"); + //$("#ticketModerateurActe").val("0"); + $("#ageMinimumActe").val("0"); + $("#ageMaximumActe").val("0"); + $("#actifActe").val("1"); + + $("#forfaitTmActe").val("0"); +} + + +function actualiser_bareme_acte_lienparente() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function inserer_bareme_acte_lienparente() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActeLienParente = $("#codeActeLienParente").val(); + + dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + forfaitPlafondActeLienParente = $("#forfaitPlafondActeLienParente").val(); + codePeriodicitePlafondActeLienParente = $("#codePeriodicitePlafondActeLienParente").val(); + nbreTransactionActeLienParente = $("#nbreTransactionActeLienParente").val(); + codePeriodiciteActeLienParente = $("#codePeriodiciteActeLienParente").val(); + codeTypeRemboursementActeLienParente = $("#codeTypeRemboursementActeLienParente").val(); + delaiCarenceActeLienParente = $("#delaiCarenceActeLienParente").val(); + ticketModerateurActeLienParente = $("#ticketModerateurActeLienParente").val(); + ageMinimumActeLienParente = $("#ageMinimumActeLienParente").val(); + ageMaximumActeLienParente = $("#ageMaximumActeLienParente").val(); + actifActeLienParente = $("#actifActeLienParente").val(); + + forfaitTmActeLienParente = $("#forfaitTmActeLienParente").val(); + + forfaitPlafondActeLienParente = forfaitPlafondActeLienParente.replace(/ /g,""); + forfaitTmActeLienParente = forfaitTmActeLienParente.replace(/ /g,""); + + if(codeActeLienParente <=" "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActeLienParente").focus(); + return; + + } + + if(dateEffetActeLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").focus(); + return; + + } + + if(codeLienParenteActeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParenteActeLienParente").focus(); + return; + + } + + if(actifActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActeLienParente").focus(); + return; + + } + + $("#div_actes_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&dateEffetActeLienParente='+dateEffetActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + donnees += '&forfaitPlafondActeLienParente='+forfaitPlafondActeLienParente; + donnees += '&codePeriodicitePlafondActeLienParente='+codePeriodicitePlafondActeLienParente; + donnees += '&nbreTransactionActeLienParente='+nbreTransactionActeLienParente; + donnees += '&codePeriodiciteActeLienParente='+codePeriodiciteActeLienParente; + + + donnees += '&codeTypeRemboursementActeLienParente='+codeTypeRemboursementActeLienParente; + donnees += '&delaiCarenceActeLienParente='+delaiCarenceActeLienParente; + donnees += '&ticketModerateurActeLienParente='+ticketModerateurActeLienParente; + donnees += '&ageMinimumActeLienParente='+ageMinimumActeLienParente; + donnees += '&ageMaximumActeLienParente='+ageMaximumActeLienParente; + donnees += '&actifActeLienParente='+actifActeLienParente; + + donnees += '&forfaitTmActeLienParente='+forfaitTmActeLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparente/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme_lienparente(); + actualiser_bareme_acte_lienparente(); + + }, + complete: function() { + afficheNombreLigneBareme('actesbaremepriseenchargelienparente'); + } + }); +} + +function intit_saisie_actebareme_lienparente() +{ + $("#codeActeLienParente").selectpicker('val', ''); + + $("#codeActeLienParente").val(''); + $("#searchInputActe").val(''); + + $("#dateEffetActeLienParente").val(""); + $("#codeLienParenteActeLienParente").val(""); + $("#forfaitPlafondActeLienParente").val("0"); + $("#codePeriodicitePlafondActeLienParente").val("A"); + $("#nbreTransactionActeLienParente").val("0"); + $("#codePeriodiciteActeLienParente").val("A"); + + //$("#codeObservationActeLienParente").val("VD"); + $("#delaiCarenceActeLienParente").val("0"); + //$("#ticketModerateurActeLienParente").val("0"); + $("#ageMinimumActeLienParente").val("0"); + $("#ageMaximumActeLienParente").val("0"); + $("#actifActeLienParente").val("1"); + + $("#forfaitTmActeLienParente").val("0"); + + +} + +function controleDateEffetGarantieBareme(){ + + var datejour = $("#datejour_C").val(); + var maxDateEffetGarantie = $("#maxDateEffetGarantie").val(); + var dateEffetGarantie = $("#dateEffetGarantie").val(); + + var str = dateEffetGarantie.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(maxDateEffetGarantie); + //return; + + if((dte < dtj) && (maxDateEffetGarantie!=undefined)){ + var tdm = new Date(maxDateEffetGarantie); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + //alert(dte < dtm); + //return; + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffetGarantie").val(''); + $("#dateEffetGarantie").focus(); + return; + } + } + + +} + +//24-02-2023 + +function validiteDateEffetGarantieLienParente(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + var codeLienParente = $("#codeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetGarantieLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparente/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetGarantieLienParente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetGarantieLienParente = $("#maxDateEffetGarantieLienParente").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetGarantieLienParente!=undefined || maxDateEffetGarantieLienParente!='')){ + var tdm = new Date(maxDateEffetGarantieLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").val(''); + $("#dateEffetGarantieLienParente").focus(); + return; + }else{ + inserer_bareme_garantie_lienparente(); + } + }else{ + + inserer_bareme_garantie_lienparente(); + } + + }, + complete: function() { + + + } + }); + +} + + +function validiteDateEffetActeBareme(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var codeActe = $("#codeActe").val(); + + var dateEffetActe = $("#dateEffetActe").val(); + var datejour = $("#datejour_C").val(); + + var str = dateEffetActe.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActe='+codeActe; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeacte/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebareme').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBareme = $("#maxDateEffetActeBareme").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBareme!=undefined || maxDateEffetActeBareme!='')){ + var tdm = new Date(maxDateEffetActeBareme); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").val(''); + $("#dateEffetActe").focus(); + return; + }else{ + inserer_bareme_acte(); + } + }else{ + + inserer_bareme_acte(); + } + + }, + complete: function() { + + + } + }); + +} + + +function validiteDateEffetActeBaremeLienParente(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + var codeActeLienParente = $("#codeActeLienParente").val(); + + var dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + var codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetActeLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparente/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebaremelienparente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBaremeLienParente = $("#maxDateEffetActeBaremeLienParente").val(); + + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBaremeLienParente!=undefined || maxDateEffetActeBaremeLienParente!='')){ + var tdm = new Date(maxDateEffetActeBaremeLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").val(''); + $("#dateEffetActeLienParente").focus(); + return; + }else{ + inserer_bareme_acte_lienparente(); + } + }else{ + + inserer_bareme_acte_lienparente(); + } + + }, + complete: function() { + + + } + }); + +} + +//30-03-2023 +function limiteadherent(){ + + var idAdherent = $('#idAdherent').val(); + + $("#div_patienter").html('
' + '
'); + + //Ajaxlimiteaddadherent + donnees = 'idAdherent='+idAdherent; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimiteadherent/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_limite_adherent').html(data); + //appliquerDataTable(); + $('#div_limite_adherent').modal("show"); + + }, + complete: function() { + + } + }); +} + +function ajax_maj_plafond_aherent(idLimite, plafond) +{ + plafond = plafond.replace(/ /g,""); + + donnees = 'idLimite='+idLimite+'&plafond='+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimiteadherent/majplafond/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + }, + complete: function() { + + } + }); + +} + +function limitebeneficiaire(){ + + var idBeneficiaire = $('#idBeneficiaire').val(); + + $("#div_patienter").html('
' + '
'); + + donnees = 'idBeneficiaire='+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimitebeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_limite_beneficiaire').html(data); + //appliquerDataTable(); + $('#div_limite_beneficiaire').modal("show"); + }, + complete: function() { + + } + }); +} + +function ajax_maj_plafond_beneficiaire(idLimite, plafond) +{ + plafond = plafond.replace(/ /g,""); + + donnees = 'idLimite='+idLimite+'&plafond='+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimitebeneficiaire/majplafond/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + }, + complete: function() { + + } + }); + +} + +//10-04-2023 +function ajax_maj_plafond_affection(idAffection, appliquerPlafond, controle) +{ + if(appliquerPlafond<=' ') + { + v_msg="Le plafond s'applique Oui ou Non ?"; + v_msgEng="Does the cap apply or not?"; + alert_ebene(v_msg, v_msgEng); + + controle.focus(); + return; + } + + donnees = 'idAffection='+idAffection+"&appliquerPlafond="+appliquerPlafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffectioncollegetm/majplafond/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + +} + +//19-04-2023 +function supprimer_baremegarantie(adminProd,idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantie/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremegarantielienparente(adminProd, idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparente/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie_lienparente(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function supprimer_baremeacte(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeacte/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremeactelienparente(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparente/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_lienparente(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//28-04-2023 +function afficheNombreLigneBareme(table) +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnbrelignebareme/"+table+"/", + type : 'post', + data: "table="+table, + error: function(errorData) { + }, + success: function(data) { + if(table=="garantiesbaremepriseencharge"){ + $("#garantiesbaremepriseencharge").html(data); + }else if(table=="garantiesbaremepriseenchargelienparente"){ + $("#garantiesbaremepriseenchargelienparente").html(data); + }else if(table=="actesbaremepriseencharge"){ + $("#actesbaremepriseencharge").html(data); + }else if(table=="actesbaremepriseenchargelienparente"){ + $("#actesbaremepriseenchargelienparente").html(data); + }else if(table=="detailbareme"){ + $("#detailbareme").html(data); + } + }, + complete: function() { + + } + }); + + +} + +//02-05-2023 +function archivage_bareme(idBaremePriseEnCharge, archiver) +{ + if(archiver=="0"){ + + v_msg="Valider l'entête du barème avant de voir son détail, confirmez-vous la validation?"; + v_msgEng="Validate the header of the scale before seeing its details, do you confirm the validation?"; + }else{ + v_msg="Invalider l'entête du barème avant de le modifier, confirmez-vous la invalidation?"; + v_msgEng="Invalidate the header of the scale before changing it, do you confirm the invalidation?"; + } + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremepriseencharge/archiver/", + type: 'POST', + data: 'idBaremePriseEnCharge='+idBaremePriseEnCharge+'&archiver='+archiver, + success: function(data) + { + if(archiver=="0"){ + v_msg="Le barème est validé avec succès!"; + v_msgEng="The schedule is successfully validated!"; + }else{ + v_msg="Le barème est invalidé avec succès!"; + v_msgEng="The scale is successfully invalidated!"; + } + + alert_ebene(v_msg, v_msgEng); + + }, + complete: function(data) + { + retour_liste_bareme(); + } + }); + } else { + // L'utilisateur a annulé + retour_liste_bareme(); + } + }); + +} + +// +function plafondFamilleProduit(){ + var codeProduit = $('#codeProduit').val(); + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees ='codeProduit='+codeProduit; + donnees +='&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondfamilleproduit/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_plafond').html(data); + //affiche_particularite_statut(); + }, + complete: function(){ + } + }); + +} + +function libelleBaremeCollege(controle){ + + tab["bareme"] = controle.options[controle.selectedIndex].text; + + nomcollege(); + +} + +function libelleTypeCollege(controle){ + + tab["type"] = controle.options[controle.selectedIndex].text; + + + + nomcollege(); +} + +function nomcollege(){ + if(tab["type"]==undefined) + { + tab["type"] = ''; + } + + if(tab["bareme"]==undefined) + { + tab["bareme"] = ''; + } + + $('#libelleCollege').val(tab["type"]+' '+tab["bareme"]); +} + +//09-05-2023 +function affichelisteactes(libelle, zone) +{ + if(libelle!='' && libelle.length >="3") + { + var donnees = 'libelle='+ libelle+'&zone='+zone; + + //alert(donnees); + vLink = "Ajaxchargeractesexamenhospitalisation/"; + $.ajax({ + type: "POST", + url: $("#racineWeb").val()+vLink, + data:donnees, + beforeSend: function(){ + if(zone=="acte" || zone=="decompte" || zone=="proforma"){ + $("#searchInputActe").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px"); + }else if (zone=="lienparente"){ + $("#searchInputLienparente").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px"); + } + }, + success: function(data){ + if(zone=="acte" || zone=="decompte" || zone=="proforma"){ + $("#div_selection_acte").show(); + $("#div_selection_acte").html(data); + $("#searchInputActe").css("background","#FFF"); + }else if (zone=="lienparente"){ + $("#div_selection_lienparente").show(); + $("#div_selection_lienparente").html(data); + $("#searchInputLienparente").css("background","#FFF"); + } + } + }); + }else{ + if(zone=="acte" || zone=="decompte" || zone=="proforma"){ + $("#div_selection_acte").hide(); + }else if (zone=="lienparente"){ + $("#div_selection_lienparente").hide(); + } + return false; + } +} + +function selectElement(code, libelle, zone){ + nomForm = $("#nomForm").val(); + + if(zone=="acte" || zone=="decompte" || zone=="proforma"){ + $("#searchInputActe").val(libelle); + $("#div_selection_acte").hide(); + $("#codeActe").val(code); + + if(nomForm=="tMadherentacte"){ + afficheMaxdateEffetAdherentacte(); + }else if(nomForm=="tMbeneficiaireActe"){ + afficheMaxdateEffetBeneficiaireacte(); + }else if(nomForm=="tMcollegeActe"){ + afficheMaxdateEffetcollegeacte(); + }else if(nomForm=="tMpoliceActe"){ + afficheMaxdateEffetpoliceacte(); + }else if(nomForm=="tMclientActe"){ + afficheMaxdateEffetclientacte(); + }else if(nomForm=="frmFactureclassique" || nomForm=="frmFactureclassiquepolice"){ + ajouter_un_acte_factureclassique(code); + }else if(nomForm=="traitementProforma"){ + ajouter_un_acte_proforma(code); + } + + + + if(zone=="decompte"){ + //var str = libelle.split(' <==> '); + + //var prixTarif = extraitNombre(str[1]); + + ajouter_un_acte_selection_dec(code); + } + + }else if (zone=="lienparente"){ + $("#searchInputLienparente").val(libelle); + $("#div_selection_lienparente").hide(); + $("#codeActeLienParente").val(code); + } +} + +function afficherDetailBareme() +{ + masquerBareme = $("#masquerBareme").val(); + + if(masquerBareme == undefined){ + masquerBareme = "1"; + } + + //alert(masquerGarantie); + + if(masquerBareme=="1"){ + $('#div_bareme').hide(); + $("#masquerBareme").val("0"); + $("#span_bareme").text("[+]"); + + }else{ + $('#div_bareme').show(); + $("#masquerBareme").val("1"); + //$("#dateEffetGarantie").focus(); + $("#span_bareme").text("[-]"); + + init_saisie_detailbareme(); + actualiser_detailbareme(); + } + + afficheNombreLigneBareme('detailbareme'); +} + + +function init_saisie_detailbareme() +{ + $("#dateEffetBareme").val(""); + $("#actif").val(""); +} + +function controleDateEffetBareme(){ + + var datejour = $("#datejour_C").val(); + var maxDateEffetBareme = $("#maxDateEffetBareme").val(); + var dateEffetBareme = $("#dateEffetBareme").val(); + + var str = dateEffetBareme.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(maxDateEffetBareme); + //return; + + if((dte < dtj) && (maxDateEffetBareme!=undefined)){ + var tdm = new Date(maxDateEffetBareme); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + //alert(dte+' '+dtm); + //return; + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffetBareme").val(''); + $("#dateEffetBareme").focus(); + return; + } + } + + +} + +function actualiser_detailbareme() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbareme/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function supprimer_detailbareme(adminProd, idDetail) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbareme/supprimer/", + type : 'post', + data: "idDetail="+idDetail, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_detailbareme(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// inserer_bareme() +function inserer_bareme() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + dateEffetBareme = $("#dateEffetBareme").val(); + ticketModerateurBareme = $("#ticketModerateurBareme").val(); + //actif = $("#actif").val(); + + if(dateEffetBareme <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetBareme").focus(); + return; + + } + + if(ticketModerateurBareme <= " "){ + + v_msg="Veuillez entrer un ticket modérateur!"; + v_msgEng="Please enter a co-payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#ticketModerateurBareme").focus(); + return; + + } + + $("#div_bareme").html('
' + '
'); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetBareme='+dateEffetBareme; + donnees += '&ticketModerateurBareme='+ticketModerateurBareme; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbareme/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + init_saisie_detailbareme(); + actualiser_detailbareme(); + }, + complete: function() { + afficheNombreLigneBareme('detailbareme'); + $("#masquerBareme").val("0"); + afficherDetailBareme(); + } + }); +} + +//15-05-2023 +function consosadherent(){ + + var idAdherent = $('#idAdherent').val(); + + $("#div_patienter").html('
' + '
'); + + //Ajaxlimiteaddadherent + donnees = 'idAdherent='+idAdherent; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsosadherent/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_consos_adherent').html(data); + $('#div_consos_adherent').modal("show"); + }, + complete: function() { + + } + }); +} + + +function consosbeneficiaire(){ + //\u00ea, \u00e9 + + var idBeneficiaire = $('#idBeneficiaire').val(); + + $("#div_patienter").html('
' + '
'); + + //Ajaxlimiteaddadherent + donnees = 'idBeneficiaire='+idBeneficiaire; + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsosbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_consos_beneficiaire').html(data); + $('#div_consos_beneficiaire').modal("show"); + }, + complete: function() { + + } + }); +} + +function recherchecodeproduit() +{ + var codeProduit = $("#codeProduit").val(); + + var donnee_a_affciher = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveauproduit/rechercher", + type : 'post', + data: 'codeProduit='+codeProduit, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + donnee_a_affciher = data; + }, + complete: function() { + //alert(donnee_a_affciher); + if(donnee_a_affciher=="true") + { + v_msg="Ce code produit existe déjà! Veuillez le remplacer."; + v_msgEng="This product code already exists! Please replace it."; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").val(""); + $("#codeProduit").focus(); + } + } + }); + +} + +function extraitNombre(str){ + return Number(str.replace(/[^\d]/g, "")) +} + + +function ajax_maj_qte_acte_dec(idPrestationactes, quantite, controle) +{ + donnee_a_affciher = ""; + + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantit\u00e9!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherajoutactesdec/majquantite/", + type: 'POST', + data: donnees, + success: function(data) { + donnee_a_affciher = data; + }, + error: function(data) { + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + } + }); + } +} + +//20-05-2023 +function maj_composante_effettarif_acte(idActe, dateEffet, maxDateEffetActe, ligne){ + + var datejour = $("#datejour_C").val(); + + var str = dateEffet.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + donnees = "idActe="+idActe+"&dateEffet="+dateEffet; + + v_msg="Confirmez-vous cette date d'effet?"; + v_msgEng="Do you confirm this effective date?"; + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(donnees); + //return; + + if((dte < dtj) && (maxDateEffetActe!="")){ + var tdm = new Date(maxDateEffetActe); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + return; + }else{ + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/majeffet/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + } + }); + } + }else{ + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/majeffet/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + } + }); + } +} + + +function actualiserActesTarifes() +{ + donnees=''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactestarifes/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_acte_2').html(data); + appliquerDataTable(); + }, + complete: function(data) + { + } + }); + +} + +//21-05-2023 +function valider_tarif() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + v_msg="Validez-vous cette composition de tarif?"; + v_msgEng="Do you validate this price composition?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/validertarif/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif("1"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_tous_prestataires_tarifclient() +{ + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe; + + v_msg="Attention, cela va associer tous les prestataires au tarif sélectionné! Confirmez-vous cette action?"; + v_msgEng="Be careful, this will associate all providers with the selected rate! Do you confirm this action?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_compsante_tarif").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifclientprestataire/ajoutertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_tarifclient(codePrestataire) +{ + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Voulez-vous associer ce prestataire au tarif sélectionné?"; + v_msgEng="Do you want to associate this service provider with the selected rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifclientprestataire/ajouterunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_prestataires_tarifclient() +{ + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Confirmez-vous le retrait du tarif de tous les prestataires ajoutés?"; + v_msgEng="Do you confirm the withdrawal of the tariff of all the providers added?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifclientprestataire/retirertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_tarifclient(codePrestataire) +{ + + idClient = $("#idClient").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idClient<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idClient="+idClient+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Attention! Confirmez-vous le retrait de ce prestataire?"; + v_msgEng="Attention! Do you confirm the withdrawal of this service provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifclientprestataire/retirerunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//25-05-2023 +function ajax_composante_tarif_police_prestataire() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idPolice = $("#idPolice").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idPolice="+idPolice+"&codeTarifActe="+codeTarifActe; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_prestataires_tarifpolice() +{ + idPolice = $("#idPolice").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idPolice="+idPolice+"&codeTarifActe="+codeTarifActe; + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Attention, cela va associer tous les prestataires au tarif sélectionné! Confirmez-vous cette action?"; + v_msgEng="Be careful, this will associate all providers with the selected rate! Do you confirm this action?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/ajoutertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_tarifpolice(codePrestataire) +{ + idPolice = $("#idPolice").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idPolice="+idPolice+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Voulez-vous associer ce prestataire au tarif sélectionné?"; + v_msgEng="Do you want to associate this service provider with the selected rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/ajouterunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + ajax_composante_tarif_police_prestataire(); + } + }); + +} + +function retirer_tous_prestataires_tarifpolice() +{ + idPolice = $("#idPolice").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idPolice="+idPolice+"&codeTarifActe="+codeTarifActe; + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Confirmez-vous le retrait du tarif de tous les prestataires ajoutés?"; + v_msgEng="Do you confirm the withdrawal of the tariff of all the providers added?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/retirertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_tarifpolice(codePrestataire) +{ + + idPolice = $("#idPolice").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idPolice<=' ') + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a insurance policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idPolice="+idPolice+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Attention! Confirmez-vous le retrait de ce prestataire?"; + v_msgEng="Attention! Do you confirm the withdrawal of this service provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifpoliceprestataire/retirerunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajax_composante_tarif_college_prestataire() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idCollege = $("#idCollege").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + idPolice = $("#idPolice").val(); + + donnees = "idCollege="+idCollege+"&codeTarifActe="+codeTarifActe; + donnees += "&idPolice="+idPolice; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifcollegeprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_prestataires_tarifcollege() +{ + idCollege = $("#idCollege").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idCollege="+idCollege+"&codeTarifActe="+codeTarifActe; + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Attention, cela va associer tous les prestataires au tarif sélectionné! Confirmez-vous cette action?"; + v_msgEng="Be careful, this will associate all providers with the selected rate! Do you confirm this action?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifcollegeprestataire/ajoutertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_tarifcollege(codePrestataire) +{ + idCollege = $("#idCollege").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idCollege="+idCollege+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Voulez-vous associer ce prestataire au tarif sélectionné?"; + v_msgEng="Do you want to associate this service provider with the selected rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifcollegeprestataire/ajouterunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_prestataires_tarifcollege() +{ + idCollege = $("#idCollege").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idCollege="+idCollege+"&codeTarifActe="+codeTarifActe; + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Confirmez-vous le retrait du tarif de tous les prestataires ajoutés?"; + v_msgEng="Do you confirm the withdrawal of the tariff of all the providers added?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifcollegeprestataire/retirertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_tarifcollege(codePrestataire) +{ + + idCollege = $("#idCollege").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idCollege<=' ') + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idCollege="+idCollege+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Attention! Confirmez-vous le retrait de ce prestataire?"; + v_msgEng="Attention! Do you confirm the withdrawal of this service provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifcollegeprestataire/retirerunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function chargernumero(numero) +{ + var nomForm = $('#nomForm').val(); + var donnees = 'numero='+ numero; + //alert(donnees); return; + + if(nomForm=="adherentprestataire" || nomForm=="tMadherent" || nomForm=="tMadherentacte" + || nomForm=="tMadherentacteprestataire" || nomForm=="tMadherentgarantie" || nomForm =="tMadherentgarantieprestataire" + || nomForm =="tMadherentprestataire") + { + vLink = "Ajaxchargernumeroadherent/"; + }else + if(nomForm=="beneficiaireprestataire" || nomForm=="tMbeneficiaire" || nomForm=="tMbeneficiaireActe" + || nomForm=="tMbeneficiaireActePrestataire" || nomForm=="tMbeneficiaireGarantie" || nomForm=="tMbeneficiaireGarantiePrestataire" + || nomForm=="tMbeneficiairePrestataire" || nomForm=="tarifappliquebeneficiaire" || nomForm=="remboursementClassic") + { + vLink = "Ajaxchargernumerobeneficiaire/"; + } + + $.ajax({ + type: "POST", + url: $("#racineWeb").val()+vLink, + data:donnees, + beforeSend: function(){ + $("#searchInput").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px"); + }, + success: function(data){ + $("#div_selection").show(); + $("#div_selection").html(data); + $("#searchInput").css("background","#FFF"); + } + }); +} + +//adhérent - prestataire +function selectAssure(id, numero, nom, nomPolice, nomCollege, codeLienParente){ + + $("#searchInput").val(numero); + $("#div_selection").hide(); + $("#nomAssure").val(nom); + $("#idAssure").val(id); + + $("#nomPolice").val(nomPolice); + $("#nomCollege").val(nomCollege); + $("#codeLienParente").val(codeLienParente); + + if($("#nomForm").val()=="tMadherent") + { + afficheMaxdateEffetAdherent(); + } +} + +function ajax_composante_tarif_adherent_prestataire() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + nomAssure = $("#nomAssure").val(); + numeroAdherent = $("#searchInput").val(); + + nomPolice = $("#nomPolice").val(); + nomCollege = $("#nomCollege").val(); + codeLienParente = $("#codeLienParente").val(); + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + donnees += "&numeroAdherent="+numeroAdherent+"&nomAssure="+nomAssure; + donnees += "&nomPolice="+nomPolice+"&nomCollege="+nomCollege; + donnees += "&codeLienParente="+codeLienParente; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifadherentprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_prestataires_tarifadherent() +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Attention, cela va associer tous les prestataires au tarif sélectionné! Confirmez-vous cette action?"; + v_msgEng="Be careful, this will associate all providers with the selected rate! Do you confirm this action?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifadherentprestataire/ajoutertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_tarifadherent(codePrestataire) +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Voulez-vous associer ce prestataire au tarif sélectionné?"; + v_msgEng="Do you want to associate this service provider with the selected rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifadherentprestataire/ajouterunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_prestataires_tarifadherent() +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Confirmez-vous le retrait du tarif de tous les prestataires ajoutés?"; + v_msgEng="Do you confirm the withdrawal of the tariff of all the providers added?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifadherentprestataire/retirertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_tarifadherent(codePrestataire) +{ + + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Attention! Confirmez-vous le retrait de ce prestataire?"; + v_msgEng="Attention! Do you confirm the withdrawal of this service provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifadherentprestataire/retirerunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +//beneficiaire - prestataire +function selectBeneficiaire(id, numero, nom, nomPolice, nomCollege, codeLienParente, numeroAdherent, adherent){ + $("#searchInput").val(numero); + $("#div_selection").hide(); + $("#nomAssure").val(nom); + $("#idAssure").val(id); + + $("#codeLienParente").val(codeLienParente); + + $("#noAdherent").val(numeroAdherent); + $("#nomAdherent").val(adherent); + + if($("#nomForm").val()=="remboursementClassic"){ + $("#idBeneficiaire").val(id); + ajax_context_adherent(id); + }else{ + $("#nomPolice").val(nomPolice); + $("#nomCollege").val(nomCollege); + } + + + + if($("#nomForm").val()=="tMbeneficiaire") + { + afficheMaxdateEffetBeneficiaire(); + } +} + +function ajax_composante_tarif_beneficiaire_prestataire() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + nomAssure = $("#nomAssure").val(); + numeroBeneficiaire = $("#searchInput").val(); + + nomPolice = $("#nomPolice").val(); + nomCollege = $("#nomCollege").val(); + codeLienParente = $("#codeLienParente").val(); + + noAdherent = $("#noAdherent").val(); + nomAdherent = $("#nomAdherent").val(); + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + donnees += "&numeroBeneficiaire="+numeroBeneficiaire+"&nomAssure="+nomAssure; + donnees += "&nomPolice="+nomPolice+"&nomCollege="+nomCollege; + donnees += "&codeLienParente="+codeLienParente; + donnees += "&noAdherent="+noAdherent+"&nomAdherent="+nomAdherent; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifbeneficiaireprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_tous_prestataires_tarifbeneficiaire() +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro du bénéficiaire!"; + v_msgEng="Please enter a beneficiary number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Attention, cela va associer tous les prestataires au tarif sélectionné! Confirmez-vous cette action?"; + v_msgEng="Be careful, this will associate all providers with the selected rate! Do you confirm this action?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifbeneficiaireprestataire/ajoutertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_tarifbeneficiaire(codePrestataire) +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Voulez-vous associer ce prestataire au tarif sélectionné?"; + v_msgEng="Do you want to associate this service provider with the selected rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifbeneficiaireprestataire/ajouterunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_prestataires_tarifbeneficiaire() +{ + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe; + + + $("#div_compsante_tarif").html('
' + '
'); + + + v_msg="Confirmez-vous le retrait du tarif de tous les prestataires ajoutés?"; + v_msgEng="Do you confirm the withdrawal of the tariff of all the providers added?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifbeneficiaireprestataire/retirertousprestataires/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_tarifbeneficiaire(codePrestataire) +{ + + idAssure = $("#idAssure").val(); + codeTarifActe = $("#codeTarifActe").val(); + + if(idAssure=='0') + { + v_msg="Veuillez entrer un numéro d'adhérent!"; + v_msgEng="Please enter a membership number!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + return; + } + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "idAssure="+idAssure+"&codeTarifActe="+codeTarifActe+'&codePrestataire='+codePrestataire; + + $("#div_compsante_tarif").html('
' + '
'); + + v_msg="Attention! Confirmez-vous le retrait de ce prestataire?"; + v_msgEng="Attention! Do you confirm the withdrawal of this service provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifbeneficiaireprestataire/retirerunprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_compsante_tarif').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//27-05-2023 + +function recupererValeur() +{ + + nomForm = $("#nomForm").val(); + + + if(nomForm=="frmadherent") + { + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + sexe = $("#sexe").val(); + dateNaissance = $("#dateNaissance").val(); + idCollege = $("#idCollege").val(); + + myVal = 0; + + donnees = "nom="+nom+"&prenoms="+prenoms+"&idCollege="+idCollege; + donnees += "&sexe="+sexe+"&dateNaissance="+dateNaissance; + + myVal_nom = (nom<=" ") ? 0 : 1; + myVal_prenoms = (prenoms<=" ") ? 0 : 1; + myVal_sexe = (sexe<=" ") ? 0 : 1; + myVal_dateNaissance = (dateNaissance<=" ") ? 0 : 1; + + myVal = parseInt(myVal_nom+myVal_prenoms+myVal_sexe+myVal_dateNaissance); + + if(myVal==4) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexistanceassure/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_existance').html(data); + var existe = $("#existe").val(); + + if(existe=="1") + { + v_msg="Les informations que vous avez saisi seront dupliquées dans la base de données si vous les enregistrez!"; + v_msgEng="The information you entered will be duplicated in the database if you save it!"; + + alert_ebene(v_msg, v_msgEng); + } + }, + error: function(data) { + }, + complete: function() + { + } + }); + } + }else if(nomForm=="frmbeneficiaire") + { + nomBeneficiaire = $("#nomBeneficiaire").val(); + prenomsBeneficiaire = $("#prenomsBeneficiaire").val(); + codeLienParente = $("#codeLienParente").val(); + sexe = $("#sexe").val(); + dateNaissance = $("#dateNaissance").val(); + idAdherent = $("#idAdherent").val(); + + myVal = 0; + + donnees = "nomBeneficiaire="+nomBeneficiaire+"&prenomsBeneficiaire="+prenomsBeneficiaire; + donnees += "&codeLienParente="+codeLienParente+"&sexe="+sexe+"&dateNaissance="+dateNaissance; + donnees += "&idAdherent="+idAdherent; + + //alert(donnees); + + + myVal_nom = (nomBeneficiaire<=" ") ? 0 : 1; + myVal_prenoms = (prenomsBeneficiaire<=" ") ? 0 : 1; + myVal_codeLienParente = (codeLienParente<=" ") ? 0 : 1; + myVal_sexe = (sexe<=" ") ? 0 : 1; + myVal_dateNaissance = (dateNaissance<=" ") ? 0 : 1; + + myVal = parseInt(myVal_nom+myVal_prenoms+myVal_codeLienParente+myVal_sexe+myVal_dateNaissance); + + if(myVal==5) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexistancebeneficiaire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_existance').html(data); + var existe = $("#existe").val(); + + if(existe=="1") + { + v_msg="Les informations que vous avez saisi seront dupliquées dans la base de données si vous les enregistrez!"; + v_msgEng="The information you entered will be duplicated in the database if you save it!"; + + alert_ebene(v_msg, v_msgEng); + } + }, + error: function(data) { + }, + complete: function() + { + } + }); + } + + + } +} + +function supprimer_un_acte_du_tarif(idDetailtarifacte, ligne) +{ + donnees = 'idDetailtarifacte='+idDetailtarifacte; + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this removal?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/supprimer/", + type: 'POST', + data: donnees, + success: function(data) + { + supprdetailtarif(idDetailtarifacte, ligne); + }, + error: function(data) { + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprdetailtarif(idDetailtarifacte, ligne) +{ + donnees = 'idDetailtarifacte='+idDetailtarifacte+'&ligne='+ligne; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailsupprime/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_suppr').html(data); + var suppr = $("#suppr").val(); + + if(suppr=="1"){ + $("#tabLigne"+ligne).css({"background-color": "red", "color": "white"}); + }else{ + $("#tabLigne"+ligne).css({"background-color": "transparent", "color": "black"}); + } + + }, + error: function(data) { + }, + complete: function() { + //ajax_composante_tarif("0"); + } + }); + +} + +//16-06-2023 sorel +function inserer_tmadherent() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet+'&tm='+tm; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherent/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherent(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + } + }); +} + +function affichertmadherent() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherent/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + + +function controleDateEffetTm(){ + + var datejour = $("#datejour_C").val(); + var maxDateEffetTmAdherent = $("#maxDateEffetTmAdherent").val(); + var dateEffet = $("#dateEffet").val(); + + var str = dateEffet.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(maxDateEffetGarantie); + //return; + + if((dte < dtj) && (maxDateEffetTmAdherent!=undefined)){ + var tdm = new Date(maxDateEffetTmAdherent); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + //alert(dte < dtm); + //return; + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffet").val(''); + $("#dateEffet").focus(); + return; + } + } + + +} + +function afficheMaxdateEffetAdherent() +{ + idAdherent = $("#idAssure").val(); + + donnees = "idAdherent="+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherent/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function supprimer_tmadherent(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherent/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherent(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +//20-06-2023 +function retour_limite() +{ + nomForm = $("#nomForm").val(); + + if(nomForm == "ficheAdherent"){ + afficher_adherent_id(); + }else if(nomForm == "ficheBeneficiaire"){ + afficher_beneficiaire_id(); + } + +} + +//20-06-2023 sorel +function inserer_tmadherentacte() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeActe='+codeActe+'&codeGarantie='+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacte/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherentacte(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + } + }); +} + +function affichertmadherentacte() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +//21-06-2023 +function supprimer_tmadherentacte(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacte/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherentacte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetAdherentacte() +{ + idAdherent = $("#idAssure").val(); + codeActe = $("#codeActe").val(); + codeGarantie= $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = "idAdherent="+idAdherent+"&codeActe="+codeActe+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacte/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function affichelisteprestataires(libelle) +{ + if(libelle!='' && libelle.length >="3") + { + var donnees = 'libelle='+ libelle; + + vLink = "Ajaxchargerlisteprestataires/"; + $.ajax({ + type: "POST", + url: $("#racineWeb").val()+vLink, + data:donnees, + beforeSend: function(){ + $("#searchInputPrestataire").css("background","#FFF url(Bootstrap/images/LoaderIcon.gif) no-repeat 165px"); + }, + success: function(data){ + $("#div_selection_prestataire").show(); + $("#div_selection_prestataire").html(data); + $("#searchInputPrestataire").css("background","#FFF"); + } + }); + }else{ + $("#div_selection_prestataire").hide(); + return false; + } +} + +function selectPrestataire(code, libelle){ + nomForm = $("#nomForm").val(); + + $("#searchInputPrestataire").val(libelle); + $("#div_selection_prestataire").hide(); + $("#codePrestataire").val(code); + + //console.log($("#codePrestataire").val()); + + if(nomForm=="tMadherentacteprestataire"){ + afficheMaxdateEffetAdherentacteprestataire(); + }else if(nomForm=="tMadherentgarantieprestataire") + { + afficheMaxdateEffetAdherentgarantieprestataire(); + }else if(nomForm=="tMadherentprestataire") + { + afficheMaxdateEffetAdherentprestataire(); + }else if(nomForm=="tMbeneficiaireActePrestataire") + { + afficheMaxdateEffetBeneficiaireacteprestataire(); + }else if(nomForm=="tMbeneficiaireGarantiePrestataire") + { + afficheMaxdateEffetBeneficiairegarantieprestataire(); + }else if(nomForm=="tMbeneficiairePrestataire") + { + afficheMaxdateEffetBeneficiairePrestataire(); + }else if(nomForm=="tMcollegeacteprestataire") + { + afficheMaxdateEffetCollegeacteprestataire(); + }else if(nomForm=="tMcollegegarantieprestataire") + { + afficheMaxdateEffetCollegegarantieprestataire(); + }else if(nomForm=="tMcollegeprestataire") + { + afficheMaxdateEffetCollegeprestataire(); + }else if(nomForm=="tMpoliceacteprestataire") + { + afficheMaxdateEffetPoliceacteprestataire(); + }else if(nomForm=="tMpolicegarantieprestataire") + { + afficheMaxdateEffetPolicegarantieprestataire(); + }else if(nomForm=="tMpoliceprestataire") + { + afficheMaxdateEffetPoliceprestataire(); + }else if(nomForm=="tMclientacteprestataire") + { + afficheMaxdateEffetClientacteprestataire(); + }else if(nomForm=="tMclientgarantieprestataire") + { + afficheMaxdateEffetClientgarantieprestataire(); + }else if(nomForm=="tMclientprestataire") + { + afficheMaxdateEffetClientprestataire(); + }else if(nomForm=="modifierRembClassique") + { + $("#prestataireConsultation").val(libelle); + } + + + + +} + +function afficheMaxdateEffetAdherentacteprestataire() +{ + idAdherent = $("#idAssure").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idAdherent="+idAdherent+"&codeActe="+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacteprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmadherentacteprestataire() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + + codeGarantie = $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeActe='+codeActe+"&codePrestataire="+codePrestataire; + donnees += "&codeGarantie="+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacteprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherentacteprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeActe").val(''); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + } + }); +} + +function affichertmadherentacteprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacteprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmadherentacteprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentacteprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherentacteprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +//26-06-2023 sorel +function inserer_tmadherentgarantie() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeGarantie='+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantie/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherentgarantie(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + } + }); +} + +function affichertmadherentgarantie() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantie/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function afficheMaxdateEffetAdherentgarantie() +{ + idAdherent = $("#idAssure").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = "idAdherent="+idAdherent+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantie/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function supprimer_tmadherentgarantie(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantie/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherentgarantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function inserer_tmadherentgarantieprestataire() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeGarantie='+codeGarantie+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantieprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherentgarantieprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + } + }); +} + +function afficheMaxdateEffetAdherentgarantieprestataire() +{ + idAdherent = $("#idAssure").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idAdherent="+idAdherent+"&codeGarantie="+codeGarantie+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantieprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function affichertmadherentgarantieprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantieprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmadherentgarantieprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentgarantieprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherentgarantieprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function inserer_tmadherentprestataire() +{ + idAdherent = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idAdherent='+idAdherent+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmadherentprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + } + }); +} + +function affichertmadherentprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function afficheMaxdateEffetAdherentprestataire() +{ + idAdherent = $("#idAssure").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idAdherent < " ") || (idAdherent == "0")) + { + v_msg="Veuillez sélectionner un adhérent!"; + v_msgEng="Please select a member!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $('.selectpicker').selectpicker('refresh'); + $("#searchInputPrestataire").val(''); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idAdherent="+idAdherent+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function supprimer_tmadherentprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmadherentprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmadherentprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//06-07-2023 +function afficheMaxdateEffetBeneficiaire() +{ + idBeneficiaire = $("#idAssure").val(); + + donnees = "idBeneficiaire="+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function controleDateEffetTmBeneficiaire(){ + + var datejour = $("#datejour_C").val(); + var maxDateEffetTmBeneficiaire = $("#maxDateEffetTmBeneficiaire").val(); + var dateEffet = $("#dateEffet").val(); + + var str = dateEffet.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(maxDateEffetGarantie); + //return; + + if((dte < dtj) && (maxDateEffetTmBeneficiaire!=undefined)){ + var tdm = new Date(maxDateEffetTmBeneficiaire); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + //alert(dte < dtm); + //return; + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffet").val(''); + $("#dateEffet").focus(); + return; + } + } + + +} + + +function inserer_tmbeneficiaire() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet+'&tm='+tm; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiaire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + } + }); +} + +function affichertmbeneficiaire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmbeneficiaire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiaire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficheMaxdateEffetBeneficiaireacte() +{ + idBeneficiaire = $("#idAssure").val(); + codeActe = $("#codeActe").val(); + + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = "idBeneficiaire="+idBeneficiaire+"&codeActe="+codeActe+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacte/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmbeneficiaireacte() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeActe='+codeActe+'&codeGarantie='+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacte/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiaireacte(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + } + }); +} + +function affichertmbeneficiaireacte() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmbeneficiaireacte(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacte/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiaireacte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function afficheMaxdateEffetBeneficiaireacteprestataire() +{ + idBeneficiaire = $("#idAssure").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idBeneficiaire="+idBeneficiaire+"&codeActe="+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacteprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +/////////////////////// + +function inserer_tmbeneficiaireacteprestataire() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeActe='+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacteprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiaireacteprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeActe").val(''); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + } + }); +} + +function affichertmbeneficiaireacteprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacteprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmbeneficiaireacteprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireacteprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiaireacteprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//07-07-2023 +function inserer_tmbeneficiairegarantie() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeGarantie='+codeGarantie; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantie/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiairegarantie(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + } + }); +} + +function affichertmbeneficiairegarantie() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantie/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function afficheMaxdateEffetBeneficiairegarantie() +{ + idBeneficiaire = $("#idAssure").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = "idBeneficiaire="+idBeneficiaire+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantie/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function supprimer_tmbeneficiairegarantie(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantie/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiairegarantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +////////////////// + +function afficheMaxdateEffetBeneficiairegarantieprestataire() +{ + idBeneficiaire = $("#idAssure").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idBeneficiaire="+idBeneficiaire+"&codeGarantie="+codeGarantie+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantieprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmbeneficiairegarantieprestataire() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+'&codeGarantie='+codeGarantie+"&codePrestataire="+codePrestataire; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantieprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiairegarantieprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + } + }); +} + +function affichertmbeneficiairegarantieprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantieprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmbeneficiairegarantieprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiairegarantieprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiairegarantieprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +///////////////////////// + +function afficheMaxdateEffetBeneficiairePrestataire() +{ + idBeneficiaire = $("#idAssure").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + $("#searchInputActe").val(''); + $("#searchInputPrestataire").val(''); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idBeneficiaire="+idBeneficiaire+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmbeneficiaireprestataire() +{ + idBeneficiaire = $("#idAssure").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + donnees = 'idBeneficiaire='+idBeneficiaire+'&dateEffet='+dateEffet; + donnees += '&tm='+tm+"&codePrestataire="+codePrestataire; + + //alert(donnees); + //return; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmbeneficiaireprestataire(); + + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + $("#dateEffet").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + } + }); +} + +function affichertmbeneficiaireprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function supprimer_tmbeneficiaireprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmbeneficiaireprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmbeneficiaireprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +//12-07-2023 + +function controleDateEffetTmNegocie(){ + + var datejour = $("#datejour_C").val(); + var maxDateEffetTm = $("#maxDateEffetTm").val(); + var dateEffet = $("#dateEffet").val(); + + var str = dateEffet.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(maxDateEffetGarantie); + //return; + + if((dte < dtj) && (maxDateEffetTm!=undefined)){ + var tdm = new Date(maxDateEffetTm); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + //alert(dte < dtm); + //return; + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffet").val(''); + $("#dateEffet").focus(); + return; + } + } + + +} + +function filtretmcollegepolice() +{ + donnees = "idPolice="+$("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltretmcollegepolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_college").html(data); + $("#idCollege").selectpicker(); + } + }); +} + +function afficheMaxdateEffetCollege() +{ + idCollege = $("#idCollege").val(); + + donnees = "idCollege="+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollege/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function inserer_tmcollege() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollege/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollege(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollege() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollege/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollege(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollege/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollege(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficheMaxdateEffetcollegeacte() +{ + idCollege = $("#idCollege").val(); + codeActe = $("#codeActe").val(); + codeGarantie= $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = "idCollege="+idCollege+"&codeActe="+codeActe+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacte/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +//13-07-2023 +function inserer_tmcollegeacte() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacte/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollegeacte(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $("#codeGarantie").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollegeacte() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollegeacte(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacte/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollegeacte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficheMaxdateEffetCollegeacteprestataire() +{ + idCollege = $("#idCollege").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idCollege="+idCollege+"&codeActe="+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacteprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmcollegeacteprestataire() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie;; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacteprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollegeacteprestataire(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $("#codeGarantie").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollegeacteprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacteprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollegeacteprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeacteprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollegeacteprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetCollegegarantie() +{ + idCollege = $("#idCollege").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = "idCollege="+idCollege+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantie/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function inserer_tmcollegegarantie() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantie/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollegegarantie(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollegegarantie() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantie/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollegegarantie(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantie/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollegegarantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetCollegegarantieprestataire() +{ + idCollege = $("#idCollege").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idCollege="+idCollege+"&codeGarantie="+codeGarantie+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantieprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function inserer_tmcollegegarantieprestataire() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantieprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollegegarantieprestataire(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollegegarantieprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantieprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollegegarantieprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegegarantieprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollegegarantieprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//14-07-2023 +function afficheMaxdateEffetCollegeprestataire() +{ + idCollege = $("#idCollege").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idCollege="+idCollege+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function inserer_tmcollegeprestataire() +{ + idCollege = $("#idCollege").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idCollege < " ") || (idCollege == "0")) + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + $("#idCollege").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idCollege='+idCollege+'&dateEffet='+dateEffet+'&tm='+tm+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmcollegeprestataire(); + + $("#idPolice").val(''); + $("#idCollege").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmcollegeprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmcollegeprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmcollegeprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmcollegeprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetPolice() +{ + idPolice = $("#idPolice").val(); + + donnees = "idPolice="+idPolice; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolice/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmpolice() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolice/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpolice(); + + $("#idPolice").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpolice() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolice/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpolice(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolice/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpolice(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetpoliceacte() +{ + idPolice = $("#idPolice").val(); + codeActe = $("#codeActe").val(); + codeGarantie= $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + //codeGarantie + donnees = "idPolice="+idPolice+"&codeActe="+codeActe+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacte/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function inserer_tmpoliceacte() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+"&codeGarantie="+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacte/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpoliceacte(); + + $("#idPolice").val(''); + $("#codeGarantie").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpoliceacte() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpoliceacte(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacte/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpoliceacte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficheMaxdateEffetPoliceacteprestataire() +{ + idPolice = $("#idPolice").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner un police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idPolice="+idPolice+"&codeActe="+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacteprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmpoliceacteprestataire() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+"&codePrestataire="+codePrestataire+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacteprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpoliceacteprestataire(); + + $("#idPolice").val(''); + $("#codeGarantie").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpoliceacteprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacteprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpoliceacteprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceacteprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpoliceacteprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function afficheMaxdateEffetPolicegarantie() +{ + idPolice = $("#idPolice").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = "idPolice="+idPolice+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantie/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmpolicegarantie() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantie/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpolicegarantie(); + + $("#idPolice").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpolicegarantie() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantie/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpolicegarantie(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantie/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpolicegarantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficheMaxdateEffetPolicegarantieprestataire() +{ + idPolice = $("#idPolice").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idPolice="+idPolice+"&codeGarantie="+codeGarantie+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantieprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmpolicegarantieprestataire() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantieprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpolicegarantieprestataire(); + + $("#idPolice").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpolicegarantieprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantieprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpolicegarantieprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpolicegarantieprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpolicegarantieprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetPoliceprestataire() +{ + idPolice = $("#idPolice").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner un police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idPolice="+idPolice+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmpoliceprestataire() +{ + idPolice = $("#idPolice").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idPolice < " ") || (idPolice == "0")) + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idPolice='+idPolice+'&dateEffet='+dateEffet+'&tm='+tm+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmpoliceprestataire(); + + $("#idPolice").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmpoliceprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmpoliceprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmpoliceprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmpoliceprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function afficheMaxdateEffetClient() +{ + idClient = $("#idClient").val(); + + donnees = "idClient="+idClient; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteur/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclient() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteur/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclient(); + + $("#idClient").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclient() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteur/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclient(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteur/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclient(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetclientacte() +{ + idClient = $("#idClient").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + donnees = "idClient="+idClient+"&codeActe="+codeActe+'&codeGarantie='+codeGarantie;; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracte/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclientacte() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracte/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclientacte(); + + $("#idClient").val(''); + $("#codeGarantie").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclientacte() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclientacte(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracte/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclientacte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetClientacteprestataire() +{ + idClient = $("#idClient").val(); + codeActe = $("#codeActe").val(); + codePrestataire = $("#codePrestataire").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + $("#searchInputPrestataire").val(''); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idClient="+idClient+"&codeActe="+codeActe+"&codePrestataire="+codePrestataire+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracteprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclientacteprestataire() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeActe = $("#codeActe").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm+'&codeActe='+codeActe+"&codePrestataire="+codePrestataire+"&codeGarantie="+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracteprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclientacteprestataire(); + + $("#idClient").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclientacteprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracteprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclientacteprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteuracteprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclientacteprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//16-07-2023 +function afficheMaxdateEffetClientgarantie() +{ + idClient = $("#idClient").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + donnees = "idClient="+idClient+"&codeGarantie="+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantie/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclientgarantie() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantie/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclientgarantie(); + + $("#idClient").val(''); + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclientgarantie() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantie/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclientgarantie(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantie/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclientgarantie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficheMaxdateEffetClientgarantieprestataire() +{ + idClient = $("#idClient").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idClient="+idClient+"&codeGarantie="+codeGarantie+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantieprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclientgarantieprestataire() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + if(codeGarantie < " ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm+'&codeGarantie='+codeGarantie+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantieprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclientgarantieprestataire(); + + $("#idClient").val(''); + + $("#codeGarantie").val(''); + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclientgarantieprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantieprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclientgarantieprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurgarantieprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclientgarantieprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//////////////////////////////// +//////////////////////////////// +function afficheMaxdateEffetClientprestataire() +{ + idClient = $("#idClient").val(); + + codePrestataire = $("#codePrestataire").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + + donnees = "idClient="+idClient+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurprestataire/controle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_effet_max').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function inserer_tmclientprestataire() +{ + idClient = $("#idClient").val(); + dateEffet = $("#dateEffet").val(); + tm = $("#tm").val(); + codeGarantie = $("#codeGarantie").val(); + codePrestataire = $("#codePrestataire").val(); + + if((idClient < " ") || (idClient == "0")) + { + v_msg="Veuillez sélectionner un souscripteur!"; + v_msgEng="Please select a subscriber!"; + alert_ebene(v_msg, v_msgEng); + + $("#idClient").focus(); + + return; + + } + + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if((dateEffet < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffet").focus(); + + return; + + } + + if(tm < " ") + { + v_msg="Veuillez entrer la valeur du ticket Modérateur!"; + v_msgEng="Please enter the Moderator ticket value!"; + alert_ebene(v_msg, v_msgEng); + + $("#tm").focus(); + + return; + + } + + donnees = 'idClient='+idClient+'&dateEffet='+dateEffet+'&tm='+tm+"&codePrestataire="+codePrestataire; + + $("#div_liste_tm").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurprestataire/inserer/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + affichertmclientprestataire(); + + $("#idClient").val(''); + + $('.selectpicker').selectpicker('refresh'); + + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#dateEffet").val(''); + $("#tm").val(''); + + } + }); +} + +function affichertmclientprestataire() +{ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_liste_tm').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function supprimer_tmclientprestataire(idTm, adminSin) +{ + if (adminSin != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtmsouscripteurprestataire/supprimer/", + type : 'post', + data: "idTm="+idTm, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertmclientprestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +//17-07-2023 +function affichertarifapplique() +{ + idBeneficiaire = $("#idAssure").val(); + codePrestataire = $("#codePrestataire").val(); + codeActe = $("#codeActe").val(); + datePrestation = $("#datePrestation").val(); + + if((idBeneficiaire < " ") || (idBeneficiaire == "0")) + { + v_msg="Veuillez sélectionner un bénéficiaire!"; + v_msgEng="Please select a beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInput").focus(); + + return; + + } + + if(codePrestataire < " ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select an provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputPrestataire").focus(); + + return; + + } + + if(codeActe < " ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#searchInputActe").focus(); + + return; + + } + + if((datePrestation < " ")) + { + v_msg="Veuillez une date d'effet!"; + v_msgEng="Please an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#datePrestation").focus(); + + return; + + } + + + donnees = 'idBeneficiaire='+idBeneficiaire+'&datePrestation='+datePrestation; + donnees += '&codeActe='+codeActe+"&codePrestataire="+codePrestataire; + + $("#div_tarif_applique").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaffichertarifapplique/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_tarif_applique').html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function reinit_tarifapplique() +{ + $("#idAssure").val(''); + $("#searchInput").val(''); + $("#nomAssure").val(''); + $("#datePrestation").val(''); + $("#tm").val(''); + $("#codeLienParente").val(''); + $("#nomPolice").val(''); + $("#nomCollege").val(''); + $("#searchInputActe").val(''); + $("#codeActe").val(''); + $("#searchInputPrestataire").val(''); + $("#codePrestataire").val(''); + + $("#noAdherent").val(''); + $("#nomAdherent").val(''); + + $('#div_tarif_applique').html(''); +} + +function ajouter_un_acte_factureclassique(codeActe) +{ + var numeroFacture = $("#numeroFacture").val(); + var codePrestataire = $("#codePrestataire").val(); + + var tmFacture = $("#tmFacture").val(); + + + donnee_a_affciher = ""; + + donnees="" + + if(numeroFacture =="" || numeroFacture =="0" || numeroFacture == undefined){ + v_msg="Veuillez entrer le numéro de la facture!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroFacture").focus(); + + $("#searchInputActe").val(''); + $("#codeActe").val(''); + + return; + } + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeActe='+codeActe+'&codePrestataire='+codePrestataire+'&tmFacture='+tmFacture; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/ajouteractefactureclassique/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnee_a_affciher = data; + + $("#searchInputActe").val(''); + $("#div_selection_acte").hide(); + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + $("#codeMotifRejetPop").selectpicker(); + $("#codeMotifExclusionPop").selectpicker(); + } + }); +} + +//marc +function modifier_coursier_prestataire(id) +{ + //////// + donnees ='&id='+id; + + + $.ajax({ + url: $("#racineWeb").val()+"Modifiercoursierprestataire/modif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Modifiercoursierprestataire/"); + + } + }); +} + +function modification_coursier_prestataire() +{ + //////// + nom=$("#nom").val(); + codePrestataire=$("#codePrestataire").val(); + email=$("#email").val(); + actif=$("#actif").val(); + + prenoms=$("#prenoms").val(); + + telephone=$("#telephone").val(); + + numeroPiece=$("#numeroPiece").val(); + + codeNaturePiece=$("#codeNaturePiece").val(); + dateNaissance=$("#dateNaissance").val(); + sexe=$("#sexe").val(); + SocieteCoursier=$("#SocieteCoursier").val(); + + + + + if(nom<=" ") + { + v_msg="Veuillez entrer le nom du coursier!"; + v_msgEng="Please enter the name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez entrer le prenom du coursier!"; + v_msgEng="Please enter the first name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + + if(telephone<=" ") + { + v_msg="Veuillez entrer le téléphone du coursier!"; + v_msgEng="Please enter courier's phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + if(numeroPiece<=" ") + { + v_msg="Veuillez entrer le numero de piece du coursier!"; + v_msgEng="Please enter courier part number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroPiece").focus(); + return; + } + if(codeNaturePiece<=" ") + { + v_msg="Veuillez entrer le nature de piece du coursier!"; + v_msgEng="Please enter courier nature number!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNaturePiece").focus(); + return; + } + if(sexe<=" ") + { + v_msg="Veuillez entrer le genre du coursier!"; + v_msgEng="Please enter the gender of the courie!"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&nom='+nom+'&prenoms='+prenoms+'&telephone='+telephone+'&email='+email; + donnees +='&actif='+actif+'&dateNaissance='+dateNaissance+'&SocieteCoursier='+SocieteCoursier+'&numeroPiece='+numeroPiece; + donnees +='&codeNaturePiece='+codeNaturePiece+'&sexe='+sexe; + + + + v_msg="Confirmez-vous ces modifications?"; + v_msgEng="Do you confirm this updates?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Modifiercoursierprestataire/modifiercoursierprestataire", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Coursierprestataire/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_coursier_prestataire() +{ + + //////// + nom=$("#nom").val(); + codePrestataire=$("#codePrestataire").val(); + email=$("#email").val(); + codeLangue=$("#codeLangue").val(); + + prenoms=$("#prenoms").val(); + + telephone=$("#telephone").val(); + + numeroPiece=$("#numeroPiece").val(); + + codeNaturePiece=$("#codeNaturePiece").val(); + dateNaissance=$("#dateNaissance").val(); + sexe=$("#sexe").val(); + SocieteCoursier=$("#SocieteCoursier").val(); + + + + + if(nom<=" ") + { + v_msg="Veuillez entrer le nom du coursier!"; + v_msgEng="Please enter the name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez entrer le prenom du coursier!"; + v_msgEng="Please enter the first name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + + if(telephone<=" ") + { + v_msg="Veuillez entrer le téléphone du coursier!"; + v_msgEng="Please enter courier's phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + if(numeroPiece<=" ") + { + v_msg="Veuillez entrer le numero de piece du coursier!"; + v_msgEng="Please enter courier part number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroPiece").focus(); + return; + } + if(codeNaturePiece<=" ") + { + v_msg="Veuillez entrer le nature de piece du coursier!"; + v_msgEng="Please enter courier nature number!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNaturePiece").focus(); + return; + } + if(sexe<=" ") + { + v_msg="Veuillez entrer le genre du coursier!"; + v_msgEng="Please enter the gender of the courie!"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&nom='+nom+'&prenoms='+prenoms+'&telephone='+telephone+'&email='+email; + donnees +='&codeLangue='+codeLangue+'&dateNaissance='+dateNaissance+'&SocieteCoursier='+SocieteCoursier+'&numeroPiece='+numeroPiece; + donnees +='&codeNaturePiece='+codeNaturePiece+'&sexe='+sexe; + + + v_msg="Confirmez-vous la création d'un nouveau coursier pour ce prestataire?"; + v_msgEng="Do you confirm the creation of a new courier for this service provider?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Nouveaucoursierprestataire/creercoursierprestataire", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Coursierprestataire/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function coursier_prestataire() +{ + window.location.assign($("#racineWeb" ).val()+"Coursierprestataire/"); +} +function nouveau_coursier_prestataire() +{ + window.location.assign($("#racineWeb" ).val()+"Nouveaucoursierprestataire/"); +} +function nouveau_coursier_prestatairecpt() +{ + window.location.assign($("#racineWeb" ).val()+"Nouveaucoursierprestatairecpt/"); +} + +function creer_coursier_prestatairecpt() +{ + + //; + nom=$("#nom").val(); + codePrestataire=$("#codePrestataire").val(); + email=$("#email").val(); + codeLangue=$("#codeLangue").val(); + + prenoms=$("#prenoms").val(); + + telephone=$("#telephone").val(); + + numeroPiece=$("#numeroPiece").val(); + + codeNaturePiece=$("#codeNaturePiece").val(); + dateNaissance=$("#dateNaissance").val(); + sexe=$("#sexe").val(); + SocieteCoursier=$("#SocieteCoursier").val(); + + idReglement_temp=$("#idReglement_temp").val(); + + if(nom<=" ") + { + v_msg="Veuillez entrer le nom du coursier!"; + v_msgEng="Please enter the name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez entrer le prenom du coursier!"; + v_msgEng="Please enter the first name of the courier!"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + + if(telephone<=" ") + { + v_msg="Veuillez entrer le téléphone du coursier!"; + v_msgEng="Please enter courier's phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + if(numeroPiece<=" ") + { + v_msg="Veuillez entrer le numero de piece du coursier!"; + v_msgEng="Please enter courier part number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroPiece").focus(); + return; + } + if(codeNaturePiece<=" ") + { + v_msg="Veuillez entrer le nature de piece du coursier!"; + v_msgEng="Please enter courier nature number!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNaturePiece").focus(); + return; + } + if(sexe<=" ") + { + v_msg="Veuillez entrer le genre du coursier!"; + v_msgEng="Please enter the gender of the courie!"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + if(dateNaissance<=" ") + { + v_msg="Veuillez entrer la date de naissance!"; + v_msgEng="Please enter the birthday of the courie!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateNaissance").focus(); + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&nom='+nom+'&prenoms='+prenoms+'&telephone='+telephone+'&email='+email; + donnees +='&codeLangue='+codeLangue+'&dateNaissance='+dateNaissance+'&SocieteCoursier='+SocieteCoursier+'&numeroPiece='+numeroPiece; + donnees +='&codeNaturePiece='+codeNaturePiece+'&sexe='+sexe; + + + + v_msg="Confirmez-vous la création d'un nouveau coursier pour ce prestataire?"; + v_msgEng="Do you confirm the creation of a new courier for this service provider?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Nouveaucoursierprestatairecpt/creercoursierprestataire", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retirer_cheque_cpt_2(idReglement_temp); + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_cheque_cpt_2(idReglement) +{ + //////// + //idReglement = $("#idReglement").val(); + donnees = 'idReglement='+idReglement; + + $.ajax({ + url: $("#racineWeb").val()+"Retirerchequecpt/retrait/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Retirerchequecpt/"+idReglement+"/"); + + } + }); + +} + +function imprimer_cheque_paiement_decompte() +{ //marc + /*$('#div_export_b').html(""); + $("#btn_pop_imprimer_cheque_pdc").click(); + */ + idPaiementDecompte=$("#idPaiementDecompte").val(); + + donnees = "idPaiementDecompte="+idPaiementDecompte; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerchequepdc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_infos_cheque").html(data); + $("#div_infos_cheque").modal("show"); + $("#div_patienter").empty(); + + }, + complete: function() { + } + }); +} + +function modifierpaimentdecompte() +{ //marc + /*$('#div_export_b').html(""); + $("#btn_pop_imprimer_cheque_pdc").click(); + +*/ + // + idPaiementDecompte=$("#idPaiementDecompte").val(); + + donnees = "idPaiementDecompte="+idPaiementDecompte; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierpaiementdecomptes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + $("#div_modifier_paiement").html(data); + $("#div_modifier_paiement").modal("show"); + $("#div_patienter").empty(); + $("#codeBanquePayeur" ).selectpicker(); + + }, + complete: function() { + } + }); +} + +function modifier_detail_paiement_decompte(codePrestataire,key) +{ + //////// + + + ordrereglementprestataire=$(key).val(); + + donnees = 'codePrestataire='+codePrestataire+'&ordrereglementprestataire='+ordrereglementprestataire; + + + v_msg="Confirmez-vous cette modification?"; + v_msgEng="Do you confirm this update?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/modifierordrereglementprestatairecp/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + return; + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function imprimer_detail_cheque_paiement_decompte() +{ + donnees_retour = ""; + + var div_export = $('#div_export_c'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerchequepaiementdecompte/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function imprimercourierreglement() +{ + idReglement = $("#idReglement").val(); + + if (idReglement>"0") + { + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimercourierreglement/", + type: 'POST', + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } +} + +function imprimercourierreglementcpt() +{ + //////// + codePrestataire = $("#codePrestataire").val(); + datedebut = $("#datedebut").val(); + datefin = $("#datefin").val(); + codeTypePrestataire = $("#codeTypePrestataire").val(); + + + donnees = 'codePrestataire='+codePrestataire+'&datedebut='+datedebut+'&datefin='+datefin+'&codeTypePrestataire='+codeTypePrestataire; + + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimercourierreglementcpt/", + type: 'POST', + data: donnees, + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} +function selectionner_cheque_a_imprimer(idReglement,choix) +{ + //debugger + donnees = 'choix='+choix+'&idReglement='+idReglement; + if(choix=="0"){ + v_url = $("#racineWeb").val()+"Ajaximprimerchequepdc/deselectionner/"; + }else{ + v_url = $("#racineWeb").val()+"Ajaximprimerchequepdc/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + imprimer_cheque_paiement_decompte(); + } + }); +} +function selectionner_cheque_a_imprimer_tout(choix) +{ + //debugger + idPaiementDecompte=$("#idPaiementDecompte").val(); + + donnees = 'choix='+choix+'&idPaiementDecompte='+idPaiementDecompte; + + v_url = $("#racineWeb").val()+"Ajaximprimerchequepdc/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + imprimer_cheque_paiement_decompte(); + } + }); +} + +function majmotifdepassement(idMessage, ligne) +{ + libelle=$("#libelle"+ligne).val(); + + donnees = 'idMessage='+idMessage+'&libelle='+libelle; + + v_url = $("#racineWeb").val()+"Ajaxparamsysteme/enregistrer/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + + } + }); + +} + +function afficher_parammessages() +{ + window.location.assign($("#racineWeb" ).val()+"Parammessages/"); +} + +function supprimer_prestation_classique(idPrestation) +{ + + donnees = 'idPrestation='+idPrestation; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/supprimerprestation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnee_a_affciher = data; + + $("#searchInputActe").val(''); + $("#div_selection_acte").hide(); + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + } + }); + +} + +//16-08-2023 +function init_supprimer_data_face() +{ + window.location.assign($("#racineWeb" ).val()+"Supprimerface/"); +} + +function supprimer_data_face() +{ + faceRegistered_C=$("#faceRegistered_C" ).val(); + + if(faceRegistered_C<1) + { + v_msg="Pas de face enregistrée!"; + v_msgEng="No face registered!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + motif=$("#motif").val(); + + if (motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + v_msg="Confirmez-vous la suppression de la face?"; + v_msgEng="Do you confirm the deletion of the face?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'motif='+motif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsupprimerface/supprimerface/", + type : 'post', + data: donnees, + success: function(data) { + v_msg="Face ré-initialisée avec succès!"; + v_msgEng="Face re-initialized successfully!"; + alert_ebene(v_msg, v_msgEng); + + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Supprimerface/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function re_init_photo_face() +{ + var photo = document.getElementById('photo_face'); + photo.setAttribute('src', ""); + $('#message_face').html(""); + $('#image_face').val(""); + $("#div_wait_face_ebene").html(''); +} + +function ebene_init_photo_face() // OK +{ + faceRegistered = $("#faceRegistered").val(); + if(faceRegistered=="1") + { + v_msg="Cette personne a déjà une face dans le système!"; + v_msgEng="This person already has a face in the system!"; + alert_ebene(v_msg, v_msgEng); + $('#message_face').html(""); + return; + } + re_init_photo_face(); + $("#btn_pop_save_face").click(); +} + + +function ebene_init_confirm_photo_face() // OK +{ + faceRegistered = $("#faceRegistered").val(); + + if(faceRegistered!="1") + { + v_msg="Cettte personne n'a pas encore de face dans le système!"; + v_msgEng="This person doesn't have a face in the system yet!"; + alert_ebene(v_msg, v_msgEng); + $('#message_face').html(""); + return; + } + + re_init_photo_face(); + $("#btn_pop_save_face").click(); + +} + +function ebene_enregistrer_photo_face() // OK +{ + $("#ebene_confirmer_photo_face").disable(); + $("#ebene_supprimer_photo_face").disable(); + $("#ebene_take_photo_face").disable(); + $("#motif").disable(); + + $("ebene_confirmer_photo_face").prop('disabled', true); + $("ebene_supprimer_photo_face").prop('disabled', true); + $("ebene_take_photo_face").prop('disabled', true); + $("motif").prop('disabled', true); + + $('#message_face').html(""); + $("#div_wait_face_ebene").html(''); + + $("#okId").val("-1"); + $("#okId_face").val("-1"); + + $("#del_face").val("0"); + image_face = $("#image_face").val(); + if(image_face<=" ") + { + v_msg="Veuillez prendre une photo!"; + v_msgEng="Please take a photo!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + $("#div_wait_face_ebene").html('
' + '
'); + + compare_face = $("#compare_face").val(); + + var dataURL = canvas.toDataURL("image/jpeg"); + + $.ajax({ + url: $("#racineWeb").val()+"Prestations/ebeneenregistrerface/", + type: 'POST', + data: {'image_face' : dataURL, 'compare_face' : compare_face , 'del_face' : "0"}, + success: function(data) { + $("#ebene_take_photo_face").enable(); + $("#div_wait_face_ebene").html(''); + $("#message_face").html(data); + photo_succes = $("#photo_succes").val(); + if(photo_succes=="1") + { + v_msg="Enrôlement effectué avec succès!"; + v_msgEng="Enrollment completed successfully!"; + // alert_ebene(v_msg, v_msgEng); + setTimeout(() => { + // prestations(); + afficher_beneficiaire_id(); + }, 2000) + } + }, + error: function(data) { + }, + complete: function(data) { + $("#div_wait_face_ebene").html(''); + } + }); +} + +function ebene_confirmer_photo_face() // OK +{ + $("#ebene_confirmer_photo_face").disable(); + $("#ebene_supprimer_photo_face").disable(); + $("#ebene_take_photo_face").disable(); + $("#motif").disable(); + + $("ebene_confirmer_photo_face").prop('disabled', true); + $("ebene_supprimer_photo_face").prop('disabled', true); + $("ebene_take_photo_face").prop('disabled', true); + $("motif").prop('disabled', true); + + $('#message_face').html(""); + $("#div_wait_face_ebene").html(''); + + $("#del_face").val("0"); + faceRegistered = $("#faceRegistered").val(); + if(faceRegistered!="1") + { + v_msg="Cette personne n'a pas encore de photo dans le système!"; + v_msgEng="This person does not have a photo in the system yet!"; + alert_ebene(v_msg, v_msgEng); + $('#message_face').html(""); + return; + } + + image_face = $("#image_face").val(); + if(image_face<=" ") + { + v_msg="Veuillez prendre une photo!"; + v_msgEng="Please take a photo!"; + alert_ebene(v_msg, v_msgEng); + $('#message_face').html(""); + return; + } + + $("#div_wait_face_ebene").html('
' + '
'); + + compare_face = $("#compare_face").val(); + + var dataURL = canvas.toDataURL("image/jpeg"); + + $.ajax({ + url: $("#racineWeb").val()+"Prestations/ebeneenregistrerface/", + type: 'POST', + data: {'image_face' : dataURL, 'compare_face' : compare_face , 'del_face' : "0"}, + success: function(data) { + $("#ebene_take_photo_face").enable(); + $("#div_wait_face_ebene").html(''); + $("#message_face").html(data); + photo_succes = $("#photo_succes").val(); + if(photo_succes=="1") + { + $("#okId_face").val("1"); + v_msg="Face confirmée!"; + v_msgEng="Face confirmed!"; + // alert_ebene(v_msg, v_msgEng); + setTimeout(() => { + // prestations(); + afficher_beneficiaire_id(); + }, 2000) + } + else + { + $("#okId").val("-1"); + $("#okId_face").val("-1"); + } + }, + error: function(data) { + }, + complete: function(data) { + $("#div_wait_face_ebene").html(''); + } + }); +} + +function ebene_supprimer_photo_face() // OK +{ + $('#message_face').html(""); + $("#div_wait_face_ebene").html(''); + + motif=$("#motif").val(); + motif= motif.trim(); + $("#motif").val(motif); + + if (motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + $("#del_face").val("1"); + + faceRegistered = $("#faceRegistered").val(); + if(faceRegistered!="1") + { + v_msg="Cette personne n'a pas encore de photo dans le système!"; + v_msgEng="This person does not have a photo in the system yet!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + image_face = $("#image_face").val(); + if(image_face<=" ") + { + v_msg="Veuillez prendre une photo!"; + v_msgEng="Please take a photo!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#ebene_confirmer_photo_face").disable(); + $("#ebene_supprimer_photo_face").disable(); + $("#ebene_take_photo_face").disable(); + $("#motif").disable(); + + $("ebene_confirmer_photo_face").prop('disabled', true); + $("ebene_supprimer_photo_face").prop('disabled', true); + $("ebene_take_photo_face").prop('disabled', true); + $("motif").prop('disabled', true); + + $("#div_wait_face_ebene").html('
' + '
'); + + compare_face = $("#compare_face").val(); + + var dataURL = canvas.toDataURL("image/jpeg"); + + $.ajax({ + url: $("#racineWeb").val()+"Prestations/ebeneenregistrerface/", + type: 'POST', + data: {'image_face' : dataURL, 'compare_face' : compare_face, 'del_face' : "1", 'motif' : motif}, + success: function(data) { + $("#ebene_take_photo_face").enable(); + $("#div_wait_face_ebene").html(''); + $("#message_face").html(data); + photo_succes = $("#photo_succes").val(); + if(photo_succes=="1") + { + $("#okId").val("-1"); + $("#okId_face").val("-1"); + + document.getElementById('photo_face').setAttribute('src', ""); + + $("#faceRegistered").val("0"); + + $("#ebene_confirmer_photo_face").disable(); + $("#ebene_supprimer_photo_face").disable(); + $("#motif").disable(); + + $("ebene_confirmer_photo_face").prop('disabled', true); + $("ebene_supprimer_photo_face").prop('disabled', true); + $("motif").prop('disabled', true); + + v_msg="Face supprimée avec succès!"; + v_msgEng="Face removed successfully!"; + // alert_ebene(v_msg, v_msgEng); + setTimeout(() => { + // prestations(); + afficher_beneficiaire_id(); + }, 2000) + } + }, + error: function(data) { + }, + complete: function(data) { + $("#div_wait_face_ebene").html(''); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function histsupprface() +{ + $("#div_detail_suppr_face").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail_suppr_face").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprface/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_suppr_face").html(data); + }, + complete: function() { + } + }); +} + +function histsupprface_export() +{ + $("#div_detail_suppr_face").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + donnees_retour = ""; + + $("#div_detail_suppr_face").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprfaceexport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_suppr_face").html(donnees_retour); + } + }); +} + +function histo_enrollement_face() +{ + $("#div_detail_suppr_face").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + donnees_retour = ""; + + $("#div_detail_suppr_face").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprfaceexport/historiqueenrollement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_suppr_face").html(donnees_retour); + } + }); +} + +function afficher_liste_log_reconnaissance_faciale() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogreconnaissancefaciale/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_log_reconnaissance_faciale() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogreconnaissancefaciale/exporterlogreconnaissancefaciale/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function afficher_liste_log_register_face() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogregisterface/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_log_register_face() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogregisterface/getlogreregisterfaceexport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function afficher_liste_log_remove_face() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogremoveface/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_log_remove_face() +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogremoveface/getlogreremovefaceexport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_logconnexion(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_logconnexion(); + } +} + +function afficher_liste_logconnexion() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogconnexion/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_logconnexion() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogconnexion/exporterlogconnexion/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +// Récupère les coordonnées géographiques à partir de l'adresse IP entrée en paramètre +// et l'affiche sur une carte google Map +function trouve_coordonnees_geo_ip(ip) +{ + donnees='ipConnexion='+ip; + + $.ajax({ + url: "Ajaxlogconnexion/getcoordonneesgeoip/", + type : 'post', + data: donnees, + error: function(errorData){ + }, + + success: function(data) { + if(data !='false') + { + var str = data.split('/'), + lat = str[0], // Latitude de l'adresse IP retourné + lon = str[1], // Longitude de l'adresse IP retourné + out = "&output=embed" + src="https://maps.google.com/maps?q="+lat+","+lon+out; // Source de l'iframe + + $('#map').attr("src", src); + $('#div_contenu_map').modal("show"); // Affiche en modal = carte google + + $('#div_contenu_map').on('hidden.bs.modal', function(){ + $('#map').html("").attr("src", ""); // Réinitialise la source de l'iframe à la fermeture du modal + }); + } + else + { + v_msg="Impossible de trouver les coordonnées géographiques de l'adresse IP: "+ip; + v_msgEng="Unable to find the geographic coordinates of the IP address: "+ip; + alert_ebene(v_msg, v_msgEng); + + } + }, + complete: function() { + + } + }); +} +function lister_encaissements_client() +{ + numeroClient = $("#numeroClient_C" ).val(); + idClient = $("#idClient_C").val(); + + if (idClient>"0") + { + window.location.assign($("#racineWeb").val()+"Listerencaissementclient/"); + } + else + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer!"; + alert_ebene(v_msg, v_msgEng); + } +} + +function changer_mode_paiement_liste_encaissements_client() +{ + codeModePaiement=$("#codeModePaiement").val(); + valide=$("#valide").val(); + + donnees = 'codeModePaiement='+codeModePaiement+'&valide='+valide; + + var div_attente = $('#div_liste'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterencaissementclient/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function lister_encaissements_attente() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + var div_attente = $('#div_liste'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsulterencaisementsattente/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function exporter_encaissements_attente() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsulterencaisementsattente/exporterencaisementsattente/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function exporter_paiement_decompte() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail_paiement_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterpaiementdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + }, + complete: function() { + } + }); +} + +function exporter_decompte_non_payes() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + + $("#div_detail_paiement_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterpaiementdecompte/impayes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_logpagesvisit(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_logpagesvisit(); + } +} + +function afficher_liste_logpagesvisit() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + vue = $("#vue").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin+'&vue='+vue; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogpagesvisit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_logpagesvisit() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + vue = $("#vue").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin+'&vue='+vue; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogpagesvisit/exporterlogpagesvisit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function afficher_liste_logpagesvisit_detail(login, ipConnexion, codeApplication, application, vue) +{ + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin+'&vue='+vue+'&codeApplication='+codeApplication+'&application='+application; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlogpagesvisit/detail/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_ipbann(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_ipbann(); + } +} + + + +function afficher_liste_ipbann() +{ + // login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + // donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + donnees = 'ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_ipbann() +{ + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/exporteripbann/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function historique_reactivation_login(login) +{ + donnees = 'login='+login; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/hsitoriquereactivationlogin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + + +function init_reactiver_login(login, idLigne) +{ + donnees = 'login='+login+'&idLigne='+idLigne; + + $("#btn_pop_motif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/initreactiverlogin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop_motif").html(data); + + $("#motif").focus(); + }, + complete: function() { + } + }); +} + +function reactiver_login() +{ + login=$("#loginArecativer").val(); + idLigne=$("#idLigne").val(); + motif=$("#motif").val(); + + + if (motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + donnees = 'login='+login+'&idLigne='+idLigne+'&motif='+motif; + + idbouton = '#bouton'+idLigne; + idcase = '#case_'+idLigne; + + v_msg="Confirmez-vous ces informations?"; + v_msgEng="Do you confirm this information?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/reactiverlogin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + $("#div_test_gabarit").html(data); + + }, + complete: function() { + $(idbouton).remove(); + $(idcase).prop('checked', true); + $("#btn_close_pop_motif").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function init_reactiver_ip(ipConnexion, idLigne) +{ + donnees = 'ipConnexion='+ipConnexion+'&idLigne='+idLigne; + + $("#btn_pop_motif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/initreactiverip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop_motif").html(data); + }, + complete: function() { + } + }); +} + +function reactiver_ip() +{ + ipConnexion=$("#ipArecativer").val(); + idLigne=$("#idLigne").val(); + motif=$("#motif").val(); + + + if (motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + donnees = 'ipConnexion='+ipConnexion+'&idLigne='+idLigne+'&motif='+motif; + + idbouton = '#bouton'+idLigne; + idcase = '#case_'+idLigne; + + v_msg="Confirmez-vous ces informations?"; + v_msgEng="Do you confirm this information?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/reactiverip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + // $("#div_test_gabarit").html(data); + + }, + complete: function() { + $(idbouton).remove(); + $(idcase).prop('checked', true); + $("#btn_close_pop_motif").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function historique_reactivation_ip(ipConnexion) +{ + donnees = 'ipConnexion='+ipConnexion; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/hsitoriquereactivationip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + + +function historique_bannissement_ip(ipConnexion) +{ + donnees = 'ipConnexion='+ipConnexion; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxipbann/hsitoriquebannissementip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + + +function ctrlkeypress_liste_loginbann(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_loginbann(); + } +} + + + +function afficher_liste_loginbann() +{ + login = $("#login").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_loginbann() +{ + login = $("#login").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/exporterloginbann/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function historique_bannissement_login(login) +{ + donnees = 'login='+login; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxloginbann/hsitoriquebannissementlogin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_histobannissement(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_histobannissement(); + } +} + +function afficher_liste_histobannissement() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistobannissement/", + + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_histobannissement() +{ + login = $("#login").val(); + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistobannissement/exporterhistobannissement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_reactivationip(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_reactivationip(); + } +} + +function afficher_liste_reactivationip() +{ + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreactivationip/", + + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_reactivationip() +{ + ipConnexion = $("#ipConnexion").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'ipConnexion='+ipConnexion+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreactivationip/exporterreactivationip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_liste_reactivationlogin(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_reactivationlogin(); + } +} + +function afficher_liste_reactivationlogin() +{ + login = $("#login").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&debut='+debut+'&fin='+fin; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreactivationlogin/", + + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function exporter_liste_reactivationlogin() +{ + login = $("#login").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'login='+login+'&debut='+debut+'&fin='+fin; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreactivationlogin/exporterreactivationlogin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function ajax_saisir_pass_new_user() +{ + codeModeGenerationPass = $("#codeModeGenerationPass").val(); + + donnees = 'codeModeGenerationPass='+codeModeGenerationPass; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsaisirpassnewuser/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_passwd").html(data); + }, + error: function(data) { + }, + complete: function() + { + if(codeModeGenerationPass=="0") + { + $("#nvmdp").focus(); + } + else + { + $("#btn_enreg").focus(); + } + } + }); +} + +function verifMailValeur(v_mail) +{ + if (v_mail.length==0) + { + return true; + } + else + { + var regex = /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/; + if(!regex.test(v_mail)) + { + return false; + } + else + { + return true; + } + } +} + +// retour_a_usersassureur() +function reinitpaswd_assureur_2(codeUtilisateur) +{ + v_msg="Confirmez-vous la réinitialisation?"; + v_msgEng="Do you confirm the reset?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/reinitpaswd/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + // retour_a_usersassureur(); + afficher_liste_users_ass(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function motdepasse_oublie(){ + + login = $("#login").val(); + console.log("login: ",login) + if(login<=" ") + { + v_msg="Veuillez indiquer le login!"; + v_msgEng="Please enter the login!"; + alert_ebene(v_msg, v_msgEng); + + $("#login").focus(); + return; + } + + + + donnees = 'login='+login; + + $("#div_msgErreur").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/motpassoublie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_msgErreur').html(data); + }, + complete: function() + { + + } + }); + +} + + +function creer_centre_gestion() +{ + + codeSociete = $("#codeSociete").val(); + + if(codeSociete<=" ") + { + v_msg="Veuillez indiquer le code du centre de gestion!"; + v_msgEng="Please indicate the management center code!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSociete").focus(); + return; + } + + nomCentreGestion = $("#nomCentreGestion").val(); + + if(nomCentreGestion<=" ") + { + v_msg="Veuillez indiquer le nom du centre de gestion!"; + v_msgEng="Please indicate the management center name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomCentreGestion").focus(); + return; + } + + donnees = 'codeSociete='+codeSociete+'&nomCentreGestion='+nomCentreGestion; + + + adresseGeoSociete = $("#adresseGeoSociete").val(); + adressePostSociete = $("#adressePostSociete").val(); + codePays = $("#codePays").val(); + ville = $("#ville").val(); + + telephoneSociete = $("#telephoneSociete").val(); + faxSociete = $("#faxSociete").val(); + + portable = $("#portable").val(); + nomResponsable = $("#nomResponsable").val(); + sigleSociete = $("#sigleSociete").val(); + + + donnees += '&adresseGeoSociete='+adresseGeoSociete+'&adressePostSociete='+adressePostSociete; + donnees += '&codePays='+codePays+'&ville='+ville+'&telephoneSociete='+telephoneSociete; + donnees += '&faxSociete='+faxSociete+'&portable='+portable+'&nomResponsable='+nomResponsable; + donnees += '&sigleSociete='+sigleSociete; + + + emailSociete = $("#emailSociete").val(); + emailMedecinConseil = $("#emailMedecinConseil").val(); + emailGestionBon = $("#emailGestionBon").val(); + + emailCcomptabilite = $("#emailCcomptabilite").val(); + emailDerogation = $("#emailDerogation").val(); + emailAccordPrealable = $("#emailAccordPrealable").val(); + + emailFraudeFinger = $("#emailFraudeFinger").val(); + email_standard = $("#email_standard").val(); + email_reply = $("#email_reply").val(); + emailSociete = emailSociete.trim(); + + if (emailSociete<=" ") + { + v_msg="Veuillez indiques les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailSociete").focus(); + return; + } + + mauvais_mailSociete=false; + email_errSociete = ""; + + mauvais_mailMedecinConseil=false; + email_errMedecinConseil = ""; + + mauvais_mailGestionBon=false; + email_errGestionBon = ""; + + mauvais_mailCcomptabilite=false; + email_errCcomptabilite = ""; + + mauvais_mailDerogation=false; + email_errDerogation = ""; + + mauvais_mailAccordPrealable=false; + email_errAccordPrealable = ""; + + mauvais_mailFraudeFinger=false; + email_errFraudeFinger = ""; + + mauvais_mail_standard=false; + email_err_standard = ""; + + mauvais_mail_reply=false; + email_err_reply = ""; + + var addrSociete = emailSociete.split(";"), + addrMedecinConseil = emailMedecinConseil.split(";"), + addrGestionBon = emailGestionBon.split(";"), + addrCcomptabilite = emailCcomptabilite.split(";"), + addrDerogation = emailDerogation.split(";"), + addrAccordPrealable = emailAccordPrealable.split(";"), + addrFraudeFinger = emailFraudeFinger.split(";"), + addr_standard = email_standard.split(";"), + addr_reply = email_reply.split(";"); + + + addrSociete.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errSociete = element; + mauvais_mailSociete = true; + // break; + return; + } + }); + + if(mauvais_mailSociete==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errSociete; + v_msgEng="Please review this address : "+email_errSociete; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(emailMedecinConseil.length > 0){ + addrMedecinConseil.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errMedecinConseil = element; + mauvais_mailMedecinConseil = true; + // break; + return; + } + }); + + if(mauvais_mailMedecinConseil==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errMedecinConseil; + v_msgEng="Please review this address : "+email_errMedecinConseil; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + + if(emailGestionBon.length > 0){ + addrGestionBon.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errGestionBon = element; + mauvais_mailGestionBon = true; + // break; + return; + } + }); + + if(mauvais_mailGestionBon==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errGestionBon; + v_msgEng="Please review this address : "+email_errGestionBon; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(emailCcomptabilite.length > 0){ + addrCcomptabilite.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errCcomptabilite = element; + mauvais_mailCcomptabilite = true; + // break; + return; + } + }); + + if(mauvais_mailCcomptabilite==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errCcomptabilite; + v_msgEng="Please review this address : "+email_errCcomptabilite; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(emailDerogation.length > 0){ + addrDerogation.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errDerogation = element; + mauvais_mailDerogation = true; + // break; + return; + } + }); + + if(mauvais_mailDerogation==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errDerogation; + v_msgEng="Please review this address : "+email_errDerogation; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(emailAccordPrealable.length > 0){ + addrAccordPrealable.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errAccordPrealable = element; + mauvais_mailAccordPrealable = true; + // break; + return; + } + }); + + if(mauvais_mailAccordPrealable==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errAccordPrealable; + v_msgEng="Please review this address : "+email_errAccordPrealable; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(emailFraudeFinger.length > 0){ + addrFraudeFinger.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_errFraudeFinger = element; + mauvais_mailFraudeFinger = true; + // break; + return; + } + }); + + if(mauvais_mailFraudeFinger==true) + { + v_msg="Veuillez revoir cette adresse : "+email_errFraudeFinger; + v_msgEng="Please review this address : "+email_errFraudeFinger; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(email_standard.length > 0){ + addr_standard.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err_standard = element; + mauvais_mail_standard = true; + // break; + return; + } + }); + + if(mauvais_mailMedecinConseil==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err_standard; + v_msgEng="Please review this address : "+email_err_standard; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(email_reply.length > 0){ + addr_reply.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err_reply = element; + mauvais_mail_reply = true; + // break; + return; + } + }); + + if(mauvais_mail_reply==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err_reply; + v_msgEng="Please review this address : "+email_err_reply; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + smsMedecinConseil = $("#smsMedecinConseil").val(); + + donnees += '&emailMedecinConseil='+emailMedecinConseil+'&emailGestionBon='+emailGestionBon; + donnees += '&emailCcomptabilite='+emailCcomptabilite+'&emailDerogation='+emailDerogation+'&emailAccordPrealable='+emailAccordPrealable; + donnees += '&emailFraudeFinger='+emailFraudeFinger+'&email_standard='+email_standard+'&smsMedecinConseil='+smsMedecinConseil+'&email_reply='+email_reply; + donnees += '&emailSociete='+emailSociete; + + smsGestionBon = $("#smsGestionBon").val(); + smsDerogation = $("#smsDerogation").val(); + smsAccordPrealable = $("#smsAccordPrealable").val(); + + donnees += '&smsGestionBon='+smsGestionBon; + donnees += '&smsDerogation='+smsDerogation; + donnees += '&smsAccordPrealable='+smsAccordPrealable; + + fraisCarteAN = $("#fraisCarteAN").val(); + spMax = $("#spMax").val(); + + donnees +='&fraisCarteAN='+fraisCarteAN; + donnees += '&spMax='+spMax; + + + codeLangueSociete = $("#codeLangueUser").val(); + + if(codeLangueSociete<=" ") + { + v_msg="Veuillez sélectionner une langue"; + v_msgEng="Please select a language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + codePrefixePolice = $("#codePrefixePolice").val(); + codeTypeSociete = $("#codeTypeSociete").val(); + + donnees += '&codeLangueSociete='+codeLangueSociete+'&codePrefixePolice='+codePrefixePolice; + donnees += '&codeTypeSociete='+codeTypeSociete; + + + indicatifTelephone = $("#codePrefixePolice").val(); + donnees += '&indicatifTelephone='+indicatifTelephone; + + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcreercentregestion/creersocieteuser/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_parametresgeneraux(); + } + }); +} + + +function liste_villes() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistevilles/", + type : 'post', + data: "codePays="+$("#codePays").val(), + error: function(errorData) { + }, + success: function(data) { + $("#div_ville").html(data); + $("#ville" ).selectpicker(); + + } + }); +} + +function recherchecodesociete() +{ + var codeSociete = $("#codeSociete").val(); + + var nbSpace = parseInt(codeSociete.split(" ").length - 1); + + + //alert(nbSpace); + + if(nbSpace > 0){ + codeSociete = codeSociete.replace(/ /g,""); + + $("#codeSociete").val(codeSociete); + } + + /* + var reg = new RegExp('[a-z](\S)'); + //var reg = new RegExp('([a-z])\S+'); + + + alert(reg.test(codeSociete)); + + return; + + if(reg.test(codeSociete)==false) + { + + v_msg="Code est invalide! Eviter d'utiliser caractères spéciaux."; + v_msgEng="Invalid product code! Avoid putting spaces."; + alert_ebene(v_msg, v_msgEng); + + $("#codeSociete").val(""); + + $("#codeSociete").focus(); + + return(false); + } + + */ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcreercentregestion/rechercher", + type : 'post', + data: 'codeSociete='+codeSociete, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + donnee_a_affciher = data; + }, + complete: function() { + //alert(donnee_a_affciher); + if(donnee_a_affciher=="true") + { + v_msg="Ce code existe déjà! Veuillez le remplacer."; + v_msgEng="This code already exists! Please replace it."; + alert_ebene(v_msg, v_msgEng); + + $("#codeSociete").val(""); + $("#codeSociete").focus(); + } + } + }); + +} + +function filtreproduitreseau(){ + + + var codeGcAssureur = $('#codeGcAssureur').val(); + + if(codeGcAssureur<=" "){ + $('#div_produitreseau').html(""); + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreproduitreseau/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_produit').html(data); + + $("#codeProduit").selectpicker(); + }, + complete: function() { + + } + }); + +} + +function filtrefamilleactetype() +{ + + + donnees = "codeTypePrestation="+$("#codeTypePrestation").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrefamilleactetype/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + //$('#div_test_gabarit').html(data); + $("#div_listefamille").html(data); + $("#codeFamilleActe").selectpicker(); + } + }); +} + +function selection_garantie() +{ + + + donnees = "codeFamilleActe="+$("#codeFamilleActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrefamilleactetype/garantie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + //$('#div_test_gabarit').html(data); + //alert(data); + + $("#div_garantie").html(data); + } + }); + +} + + +function valider_tarif_lettrecle() +{ + codeTarifActe=$("#codeTarifActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + + donnees = 'codeTarifActe='+codeTarifActe; + + v_msg="Validez-vous cette composition de tarif?"; + v_msgEng="Do you validate this price composition?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/validertarif/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + ajax_cout_lettrecle_tarif('1'); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_une_expression_complexite_pass(idExpression, actif) +{ + donnees = 'idExpression='+idExpression+'&actif='+actif; + + $.ajax({ + url: $("#racineWeb").val()+"Paramreinitmotpass/majcomplexitepassword/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complexite_pass").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + + +//25-09-2023 +function maj_composante_effettarif_lettrecle(idDetail, dateEffet, maxDateEffetActe, ligne){ + + var datejour = $("#datejour_C").val(); + + var str = dateEffet.split('/'); + + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + var tdj = new Date(datejour); + var tde = new Date(effet); + + donnees = "idDetail="+idDetail+"&dateEffet="+dateEffet; + + v_msg="Confirmez-vous cette date d'effet?"; + v_msgEng="Do you confirm this effective date?"; + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + //alert(donnees); + //return; + + if((dte < dtj) && (maxDateEffetActe!="")){ + var tdm = new Date(maxDateEffetActe); + + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + return; + }else{ + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/majeffet/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + } + }); + + } + }else{ + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/majeffet/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#dateEffet"+ligne).val(''); + $("#dateEffet"+ligne).focus(); + } + }); + + } +} + +function maj_composante_tarif_lettrecle(idDetail, prix, ligne) +{ + dateEffet = $("#dateEffet"+ligne).val(); + + if(dateEffet<=" "){ + v_msg="la date d'effet est obligatoire!"; + v_msgEng="The effective date is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#prix"+ligne).val(0); + + $("#dateEffet"+ligne).focus(); + return; + } + + + + donnees = 'idDetail='+idDetail+"&prix="+prix; + + v_msg="Confirmez-vous cet prix?"; + v_msgEng="Do you confirm this price?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/majprix/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#prix"+ligne).val(0); + $("#prix"+ligne).focus(); + } + }); + +} + +function maj_composante_tarifnuit_lettrecle(idDetail, prixNuitFerier, ligne) +{ + + dateEffet = $("#dateEffet"+ligne).val(); + + if(dateEffet<=" "){ + v_msg="La date d'effet est obligatoire!"; + v_msgEng="The effective date is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixNuitFerier"+ligne).val(0); + + $("#dateEffet"+ligne).focus(); + return; + } + + donnees = 'idDetail='+idDetail+"&prixNuitFerier="+prixNuitFerier; + + v_msg="Confirmez-vous cet prix?"; + v_msgEng="Do you confirm this price?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/majprixnuitferier/", + type: 'POST', + data: donnees, + success: function(data) + { + //actualiserActesTarifes(); + }, + complete: function(data) + { + } + }); + } else { + // L'utilisateur a annulé + $("#prixNuitFerier"+ligne).val(0); + $("#prixNuitFerier"+ligne).focus(); + } + }); + +} + +function supprimer_une_lettrecle_du_tarif(idDetail, ligne) +{ + donnees = 'idDetail='+idDetail; + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this removal?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcoutlettrecletarif/supprimer/", + type: 'POST', + data: donnees, + success: function(data) + { + supprdetailtariflettrecle(idDetail, ligne); + }, + error: function(data) { + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprdetailtariflettrecle(idDetail, ligne) +{ + donnees = 'idDetail='+idDetail+'&ligne='+ligne; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailsupprimelettrecle/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_suppr').html(data); + var suppr = $("#suppr").val(); + + if(suppr=="1"){ + $("#tabLigne"+ligne).css({"background-color": "red", "color": "white"}); + }else{ + $("#tabLigne"+ligne).css({"background-color": "transparent", "color": "black"}); + } + + }, + error: function(data) { + }, + complete: function() { + //ajax_composante_tarif("0"); + } + }); + +} + +function lignemedicament() +{ + var codeTypePrestataire = $('#codeTypePrestataire').val(); + + if(codeTypePrestataire=="PHA"){ + $("#ligne_pharmacie").show(); + $("#appliquerTarifNuit").attr('disabled', 'disabled'); + }else{ + $("#ligne_pharmacie").hide(); + $("#appliquerTarifNuit").removeAttr('disabled'); + } +} + +function init_bareme() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondfamilleproduit/initbareme/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function bareme_college_temp() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + if(idBaremePriseEnCharge<=" " || idBaremePriseEnCharge==undefined) + { + v_msg="Veuillez sélectionner le barème initial!"; + v_msgEng="Please select the initial scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#idBaremePriseEnCharge").focus(); + + return; + } + + + window.location.assign($("#racineWeb" ).val()+"Detailbaremecollegetemp/"+idBaremePriseEnCharge+"/"); +} + +function detail_baremecollege(idBaremePriseEnCharge) +{ + window.location.assign($("#racineWeb" ).val()+"Detailbaremecollege/"+idBaremePriseEnCharge+"/"); + + //window.location.assign($("#racineWeb" ).val()+"Detailbaremecollegetemp/"+idBaremePriseEnCharge+"/"); +} + + + +function afficherDetailBaremeCollege() +{ + masquerBareme = $("#masquerBareme").val(); + + if(masquerBareme == undefined){ + masquerBareme = "1"; + } + + //alert(masquerGarantie); + + if(masquerBareme=="1"){ + $('#div_bareme').hide(); + $("#masquerBareme").val("0"); + $("#span_bareme").text("[+]"); + + }else{ + $('#div_bareme').show(); + $("#masquerBareme").val("1"); + //$("#dateEffetGarantie").focus(); + $("#span_bareme").text("[-]"); + + init_saisie_detailbareme(); + actualiser_detailbareme_college(); + } + + afficheNombreLigneBaremeCollege('detailbareme'); +} + +function afficheNombreLigneBaremeCollege(table) +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnbrelignebaremecollege/"+table+"/", + type : 'post', + data: "table="+table, + error: function(errorData) { + }, + success: function(data) { + if(table=="garantiesbaremepriseencharge"){ + $("#garantiesbaremepriseencharge").html(data); + }else if(table=="garantiesbaremepriseenchargelienparente"){ + $("#garantiesbaremepriseenchargelienparente").html(data); + }else if(table=="actesbaremepriseencharge"){ + $("#actesbaremepriseencharge").html(data); + }else if(table=="actesbaremepriseenchargelienparente"){ + $("#actesbaremepriseenchargelienparente").html(data); + }else if(table=="detailbareme"){ + $("#detailbareme").html(data); + } + }, + complete: function() { + + } + }); +} + +function actualiser_detailbareme_college() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + + +// inserer_bareme() +function inserer_bareme_college() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + dateEffetBareme = $("#dateEffetBareme").val(); + ticketModerateurBareme = $("#ticketModerateurBareme").val(); + //actif = $("#actif").val(); + + if(dateEffetBareme <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetBareme").focus(); + return; + + } + + if(ticketModerateurBareme <= " "){ + + v_msg="Veuillez entrer un ticket modérateur!"; + v_msgEng="Please enter a co-payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#ticketModerateurBareme").focus(); + return; + + } + + $("#div_bareme").html('
' + '
'); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetBareme='+dateEffetBareme; + donnees += '&ticketModerateurBareme='+ticketModerateurBareme; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollege/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + init_saisie_detailbareme(); + actualiser_detailbareme_college(); + }, + complete: function() { + afficheNombreLigneBaremeCollege('detailbareme'); + $("#masquerBareme").val("0"); + afficherDetailBaremeCollege(); + } + }); +} + + +function afficher_actes_garantiebareme_college(idBaremePriseEnCharge, codeGarantie){ + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $("#div_patienter").html(''); + + $("#div_patienter").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebaremecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + + $('#div_actesgarantiebareme').html(data); + $('#div_actesgarantiebareme').modal("show"); + + appliquerDataTableBareme(); + + $('#div_actesgarantiebareme').on('shown.bs.modal', function(){ + stylechampsRequis(); + }); + + afficherMasquerGarantiesBaremeCollege(); + afficherMasquerGarantiesBaremeLienParenteCollege(); + afficherMasquerActeBaremeCollege(); + afficherMasquerActeBaremeLienParenteCollege(); + + $(".datepicker").datepicker(); + $("#codeActe").selectpicker(); + $("#codeActeLienParente").selectpicker(); + $("#div_patienter").html(''); + }, + complete: function() { + afficheNombreLigneBaremeCollege('garantiesbaremepriseencharge'); + afficheNombreLigneBaremeCollege('garantiesbaremepriseenchargelienparente'); + afficheNombreLigneBaremeCollege('actesbaremepriseencharge'); + afficheNombreLigneBaremeCollege('actesbaremepriseenchargelienparente'); + } + }); +} + + +function afficherMasquerGarantiesBaremeCollege() +{ + masquerGarantie = $("#masquerGarantie").val(); + + + if(masquerGarantie == undefined){ + masquerGarantie = "1"; + } + + //alert(masquerGarantie); + + if(masquerGarantie=="1"){ + $('#div_garanties_masquer').hide(); + $("#masquerGarantie").val("0"); + $("#span_garantie").text("[+]"); + + }else{ + $('#div_garanties_masquer').show(); + $("#masquerGarantie").val("1"); + //$("#dateEffetGarantie").focus(); + intit_saisie_garantiebareme(); + actualiser_bareme_garantie_college(); + $("#span_garantie").text("[-]"); + + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeLienParenteCollege(); + afficherMasquerActeBaremeCollege(); + afficherMasquerActeBaremeLienParenteCollege(); + } + + afficheNombreLigneBaremeCollege('garantiesbaremepriseencharge'); +} + +function afficherMasquerGarantiesBaremeLienParenteCollege() +{ + masquerGarantieLienParente = $("#masquerGarantieLienParente").val(); + + + + if(masquerGarantieLienParente == undefined){ + masquerGarantieLienParente = "1"; + } + + if(masquerGarantieLienParente=="1"){ + $('#div_garanties_lienparente_masquer').hide(); + $("#masquerGarantieLienParente").val("0"); + $("#span_garantie_lienparente").text("[+]"); + + }else{ + $('#div_garanties_lienparente_masquer').show(); + $("#masquerGarantieLienParente").val("1"); + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente_college(); + $("#span_garantie_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeCollege(); + afficherMasquerActeBaremeCollege(); + afficherMasquerActeBaremeLienParenteCollege(); + } + + afficheNombreLigneBaremeCollege('garantiesbaremepriseenchargelienparente'); +} + +function afficherMasquerActeBaremeCollege() +{ + masquerActe = $("#masquerActe").val(); + + if(masquerActe == undefined){ + masquerActe = "1"; + } + + if(masquerActe=="1"){ + $('#div_acte_masquer').hide(); + $("#masquerActe").val("0"); + $("#span_acte").text("[+]"); + + }else{ + $('#div_acte_masquer').show(); + $("#masquerActe").val("1"); + intit_saisie_actebareme(); + actualiser_bareme_acte_college(); + $("#span_acte").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeCollege(); + afficherMasquerGarantiesBaremeLienParenteCollege(); + afficherMasquerActeBaremeLienParenteCollege(); + } + + afficheNombreLigneBaremeCollege('actesbaremepriseencharge'); +} + +function afficherMasquerActeBaremeLienParenteCollege() +{ + masquerActeLienParente = $("#masquerActeLienParente").val(); + + if(masquerActeLienParente == undefined){ + masquerActeLienParente = "1"; + } + + if(masquerActeLienParente=="1"){ + $('#div_acte_lienparente_masquer').hide(); + $("#masquerActeLienParente").val("0"); + $("#span_acte_lienparente").text("[+]"); + + }else{ + $('#div_acte_lienparente_masquer').show(); + $("#masquerActeLienParente").val("1"); + + intit_saisie_actebareme_lienparente(); + actualiser_bareme_acte_lienparente_college(); + $("#span_acte_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + + afficherMasquerGarantiesBaremeCollege(); + afficherMasquerGarantiesBaremeLienParenteCollege(); + afficherMasquerActeBaremeCollege(); + } + + afficheNombreLigneBaremeCollege('actesbaremepriseenchargelienparente'); +} + +function inserer_bareme_garantie_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantie = $("#dateEffetGarantie").val(); + forfaitPlafondGarantieAdherent = $("#forfaitPlafondGarantieAdherent").val(); + codePeriodicitePlafondGarantieAdherent = $("#codePeriodicitePlafondGarantieAdherent").val(); + nbreTransactionGarantieAdherent = $("#nbreTransactionGarantieAdherent").val(); + codePeriodiciteGarantieAdherent = $("#codePeriodiciteGarantieAdherent").val(); + forfaitPlafondGarantie = $("#forfaitPlafondGarantie").val(); + codePeriodicitePlafondGarantie = $("#codePeriodicitePlafondGarantie").val(); + nbreTransactionGarantie = $("#nbreTransactionGarantie").val(); + codePeriodiciteGarantie = $("#codePeriodiciteGarantie").val(); + //codeObservationFamilleActe = $("#codeObservationFamilleActe").val(); + codeTypeRemboursement = $("#codeTypeRemboursement").val(); + delaiCarenceFamilleActe = $("#delaiCarenceFamilleActe").val(); + ticketModerateurFamilleActe = $("#ticketModerateurFamilleActe").val(); + + forfaitTmGarantie = $("#forfaitTmGarantie").val(); + + ageMinimumFamilleActe = $("#ageMinimumFamilleActe").val(); + ageMaximumFamilleActe = $("#ageMaximumFamilleActe").val(); + actifFamilleActe = $("#actifFamilleActe").val(); + + + forfaitPlafondGarantieAdherent = forfaitPlafondGarantieAdherent.replace(/ /g,""); + forfaitPlafondGarantie = forfaitPlafondGarantie.replace(/ /g,""); + + forfaitTmGarantie = forfaitTmGarantie.replace(/ /g,""); + + + if(dateEffetGarantie <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantie").focus(); + return; + + } + + if(actifFamilleActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActe").focus(); + return; + + } + + $("#div_garanties_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetGarantie='+dateEffetGarantie; + donnees += '&forfaitPlafondGarantieAdherent='+forfaitPlafondGarantieAdherent; + donnees += '&codePeriodicitePlafondGarantieAdherent='+codePeriodicitePlafondGarantieAdherent; + donnees += '&nbreTransactionGarantieAdherent='+nbreTransactionGarantieAdherent; + donnees += '&codePeriodiciteGarantieAdherent='+codePeriodiciteGarantieAdherent; + donnees += '&forfaitPlafondGarantie='+forfaitPlafondGarantie; + donnees += '&codePeriodicitePlafondGarantie='+codePeriodicitePlafondGarantie; + donnees += '&nbreTransactionGarantie='+nbreTransactionGarantie; + donnees += '&codePeriodiciteGarantie='+codePeriodiciteGarantie; + //donnees += '&codeObservationFamilleActe='+codeObservationFamilleActe; + donnees += '&codeTypeRemboursement='+codeTypeRemboursement; + donnees += '&delaiCarenceFamilleActe='+delaiCarenceFamilleActe; + donnees += '&ticketModerateurFamilleActe='+ticketModerateurFamilleActe; + donnees += '&ageMinimumFamilleActe='+ageMinimumFamilleActe; + donnees += '&ageMaximumFamilleActe='+ageMaximumFamilleActe; + donnees += '&actifFamilleActe='+actifFamilleActe; + + donnees += '&forfaitTmGarantie='+forfaitTmGarantie; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollege/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_garantiebareme(); + actualiser_bareme_garantie_college(); + + }, + complete: function() { + afficheNombreLigneBaremeCollege('garantiesbaremepriseencharge'); + + } + }); +} + +function validiteDateEffetGarantieLienParenteCollege(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + var codeLienParente = $("#codeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetGarantieLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollege/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetGarantieLienParente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetGarantieLienParente = $("#maxDateEffetGarantieLienParente").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetGarantieLienParente!=undefined || maxDateEffetGarantieLienParente!='')){ + var tdm = new Date(maxDateEffetGarantieLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").val(''); + $("#dateEffetGarantieLienParente").focus(); + return; + }else{ + inserer_bareme_garantie_lienparente_college(); + } + }else{ + + inserer_bareme_garantie_lienparente_college(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_garantie_lienparente_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + codeLienParente = $("#codeLienParente").val(); + forfaitPlafondGarantieLienParente = $("#forfaitPlafondGarantieLienParente").val(); + codePeriodicitePlafondGarantieLienParente = $("#codePeriodicitePlafondGarantieLienParente").val(); + nbreTransactionGarantieLienParente = $("#nbreTransactionGarantieLienParente").val(); + codePeriodiciteGarantieLienParente = $("#codePeriodiciteGarantieLienParente").val(); + //codeObservationFamilleActeLienParente = $("#codeObservationFamilleActeLienParente").val(); + codeTypeRemboursementLienParente = $("#codeTypeRemboursementLienParente").val(); + delaiCarenceFamilleActeLienParente = $("#delaiCarenceFamilleActeLienParente").val(); + ticketModerateurFamilleActeLienParente = $("#ticketModerateurFamilleActeLienParente").val(); + + + forfaitTmGarantieLienParente = $("#forfaitTmGarantieLienParente").val(); + + ageMinimumFamilleActeLienParente = $("#ageMinimumFamilleActeLienParente").val(); + ageMaximumFamilleActeLienParente = $("#ageMaximumFamilleActeLienParente").val(); + actifFamilleActeLienParente = $("#actifFamilleActeLienParente").val(); + + + forfaitPlafondGarantieLienParente = forfaitPlafondGarantieLienParente.replace(/ /g,""); + forfaitTmGarantieLienParente = forfaitTmGarantieLienParente.replace(/ /g,""); + + if(dateEffetGarantieLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").focus(); + return; + + } + + if(codeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParente").focus(); + return; + + } + + if(actifFamilleActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActeLienParente").focus(); + return; + + } + + $("#div_garanties_bareme_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&dateEffetGarantieLienParente='+dateEffetGarantieLienParente; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&forfaitPlafondGarantieLienParente='+forfaitPlafondGarantieLienParente; + donnees += '&codePeriodicitePlafondGarantieLienParente='+codePeriodicitePlafondGarantieLienParente; + donnees += '&nbreTransactionGarantieLienParente='+nbreTransactionGarantieLienParente; + donnees += '&codePeriodiciteGarantieLienParente='+codePeriodiciteGarantieLienParente; + + + //donnees += '&codeObservationFamilleActeLienParente='+codeObservationFamilleActeLienParente; + donnees += '&codeTypeRemboursementLienParente='+codeTypeRemboursementLienParente; + donnees += '&delaiCarenceFamilleActeLienParente='+delaiCarenceFamilleActeLienParente; + donnees += '&ticketModerateurFamilleActeLienParente='+ticketModerateurFamilleActeLienParente; + donnees += '&ageMinimumFamilleActeLienParente='+ageMinimumFamilleActeLienParente; + donnees += '&ageMaximumFamilleActeLienParente='+ageMaximumFamilleActeLienParente; + donnees += '&actifFamilleActeLienParente='+actifFamilleActeLienParente; + + donnees += '&forfaitTmGarantieLienParente='+forfaitTmGarantieLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollege/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente_college(); + + }, + complete: function() { + afficheNombreLigneBaremeCollege('garantiesbaremepriseenchargelienparente'); + + } + }); +} + +function actualiser_bareme_garantie_lienparente_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function validiteDateEffetActeBaremeCollege(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var codeActe = $("#codeActe").val(); + + var dateEffetActe = $("#dateEffetActe").val(); + var datejour = $("#datejour_C").val(); + + var str = dateEffetActe.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActe='+codeActe; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollege/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebareme').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBareme = $("#maxDateEffetActeBareme").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBareme!=undefined || maxDateEffetActeBareme!='')){ + var tdm = new Date(maxDateEffetActeBareme); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").val(''); + $("#dateEffetActe").focus(); + return; + }else{ + inserer_bareme_acte_college(); + } + }else{ + + inserer_bareme_acte_college(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_acte_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActe = $("#codeActe").val(); + + dateEffetActe = $("#dateEffetActe").val(); + forfaitPlafondActeAdherent = $("#forfaitPlafondActeAdherent").val(); + codePeriodicitePlafondActeAdherent = $("#codePeriodicitePlafondActeAdherent").val(); + nbreTransactionActeAdherent = $("#nbreTransactionActeAdherent").val(); + codePeriodiciteActeAdherent = $("#codePeriodiciteActeAdherent").val(); + forfaitPlafondActe = $("#forfaitPlafondActe").val(); + codePeriodicitePlafondActe = $("#codePeriodicitePlafondActe").val(); + nbreTransactionActe = $("#nbreTransactionActe").val(); + codePeriodiciteActe = $("#codePeriodiciteActe").val(); + codeTypeRemboursementActe = $("#codeTypeRemboursementActe").val(); + delaiCarenceActe = $("#delaiCarenceActe").val(); + ticketModerateurActe = $("#ticketModerateurActe").val(); + ageMinimumActe = $("#ageMinimumActe").val(); + ageMaximumActe = $("#ageMaximumActe").val(); + actifActe = $("#actifActe").val(); + + + forfaitTmActe = $("#forfaitTmActe").val(); + + + forfaitPlafondActeAdherent = forfaitPlafondActeAdherent.replace(/ /g,""); + forfaitPlafondActe = forfaitPlafondActe.replace(/ /g,""); + forfaitTmActe = forfaitTmActe.replace(/ /g,""); + + if(codeActe <= " "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + + } + + if(dateEffetActe <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").focus(); + return; + + } + + if(actifActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActe").focus(); + return; + + } + + $("#div_actes_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&codeActe='+codeActe; + + donnees += '&dateEffetActe='+dateEffetActe; + donnees += '&forfaitPlafondActeAdherent='+forfaitPlafondActeAdherent; + donnees += '&codePeriodicitePlafondActeAdherent='+codePeriodicitePlafondActeAdherent; + donnees += '&nbreTransactionActeAdherent='+nbreTransactionActeAdherent; + donnees += '&codePeriodiciteActeAdherent='+codePeriodiciteActeAdherent; + + donnees += '&forfaitPlafondActe='+forfaitPlafondActe; + donnees += '&codePeriodicitePlafondActe='+codePeriodicitePlafondActe; + donnees += '&nbreTransactionActe='+nbreTransactionActe; + donnees += '&codePeriodiciteActe='+codePeriodiciteActe; + donnees += '&codeTypeRemboursementActe='+codeTypeRemboursementActe; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + donnees += '&ticketModerateurActe='+ticketModerateurActe; + donnees += '&ageMinimumActe='+ageMinimumActe; + donnees += '&ageMaximumActe='+ageMaximumActe; + donnees += '&actifActe='+actifActe; + + donnees += '&forfaitTmActe='+forfaitTmActe; + + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollege/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme(); + actualiser_bareme_acte_college(); + + }, + complete: function() { + afficheNombreLigneBaremeCollege('actesbaremepriseencharge'); + + } + }); +} + +function actualiser_bareme_acte_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + + +function validiteDateEffetActeBaremeLienParenteCollege(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + var codeActeLienParente = $("#codeActeLienParente").val(); + + var dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + var codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetActeLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollege/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebaremelienparente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBaremeLienParente = $("#maxDateEffetActeBaremeLienParente").val(); + + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBaremeLienParente!=undefined || maxDateEffetActeBaremeLienParente!='')){ + var tdm = new Date(maxDateEffetActeBaremeLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").val(''); + $("#dateEffetActeLienParente").focus(); + return; + }else{ + inserer_bareme_acte_lienparente_college(); + } + }else{ + + inserer_bareme_acte_lienparente_college(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_acte_lienparente_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActeLienParente = $("#codeActeLienParente").val(); + + dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + forfaitPlafondActeLienParente = $("#forfaitPlafondActeLienParente").val(); + codePeriodicitePlafondActeLienParente = $("#codePeriodicitePlafondActeLienParente").val(); + nbreTransactionActeLienParente = $("#nbreTransactionActeLienParente").val(); + codePeriodiciteActeLienParente = $("#codePeriodiciteActeLienParente").val(); + codeTypeRemboursementActeLienParente = $("#codeTypeRemboursementActeLienParente").val(); + delaiCarenceActeLienParente = $("#delaiCarenceActeLienParente").val(); + ticketModerateurActeLienParente = $("#ticketModerateurActeLienParente").val(); + ageMinimumActeLienParente = $("#ageMinimumActeLienParente").val(); + ageMaximumActeLienParente = $("#ageMaximumActeLienParente").val(); + actifActeLienParente = $("#actifActeLienParente").val(); + + forfaitTmActeLienParente = $("#forfaitTmActeLienParente").val(); + + forfaitPlafondActeLienParente = forfaitPlafondActeLienParente.replace(/ /g,""); + forfaitTmActeLienParente = forfaitTmActeLienParente.replace(/ /g,""); + + if(codeActeLienParente <=" "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActeLienParente").focus(); + return; + + } + + if(dateEffetActeLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").focus(); + return; + + } + + if(codeLienParenteActeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParenteActeLienParente").focus(); + return; + + } + + if(actifActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActeLienParente").focus(); + return; + + } + + $("#div_actes_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&dateEffetActeLienParente='+dateEffetActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + donnees += '&forfaitPlafondActeLienParente='+forfaitPlafondActeLienParente; + donnees += '&codePeriodicitePlafondActeLienParente='+codePeriodicitePlafondActeLienParente; + donnees += '&nbreTransactionActeLienParente='+nbreTransactionActeLienParente; + donnees += '&codePeriodiciteActeLienParente='+codePeriodiciteActeLienParente; + + + donnees += '&codeTypeRemboursementActeLienParente='+codeTypeRemboursementActeLienParente; + donnees += '&delaiCarenceActeLienParente='+delaiCarenceActeLienParente; + donnees += '&ticketModerateurActeLienParente='+ticketModerateurActeLienParente; + donnees += '&ageMinimumActeLienParente='+ageMinimumActeLienParente; + donnees += '&ageMaximumActeLienParente='+ageMaximumActeLienParente; + donnees += '&actifActeLienParente='+actifActeLienParente; + + donnees += '&forfaitTmActeLienParente='+forfaitTmActeLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollege/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme_lienparente(); + actualiser_bareme_acte_lienparente_college(); + + }, + complete: function() { + afficheNombreLigneBaremeCollege('actesbaremepriseenchargelienparente'); + } + }); +} + +function actualiser_bareme_acte_lienparente_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function supprimer_baremeactelienparente_college(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollege/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_lienparente_college(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremeacte_college(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollege/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_college(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremegarantielienparente_college(adminProd, idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollege/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie_lienparente_college(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremegarantie_college(adminProd,idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollege/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie_college(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function actualiser_bareme_garantie_college() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function afficherDetailBaremeCollegeTemp() +{ + masquerBareme = $("#masquerBareme").val(); + + if(masquerBareme == undefined){ + masquerBareme = "1"; + } + + //alert(masquerGarantie); + + if(masquerBareme=="1"){ + $('#div_bareme').hide(); + $("#masquerBareme").val("0"); + $("#span_bareme").text("[+]"); + + }else{ + $('#div_bareme').show(); + $("#masquerBareme").val("1"); + //$("#dateEffetGarantie").focus(); + $("#span_bareme").text("[-]"); + + init_saisie_detailbareme(); + actualiser_detailbareme_college_temp(); + } + + afficheNombreLigneBaremeCollegeTemp('detailbareme'); +} + +function actualiser_detailbareme_college_temp() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function afficheNombreLigneBaremeCollegeTemp(table) +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnbrelignebaremecollegetemp/"+table+"/", + type : 'post', + data: "table="+table, + error: function(errorData) { + }, + success: function(data) { + if(table=="garantiesbaremepriseencharge"){ + $("#garantiesbaremepriseencharge").html(data); + }else if(table=="garantiesbaremepriseenchargelienparente"){ + $("#garantiesbaremepriseenchargelienparente").html(data); + }else if(table=="actesbaremepriseencharge"){ + $("#actesbaremepriseencharge").html(data); + }else if(table=="actesbaremepriseenchargelienparente"){ + $("#actesbaremepriseenchargelienparente").html(data); + }else if(table=="detailbareme"){ + $("#detailbareme").html(data); + } + }, + complete: function() { + + } + }); +} + +function inserer_bareme_college_temp() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + dateEffetBareme = $("#dateEffetBareme").val(); + ticketModerateurBareme = $("#ticketModerateurBareme").val(); + //actif = $("#actif").val(); + + if(dateEffetBareme <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetBareme").focus(); + return; + + } + + if(ticketModerateurBareme <= " "){ + + v_msg="Veuillez entrer un ticket modérateur!"; + v_msgEng="Please enter a co-payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#ticketModerateurBareme").focus(); + return; + + } + + $("#div_bareme").html('
' + '
'); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetBareme='+dateEffetBareme; + donnees += '&ticketModerateurBareme='+ticketModerateurBareme; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollegetemp/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + init_saisie_detailbareme(); + actualiser_detailbareme_college_temp(); + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('detailbareme'); + $("#masquerBareme").val("0"); + afficherDetailBaremeCollegeTemp(); + } + }); +} + +function afficher_actes_garantiebareme_college_temp(idBaremePriseEnCharge, codeGarantie){ + // + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $("#div_patienter").html(''); + + $("#div_patienter").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebaremecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + + $('#div_actesgarantiebareme').html(data); + $('#div_actesgarantiebareme').modal("show"); + + appliquerDataTableBareme(); + + $('#div_actesgarantiebareme').on('shown.bs.modal', function(){ + stylechampsRequis(); + }); + + afficherMasquerGarantiesBaremeCollegeTemp(); + afficherMasquerGarantiesBaremeLienParenteCollegeTemp(); + afficherMasquerActeBaremeCollegeTemp(); + afficherMasquerActeBaremeLienParenteCollegeTemp(); + + $(".datepicker").datepicker(); + $("#codeActe").selectpicker(); + $("#codeActeLienParente").selectpicker(); + $("#div_patienter").html(''); + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseencharge'); + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseenchargelienparente'); + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseencharge'); + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseenchargelienparente'); + } + }); +} + +function afficherMasquerGarantiesBaremeCollegeTemp() +{ + masquerGarantie = $("#masquerGarantie").val(); + + + if(masquerGarantie == undefined){ + masquerGarantie = "1"; + } + + //alert(masquerGarantie); + + if(masquerGarantie=="1"){ + $('#div_garanties_masquer').hide(); + $("#masquerGarantie").val("0"); + $("#span_garantie").text("[+]"); + + }else{ + $('#div_garanties_masquer').show(); + $("#masquerGarantie").val("1"); + //$("#dateEffetGarantie").focus(); + intit_saisie_garantiebareme(); + actualiser_bareme_garantie_college_temp(); + $("#span_garantie").text("[-]"); + + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeLienParenteCollegeTemp(); + afficherMasquerActeBaremeCollegeTemp(); + afficherMasquerActeBaremeLienParenteCollegeTemp(); + } + + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseencharge'); +} + +function afficherMasquerGarantiesBaremeLienParenteCollegeTemp() +{ + masquerGarantieLienParente = $("#masquerGarantieLienParente").val(); + + if(masquerGarantieLienParente == undefined){ + masquerGarantieLienParente = "1"; + } + + if(masquerGarantieLienParente=="1"){ + $('#div_garanties_lienparente_masquer').hide(); + $("#masquerGarantieLienParente").val("0"); + $("#span_garantie_lienparente").text("[+]"); + + }else{ + $('#div_garanties_lienparente_masquer').show(); + $("#masquerGarantieLienParente").val("1"); + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente_college_temp(); + $("#span_garantie_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerActe").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeCollegeTemp(); + afficherMasquerActeBaremeCollegeTemp(); + afficherMasquerActeBaremeLienParenteCollegeTemp(); + } + + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseenchargelienparente'); +} + +function afficherMasquerActeBaremeCollegeTemp() +{ + masquerActe = $("#masquerActe").val(); + + if(masquerActe == undefined){ + masquerActe = "1"; + } + + if(masquerActe=="1"){ + $('#div_acte_masquer').hide(); + $("#masquerActe").val("0"); + $("#span_acte").text("[+]"); + + }else{ + $('#div_acte_masquer').show(); + $("#masquerActe").val("1"); + intit_saisie_actebareme(); + actualiser_bareme_acte_college_temp(); + $("#span_acte").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActeLienParente").val("1"); + + afficherMasquerGarantiesBaremeCollegeTemp(); + afficherMasquerGarantiesBaremeLienParenteCollegeTemp(); + afficherMasquerActeBaremeLienParenteCollegeTemp(); + } + + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseencharge'); +} + +function afficherMasquerActeBaremeLienParenteCollegeTemp() +{ + masquerActeLienParente = $("#masquerActeLienParente").val(); + + if(masquerActeLienParente == undefined){ + masquerActeLienParente = "1"; + } + + if(masquerActeLienParente=="1"){ + $('#div_acte_lienparente_masquer').hide(); + $("#masquerActeLienParente").val("0"); + $("#span_acte_lienparente").text("[+]"); + + }else{ + $('#div_acte_lienparente_masquer').show(); + $("#masquerActeLienParente").val("1"); + + intit_saisie_actebareme_lienparente(); + actualiser_bareme_acte_lienparente_college_temp(); + $("#span_acte_lienparente").text("[-]"); + + $("#masquerGarantie").val("1"); + $("#masquerGarantieLienParente").val("1"); + $("#masquerActe").val("1"); + + afficherMasquerGarantiesBaremeCollegeTemp(); + afficherMasquerGarantiesBaremeLienParenteCollegeTemp(); + afficherMasquerActeBaremeCollegeTemp(); + } + + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseenchargelienparente'); +} + +function actualiser_bareme_acte_lienparente_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function actualiser_bareme_acte_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actes_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function actualiser_bareme_garantie_lienparente_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme_lienparente').html(data); + + + }, + complete: function() { + + } + }); + +} + +function actualiser_bareme_garantie_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollegetemp/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_garanties_bareme').html(data); + + + }, + complete: function() { + + } + }); + +} + +function supprimer_baremegarantie_college_temp(adminProd,idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollegetemp/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie_college_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremegarantielienparente_college_temp(adminProd, idGarantie) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollegetemp/supprimer/", + type : 'post', + data: "idGarantie="+idGarantie, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_garantie_lienparente_college_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremeactelienparente_college_temp(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollegetemp/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_lienparente_college_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_baremeacte_college_temp(adminProd, idActe) +{ + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollegetemp/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_college_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function inserer_bareme_garantie_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantie = $("#dateEffetGarantie").val(); + forfaitPlafondGarantieAdherent = $("#forfaitPlafondGarantieAdherent").val(); + codePeriodicitePlafondGarantieAdherent = $("#codePeriodicitePlafondGarantieAdherent").val(); + nbreTransactionGarantieAdherent = $("#nbreTransactionGarantieAdherent").val(); + codePeriodiciteGarantieAdherent = $("#codePeriodiciteGarantieAdherent").val(); + forfaitPlafondGarantie = $("#forfaitPlafondGarantie").val(); + codePeriodicitePlafondGarantie = $("#codePeriodicitePlafondGarantie").val(); + nbreTransactionGarantie = $("#nbreTransactionGarantie").val(); + codePeriodiciteGarantie = $("#codePeriodiciteGarantie").val(); + //codeObservationFamilleActe = $("#codeObservationFamilleActe").val(); + codeTypeRemboursement = $("#codeTypeRemboursement").val(); + delaiCarenceFamilleActe = $("#delaiCarenceFamilleActe").val(); + ticketModerateurFamilleActe = $("#ticketModerateurFamilleActe").val(); + + forfaitTmGarantie = $("#forfaitTmGarantie").val(); + + ageMinimumFamilleActe = $("#ageMinimumFamilleActe").val(); + ageMaximumFamilleActe = $("#ageMaximumFamilleActe").val(); + actifFamilleActe = $("#actifFamilleActe").val(); + + + forfaitPlafondGarantieAdherent = forfaitPlafondGarantieAdherent.replace(/ /g,""); + forfaitPlafondGarantie = forfaitPlafondGarantie.replace(/ /g,""); + + forfaitTmGarantie = forfaitTmGarantie.replace(/ /g,""); + + + if(dateEffetGarantie <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantie").focus(); + return; + + } + + if(actifFamilleActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActe").focus(); + return; + + } + + $("#div_garanties_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&dateEffetGarantie='+dateEffetGarantie; + donnees += '&forfaitPlafondGarantieAdherent='+forfaitPlafondGarantieAdherent; + donnees += '&codePeriodicitePlafondGarantieAdherent='+codePeriodicitePlafondGarantieAdherent; + donnees += '&nbreTransactionGarantieAdherent='+nbreTransactionGarantieAdherent; + donnees += '&codePeriodiciteGarantieAdherent='+codePeriodiciteGarantieAdherent; + donnees += '&forfaitPlafondGarantie='+forfaitPlafondGarantie; + donnees += '&codePeriodicitePlafondGarantie='+codePeriodicitePlafondGarantie; + donnees += '&nbreTransactionGarantie='+nbreTransactionGarantie; + donnees += '&codePeriodiciteGarantie='+codePeriodiciteGarantie; + //donnees += '&codeObservationFamilleActe='+codeObservationFamilleActe; + donnees += '&codeTypeRemboursement='+codeTypeRemboursement; + donnees += '&delaiCarenceFamilleActe='+delaiCarenceFamilleActe; + donnees += '&ticketModerateurFamilleActe='+ticketModerateurFamilleActe; + donnees += '&ageMinimumFamilleActe='+ageMinimumFamilleActe; + donnees += '&ageMaximumFamilleActe='+ageMaximumFamilleActe; + donnees += '&actifFamilleActe='+actifFamilleActe; + + donnees += '&forfaitTmGarantie='+forfaitTmGarantie; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantiecollegetemp/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_garantiebareme(); + actualiser_bareme_garantie_college_temp(); + + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseencharge'); + + } + }); +} + +function validiteDateEffetGarantieLienParenteCollegeTemp(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + var codeLienParente = $("#codeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetGarantieLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollegetemp/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetGarantieLienParente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetGarantieLienParente = $("#maxDateEffetGarantieLienParente").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetGarantieLienParente!=undefined || maxDateEffetGarantieLienParente!='')){ + var tdm = new Date(maxDateEffetGarantieLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").val(''); + $("#dateEffetGarantieLienParente").focus(); + return; + }else{ + inserer_bareme_garantie_lienparente_college_temp(); + } + }else{ + + inserer_bareme_garantie_lienparente_college_temp(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_garantie_lienparente_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + dateEffetGarantieLienParente = $("#dateEffetGarantieLienParente").val(); + codeLienParente = $("#codeLienParente").val(); + forfaitPlafondGarantieLienParente = $("#forfaitPlafondGarantieLienParente").val(); + codePeriodicitePlafondGarantieLienParente = $("#codePeriodicitePlafondGarantieLienParente").val(); + nbreTransactionGarantieLienParente = $("#nbreTransactionGarantieLienParente").val(); + codePeriodiciteGarantieLienParente = $("#codePeriodiciteGarantieLienParente").val(); + //codeObservationFamilleActeLienParente = $("#codeObservationFamilleActeLienParente").val(); + codeTypeRemboursementLienParente = $("#codeTypeRemboursementLienParente").val(); + delaiCarenceFamilleActeLienParente = $("#delaiCarenceFamilleActeLienParente").val(); + ticketModerateurFamilleActeLienParente = $("#ticketModerateurFamilleActeLienParente").val(); + + + forfaitTmGarantieLienParente = $("#forfaitTmGarantieLienParente").val(); + + ageMinimumFamilleActeLienParente = $("#ageMinimumFamilleActeLienParente").val(); + ageMaximumFamilleActeLienParente = $("#ageMaximumFamilleActeLienParente").val(); + actifFamilleActeLienParente = $("#actifFamilleActeLienParente").val(); + + + forfaitPlafondGarantieLienParente = forfaitPlafondGarantieLienParente.replace(/ /g,""); + forfaitTmGarantieLienParente = forfaitTmGarantieLienParente.replace(/ /g,""); + + if(dateEffetGarantieLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetGarantieLienParente").focus(); + return; + + } + + if(codeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParente").focus(); + return; + + } + + if(actifFamilleActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifFamilleActeLienParente").focus(); + return; + + } + + $("#div_garanties_bareme_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&dateEffetGarantieLienParente='+dateEffetGarantieLienParente; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&forfaitPlafondGarantieLienParente='+forfaitPlafondGarantieLienParente; + donnees += '&codePeriodicitePlafondGarantieLienParente='+codePeriodicitePlafondGarantieLienParente; + donnees += '&nbreTransactionGarantieLienParente='+nbreTransactionGarantieLienParente; + donnees += '&codePeriodiciteGarantieLienParente='+codePeriodiciteGarantieLienParente; + + + //donnees += '&codeObservationFamilleActeLienParente='+codeObservationFamilleActeLienParente; + donnees += '&codeTypeRemboursementLienParente='+codeTypeRemboursementLienParente; + donnees += '&delaiCarenceFamilleActeLienParente='+delaiCarenceFamilleActeLienParente; + donnees += '&ticketModerateurFamilleActeLienParente='+ticketModerateurFamilleActeLienParente; + donnees += '&ageMinimumFamilleActeLienParente='+ageMinimumFamilleActeLienParente; + donnees += '&ageMaximumFamilleActeLienParente='+ageMaximumFamilleActeLienParente; + donnees += '&actifFamilleActeLienParente='+actifFamilleActeLienParente; + + donnees += '&forfaitTmGarantieLienParente='+forfaitTmGarantieLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremegarantielienparentecollegetemp/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_garantiebareme_lienparente(); + actualiser_bareme_garantie_lienparente_college_temp(); + + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('garantiesbaremepriseenchargelienparente'); + + } + }); +} + +function validiteDateEffetActeBaremeCollegeTemp(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + var codeActe = $("#codeActe").val(); + + var dateEffetActe = $("#dateEffetActe").val(); + var datejour = $("#datejour_C").val(); + + var str = dateEffetActe.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActe='+codeActe; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollegetemp/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebareme').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBareme = $("#maxDateEffetActeBareme").val(); + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBareme!=undefined || maxDateEffetActeBareme!='')){ + var tdm = new Date(maxDateEffetActeBareme); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").val(''); + $("#dateEffetActe").focus(); + return; + }else{ + inserer_bareme_acte_college_temp(); + } + }else{ + + inserer_bareme_acte_college_temp(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_acte_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActe = $("#codeActe").val(); + + dateEffetActe = $("#dateEffetActe").val(); + forfaitPlafondActeAdherent = $("#forfaitPlafondActeAdherent").val(); + codePeriodicitePlafondActeAdherent = $("#codePeriodicitePlafondActeAdherent").val(); + nbreTransactionActeAdherent = $("#nbreTransactionActeAdherent").val(); + codePeriodiciteActeAdherent = $("#codePeriodiciteActeAdherent").val(); + forfaitPlafondActe = $("#forfaitPlafondActe").val(); + codePeriodicitePlafondActe = $("#codePeriodicitePlafondActe").val(); + nbreTransactionActe = $("#nbreTransactionActe").val(); + codePeriodiciteActe = $("#codePeriodiciteActe").val(); + codeTypeRemboursementActe = $("#codeTypeRemboursementActe").val(); + delaiCarenceActe = $("#delaiCarenceActe").val(); + ticketModerateurActe = $("#ticketModerateurActe").val(); + ageMinimumActe = $("#ageMinimumActe").val(); + ageMaximumActe = $("#ageMaximumActe").val(); + actifActe = $("#actifActe").val(); + + + forfaitTmActe = $("#forfaitTmActe").val(); + + + forfaitPlafondActeAdherent = forfaitPlafondActeAdherent.replace(/ /g,""); + forfaitPlafondActe = forfaitPlafondActe.replace(/ /g,""); + forfaitTmActe = forfaitTmActe.replace(/ /g,""); + + if(codeActe <= " "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + + } + + if(dateEffetActe <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActe").focus(); + return; + + } + + if(actifActe <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActe").focus(); + return; + + } + + $("#div_actes_bareme").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + donnees += '&codeActe='+codeActe; + + donnees += '&dateEffetActe='+dateEffetActe; + donnees += '&forfaitPlafondActeAdherent='+forfaitPlafondActeAdherent; + donnees += '&codePeriodicitePlafondActeAdherent='+codePeriodicitePlafondActeAdherent; + donnees += '&nbreTransactionActeAdherent='+nbreTransactionActeAdherent; + donnees += '&codePeriodiciteActeAdherent='+codePeriodiciteActeAdherent; + + donnees += '&forfaitPlafondActe='+forfaitPlafondActe; + donnees += '&codePeriodicitePlafondActe='+codePeriodicitePlafondActe; + donnees += '&nbreTransactionActe='+nbreTransactionActe; + donnees += '&codePeriodiciteActe='+codePeriodiciteActe; + donnees += '&codeTypeRemboursementActe='+codeTypeRemboursementActe; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + donnees += '&ticketModerateurActe='+ticketModerateurActe; + donnees += '&ageMinimumActe='+ageMinimumActe; + donnees += '&ageMaximumActe='+ageMaximumActe; + donnees += '&actifActe='+actifActe; + + donnees += '&forfaitTmActe='+forfaitTmActe; + + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactecollegetemp/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme(); + actualiser_bareme_acte_college_temp(); + + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseencharge'); + + } + }); +} + +function validiteDateEffetActeBaremeLienParenteCollegeTemp(){ + + var codeGarantie = $("#codeGarantie").val(); + var idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + var codeActeLienParente = $("#codeActeLienParente").val(); + + var dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + var codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + + var datejour = $("#datejour_C").val(); + + var str = dateEffetActeLienParente.split('/'); + var effet = str[2]+'-'+str[1]+'-'+str[0]; + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollegetemp/controle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maxdateeffetactebaremelienparente').html(data); + + var tdj = new Date(datejour); + var tde = new Date(effet); + + maxDateEffetActeBaremeLienParente = $("#maxDateEffetActeBaremeLienParente").val(); + + + dte=Math.round(Date.parse(tde)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if((dte < dtj) && (maxDateEffetActeBaremeLienParente!=undefined || maxDateEffetActeBaremeLienParente!='')){ + var tdm = new Date(maxDateEffetActeBaremeLienParente); + dtm = Math.round(Date.parse(tdm)/(1000*3600*24)); + + if(dte < dtm){ + + v_msg="Date d'effet invalide!"; + v_msgEng="Invalid effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").val(''); + $("#dateEffetActeLienParente").focus(); + return; + }else{ + inserer_bareme_acte_lienparente_college_temp(); + } + }else{ + + inserer_bareme_acte_lienparente_college_temp(); + } + + }, + complete: function() { + + + } + }); + +} + +function inserer_bareme_acte_lienparente_college_temp() +{ + codeGarantie = $("#codeGarantie").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + codeActeLienParente = $("#codeActeLienParente").val(); + + dateEffetActeLienParente = $("#dateEffetActeLienParente").val(); + codeLienParenteActeLienParente = $("#codeLienParenteActeLienParente").val(); + forfaitPlafondActeLienParente = $("#forfaitPlafondActeLienParente").val(); + codePeriodicitePlafondActeLienParente = $("#codePeriodicitePlafondActeLienParente").val(); + nbreTransactionActeLienParente = $("#nbreTransactionActeLienParente").val(); + codePeriodiciteActeLienParente = $("#codePeriodiciteActeLienParente").val(); + codeTypeRemboursementActeLienParente = $("#codeTypeRemboursementActeLienParente").val(); + delaiCarenceActeLienParente = $("#delaiCarenceActeLienParente").val(); + ticketModerateurActeLienParente = $("#ticketModerateurActeLienParente").val(); + ageMinimumActeLienParente = $("#ageMinimumActeLienParente").val(); + ageMaximumActeLienParente = $("#ageMaximumActeLienParente").val(); + actifActeLienParente = $("#actifActeLienParente").val(); + + forfaitTmActeLienParente = $("#forfaitTmActeLienParente").val(); + + forfaitPlafondActeLienParente = forfaitPlafondActeLienParente.replace(/ /g,""); + forfaitTmActeLienParente = forfaitTmActeLienParente.replace(/ /g,""); + + if(codeActeLienParente <=" "){ + + v_msg="Veuillez entrer un acte!"; + v_msgEng="Please enter an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActeLienParente").focus(); + return; + + } + + if(dateEffetActeLienParente <= " "){ + + v_msg="Veuillez entrer une date d'effet!"; + v_msgEng="Please enter an effective date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateEffetActeLienParente").focus(); + return; + + } + + if(codeLienParenteActeLienParente <= " "){ + + v_msg="Veuillez entrer le lien de parenté!"; + v_msgEng="Please enter the relationship!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienParenteActeLienParente").focus(); + return; + + } + + if(actifActeLienParente <= " "){ + + v_msg="Veuillez indiquer le statut de cet barème!"; + v_msgEng="Please indicate the status of this scale!"; + alert_ebene(v_msg, v_msgEng); + + $("#actifActeLienParente").focus(); + return; + + } + + $("#div_actes_lienparente").html('
' + '
'); + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeActeLienParente='+codeActeLienParente; + donnees += '&dateEffetActeLienParente='+dateEffetActeLienParente; + donnees += '&codeLienParenteActeLienParente='+codeLienParenteActeLienParente; + donnees += '&forfaitPlafondActeLienParente='+forfaitPlafondActeLienParente; + donnees += '&codePeriodicitePlafondActeLienParente='+codePeriodicitePlafondActeLienParente; + donnees += '&nbreTransactionActeLienParente='+nbreTransactionActeLienParente; + donnees += '&codePeriodiciteActeLienParente='+codePeriodiciteActeLienParente; + + + donnees += '&codeTypeRemboursementActeLienParente='+codeTypeRemboursementActeLienParente; + donnees += '&delaiCarenceActeLienParente='+delaiCarenceActeLienParente; + donnees += '&ticketModerateurActeLienParente='+ticketModerateurActeLienParente; + donnees += '&ageMinimumActeLienParente='+ageMinimumActeLienParente; + donnees += '&ageMaximumActeLienParente='+ageMaximumActeLienParente; + donnees += '&actifActeLienParente='+actifActeLienParente; + + donnees += '&forfaitTmActeLienParente='+forfaitTmActeLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererbaremeactelienparentecollegetemp/ajouter/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + intit_saisie_actebareme_lienparente(); + actualiser_bareme_acte_lienparente_college_temp(); + + }, + complete: function() { + afficheNombreLigneBaremeCollegeTemp('actesbaremepriseenchargelienparente'); + } + }); +} + +function supprimer_detailbareme_college(adminProd, idDetail) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollege/supprimer/", + type : 'post', + data: "idDetail="+idDetail, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_detailbareme_college(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_detailbareme_college_temp(adminProd, idDetail) +{ + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinsererdetailbaremecollegetemp/supprimer/", + type : 'post', + data: "idDetail="+idDetail, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_detailbareme_college_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modecalculeprime() +{ + codeModecalculPrime = $("#codeModecalculPrime").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + + codeEnteteTrancheAge = $("#codeEnteteTrancheAge").val(); + + plafondAdherent = $("#plafondAdherent").val(); + + codeProduit = $("#codeProduit").val(); + + + if(codeGcAssureur =="AUC"){ + v_msg="Veuillez indiquer le code garant!"; + v_msgEng="Please indicate the guarantor code!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + $("#codeModecalculPrime").val(""); + return; + + } + + /* Ne pas rendre le plafond adhérent obligatoire + if(plafondAdherent=="0" || plafondAdherent<=" "){ + v_msg="Veuillez indiquer le montant du plafond de famille!"; + v_msgEng="Please indicate the amount of the family limit!"; + alert_ebene(v_msg, v_msgEng); + + $("#plafondAdherent").focus(); + $("#codeModecalculPrime").val(""); + return; + } + */ + + if(codeProduit==undefined){ + codeProduit = ''; + } + + if(codeModecalculPrime<=" ") + { + v_msg="Veuillez indiquer le mode de calcul de prime!"; + v_msgEng="Please indicate how the premium is calculated!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModecalculPrime").focus(); + + $("#div_typetrancheage").empty(); + $("#div_prime_lienparente").empty(); + + return; + }else if(codeModecalculPrime=="TA") + { + $("#div_prime_lienparente").empty(); + $("#div_typetrancheage").empty(); + $("#div_typetrancheage").html('
' + '
'); + + donnees = "codeGcAssureur="+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/typetrancheage/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_typetrancheage").html(data); + $("#codeEnteteTrancheAge").selectpicker(); + + }, + complete: function() { + + } + }); + + }else{ + $("#div_typetrancheage").empty(); + $("#div_prime_lienparente").empty(); + $("#div_prime_lienparente").html('
' + '
'); + + donnees = "codeGcAssureur="+codeGcAssureur+'&codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_prime_lienparente").html(data); + + }, + complete: function() { + + } + }); + + } +} + +function trancheage() +{ + codeModecalculPrime = $("#codeModecalculPrime").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + + codeProduit = $("#codeProduit").val(); + + codeEnteteTrancheAge = $("#codeEnteteTrancheAge").val(); + + if(codeProduit==undefined){ + codeProduit = ''; + } + + if (codeEnteteTrancheAge<=" " && codeModecalculPrime=="TA") + { + v_msg="Veuillez sélectionner un type de tranche âge!"; + v_msgEng="Please select an age group type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeEnteteTrancheAge").focus(); + + $("#div_trancheage").empty(); + + return; + } + + donnees = "codeGcAssureur="+codeGcAssureur+"&codeProduit="+codeProduit+"&codeEnteteTrancheAge="+codeEnteteTrancheAge; + //donnees +="&idProduit="+idProduit; + $("#div_trancheage").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/trancheage/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_trancheage").html(data); + + }, + complete: function() { + + } + }); + +} + +function ajaxprimelienparente() +{ + donnees = ""; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_modeprime").html(data); + + }, + complete: function() { + + } + }); +} + +function ajax_maj_prime_produit(idPrime, prime, controle) +{ + prime=prime.replace(/ /g,""); + prime=parseInt(prime.replace(",","."),10); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&prime="+prime; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majprimeproduit/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function ajaxmodecalculprime() +{ + idProduit = $("#idProduit").val(); + codeModecalculPrime = $("#codeModecalculPrime").val(); + + if(codeModecalculPrime<=" ") + { + v_msg="Veuillez indiquer le mode de calcul de prime!"; + v_msgEng="Please indicate how the premium is calculated!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModecalculPrime").focus(); + + $("#div_modeprime").html(''); + + return; + }else if(codeModecalculPrime!="LP") + { + $("#div_modeprime").empty(); + $("#div_modeprime").html('
' + '
'); + }else{ + //ajaxprimelienparente(); + $("#div_modeprime").empty(); + return; + } + + $("#div_modeprime").html('
' + '
'); + + + donnees = "idProduit="+idProduit+"&codeModecalculPrime="+codeModecalculPrime; + + //alert(donnees); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodecalculprime/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_modeprime").html(data); + + $("#codeEnteteTrancheAge").selectpicker(); + + }, + complete: function() { + + } + }); +} + +/* +function test_code(controle) +{ + alert(event.keyCode); + + return; + + if((event.keyCode < 45) || (event.keyCode > 45 && event.keyCode <= 47) + || (event.keyCode > 57 && event.keyCode < 65) || (event.keyCode >=91 && event.keyCode < 95) + || (event.keyCode == 96) || (event.keyCode>=123 && event.keyCode<=126)) + { + + v_msg="Un code ne peut contenir de caractères spéciaux!"; + v_msgEng="A code cannot contain special characters!"; + + alert_ebene(v_msg, v_msgEng); + + controle.value=""; + controle.focus(); + + event.returnValue = false; + } + +} +*/ + +function test_code(controle, code) +{ + var reg = new RegExp('^[a-zA-Z][a-zA-Z0-9]*$'); + + if(reg.test(code)==false) + { + v_msg="Code invalide! Un code ne doit pas contenir d'espace ni de caractère spéciaux et ne pas commencer par un chiffre!"; + v_msgEng="Code is invalid! A code must not contain spaces or special characters and must not start with a number!" ; + alert_ebene(v_msg, v_msgEng); + + controle.value=""; + controle.focus(); + return false; + } +} + + +function ajax_maj_nbrefamille_college_temp(idPrime, nbreFamille, controle, modeDevis) +{ + nbreFamille=nbreFamille.replace(/ /g,""); + nbreFamille=parseInt(nbreFamille.replace(",","."),10); + controle.value=nbreFamille; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&nbreFamille="+nbreFamille; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majnbrefamillecollege/"; + }else{ + v_url = "Ajaxprimescategoried/majnbrefamillecollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + if(modeDevis == "0"){ + enregistrer_college_temp(); + recapitulercollege(); + }else{ + enregistrer_college_temp_d(); + recapitulercollege_d(); + } + + } + }); + } +} + +function ajax_maj_supplementaire_college_temp(idPrime, prime, controle, modeDevis) +{ + prime=prime.replace(/ /g,""); + prime=parseInt(prime.replace(",","."),10); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&prime="+prime; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majprimesupplementairecollege/"; + }else{ + v_url = "Ajaxprimescategoried/majprimesupplementairecollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + + }, + complete: function() { + if(modeDevis == "0"){ + enregistrer_college_temp(); + }else{ + enregistrer_college_temp_d(); + } + } + }); + } +} + +function ajax_maj_prime_trancheage_college(idPrime, prime, controle, modeDevis) +{ + + + prime=prime.replace(/ /g,""); + prime=parseInt(prime.replace(",","."),10); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&prime="+prime; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majprimetrancheage/"; + }else{ + v_url = "Ajaxprimescategoried/majprimetrancheage/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + + if(modeDevis == "0"){ + change_categorie_college_temp(); + }else{ + change_categorie_college_temp_d(); + } + } + }); + } +} + +function maj_effectif_trancheage_college(idPrime, population, controle, modeDevis) +{ + + + population=population.replace(/ /g,""); + population=parseInt(population.replace(",","."),10); + controle.value=population; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&population="+population; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majpopulationtranche/"; + }else{ + v_url = "Ajaxprimescategoried/majpopulationtranche/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + + if(modeDevis == "0"){ + change_categorie_college_temp(); + }else{ + change_categorie_college_temp_d(); + } + } + }); + } +} + + + +function calcul_prime_adherent() +{ + codeModeCalculPrime = $("#codeModeCalculPrime").val(); + + if(codeModeCalculPrime=='TA'){ + idCollege=$("#idCollege").val(); + dateEntree=$("#dateEntree").val(); + dateNaissance=$("#dateNaissance").val(); + prorata=$("#prorata").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollege='+idCollege; + donnees += '&dateEntree='+dateEntree; + donnees += '&prorata='+prorata; + donnees += '&dateNaissance='+dateNaissance; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproraterprime/calculprime/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prime").html(data); + }, + complete: function() { + } + }); + } + +} + +function calcul_prime_beneficiaire() +{ + codeModeCalculPrime = $("#codeModeCalculPrime").val(); + + if(codeModeCalculPrime=='TA'){ + idAdherent = $("#idAdherent").val(); + dateNaissance =$("#dateNaissance").val(); + fraisCarte =$("#fraisCarte").val(); + prorata =$("#prorata").val(); + + + donnees = 'idAdherent='+idAdherent; + donnees += '&dateNaissance='+dateNaissance; + donnees += '&fraisCarte='+fraisCarte; + donnees += '&prorata='+prorata; + + // ajout KANE 27/10/2023 + codeLienParente =$("#codeLienParente").val(); + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproraterprimebeneficiaire/calculprime/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prime").html(data); + }, + complete: function() { + } + }); + } + +} + + + +function retour_de_detailbaremecollegetemp() +{ + window.location.assign($("#racineWeb" ).val()+$("#retour").val()+"/"); +} + +function init_trancheage_college_temp() +{ + codeProduit = $("#codeProduit").val(); + + donnees = 'codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/inittrancheage/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function init_prime_college_temp() +{ + codeProduit = $("#codeProduit").val(); + + donnees = 'codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/initprimelienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function init_prime_college_base_tarif() +{ + codeProduit = $("#codeProduit").val(); + codeBaseTarification = $("#codeBaseTarification").val(); + + donnees = 'codeProduit='+codeProduit+'&codeBaseTarification='+codeBaseTarification; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/initprimebasetarif/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function modifier_centre_gestion(idCentreGestion) +{ + if(isNaN(idCentreGestion)){ + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + return false; + } + + window.location.assign($("#racineWeb" ).val()+"Modifierparametresgeneraux/"+idCentreGestion+"/"); + +} + +function controle_effet_assure(){ + + + var d_effet = new Date($("#dateEffetSql").val()); // 01/05/2022 + var d_fin = new Date($("#dateFinSql").val()); // 31/12/2022 + var d_entree = $("#dateEntree").datepicker("getDate"); // 20/07/2022 + + var effet = $("#dateAvenant").val(); + + + dt_effet = Math.round(Date.parse(d_effet)/(1000*3600*24)); + dt_fin = Math.round(Date.parse(d_fin)/(1000*3600*24)); + d_entree = Math.round(Date.parse(d_entree)/(1000*3600*24)); + + //alert('dt_effet='+dt_effet+'&dt_fin='+dt_fin+'&d_entree='+d_entree); + + if (d_entree>dt_fin || d_entree' + ''); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireremboursement/liste/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_liste_beneficiaire').html(data); + }, + complete: function() { + + } + }); + +} + +function modifier_beneficiaire_remboursement(idData) +{ + + donnees = 'idData='+idData; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireremboursement/saisirmodif/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_saisie_beneficiaire').html(data); + + }, + complete: function() { + + } + }); + + +} + +function enregistrer_beneficiaire_remboursement() +{ + idData = $("#idData").val(); + idAdherent = $("#idAdherent").val(); + beneficiaireReglement = $("#beneficiaireReglement").val(); + codeLienBeneficiaire = $("#codeLienBeneficiaire").val(); + codeModePaiement = $("#codeModePaiement").val(); + + enVigueur = $("#enVigueur").val(); + + telephoneMobile = $("#telephoneMobile").val(); + rib = $("#rib").val(); + + if($('#beneficiaireReglement').val()<=" ") + { + v_msg="Veuillez saisir le bénéficiaire!"; + v_msgEng="Please enter the beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $('#beneficiaireReglement').focus(); + $("#beneficiaireReglement").val(""); + return; + } + + if($('#codeLienBeneficiaire').val()<=" ") + { + v_msg="Veuillez saisir le lien avec l'adhérent!"; + v_msgEng="Please enter the link with the member!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienBeneficiaire').focus(); + $("#codeLienBeneficiaire").val(""); + return; + } + + + if($('#codeModePaiement').val()<=" ") + { + v_msg="Veuillez saisir le mode de paiement!"; + v_msgEng="Please enter payment method!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeModePaiement').focus(); + $("#codeModePaiement").val(""); + return; + } + + donnees = 'idData='+idData; + donnees += '&idAdherent='+idAdherent+'&beneficiaireReglement='+beneficiaireReglement; + donnees += '&codeLienBeneficiaire='+codeLienBeneficiaire+'&codeModePaiement='+codeModePaiement; + donnees += '&enVigueur='+enVigueur+'&telephoneMobile='+telephoneMobile+'&rib='+rib; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireremboursement/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + actualiser_beneficiaire_remboursement(); + }, + complete: function() { + //afficherListeBeneficiaire(); + } + }); + +} + +function reinitialiser_beneficiaire_remboursement() +{ + + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireremboursement/reinitialiser/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_saisie_beneficiaire').html(data); + + }, + complete: function() { + + } + }); + + +} + + +function recherchecode(controle, code, table) +{ + var donnee_a_affciher = ""; + + donnees = 'code='+code+'&table='+table; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrecherchecodetable/rechercher/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + donnee_a_affciher = data; + }, + complete: function() { + //alert(donnee_a_affciher); + if(donnee_a_affciher=="true") + { + v_msg="Ce code existe déjà! Veuillez le remplacer."; + v_msgEng="This code already exists! Please replace it."; + alert_ebene(v_msg, v_msgEng); + + controle.value=""; + controle.focus(); + } + } + }); + +} + +// DEBUT KANE 21/10/2023 pour gérer le paramétrage des tranches d'âge +function filtreentetetrancheange(){ + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees = 'codeGcAssureur='+codeGcAssureur; + + if(codeGcAssureur !=""){ + $('#div_entetetrancheage').html(''); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreentetetrancheange/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_entetetrancheage').html(data); + $("#codeEnteteTrancheAge").selectpicker(); + }, + complete: function() { + + } + }); + + + } +} + +function afficher_trancheage() +{ + if(verifier_entete_trancheage()) + { + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeEnteteTrancheAge='+codeEnteteTrancheAge; + + var div_attente = $('#div_trancheage'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtrancheage/affichertrancheage/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + $("#ageMax").focus(); + } + }); + } +} + +function supprimer_derniere_tranche_age(idTrancheage) +{ + donnees = 'idTrancheage='+idTrancheage; + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this removal?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtrancheage/supprimer/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error: function(data) { + }, + complete: function() { + afficher_trancheage(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function vider_entete_trancheage() +{ + if(verifier_entete_trancheage()) + { + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeEnteteTrancheAge='+codeEnteteTrancheAge; + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this removal?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtrancheage/viderentetetrancheage/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_trancheage(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } +} + +function verifier_entete_trancheage() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeEnteteTrancheAge=$("#codeEnteteTrancheAge").val(); + + if (codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + if (codeEnteteTrancheAge<=" ") + { + v_msg="Veuillez sélectionner un type de tranche âge!"; + v_msgEng="Please select an age group type!"; + alert_ebene(v_msg, v_msgEng); + + return false; + } + + return true; +} + +function ajouter_une_trancheage() +{ + if(verifier_entete_trancheage()) + { + + ageMax = $("#ageMax").val(); + ageMax = ageMax.replace(/ /g,""); + ageMax = parseInt(ageMax.replace(",","."),10); + + if (ageMax<="0") + { + v_msg="Veuillez revoir votre saisie!"; + v_msgEng="Please review your entry!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeEnteteTrancheAge='+codeEnteteTrancheAge+'&ageMax='+ageMax; + + v_msg="Confirmez-vous cette ajout?"; + v_msgEng="Do you confirm this addition?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtrancheage/ajouterunetrancheage/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_trancheage(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } +} + + +function validation_ancien_numero() +{ + ancienNumeroAssure = $('#ancienNumeroAssure').val(); + conserverAncienNumeroAssure = $('#conserverAncienNumeroAssure').val(); + + if(conserverAncienNumeroAssure=="1"){ + + if(ancienNumeroAssure<=" "){ + v_msg="Veuillez saisir l'ancien numéro d'assuré!"; + v_msgEng="Please enter the old insurance number!"; + alert_ebene(v_msg, v_msgEng); + + $('#ancienNumeroAssure').focus(); + + $('#conserverAncienNumeroAssure').val("0"); + return; + } + + donnees="ancienNumeroAssure="+ancienNumeroAssure; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxanciennumeroassure/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_validation').html(data); + + valider = $("#valider").val(); + + if(valider>"0"){ + v_msg="L'ancien numéro assuré saisi existe déjà pour un autre bénéficiaire. Remplacer le!"; + v_msgEng="The old insured number entered already exists for another beneficiary. Replace it!"; + alert_ebene(v_msg, v_msgEng); + + $('#ancienNumeroAssure').focus(); + $('#ancienNumeroAssure').val(""); + $('#conserverAncienNumeroAssure').val("0"); + + return; + } + + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + }else{ + + if(ancienNumeroAssure >" "){ + + v_msg="Cet ancien numéro assuré ne sera retenu comme numéro bénéficiaire que si vous le conservez par la suite!"; + v_msgEng="This old insured number will only be retained as a beneficiary number if you keep it afterwards!"; + + alert_ebene(v_msg, v_msgEng); + + } + + } + +} +// Ajaxselectionsuspensionassure +function pop_afficher_selection_suspension_assure() +{ + var div_selection_assure = $('#div_selection_assure'); + div_selection_assure.html('
' + '
'); + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionsuspensionassure/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + div_selection_assure.html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + complete: function() { + // $("#btn_pop").click(); + } + }); +} + +function beneficiaire_a_suspendre(p_choix, p_id_beneficiaire) +{ + donnees = 'idBeneficiaire='+p_id_beneficiaire; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionsuspensionassure/selectionner/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function actualiser_suspension_assure() +{ + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + div_assure_a_retirer.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailsuspensionassure/", + type: 'POST', + success: function(data) { + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +// enregistrer_avenant_incorporation_garantie +function enregistrer_suspension_assure() +{ + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailsuspensionassure/", + type: 'POST', + success: function(data) { + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + nbAliment=$("#nbAliment").val(); + + if (nbAliment<"1") + { + v_msg="Veuillez sélectionner les personnes à suspendre!"; + v_msgEng="Please select people to suspend!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la suspension des personnes sélectionnées de cette police?"; + v_msgEng="Do you confirm the suspension of selected individuals from this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Suspensionassure/enregistrer/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } + }); + + +} + +function pop_afficher_selection_remiseenvigueur_assure() +{ + var div_selection_assure = $('#div_selection_assure'); + div_selection_assure.html('
' + '
'); + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionremiseenvigueurassure/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + div_selection_assure.html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + complete: function() { + // $("#btn_pop").click(); + } + }); +} + +function beneficiaire_a_remettreenvigueur(p_choix, p_id_beneficiaire) +{ + donnees = 'idBeneficiaire='+p_id_beneficiaire; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionremiseenvigueurassure/selectionner/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function actualiser_remiseenvigueur_assure() +{ + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + div_assure_a_retirer.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailremiseenvigueurassure/", + type: 'POST', + success: function(data) { + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function enregistrer_remiseenvigueur_assure() +{ + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailremiseenvigueurassure/", + type: 'POST', + success: function(data) { + div_assure_a_retirer.html(data); + }, + error: function(data) { + }, + complete: function() { + nbAliment=$("#nbAliment").val(); + + if (nbAliment<"1") + { + v_msg="Veuillez sélectionner les personnes à remettre en vigueur!"; + v_msgEng="Please select the people to reinstate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la remise en vigueur des personnes sélectionnées de cette police?"; + v_msgEng="Do you confirm the reinstatement of selected persons of this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Remiseenvigueurassure/enregistrer/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } + }); + + +} + + +function filtregarantiecollege() +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if(idCollegePolice ==""){ + idCollegePolice = "0"; + } + + donnees = 'idCollegePolice='+idCollegePolice; + + var div_garantieproduit = $('#div_garantieproduit'); + + div_garantieproduit.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_garantieproduit.html(data); + //afficher_adherents_police(); + + + }, + complete: function() { + + } + }); + +} + +function incorporer_une_garantie_college(codeGarantie) +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if (idCollegePolice<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollegePolice='+idCollegePolice+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollege/incorporer/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + filtregarantiecollege(); + } + }); +} + +function annuler_une_garantie_college(idGarantie) +{ + donnees = 'idGarantie='+idGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollege/annuler/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + filtregarantiecollege(); + } + }); +} + +// +function enregistrer_avenant_incorporation_garantie() +{ + v_msg="Confirmez-vous l'incorporation des garanties à cette police?"; + v_msgEng="Do you confirm the incorporation of the guarantees into this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollege/enregistrer/", + type: 'POST', + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + // window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); + window.location.assign($("#racineWeb" ).val()+"Listeavenant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function filtregarantiecollegeretrait() +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if(idCollegePolice ==""){ + idCollegePolice = "0"; + } + + donnees = 'idCollegePolice='+idCollegePolice; + + var div_garantieproduit = $('#div_garantieproduit'); + + div_garantieproduit.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollegeretrait/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_garantieproduit.html(data); + //afficher_adherents_police(); + + + }, + complete: function() { + + } + }); + +} + + +function retirer_une_garantie_college(codeGarantie) +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if (idCollegePolice<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollegePolice='+idCollegePolice+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollegeretrait/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + filtregarantiecollegeretrait(); + } + }); +} + + +function annuler_une_garantie_college_retrait(idGarantie) +{ + donnees = 'idGarantie='+idGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollegeretrait/annuler/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + filtregarantiecollegeretrait(); + } + }); +} + +// +function enregistrer_avenant_retrait_garantie() +{ + v_msg="Confirmez-vous le retrait des garanties à cette police?"; + v_msgEng="Do you confirm the withdrawal of coverage from this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiecollegeretrait/enregistrer/", + type: 'POST', + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + // window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); + window.location.assign($("#racineWeb" ).val()+"Listeavenant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function filtregarantiesparcollege() +{ + var idCollegePolice = $('#idCollegePolice').val(); + var div_garanties_college = $('#div_garanties_college'); + + donnees = 'idCollegePolice='+idCollegePolice; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltregarantiesparcollege/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_garanties_college.html(data); + $("#codeGarantie").val(""); + }, + complete: function() { + + } + }); + + +} + +function filtreactecollegeretrait() +{ + var idCollegePolice = $('#idCollegePolice').val(); + var codeGarantie = $('#codeGarantie').val(); + + if (codeGarantie<=" ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a guarantee!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeGarantie').focus(); + + return; + } + + donnees = 'idCollegePolice='+idCollegePolice+'&codeGarantie='+codeGarantie; + + var div_garantieproduit = $('#div_garantieproduit'); + + div_garantieproduit.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreactecollegeretrait/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_garantieproduit.html(data); + appliquerDataTable(); + + + }, + complete: function() { + + } + }); + +} + +function retirer_un_acte_college(codeGarantie, codeActe) +{ + var idCollegePolice = $('#idCollegePolice').val(); + + if (idCollegePolice<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollegePolice='+idCollegePolice+'&codeGarantie='+codeGarantie+'&codeActe='+codeActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreactecollegeretrait/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + filtreactecollegeretrait(); + } + }); +} + +// +function annuler_retrait_un_acte_college(idActe) +{ + donnees = 'idActe='+idActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreactecollegeretrait/annuler/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + filtreactecollegeretrait(); + } + }); +} + + +function enregistrer_avenant_retrait_acte() +{ + v_msg="Confirmez-vous le retrait des actes à cette police?"; + v_msgEng="Do you confirm the withdrawal of deeds from this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreactecollegeretrait/enregistrer/", + type: 'POST', + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + // window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); + window.location.assign($("#racineWeb" ).val()+"Listeavenant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function mode_calcul_prime_college() +{ + var idCollege = $('#idCollege').val(); + + if (idCollege<=" ") + { + + return; + } + + var div_modeCalculPrime = $('#div_modeCalculPrime'); + + donnees = 'idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodecalculeprimecollege/", + type: 'POST', + data: donnees, + success: function(data) { + div_modeCalculPrime.html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function liste_ententeprealables_dent() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealabledent/"); +} + +function Listeententeprealabledent() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealabledent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + + + + +function liste_ententeprealables_hospi() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablehospi/"); +} + +function Listeententeprealablehospi() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Listeententeprealablehospi/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + + +function listeententeprealablesdent() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesdent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function listeententeprealableshospi() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealableshospi/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function accepterrefusertouslesmedicaments() { + + modeSaisieFeuille = $("#modeSaisieFeuille").val(); + + idPrescription = $("#idPrescription").val(); + numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val(); + + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + motifRefusPrestataire = $("#motifRefusPrestataire").val(); + + entente = $("#entente").val(); + refuser = $("#refuser").val(); + accepter = $("#accepter").val(); + smsenoye = $("#smsenoye").val(); + + + if (refuser > 0) { + typeMailRefus = 'refusententeprealablepha'; + typeSmsRefus = "refusententeprealablepha"; + + } + + if (accepter > 0) { + typeMailAccord = "accordententeprealablepha"; + typeSmsAccord = "accordententeprealablepha"; + } + + if (accepter > 0 && refuser > 0) { + var accepterRefuser = 1; + } + + + if ((motifReel == "" || motifReel <= " ") && (accepter > 0)) { + motifReel = "BON POUR ACCORD"; + $("#motifReel").val(motifReel); + } + + + if ((motifRefusAssure == "" || motifRefusPrestataire <= " ") && (refuser > 0)) { + $("#btn-fermer-modal").removeAttr('data-bs-dismiss'); + v_msg = "Veuillez saisir un motif de refus pour l\'assuré! et le prestataire"; + v_msgEng = "Please enter a reason for refusal for the insured! and the service provider"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusPrestataire").focus(); + return; + }else{ + v_msg = "Confirmez-vous la liste des medicaments?"; + v_msgEng = "DDo you confirm the list of medications?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + codePrestataire = $("#codePrestataireMedicament").val(); + + donnees = 'idPrescription=' + idPrescription + '&motifReel=' + motifReel + '&motifRefusAssure=' + + motifRefusAssure + '&codePrestataire=' + codePrestataire + + '&refuser=' + refuser + '&entente=' + entente + + '&accepter=' + accepter + + '&numeroFeuilleMaladie=' + numeroFeuilleMaladie + + '&motifRefusPrestataire=' + motifRefusPrestataire; + + donnees_sav = donnees; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealablesbenficiaire/accepterrefusertouslesmedicaments/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + if (modeSaisieFeuille != 1) { + if ((refuser > "0") && (smsenoye != "1") && (accepterRefuser != 1)) { + preparesmsRefus(typeSmsRefus); + } + if ((accepter > "0") && (smsenoye != "1") && (accepterRefuser != 1)) { + debugger + preparesmsAccord(typeSmsAccord); + } + if (accepterRefuser == 1 && (smsenoye != "1")) { + preparesmsAccordRefus(typeSmsAccord, typeSmsRefus); + } + } + }, + complete: function () { + + + liste_ententeprealables_pha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } + +} + +function refusermedicament(idMedicament, numeroFeuilleMaladie, p_choix) { + + + + donnees = 'idMedicament=' + idMedicament + "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + if (p_choix == 1) { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/refusermedicament/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + }else{ + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/annulerrefusermedicament/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + } + +} +/* ENLEVER PARCE QUE CA RETOURNE DES ERREURS*/ +function ajax_maj_qte_prescrit_medicament(idMedicament, quantite, controle) { + + donnee_a_affciher = ""; + + quantite = quantite.replace(",", "."); + controle.value = quantite; + + if (controle_numerique(controle)) { + if (quantite == 0) { + controle.focus(); + v_msg = "Veuillez saisir la quantit\u00e9!"; + v_msgEng = "Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idMedicament=' + idMedicament + "&quantite=" + quantite; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/majquantiteaccorde/", + type: 'POST', + data: donnees, + success: function (data) { + + }, + error: function (data) { + }, + complete: function () { + affiche_liste_phar_provisoire(); + } + }); + } +} + +function preparesmsRefus(typeSmsRefus) { + + envoismsactif = $("#envoismsactif").val(); + if (envoismsactif == "0") { + return; + } + + codeLangueSociete = $("#codeLangueSociete").val(); + + p_destinataires = ""; + p_message = ""; + creation_message = "1"; + + + if (typeSmsRefus == "refusententeprealable") { + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroBonExamen = $("#numeroBonExamen").val(); + libelleActe = $("#libelleActe").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + + p_message = (codeLangueSociete == "en_US") ? "Act refused : " : "Actes refusés : "; + + p_message += "\n"; + + if (refuser > 0) { + for (let i = 1; i <= refuser; i++) { + p_message += '- ' + $("#libelleActeRefuser_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleActe; + p_message += "\n"; + } + + p_message += "Motif de refus : " + motifRefusAssure + " "; + + + + } + + if (typeSmsRefus == "refusententeprealablepha") { + + //pour fraza + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroBonExamen = $("#numeroBonExamen").val(); + numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); + //numeroEntentePrealable = $("#numeroEntentePrealable").val(); + libelleMedicament = $("#libelleMedicament").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + motifReel = $("#motifReel").val(); + + //p_message = prestataire+" "; + + p_message = (codeLangueSociete == "en_US") ? "Act refused : " : "Médicaments refusés : "; + + p_message += "\n"; + + if (refuser > 0) { + for (let i = 1; i <= refuser; i++) { + p_message += '- ' + $("#libelleMedicamentRefuser_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleMedicament; + p_message += "\n"; + } + + p_message += "Motif de refus : " + motifRefusAssure + " "; + + + } + + + envoyersms(p_destinataires, p_message, creation_message); +} + + +function preparesmsAccord(typeSmsAccord) { + + envoismsactif = $("#envoismsactif").val(); + if (envoismsactif == "0") { + return; + } + + codeLangueSociete = $("#codeLangueSociete").val(); + + p_destinataires = ""; + p_message = ""; + creation_message = "1"; + + if (typeSmsAccord == "accordententeprealable") { + + + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroBonExamen = $("#numeroBonExamen").val(); + libelleActe = $("#libelleActe").val(); + motifReel = $("#motifReel").val(); + + if ((motifReel == "" || motifReel <= " ") && (accepter > 0)) { + motifReel = "BON POUR ACCORD"; + } + + + p_message = (codeLangueSociete == "en_US") ? "Act granted : " : "Actes accordés : "; + + p_message += "\n"; + + if (accepter > 0) { + for (let i = 1; i <= accepter; i++) { + p_message += '- ' + $("#libelleActeAccepter_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleActe; + p_message += "\n"; + } + + p_message += "Observation : " + motifReel + " "; + + + } + + if (typeSmsAccord == "accordententeprealablepha") { + + + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroEntentePrealable = $("#numeroEntentePrealable").val(); + numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); + libelleMedicament = $("#libelleMedicament").val(); + motifReel = $("#motifReel").val(); + if ((motifReel == "" || motifReel <= " ") && (accepter > 0)) { + motifReel = "BON POUR ACCORD"; + } + p_message = (codeLangueSociete == "en_US") ? "Act granted : " : "Médicaments accordés : "; + + p_message += "\n"; + + if (accepter > 0) { + for (let i = 1; i <= accepter; i++) { + p_message += '- ' + $("#libelleMedicamentAccepter_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleMedicament; + p_message += "\n"; + } + + p_message += "Observation : " + motifReel + " "; + + } + + + envoyersms(p_destinataires, p_message, creation_message); +} + +function preparesmsAccordRefus(typeSmsAccord, typeSmsRefus) { + + envoismsactif = $("#envoismsactif").val(); + if (envoismsactif == "0") { + return; + } + + codeLangueSociete = $("#codeLangueSociete").val(); + + p_destinataires = ""; + p_message = ""; + creation_message = "1"; + + + if (typeSmsAccord == "accordententeprealable" && typeSmsRefus == "refusententeprealable") { + + + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroBonExamen = $("#numeroBonExamen").val(); + libelleActe = $("#libelleActe").val(); + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + //p_message = prestataire+" "; + if ((motifReel == "" || motifReel <= " ") && (accepter > 0)) { + motifReel = "BON POUR ACCORD"; + } + + p_message = (codeLangueSociete == "en_US") ? "Act refused : " : "Actes refusé : "; + + p_message += "\n"; + + if (refuser > 0) { + for (let i = 1; i <= refuser; i++) { + p_message += '- ' + $("#libelleActeRefuser_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleActe; + p_message += "\n"; + } + + p_message += "Motif de refus : " + motifRefusAssure + " "; + + p_message += "\n"; + + p_message += (codeLangueSociete == "en_US") ? "Act granted : " : "Actes accordés : "; + + p_message += "\n"; + + if (accepter > 0) { + for (let i = 1; i <= accepter; i++) { + p_message += '- ' + $("#libelleActeAccepter_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleActe; + p_message += "\n"; + } + + p_message += "Observation : " + motifReel + " "; + //p_message += "\n"; + + } + + if (typeSmsAccord == "accordententeprealablepha" && typeSmsRefus == "refusententeprealablepha") { + + + p_destinataires = $("#smsGestionPrestataire").val(); + entente = $("#entente").val(); + accepter = $("#accepter").val(); + refuser = $("#refuser").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + + if (copieSmsPrestataireAssure == "1") { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + prestataire = $("#prestataire").val(); + numeroEntentePrealable = $("#numeroEntentePrealable").val(); + numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); + libelleMedicament = $("#libelleMedicament").val(); + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + + p_message = (codeLangueSociete == "en_US") ? "Act refused : " : "Médicaments refusés : "; + + p_message += "\n"; + + if (refuser > 0) { + for (let i = 1; i <= refuser; i++) { + p_message += '- ' + $("#libelleMedicamentRefuser_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleMedicament; + p_message += "\n"; + } + + p_message += "Motif de refus : " + motifRefusAssure + " "; + + p_message += "\n"; + + p_message += (codeLangueSociete == "en_US") ? "Act granted : " : "Medicaments accordés : "; + + p_message += "\n"; + + if (accepter > 0) { + for (let i = 1; i <= accepter; i++) { + p_message += '- ' + $("#libelleMedicamentAccepter_" + i).val(); + p_message += "\n"; + } + } else { + p_message += libelleMedicament; + p_message += "\n"; + } + + p_message += "Observation : " + motifReel + " "; + } + + + envoyersms(p_destinataires, p_message, creation_message); +} + + +function validerTousLesMedicaments(numeroFeuilleMaladie, p_choix) { + + + donnees = "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/validertousmedicaments/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + + +function annulerValiderTousLesMedicaments(numeroFeuilleMaladie, p_choix) { + + + donnees = "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/annulervalidertous/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function refuserTousLesMedicaments(numeroFeuilleMaladie, p_choix) { + + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/refusertousmedicaments/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + + +function annulerRefuserTousLesMedicaments(numeroFeuilleMaladie, p_choix) { + + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/annulerrefusertous/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function validermedicament(idMedicament, numeroFeuilleMaladie, p_choix) { + + donnees = 'idMedicament=' + idMedicament + "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + + if (p_choix == 1) { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/validermedicament/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + }else{ + $.ajax({ + url: $("#racineWeb").val() + "Ajaxmedicamentsprescrits/annulervalidermedicament/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_medicaments_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + } + +} + + +function accepterrefusertouslesexamens() { + + modeSaisieFeuille = $("#modeSaisieFeuille").val(); + codePrestataire = $("#codePrestataireExamen").val(); + + + idExamen = $("#idExamen").val(); + numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val(); + + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusPrestataire").val(); + motifRefusPrestataire = $("#motifRefusPrestataire").val(); + + entente = $("#entente").val(); + refuser = $("#refuser").val(); + accepter = $("#accepter").val(); + smsenoye = $("#smsenoye").val(); + + + if (refuser > 0) { + typeMailRefus = 'refusententeprealable'; + typeSmsRefus = "refusententeprealable"; + } + + if (accepter > 0) { + typeMailAccord = "accordententeprealable"; + typeSmsAccord = "accordententeprealable"; + } + + if (accepter > 0 && refuser > 0) { + var accepterRefuser = 1; + } + + + if ((motifReel == "" || motifReel <= " ") && (accepter > 0)) { + motifReel = "BON POUR ACCORD"; + + $("#motifReel").val(motifReel); + } + + + if ((motifRefusAssure <= " " || motifRefusPrestataire <= " ") && (refuser > 0)) { + v_msg = "Veuillez saisir le motif du refus!"; + v_msgEng = "Please enter the reason for the refusal!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + return; + }else{ + + + v_msg = "Confirmez-vous la liste des examens?"; + v_msgEng = "Do you confirm this refusal?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idExamen=' + idExamen + '&motifReel=' + motifReel; + donnees += '&motifRefusAssure='+ motifRefusAssure + '&codePrestataire='+ codePrestataire; + donnees += '&refuser=' + refuser + '&entente=' + entente + '&accepter=' + accepter; + donnees += '&numeroFeuilleMaladie=' + numeroFeuilleMaladie + '&motifRefusPrestataire=' + motifRefusPrestataire; + + donnees_sav = donnees; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealablesbenficiaire/accepterrefusertouslesexamens/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + if (modeSaisieFeuille != 1) { + if ((refuser > 0) && (accepterRefuser != 1)) { + + preparesmsRefus(typeSmsRefus); + } + if ((accepter > 0) && (accepterRefuser != 1)) { + + preparesmsAccord(typeSmsAccord); + } + if (accepterRefuser == 1) { + preparesmsAccordRefus(typeSmsAccord, typeSmsRefus); + } + } + }, + complete: function () { + + liste_ententeprealables(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + } + +} + +function validerTouteDemandes(numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + codeLangue = $("#codeLangue").val(); + + donnees = "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/validerTouteDemandes/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#div_examens_prescrits").html(data); + //controle.focus(); + if(codeLangue=="en_US") + { + $("#motifReel").val("GOOD FOR AGREEMENT"); + }else{ + $("#motifReel").val("BON POUR ACCORD"); + } + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function refuserTouteDemandes(numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/refuserTouteDemandes/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function validerexamen(idExamen, numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + + donnees = 'idExamen=' + idExamen + "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + if (p_choix == 1) { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/validerexamen/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + + }, + error: function (data) { + }, + complete: function () { + } + }); + } else { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/annulervalidationexamen/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + + }, + error: function (data) { + }, + complete: function () { + } + }); + } + + +} + + +function refuserexamen(idExamen, numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + + donnees = 'idExamen=' + idExamen + "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + if (p_choix == 1) { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/refuserexamen/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + } else { + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/annulerrefusexamen/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + } +} + +function annulerValiderTouteDemandes(numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + + donnees = "&numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/annulervaliderTouteDemande/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#div_examens_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function annulerRefuserTouteDemandes(numeroFeuilleMaladie, p_choix, codeTypePrestation) { + + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie + "&p_choix=" + p_choix; + donnees +="&codeTypePrestation="+codeTypePrestation; + + //$("#div_examens").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/annulerRefuserTouteDemandes/", + type: 'POST', + data: donnees, + success: function (data) { + $("#div_examens_prescrits").html(data); + //controle.focus(); + }, + error: function (data) { + }, + complete: function () { + } + }); + +} + +function ajax_maj_prime_produit_lienparente(idPrime, prime, controle) +{ + prime=prime.replace(/ /g,""); + prime=parseInt(prime.replace(",","."),10); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&prime="+prime; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majprimeproduitlienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + + +function ajax_maj_plafond_produit_lienparente(idPrime, plafond, controle) +{ + plafond=plafond.replace(/ /g,""); + plafond=parseInt(plafond.replace(",","."),10); + controle.value=plafond; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&plafond="+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majplafondproduitlienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function ajax_maj_autoriser_produit_lienparente(idPrime, autorise, controle, ligne) +{ + donnees = 'idPrime='+idPrime+"&autorise="+autorise; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majautoriserproduitlienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + + +} + +function ajax_maj_nbrefamille_produit_lienparente(idPrime, nbrefamille, controle) +{ + nbrefamille=nbrefamille.replace(/ /g,""); + nbrefamille=parseInt(nbrefamille.replace(",","."),10); + controle.value=nbrefamille; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&nbrefamille="+nbrefamille; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majnbrefamilleproduitlienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function ajax_maj_supplementaire_produit_lienparente(idPrime, supplementaire, controle) +{ + supplementaire=supplementaire.replace(/ /g,""); + supplementaire=parseInt(supplementaire.replace(",","."),10); + controle.value=supplementaire; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&supplementaire="+supplementaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majsupplementaireproduitlienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function consulter_produit(idProduit) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterproduit/"+idProduit+"/"); +} + +/* +function etatBarMenu() +{ + + + var bar = "0"; + + if (body.classList.contains('toggle-sidebar')) { + bar = "1"; + } else { + bar = "0"; + } + + donnees = 'bar='+bar; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxetatbarmenu/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_etat_menu").html(data); + }, + error: function(data) { + }, + complete: function() { + hideBar(); + } + }); + +} +*/ + +/* +function hideBar() +{ + + + bar = $("#bar").val(); + + if(bar=="1"){ + + body.classList.remove("toggle-sidebar"); + }else{ + body.classList.add("toggle-sidebar"); + } + +} +*/ + +function ajax_maj_prime_ajuster(idCollege, prime, controle, codeLienParente) +{ + prime=prime.replace(",","."); + controle.value=prime; + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&prime="+prime+'&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajustementprime/majprime/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_test_gabarit").html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function recapituler_ajustement() +{ + donnees = ''; + + $("#div_college").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajustementprime/recapituler/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_college").html(data); + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function enregistrer_ajustementprime() +{ + donnees = ''; + + v_msg="Confirmez-vous l'ajustement des primes de cette police?"; + v_msgEng="Can you confirm the premium adjustment for this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajustementprime/enregistrer/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_college").html(data); + + }, + error: function(data) { + }, + complete: function() { + // window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); + window.location.assign($("#racineWeb" ).val()+"Facturerpolice/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajax_maj_autoriser_college_temp(idPrime, autorise, controle, modeDevis) +{ + + donnees = 'idPrime='+idPrime+"&autorise="+autorise; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majautorisercollege/"; + }else{ + v_url = "Ajaxprimescategoried/majautorisercollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + if(modeDevis == "0"){ + enregistrer_college_temp(); + }else{ + enregistrer_college_temp_d(); + } + } + }); + +} + + +function affichertoutfacturationprime() +{ + $("#div_page_complet").html('
' + '
'); + // + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/affichertoutfacturationprime/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_page_complet").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function importer_modele_assure(idAvenant) +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $('#div_form_upload').hide(); + + + var div_export = $('#div_exporter_liste_assures'); + + enregistrer_date_effet(); + + div_export.html('
' + '
'); + + cheminFichier=$("#cheminFichier").val(); + + donnees = 'idAvenant='+idAvenant+'&cheminFichier='+cheminFichier; + + $("#div_erreur_excel").html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/importermodele/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(''); + $("#div_erreur_excel").html(data); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_export.html(''); + + succes_impot_execl=$("#succes_impot_execl").val(); + + if (succes_impot_execl == "1") + { + maj_etape_3_import_assures(); + } + } + }); +} + +// + +function saisie_date_entree(idAvenant){ + + + $("#div_patienter").html('
' + '
'); + + donnees = 'idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsaisidateassure/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_saisie_date').html(data); + $(".datepicker" ).datepicker(); + $('#div_saisie_date').modal("show"); + + }, + complete: function() { + + } + }); +} + +function enregistrer_date_effet() +{ + dateEffet = $("#dateEntree").val(); + + donnees = 'dateEffet='+dateEffet; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsaisidateassure/majdateeffet/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + + }, + complete: function() { + + } + }); + +} + + +function annulation_quittance(){ + annule = $("#annule").val(); + annulant= $("#annulant").val(); + + if(annule=="1" || annulant=="1"){ + v_msg="Emission déjà annulée!"; + v_msgEng="Issue already canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#div_patienter").html('
' + '
'); + + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxannulerquittance/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_annulation_quittance').html(data); + $('#div_annulation_quittance').modal("show"); + + }, + complete: function() { + + } + }); +} + +function valier_annulation_quittance(idEmission) +{ + var motifAnnulation = $("#motifAnnulation").val(); + + if(motifAnnulation<=" "){ + v_msg = "Veuillez saisir le motif d'annulation de la quittance!"; + v_msgEng = "Please enter the reason for cancelling the receipt!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifAnnulation").focus(); + return false; + + } + + $("#div_wait").html('
' + '
'); + + $("#btn_annulation").prop("disabled",true); + + donnees = 'idEmission='+idEmission+'&motifAnnulation='+motifAnnulation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxannulerquittance/valider/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + $("#btn_annulation").prop("disabled",false); + + v_msg="Emission annulmée avec effectué!"; + v_msgEng="Successfuly done!"; + alert_ebene(v_msg, v_msgEng); + + afficher_emission(idEmission); + }, + complete: function() { + + } + }); +} + +function nb_famille_atteint() +{ + codeLienParente = $("#codeLienParente").val(); + + $("#btn_enreg_ben").enable(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproraterprimebeneficiaire/nbfamilleatteint/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_nbfamilleatteint').html(data); + + nbfamilleatteint = $("#nbfamilleatteint").val(); + + if(nbfamilleatteint=="1"){ + $("#btn_enreg_ben").disable(); + + v_msg = "Population maximum atteinte pour ce lien parenté!"; + v_msgEng = "Maximum population reached for this relationship"; + alert_ebene(v_msg, v_msgEng); + } + }, + complete: function() { + + } + }); + +} + + +function ajax_maj_Agemin_produit_lienparente(idPrime, ageMin, controle) +{ + ageMin=ageMin.replace(/ /g,""); + ageMin=parseInt(ageMin.replace(",","."),10); + controle.value=ageMin; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&ageMin="+ageMin; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majagemin/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + + +function ajax_maj_Agemax_produit_lienparente(idPrime, ageMax, controle) +{ + ageMax=ageMax.replace(/ /g,""); + ageMax=parseInt(ageMax.replace(",","."),10); + controle.value=ageMax; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&ageMax="+ageMax; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimelienparente/majagemax/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + + +function ajax_maj_agemin_college_temp(idPrime, ageMin, controle, modeDevis) +{ + ageMin=ageMin.replace(/ /g,""); + ageMin=parseInt(ageMin.replace(",","."),10); + controle.value=ageMin; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&ageMin="+ageMin; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majagemincollege/"; + }else{ + v_url = "Ajaxprimescategoried/majagemincollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + if(modeDevis == "0"){ + enregistrer_college_temp(); + }else{ + enregistrer_college_temp_d(); + } + } + }); + } +} + +function ajax_maj_agemax_college_temp(idPrime, ageMax, controle, modeDevis) +{ + ageMax=ageMax.replace(/ /g,""); + ageMax=parseInt(ageMax.replace(",","."),10); + controle.value=ageMax; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&ageMax="+ageMax; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majagemaxcollege/"; + }else{ + v_url = "Ajaxprimescategoried/majagemaxcollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + if(modeDevis == "0"){ + enregistrer_college_temp(); + }else{ + enregistrer_college_temp_d(); + } + } + }); + } +} + + +function filtrertypefacturegarant(){ + + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees ='codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/filtretypefacture/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_typefacture').html(data); + }, + complete: function(){ + } + }); + +} + +function initierfacturegarant() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + dateFacture = $("#dateFacture").val(); + codeTypeFacturationGarant = $("#codeTypeFacturationGarant").val(); + codePeriodicite = $("#codePeriodicite").val(); + codeExercice = $("#codeExercice").val(); + + bonneDate = control_date_facture_garant(dateFacture, codeExercice); + + + if(!bonneDate) + { + v_msg="Veuillez revoir la date!"; + v_msgEng="Please review the date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeTypeFacturationGarant<=" "){ + v_msg="Veuillez sélectionner un type de facturation!"; + v_msgEng="Please select a billing type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeFacturationGarant").focus(); + return; + + } + + if(codePeriodicite<=" "){ + v_msg="Veuillez sélectionner une périodicité!"; + v_msgEng="Please select a periodicity!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePeriodicite").focus(); + return; + + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeTypeFacturationGarant='+codeTypeFacturationGarant; + donnees += '&codePeriodicite='+codePeriodicite+'&codeExercice='+codeExercice+'&dateFacture='+dateFacture; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/initierfacturegarant/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Detailfacturegarant/"); + } + }); + +} + +function filtreperiodicitefacture(){ + + var codeGcAssureur = $('#codeGcAssureur').val(); + var codeNatureFacturationGarant = $('#codeNatureFacturationGarant').val(); + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeNatureFacturationGarant<=" "){ + v_msg="Veuillez sélectionner la nature de la facture!"; + v_msgEng="Please select the nature of the invoice!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNatureFacturationGarant").focus(); + return; + + } + + /* + if(codeNatureFacturationGarant=="DEF"){ + v_msg="Non implémenté pour le moment!"; + v_msgEng="Not implemented at the moment!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNatureFacturationGarant").val(""); + $("#codeNatureFacturationGarant").focus(); + return; + } + */ + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeNatureFacturationGarant='+codeNatureFacturationGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/filtreperiodicite/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_periodicite').html(data); + $("#codePeriodicite").disable(); + }, + complete: function(){ + + } + }); + +} + + +function maj_ht_facturegarant_temp() +{ + montantHt = parseInt($('#montantHt').val().replace(/ /g,"")); + + donnees = 'montantHt='+montantHt; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/majmontantht/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_detail_facture').html(data); + }, + complete: function(){ + } + }); + +} + +function genererfacturecautiongarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturecaution/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichegroupefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function ajax_maj_accessoire_facture_honoraire_prime (controle,p_accessoire, id) +{ + // p_accessoire=p_accessoire.replace(",","."); + parseInt(p_accessoire.replace(/ /g,"")); + + controle.value=p_accessoire; + + if(controle_numerique(controle)) + { + donnees = 'id='+id; + donnees += '&accessoire='+p_accessoire; + + + // debugger + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/majaccessoirehonorairePrime/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_detail_facture').html(data); + }, + error: function(data) { + }, + complete: function() { + + + } + }); + } +} + + +function genererfacturehonoraireprimegarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturehonoraireprime/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function genererfacturesinitresgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturesinistre/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function genererfacturehonorairesinitresgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturehonorairesinistre/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function select_garant_a_facturer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/selectiongarant/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_garant').html(data); + + + + dataTab(); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + +function select_typefacture_garant_a_facturer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/selectiontypefacture/", + type: 'POST', + data: donnees, + success: function(data) { + $('#tab_type_facture').html(data); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + + +function select_tous_garant_a_facturer(p_choix) +{ + + + donnees = 'choix='+p_choix; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/tousgarants/", + type: 'POST', + data: donnees, + success: function(data) { + + $('#div_garant').html(data); + + + + dataTab(); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + +function select_tous_type_facture(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/toustypefacture/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_type_facture').html(data); + + dataTab(); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + +function fin_periode_facturation_garant() +{ + codeMoisDebut = $("#codeMoisDebut").val(); + + donnees = 'codeMoisDebut='+codeMoisDebut; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/finperiode/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_mois_fin').html(data); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); + + +} + +function control_date_facture_garant(dateFacture, exercice) +{ + tab = dateFacture.split('/'); + + annee = parseInt(tab[2]); + exercice = parseInt(exercice); + + return (exercice==annee); +} + +function filtrer_facture_garants() +{ + nbreGarantsSelection = $("#nbreGarantsSelection").val(); + nbreNatureFacSelection = $("#nbreNatureFacSelection").val(); + + + if (nbreGarantsSelection == "0"){ + v_msg="Veuillez s\u00e9lectionnez au moins un garant!"; + v_msgEng="Please select at least one guarantor!"; + + alert_ebene(v_msg, v_msgEng); + + $('#div_liste_facture_garant').html(''); + + return; + } + + if (nbreNatureFacSelection == "0"){ + v_msg="Veuillez s\u00e9lectionnez au moins une nature de facture!"; + v_msgEng="Please select at least one invoice type!"; + alert_ebene(v_msg, v_msgEng); + + $('#div_liste_facture_garant').html(''); + + return; + } + + debut = $("#debut").val(); + fin = $("#fin").val(); + + + + donnees = 'debut='+debut+'&fin='+fin; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/filtrerfacturegarants/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + lister_facture_garants(); + } + }); + +} + + +function lister_facture_garants() +{ + $("#div_liste_facture_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/listerfacturegarants/", + type: 'POST', + success: function(data) { + $('#div_liste_facture_garant').html(data); + filtreTab(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function charger_honoraire_forfaitaire_garant() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeAssietteFacturationGarant = $("#codeAssietteFacturationGarant").val(); + codeTypeFacturationGarant = $("#codeTypeFacturationGarant").val(); + + $("#div_honoraires_forfaitaire").html('
' + '
'); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeAssietteFacturationGarant='+codeAssietteFacturationGarant; + donnees += '&codeTypeFacturationGarant='+codeTypeFacturationGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/honoraireforfaitgarant/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_honoraires_forfaitaire').html(data); + setTimeout(function() { + dataTableMini(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function genererfacturehonoraireforfaitaire() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturehonoraireforfaitaire/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_appel_fond_garant() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeAssietteFacturationGarant = $("#codeAssietteFacturationGarant").val(); + codeTypeFacturationGarant = $("#codeTypeFacturationGarant").val(); + + $("#div_appel_fond").html('
' + '
'); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeAssietteFacturationGarant='+codeAssietteFacturationGarant; + donnees += '&codeTypeFacturationGarant='+codeTypeFacturationGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/appelfondgarant/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_appel_fond').html(data); + setTimeout(function() { + dataTableMini(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function genererfactureappelfondgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfactureappelfond/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function charger_appel_cotisation_garant() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeAssietteFacturationGarant = $("#codeAssietteFacturationGarant").val(); + codeTypeFacturationGarant = $("#codeTypeFacturationGarant").val(); + + $("#div_appel_cotisation").html('
' + '
'); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeAssietteFacturationGarant='+codeAssietteFacturationGarant; + donnees += '&codeTypeFacturationGarant='+codeTypeFacturationGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/appelcotisationgarant/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_appel_cotisation').html(data); + + setTimeout(function() { + dataTableMini(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function genererfactureappelcotisationgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfactureappelcotisationgarant/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_honoraire_budget_garant() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeAssietteFacturationGarant = $("#codeAssietteFacturationGarant").val(); + codeTypeFacturationGarant = $("#codeTypeFacturationGarant").val(); + + $("#div_appel_cotisation").html('
' + '
'); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeAssietteFacturationGarant='+codeAssietteFacturationGarant; + donnees += '&codeTypeFacturationGarant='+codeTypeFacturationGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/honorairebudgetgarant/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_appel_cotisation').html(data); + + setTimeout(function() { + dataTableMini(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + + +} + +function genererfacturehonorairebudgetgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturehonorairebudgetgarant/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function retour_fiche_garant() +{ + idGc = $("#idGc").val(); + + afficher_gc_assureur(idGc); + +} + + +function select_toutes_factures_edition(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/toutesfacturesedition/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + lister_facture_garants(); + } + }); +} + +function select_facture_a_editer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/unefactureedition/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + lister_facture_garants(); + } + }); +} + + +function selectionner_convention(idEntete, codeTypeFacture, codeConvention){ + // + + donnees = 'idEntete='+idEntete+'&codeTypeFacture='+codeTypeFacture+'&codeConvention='+codeConvention; + // + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconventioneditionfacture/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_convention_garant').html(data); + $('#div_convention_garant').modal("show"); + + }, + complete: function() { + + } + }); +} + +function editer_facture_garant() +{ + codeConvention = $("#codeConvention").val(); + + + if(codeConvention<=" ") + { + v_msg="Veuillez sélectionner une convention!"; + v_msgEng="Please select a convention!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeConvention").focus(); + return; + } + + donnees = 'codeConvention='+codeConvention; + // + var div_export = $('#div_editer_facture'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarantedition/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + div_export.html(data); + + }, + complete: function() { + + } + }); + + +} + +function majtextefacturation(idTexte, texte) +{ + + donnees = 'idTexte='+idTexte+'&texte='+texte; + + v_url = $("#racineWeb").val()+"Ajaxparamsysteme/majtextefacturation/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + + } + }); + +} + +function majecheancefacturation(idTexte, echeance) +{ + + donnees = 'idTexte='+idTexte+'&echeance='+echeance; + + v_url = $("#racineWeb").val()+"Ajaxparamsysteme/majecheancefacturation/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + + } + }); + +} + +function retirer_tous_prestataires_du_site() +{ + retirer_tous_prestataires_reseau(); +} + +function filtrer_facture_garants_encaissement() +{ + debut =$("#debut").val(); + fin =$("#fin").val(); + encaisse=$("#encaisse").val(); + + donnees = 'debut='+debut+'&fin='+fin+'&encaisse='+encaisse; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/filtrerfacturegarantsencaissement/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + lister_encaissement_facture_garants(); + + } + }); + +} + +function nom_tireur(controle){ + $("#nomTireur").val(controle.options[controle.selectedIndex].text); +} + +// +function solder_facturegarant_temp(idFacture) +{ + donnees = 'idFacture='+idFacture; + + $("#div_situation_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsituationgarant/solderfacture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_situation_garant").html(data); + }, + error: function(data) { + }, + complete: function() { + //recap_bordereau_encaissement_garant(); + } + }); +} + +function recap_bordereau_encaissement_garant() +{ + montant_ecart = $("#montant_ecart_info").val(); + $("#montant_selection").val( $("#montant_selection_info").val()); + $("#montant_ecart").val(montant_ecart); +} + +function supprimer_detail_encaissement_garant(idDetailencaissement) +{ + donnees = 'idDetailencaissement='+idDetailencaissement; + + $("#div_situation_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsituationgarant/supprimerfacture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_situation_garant").html(data); + }, + error: function(data) { + }, + complete: function() { + //recap_bordereau_encaissement_garant(); + } + }); +} + +function selectionner_facturegarant_impayee(numeroFacture, idFacture, montantTtc, montantEncaisse, solde) +{ + $("#numeroFactureAcpte").val(numeroFacture); + $("#idFactureAcpte").val(idFacture); + $("#montantTtcAcpte").val(formatCurrency(montantTtc)); + $("#montantEncaisseAcpte").val(formatCurrency(montantEncaisse)); + $("#montantAcpte").val(formatCurrency(solde)); + $("#anc_soldeAcpte").val(solde); + + $("#montantAcpte").focus(); +} + + +function ajouter_facturegarant_acompte() +{ + idFacture = $("#idFactureAcpte" ).val(); + montantAcpte = parseInt($('#montantAcpte').val().replace(/ /g,""),10); + + montantTtcAcpte = parseInt($('#montantTtcAcpte').val().replace(/ /g,""),10); + + if(idFacture<="0") + { + v_msg="Veuillez sélectionner une facture!"; + v_msgEng="PLease select an invoice!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + if(montantAcpte<="0") + { + v_msg="Veuillez saisir l\'acompte!"; + v_msgEng="Please enter the deposit!"; + alert_ebene(v_msg, v_msgEng); + $("#montantAcpte" ).focus(); + return; + } + + anc_soldeAcpte = parseInt($('#anc_soldeAcpte').val().replace(/ /g,""),10); + + if(Number(montantAcpte)>Number(anc_soldeAcpte)) + { + $("#montantAcpte").focus(); + v_msg="Veuillez vérifier le montant de l\'acompte!"; + v_msgEng="Please check the amount of the deposit!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = 'idFacture='+idFacture+'&montantAcpte='+montantAcpte+'&montantTtcAcpte='+montantTtcAcpte; + + $("#div_situation_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsituationgarant/ajouteracomptefacture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_situation_garant").html(data); + }, + error: function(data) { + }, + complete: function() { + //recap_bordereau_encaissement_garant(); + } + }); +} + +function enregistrer_encaissement_facturegarant() +{ + montant_ecart = $("#montant_ecart").val(); + montant_ecart = montant_ecart.replace(" ", ""); + montant_ecart = parseInt(montant_ecart); + montant_ecart = Math.abs(montant_ecart); + + EcartEncaissementTolerable = parseInt($("#EcartEncaissementTolerable").val()); + + //if(montant_ecart>"100") + if(montant_ecart>EcartEncaissementTolerable) + { + v_msg="Veuillez vérifier votre écart!"; + v_msgEng="Please check your gap!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous l'enregistrement?"; + v_msgEng="Do you confirm registration?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#formente_encaissement").submit(); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function imprimer_recu_garant(idEncaissement) +{ + donnees = 'idEncaissement='+idEncaissement; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerrecucaisse/garant/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function filtrer_encaissements_garants() +{ + debut =$("#debut").val(); + fin =$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/filtrerencaissements/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + lister_encaissements_garants(); + } + }); + +} + + +function lister_encaissements_garants() +{ + + $("#div_liste_encaissements_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/listerencaissementsgarants/", + type: 'POST', + success: function(data) { + $('#div_liste_encaissements_garant').html(data); + dataTab(); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function imprimer_recu_garant_consulter(idEncaissement) +{ + div_edition = $('#div_edition'); + + donnees = 'idEncaissement='+idEncaissement; + + //alert(donnees); + + var div_export = $('#div_page_encaissement'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerrecucaisse/garantpop/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_edition.modal("show"); + } + }); + +} + +function select_encaissement_a_editer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/unencaisseselection/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + lister_encaissements_garants(); + } + }); +} + +function select_tous_encaisse_garant(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/tousencaissegarant/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + lister_encaissements_garants(); + } + }); +} + +function get_type_garant() +{ + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees ='codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/gettypegarant/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_type_garant').html(data); + }, + complete: function(){ + } + }); + + +} + + +function exporter_liste_facture_garant() +{ + div_exporter = $('#div_exporter'); + + debut =$("#debut").val(); + fin =$("#fin").val(); + encaisse=$("#encaisse").val(); + + donnees = 'debut='+debut+'&fin='+fin+'&encaisse='+encaisse; + + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterfacturegarant/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_exporter.modal("show"); + } + }); + +} + +function exporter_liste_groupe_facture_garant() +{ + div_exporter = $('#div_exporter'); + + debut =$("#debut").val(); + fin =$("#fin").val(); + encaisse=$("#encaisse").val(); + + donnees = 'debut='+debut+'&fin='+fin+'&encaisse='+encaisse; + + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterfacturegarant/groupefacture/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_exporter.modal("show"); + } + }); + +} + +function exporter_liste_encaissement_garant() +{ + div_exporter = $('#div_exporter'); + + debut =$("#debut").val(); + fin =$("#fin").val(); + + + donnees = 'debut='+debut+'&fin='+fin; + + + //alert(donnees); + //return; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterfacturegarant/encaissementgarant/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_exporter.modal("show"); + } + }); + +} + +function controle_spmax() +{ + spMin = parseInt($("#spMin").val()); + spMax = parseInt($("#spMax").val()); + + if(spMin>spMax) + { + v_msg="Veuillez vérifier S/P Maximum!"; + v_msgEng="Please check Maximum S/P!"; + alert_ebene(v_msg, v_msgEng); + + $("#spMax").val(0); + $("#spMax").focus(); + + return; + } + +} +//Ajaxtbajouterbaremeaccessoireavenant +//Ajaxtbmodifierbaremeaccessoireavenant/ +//Ajaxajouterbaremeaccessoiregarant + +//Ajaxtbmodifiertableauajustement/ + +function controle_spmax() +{ + spMin = parseInt($("#spMin").val()); + spMax = parseInt($("#spMax").val()); + + if(spMin>spMax) + { + v_msg="Veuillez vérifier S/P Maximum!"; + v_msgEng="Please check Maximum S/P!"; + alert_ebene(v_msg, v_msgEng); + + $("#spMax").val(0); + $("#spMax").focus(); + + return; + } + +} + + +function afficher_tauxajustement_garant(){ + + var codeGcAssureur = $('#codeGcAssureur').val(); + afficheBoutons(0); + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtblistertableauajustementgarant/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_lister_table').html(data); + appliquerDataTable(); + }, + complete: function() { + + } + }); + +} + +function affiche_garants_territoire() +{ + var codeTerritoire = $('#codeTerritoire').val(); + + donnees = 'codeTerritoire='+codeTerritoire; + + div_garant=$("#div_garant"); + + div_garant.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + + $('#div_garant').html(data); + datatab_plus(); + }, + complete: function() { + + } + }); +} + +function ajouter_un_garant_territoire(codeGcAssureur) +{ + + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire+'&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/ajouterungarant/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + affiche_garants_territoire(); + } + }); +} + +// +function ajouter_tous_garants_territoire() +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/ajoutertousgarants/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_garants_territoire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_garants_territoire() +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/retirertousgarants/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_garants_territoire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function retirer_un_garant_territoire(idGarant) +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idGarant='+idGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/retirerungarant/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_garants_territoire(); + } + }); +} + +function maj_montant_accessoire_territoire(idGarant, montant, controle) +{ + montant=montant.replace(/ /g,""); + montant=parseInt(montant.replace(",","."),10); + controle.value=montant; + + if(controle_numerique(controle)) + { + donnees = 'idGarant='+idGarant+"&montant="+montant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantterritoire/majmontant/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +/* +function maj_forfait_honoraire_college(idColleTemp, forfait, controle) +{ + forfait=forfait.replace(/ /g,""); + forfait=parseInt(forfait.replace(",","."),10); + controle.value=forfait; + + if(controle_numerique(controle)) + { + donnees = 'idColleTemp='+idColleTemp+"&forfait="+forfait; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majforfaithonoraire/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function maj_forfait_appelfond_college(idColleTemp, forfait, controle) +{ + forfait=forfait.replace(/ /g,""); + forfait=parseInt(forfait.replace(",","."),10); + controle.value=forfait; + + if(controle_numerique(controle)) + { + donnees = 'idColleTemp='+idColleTemp+"&forfait="+forfait; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majforfaitappelfond/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} + +function maj_forfait_appelcotisation_college(idColleTemp, forfait, controle) +{ + forfait=forfait.replace(/ /g,""); + forfait=parseInt(forfait.replace(",","."),10); + controle.value=forfait; + + if(controle_numerique(controle)) + { + donnees = 'idColleTemp='+idColleTemp+"&forfait="+forfait; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majforfaitappelcotisation/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + } +} +*/ + +function controle_primeMax() +{ + primeMin = $("#primeMin").val().replace(/ /g,""); + primeMax = $("#primeMax").val().replace(/ /g,""); + + primeMin = parseInt(primeMin); + primeMax = parseInt(primeMax); + + if(primeMin>primeMax) + { + v_msg="Veuillez vérifier la prime maximum!"; + v_msgEng="Please check the maximum premium!"; + alert_ebene(v_msg, v_msgEng); + + $("#primeMax").val(0); + $("#primeMax").focus(); + + return; + } + +} + +function affiche_prime_min() +{ + codeTypeContrat = $("#codeTypeContrat").val(); + codeApplication = $("#codeApplication").val(); + + if (codeTypeContrat<=" ") + { + v_msg="Veuillez sélectionner un type de contrat!"; + v_msgEng="Please select a type of contract!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (codeApplication<=" ") + { + v_msg="Veuillez sélectionner un champs d'application!"; + v_msgEng="Please select a field of application!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTypeContrat='+codeTypeContrat+"&codeApplication="+codeApplication; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtbajouterbaremeaccessoireavenant/primemini/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_prime_mini").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + + +function affiche_prime_min_garant() +{ + codeTypeContrat = $("#codeTypeContrat").val(); + codeApplication = $("#codeApplication").val(); + + codeGcAssureur = $("#codeGcAssureur").val(); + + if (codeTypeContrat<=" ") + { + v_msg="Veuillez sélectionner un type de contrat!"; + v_msgEng="Please select a type of contract!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (codeApplication<=" ") + { + v_msg="Veuillez sélectionner un champs d'application!"; + v_msgEng="Please select a field of application!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTypeContrat='+codeTypeContrat+"&codeApplication="+codeApplication; + donnees += '&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajouterbaremeaccessoiregarant/primemini/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_prime_mini").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function ajax_fiche_facture_garant(idEntetefacturegarant) +{ + donnees = 'idEntetefacturegarant='+idEntetefacturegarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfichefacturegarant/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_fiche_facture_modal").html(data); + //alert(data); + //return; + $('#div_fiche_facture').modal("show"); + + + setTimeout(function() { + //your datatable code + dataTableMini(); + + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function editionmouvementeffectif(idEmission) +{ + donnees = 'idEmission='+idEmission; + + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + + $.ajax({ + // url: $("#racineWeb").val()+"Ajaxcontextditionpieceavenant/", + url: $("#racineWeb").val()+"Ajaxeditionmouvementeffectif/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_deatil_pop").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + + } + }); +} +function afficherListeActesPrescrits(numeroFeuilleMaladie, codeTypePrestation, codeGarantie) { + + + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + donnees = "numeroFeuilleMaladie=" + numeroFeuilleMaladie; + donnees += "&codeReponseEntentePrealable=" + codeReponseEntentePrealable; + donnees += "&codeTypePrestation=" + codeTypePrestation; + donnees += "&codeGarantie=" + codeGarantie; + + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteactesprescrits/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_examens_prescrits").html(data); + appliquerDataTable(); + $("#div_examens_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); + $("#div_examens_prescrits").modal("show"); + $("#div_patienter").empty(); + + /* + var motifReel = document.getElementById('motifReel'); + var motifRefusPrestataire = document.getElementById('motifRefusPrestataire'); + motifReel.value = ""; + motifRefusPrestataire.value = ""; + */ + }, + complete: function () { + + } + }); + +} + +function listeententeprealablesproformahospi() +{ + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesproformahospi/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + + + +function afficheractesproforma(idProforma) { + + window.location.assign($("#racineWeb" ).val()+"Traitementproformahospitalisation/"+idProforma+"/"); +} + +function maj_dureeCorrigee_proforma_hospit(idProforma, dureeCorrigee) +{ + donnees = 'idProforma='+idProforma; + donnees += '&dureeCorrigee='+dureeCorrigee; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/majdureecorrigee/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + ajaxtraitementproformahospitalisation(); + } + }); + +} + +function ajaxtraitementproformahospitalisation() +{ + $idProforma = $("#idProforma").val(); + + donnees = 'idProforma='+idProforma; + $("#div_examens").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + $("#div_examens").html(data); + }, + complete: function() { + } + }); + + +} + +function validertoutproformahospit(idProforma){ + + codeLangue = $("#codeLangue").val(); + + donnees = "idProforma=" + idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/validertoutproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#div_examens").html(data); + if(codeLangue=="en_US") + { + $("#motifReel").val("GOOD FOR AGREEMENT"); + }else{ + $("#motifReel").val("BON POUR ACCORD"); + } + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + +} + + +function annulervalidertoutproformahospit(idProforma) +{ + donnees = "idProforma=" + idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/annulervalidertoutproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#motifReel").val(""); + + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + + +} + +function refusertoutproformahospit(idProforma) +{ + donnees = "idProforma=" + idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/refusertoutproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#motifReel").val(""); + + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + + +} + + +function annulerrefusertoutproformahospit(idProforma) +{ + donnees = "idProforma=" + idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/annulerrefusertoutproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#motifReel").val(""); + + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + + +} + +function ajax_maj_prix_acte_proformahospitalisation(idPrestationactes, valeurActe, controle) +{ + valeurActe=valeurActe.replace(",","."); + controle.value=valeurActe; + + valeurActe=valeurActe.replace(/ /g,""); + valeurActe=parseInt(valeurActe.replace(",","."),10); + controle.value=valeurActe; + + if(controle_numerique(controle)) + { + donnees = 'idPrestationactes='+idPrestationactes+"&valeurActe="+valeurActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/majvaleuracte/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + ajaxtraitementproformahospitalisation(); + + + } + }); + } +} + +function ajax_maj_qte_acte_proformahospitalisation(idPrestationactes, quantite, controle) +{ + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantit\u00e9!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idPrestationactes='+idPrestationactes+"&quantite="+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/majquantite/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + ajaxtraitementproformahospitalisation(); + } + }); + } +} + +function validerunacteproformahospit(idProforma, idPrestationactes, choix) +{ + + + donnees = "idPrestationactes=" + idPrestationactes+"&choix="+choix; + donnees += "&idProforma="+idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/validerunacteproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#motifReel").val(""); + + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + + +} + +function refuserunacteproformahospit(idProforma, idPrestationactes, choix) +{ + donnees = "idPrestationactes=" + idPrestationactes+"&choix="+choix; + donnees += "&idProforma="+idProforma; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/refuserunacteproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + + $("#motifReel").val(""); + + }, + error: function (data) { + }, + complete: function () { + ajaxtraitementproformahospitalisation(); + } + }); + +} + +function validerproformahospitalisation(idProforma) +{ + + motifReel = $("#motifReel").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + siRefus = $("#siRefus").val(); + accorderTout = $("#accorderTout").val(); + //entente = $("#entente").val(); + + + if ((motifReel == "" || motifReel <= " ") && (accorderTout > 0)) { + motifReel = "BON POUR ACCORD"; + + $("#motifReel").val(motifReel); + + maj_motifReel_proformahospit(idProforma, motifReel); + } + + + if ((motifRefusAssure <= " ") && (siRefus > 0)) { + v_msg = "Veuillez saisir le motif du refus!"; + v_msgEng = "Please enter the reason for the refusal!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + return; + } + + dureeCorrigee = $("#dureeCorrigee").val(); + if (dureeCorrigee<='0') { + v_msg = "Veuillez saisir la durée accordée!"; + v_msgEng = "Please enter the duration granted!"; + alert_ebene(v_msg, v_msgEng); + + $("#dureeCorrigee").focus(); + return; + } + + donnees = "idProforma="+idProforma; + + //typeSms="proformahospitalisation"; + + v_msg="Validez-vous cette facture proforma?"; + v_msgEng="Do you validate this proforma invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val() + "Ajaxtraitementproformahospitalisation/validerproformahospit/", + type: 'POST', + data: donnees, + success: function (data) { + //alert(data); + v_msg = "Facture Proforma trait\u00e9 avec succès!"; + v_msgEng = "Proforma invoice processed successfully!"; + alert_ebene(v_msg, v_msgEng); + + setTimeout(function() { + //your datatable code + fermertraitementproformahospitalisation(); + }, 500); + + }, + error: function (data) { + }, + complete: function () { + // listeententeprealablesproformahospi(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function maj_motifReel_proformahospit(idProforma, observation) +{ + donnees = 'idProforma='+idProforma; + donnees += '&observation='+observation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/majobservation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + //ajaxtraitementproformahospitalisation(); + } + }); +} + + +function maj_motifRefusPrestataire_proformahospit(idProforma, motifRefus) +{ + donnees = 'idProforma='+idProforma; + donnees += '&motifRefus='+motifRefus; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/majmotifrefus/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + //ajaxtraitementproformahospitalisation(); + } + }); +} + +function fermertraitementproformahospitalisation() +{ + window.location.assign($("#racineWeb" ).val()+"Proformahospitalisation/"); + +} + +function filtrergenreconjoint() +{ + codeLienParente = $('#codeLienParente').val(); + genreAdherent = $('#genreAdherent').val(); + + if(codeLienParente=='C'){ + if(genreAdherent=="F"){ + $('#sexe').val('M'); + $('#sexeConjoint').val('M'); + }else{ + $('#sexe').val('F'); + $('#sexeConjoint').val('F'); + } + + $('#sexe').disable(); + return; + } + $('#sexe').enable(); +} + + +function agemaxbeneficiaire() +{ + codeLienParente = $('#codeLienParente').val(); + idCollege = $('#idCollege').val(); + + if (idCollege<=" ") + { + return; + } + + donnees = 'idCollege='+idCollege; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxagemaxbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_age_max").html(data); + }, + complete: function() { + + } + }); + +} + +function select_tous_beneficiaire_a_retirer(p_choix) +{ + + + donnees = 'choix='+p_choix; + + $('#div_selection_assure').html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionretrait/tousselectionner/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_selection_assure').html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function ajouteradherentfacturation() +{ + + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherent/ajouteradherentfacturation/", + type: 'POST', + data: donnees, + success: function(data) { + //$('#div_selection_assure').html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function select_tous_beneficiaire_changement_college(p_choix) +{ + + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/tousselectionner/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_selection_assure').html(data); + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function pop_changementcollege_masse() +{ + var div_changementcollege_masse = $('#div_changementcollege_masse'); + + div_changementcollege_masse.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/affichercollegebeneficiaireenmasse/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + div_changementcollege_masse.html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + complete: function() { + $("#btn_changementcollege_masse").click(); + } + }); +} + +function select_tous_beneficiaire_changement_college_masse(p_choix) +{ + + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/tousselectionnermasse/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_tabliste').html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function choix_beneficiaire_changementcollege_masse(p_choix, p_id_beneficiaire) +{ + + + donnees = 'idBeneficiaire='+p_id_beneficiaire; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/selectionnermasse/", + type: 'POST', + data: donnees, + success: function(data) { + + $('#div_nbselection').html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + + +function changer_college_beneficiaire_masse() +{ + idCollegeNew = $("#idCollegeNew").val(); + + if (idCollegeNew<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbselection = $("#nbselection").val(); + + if (nbselection == "0") + { + v_msg="Veuillez sélectionner des bénéficiaires!"; + v_msgEng="Please select beneficiaries!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollegeNew='+idCollegeNew; + + $("#div_tabliste").html('
' + '
'); + + v_msg="Confirmez-vous le changement de collège?"; + v_msgEng="Do you confirm the change of college?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxselectionchangementcollege/changercollegebeneficiairemasse/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_tabliste').html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + appliquerDataTable(); + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_limite_adherent(idLimite, plafondOld) +{ + donnees = "idLimite="+idLimite+'&plafondOld='+plafondOld; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimiteadherent/modifierlimite/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_modif_limite').html(data); + $("#plafondNew").focus(); + + }, + complete: function() { + } + }); + +} + +function valider_limite_adherent() +{ + + + idLimite = $("#idLimite").val(); + + plafond = $("#plafondNew").val().replace(/ /g,""); + + + motif = $("#motif").val(); + + idAdherent = $("#idAdherent").val(); + + if (plafond<=" ") + { + $("#plafondNew").val("0"); + } + + if(motif <=" ") + { + v_msg="Le motif est obligatoire!"; + v_msgEng="The pattern is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + + return; + + } + + plafondOld = $("#plafondOld").val().replace(/ /g,""); + + if(plafond=="0" || plafond==plafondOld){ + return; + } + + donnees = "idLimite="+idLimite+'&plafond='+plafond+'&motif='+motif+'&idAdherent='+idAdherent; + + v_msg="Confirmez-vous la modification du plafond?"; + v_msgEng="Do you confirm the modification of the ceiling?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimiteadherent/majplafond/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_modif_limite').empty(); + $('#div_bareme').html(data); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function modifier_limite_beneficiaire(idLimite, plafondOld) +{ + donnees = "idLimite="+idLimite+'&plafondOld='+plafondOld; + + $('#div_modif_limite').empty(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimitebeneficiaire/modifierlimite/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_modif_limite').html(data); + $("#plafondNew").focus(); + + }, + complete: function() { + } + }); + +} + + +function valider_limite_beneficiaire() +{ + + + idLimite = $("#idLimite").val(); + + plafond = $("#plafondNew").val().replace(/ /g,""); + + motif = $("#motif").val(); + + idBeneficiaire = $("#idBeneficiaire").val(); + + //$('#div_bareme').empty(); + + if (plafond<=" ") + { + $("#plafondNew").val("0"); + } + + if(motif <=" ") + { + v_msg="Le motif est obligatoire!"; + v_msgEng="The pattern is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + + return; + } + + plafondOld = $("#plafondOld").val().replace(/ /g,""); + + if(plafond=="0" || plafond==plafondOld){ + return; + } + + donnees = "idLimite="+idLimite+'&plafond='+plafond+'&motif='+motif+'&idBeneficiaire='+idBeneficiaire; + + v_msg="Confirmez-vous la modification du plafond?"; + v_msgEng="Do you confirm the modification of the ceiling?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlimitebeneficiaire/majplafond/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_modif_limite').empty(); + $('#div_bareme').html(data); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function appliquer_ajustemet_renouvellement() +{ + appliquerTauxAjustement = $('#appliquerTauxAjustement').val(); + + donnees = 'appliquerTauxAjustement='+appliquerTauxAjustement; + + $("#div_prime_a_emettre").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrenouvellement/appliquertauxajustement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prime_a_emettre").html(data); + }, + complete: function() { + + } + }); +} + +function alertvip(codeReponse, medical, idDemandederogation) +{ + if(medical=='derogation'){ + v_msg="Attention bénéficiaire VIP!"; + v_msgEng="Attention VIP beneficiary!"; + + + alert_ebene(v_msg, v_msgEng); + + + setTimeout(function() { + if(codeReponse=="A"){ + accepter_derogation_2(idDemandederogation); + }else{ + refuser_derogation_2(idDemandederogation); + } + + }, 500); + } + + +} + + +function retour_modifierparametre() +{ + codeProfil = $('#codeProfil_C').val(); + + if(codeProfil=="SUPADM"){ + window.location.assign($("#racineWeb" ).val()+"Listecentregestion/"); + }else{ + window.location.assign($("#racineWeb" ).val()+"Parametresgeneraux/"); + } +} + +function listeenteteententeprealables() { + codePrestataire = $("#codePrestataire").val(); + + if(codePrestataire==undefined || codePrestataire=="undefined") + { + codePrestataire=""; + } + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'codePrestataire=' + codePrestataire + '&demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealables/entetesententeprealable/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ententeprealable").html(data); + + + }, + complete: function () { + } + }); +} + + + + +function affiche_liste_act_exam_provisoire() +{ + + codeTypeEntentePrealable = $("#codeTypeEntentePrealable").val(); + + + $("#tab_liste").html('
' + '
'); + + if(codeTypeEntentePrealable=="EXAM"){ + v_url = "Ajaxlisteacteexamen/traitementprovisoireexam/"; + }else{ + v_url = "Ajaxlisteacteexamen/traitementprovisoireact/"; + } + + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val() + v_url, + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#tab_liste").html(data); + }, + complete: function () { + + } + }); + +} + + +function traiter_un_provisoire_act_exam(idExamen, codeReponseProvisoire) +{ + + donnees = "idExamen=" + idExamen + "&codeReponseProvisoire=" + codeReponseProvisoire; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/traiterunprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_act_exam_provisoire(); + }, + complete: function () { + + } + }); + +} + +function traitement_tous_provisoire_act_exam(codeReponseProvisoire) +{ + donnees = "codeReponseProvisoire=" + codeReponseProvisoire; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/traitertousprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_act_exam_provisoire(); + }, + complete: function () { + + } + }); + +} + + +function afficher_detail_act_exam(idEnteteEntentePrealable) { + + donnees = "idEnteteEntentePrealable=" + idEnteteEntentePrealable; + + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_examens_prescrits").html(data); + //appliquerDataTable(); + $("#div_examens_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); + $("#div_examens_prescrits").modal("show"); + $("#div_patienter").empty(); + + $(".selectpicker").selectpicker(); + }, + complete: function () { + afficherMasquerAntecedents(); + afficherMasquerSituation(); + } + }); + +} + + +function valider_entente(codeTypeEntentePrealable) { + observations = $("#observations").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + nombreRefus = $("#nombreRefus").val(); + nombreEnAttente = $("#nombreEnAttente").val(); + + if(nombreEnAttente>"0"){ + v_msg = "Veuillez traiter toutes les lignes!"; + v_msgEng = "Please process all lines!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (nombreRefus >"0" && motifRefusAssure <= " ") { + v_msg = "Veuillez saisir le motif pour les refus!"; + v_msgEng = "Please enter the reason for rejections!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + + return; + } + + + v_msg = "Confirmez-vous cette validation?"; + v_msgEng = "Do you confirm this validation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'observations=' + observations + '&motifRefusAssure=' + motifRefusAssure; + + donnees_sav = donnees; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/valider/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $('#div_resultat_validation').html(data); + valider = $("#valider").val(); + + if(valider=="1"){ + v_msg = "Validation réussie!"; + v_msgEng = "Validation succeed!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn-fermer-entente").click(); + + }else{ + v_msg = "Echèc de la validation!"; + v_msgEng = "Validation failed!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + }, + complete: function () { + switch (codeTypeEntentePrealable) + { + case "ACT": + listeenteteententeprealables(); + break; + + case "EXAM": + listeenteteententeprealables(); + break; + + case "DEN": + listeenteteententeprealablesdent(); + break; + + case "SEA": + listeenteteententeprealablessea(); + break; + + case "HOS": + listeenteteententeprealableshospi(); + break; + + default: + v_msg = "type inconu!"; + v_msgEng = "Unknown type!"; + alert_ebene(v_msg, v_msgEng); + } + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function majobservation_act_exam() +{ + observations = $("#observations").val(); + + donnees = "observations=" + observations; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/majobservation/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +function majmotifrefus_act_exam() +{ + motifRefusAssure = $("#motifRefusAssure").val(); + + donnees = "motifRefusAssure=" + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteacteexamen/majmotifrefus/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +function listeenteteententeprealablesdent() { + + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealablesdent/entetesententeprealable/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ententeprealable").html(data); + + + }, + complete: function () { + } + }); +} + + +function afficher_detail_phar(idEnteteEntentePrealable) { + + + donnees = "idEnteteEntentePrealable=" + idEnteteEntentePrealable; + + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + //$('#div_test_gabarit').html(data); + //alert(data); + + $("#div_medicaments_prescrits").html(data); + $("#div_medicaments_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); + $("#div_medicaments_prescrits").modal("show"); + $("#div_patienter").empty(); + + }, + complete: function () { + afficherMasquerMedicaments(); + afficherMasquerAntecedents(); + afficherMasquerSituation(); + } + }); + +} + +function traiter_un_provisoire_pha(idMedicament, codeReponseProvisoire) +{ + + donnees = "idMedicament=" + idMedicament + "&codeReponseProvisoire=" + codeReponseProvisoire; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/traiterunprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_phar_provisoire(); + }, + complete: function () { + + } + }); + +} + +function traitement_tous_provisoire_pha(codeReponseProvisoire) +{ + donnees = "codeReponseProvisoire=" + codeReponseProvisoire; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/traitertousprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_phar_provisoire(); + }, + complete: function () { + + } + }); + +} + +function affiche_liste_phar_provisoire() +{ + $("#tab_liste").html('
' + '
'); + + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/traitementprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#tab_liste").html(data); + }, + complete: function () { + + } + }); + +} + +function valider_entente_pha() { + + observations = $("#observations").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + nombreRefus = $("#nombreRefus").val(); + nombreEnAttente = $("#nombreEnAttente").val(); + + if(nombreEnAttente>"0"){ + v_msg = "Veuillez traiter toutes les lignes!"; + v_msgEng = "Please process all lines!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (nombreRefus >"0" && motifRefusAssure <= " ") { + v_msg = "Veuillez saisir le motif pour les refus!"; + v_msgEng = "Please enter the reason for rejections!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + + return; + } + + + v_msg = "Confirmez-vous cette validation?"; + v_msgEng = "Do you confirm this validation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'observations=' + observations + '&motifRefusAssure=' + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/valider/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $('#div_resultat_validation').html(data); + valider = $("#valider").val(); + + if(valider=="1"){ + v_msg = "Validation réussie!"; + v_msgEng = "Validation succeed!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn-fermer-entente").click(); + }else{ + v_msg = "Echèc de la validation!"; + v_msgEng = "Validation failed!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + }, + complete: function () { + listeententeprealablespha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function majobservation_phar() +{ + observations = $("#observations").val(); + + donnees = "observations=" + observations; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/majobservation/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +function majmotifrefus_phar() +{ + motifRefusAssure = $("#motifRefusAssure").val(); + + donnees = "motifRefusAssure=" + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsentente/majmotifrefus/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +function liste_ententeprealables_sea() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablesea/"); +} + +function listeenteteententeprealablessea() { + + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealablessea/entetesententeprealable/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ententeprealable").html(data); + + + }, + complete: function () { + } + }); +} + + +function listeenteteententeprealablesopt() { + + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealablesopt/entetesententeprealable/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ententeprealable").html(data); + + + }, + complete: function () { + } + }); +} + +function listeenteteententeprealableshospi() { + + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut=' + debut + '&fin=' + fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxententeprealableshospi/entetesententeprealable/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ententeprealable").html(data); + + + }, + complete: function () { + } + }); +} + +function listeententeprealablessea() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablessea/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function control_param_facturation_garant() +{ + + codeSourceFondGarantAppelFond = $("#codeSourceFondGarantAppelFond").val(); + codeSourceFondGarantHonoraire = $("#codeSourceFondGarantHonoraire").val(); + codeSourceFondGarantCaution = $("#codeSourceFondGarantCaution").val(); + + if(codeSourceFondGarantHonoraire == "FOR"){ + $("#forfaitHonoraire").enable(); + //$("#montantBudget").disable(); + //$("#montantBudget").val("0"); + + }else{ + $("#forfaitHonoraire").disable(); + $("#forfaitHonoraire").val("0"); + + } + + if(codeSourceFondGarantCaution == "FOR"){ + $("#forfaitCautionPermanant").enable(); + //$("#montantBudget").disable(); + //$("#montantBudget").val("0"); + + }else{ + $("#forfaitCautionPermanant").disable(); + $("#forfaitCautionPermanant").val("0"); + } + + if(codeSourceFondGarantHonoraire == "BUD" || codeSourceFondGarantHonoraire == "SIN"){ + $("#gcTauxCommissionGerant").disable(); + $("#gcTauxFraisReel").enable(); + $("#gcTauxCommissionGerant").val("0"); + }else if(codeSourceFondGarantHonoraire == "FOR"){ + $("#gcTauxCommissionGerant").disable(); + $("#gcTauxFraisReel").disable(); + $("#gcTauxCommissionGerant").val("0"); + $("#gcTauxFraisReel").val("0"); + }else if(codeSourceFondGarantHonoraire == "PRI"){ + $("#gcTauxCommissionGerant").enable(); + $("#gcTauxFraisReel").disable(); + $("#gcTauxFraisReel").val("0"); + } + + if(codeSourceFondGarantAppelFond == "BUD" || codeSourceFondGarantHonoraire == "BUD" || codeSourceFondGarantCaution == "BUD"){ + $("#montantBudget").enable(); + }else{ + $("#montantBudget").disable(); + $("#montantBudget").val("0"); + } +} + +function filtre_assiette_fond(){ + + codeSourceFondGarantAppelFond = $("#codeSourceFondGarantAppelFond").val(); + + donnees = "codeSourceFondGarantAppelFond="+codeSourceFondGarantAppelFond; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxassiettefacturationgarant/fonds/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_assiette_fonds").html(data); + }, + complete: function() { + } + }); +} + +function filtre_assiette_honoraire(){ + + codeSourceFondGarantHonoraire = $("#codeSourceFondGarantHonoraire").val(); + + donnees = "codeSourceFondGarantHonoraire="+codeSourceFondGarantHonoraire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxassiettefacturationgarant/honoraire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_assiette_honoraire").html(data); + }, + complete: function() { + } + }); +} + +function change_periodicite_honoraire() +{ + $("#codePeriodiciteHonoraire").val($("#codePeriodiciteAppelFond").val()); +} + +function initiergroupefacturegarant() +{ + + codeGcAssureur = $("#codeGcAssureur").val(); + dateFacture = $("#dateFacture").val(); + codeNatureFacturationGarant = $("#codeNatureFacturationGarant").val(); + codePeriodicite = $("#codePeriodicite").val(); + codeExercice = $("#codeExercice").val(); + + bonneDate = control_date_facture_garant(dateFacture, codeExercice); + + + if(!bonneDate) + { + v_msg="Veuillez revoir la date!"; + v_msgEng="Please review the date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(codeNatureFacturationGarant<=" "){ + v_msg="Veuillez sélectionner un type de facturation!"; + v_msgEng="Please select a billing type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeFacturationGarant").focus(); + return; + + } + + if(codePeriodicite<=" "){ + v_msg="Veuillez sélectionner une périodicité!"; + v_msgEng="Please select a periodicity!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePeriodicite").focus(); + return; + + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeNatureFacturationGarant='+codeNatureFacturationGarant; + donnees += '&codePeriodicite='+codePeriodicite+'&codeExercice='+codeExercice+'&dateFacture='+dateFacture; + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/initiergroupefacturegarant/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Detailgroupefacturegarant/"); + } + }); + +} + + + + +// +function afficher_detail_optique(idEnteteEntentePrealable) { + + + donnees = "idEnteteEntentePrealable=" + idEnteteEntentePrealable; + + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + //$('#div_test_gabarit').html(data); + //alert(data); + //return; + + $("#div_optique_prescrits").html(data); + //appliquerDataTable(); + $("#div_optique_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); + $("#div_optique_prescrits").modal("show"); + $("#div_patienter").empty(); + + }, + complete: function () { + + } + }); + +} + +function traiter_un_provisoire_opt(idMedicament, codeReponseProvisoire) +{ + + donnees = "idMedicament=" + idMedicament + "&codeReponseProvisoire=" + codeReponseProvisoire; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/traiterunprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_opt_provisoire(); + }, + complete: function () { + + } + }); + +} + +function traitement_tous_provisoire_opt(codeReponseProvisoire) +{ + donnees = "codeReponseProvisoire=" + codeReponseProvisoire; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/traitertousprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_opt_provisoire(); + }, + complete: function () { + + } + }); + +} + +function affiche_liste_opt_provisoire() +{ + $("#tab_liste").html('
' + '
'); + + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/traitementprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#tab_liste").html(data); + }, + complete: function () { + + } + }); + +} + +function valider_entente_opt() { + + observations = $("#observations").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + nombreRefus = $("#nombreRefus").val(); + nombreEnAttente = $("#nombreEnAttente").val(); + + if(nombreEnAttente>"0"){ + v_msg = "Veuillez traiter toutes les lignes!"; + v_msgEng = "Please process all lines!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (nombreRefus >"0" && motifRefusAssure <= " ") { + v_msg = "Veuillez saisir le motif pour les refus!"; + v_msgEng = "Please enter the reason for rejections!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + + return; + } + + + v_msg = "Confirmez-vous cette validation?"; + v_msgEng = "Do you confirm this validation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'observations=' + observations + '&motifRefusAssure=' + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/valider/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $('#div_resultat_validation').html(data); + valider = $("#valider").val(); + + if(valider=="1"){ + v_msg = "Validation réussie!"; + v_msgEng = "Validation succeed!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn-fermer-entente").click(); + }else{ + v_msg = "Echèc de la validation!"; + v_msgEng = "Validation failed!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + }, + complete: function () { + listeenteteententeprealablesopt(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function majobservation_opt() +{ + observations = $("#observations").val(); + + donnees = "observations=" + observations; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/majobservation/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +function majmotifrefus_opt() +{ + motifRefusAssure = $("#motifRefusAssure").val(); + + donnees = "motifRefusAssure=" + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlisteoptique/majmotifrefus/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + + }, + complete: function () { + + } + }); + +} + +// +function afficher_laboratoire(numeroBonExamen, codePrestataireLivraison, prestataireLivraison) +{ + donnees = 'numeroBonExamen='+numeroBonExamen+'&codePrestataireLivraison='+codePrestataireLivraison; + donnees += '&prestataireLivraison='+prestataireLivraison; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextlaboratoire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Laboratoirecons/"); + } + }); +} + + +function genererfactureperiodiquegarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfactureperiodique/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichegroupefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function afficher_detail_facture_garant(idEntetefacturegarant) +{ + window.location.assign($("#racineWeb" ).val()+"Detailfactureperiodiquegarant/"+idEntetefacturegarant); +} + +function modifier_param_fact_garant(superUser) +{ + if (superUser != "1"){ + v_msg="Non autorisé!"; + v_msgEng="Unauthorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Paramfacturegarant/"); +} + +function consulter_param_fact_garant() +{ + window.location.assign($("#racineWeb" ).val()+"Paramfacturegarantcons/"); +} + +function editer_groupe_facture_garant() +{ + donnees=""; + + var div_export = $('#div_editer_facture'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarantedition/groupefacture/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + div_export.html(data); + + }, + complete: function() { + + } + }); + + +} + +function select_toutes_natures_facture(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/toutesnaturesfacture/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_type_facture').html(data); + datafiltre(); + + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + +function select_naturefacture_garant_a_facturer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/selectionnaturefacture/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_type_facture').html(data); + datafiltre(); + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + + + +function ajax_fiche_groupe_facture_garant(idGroupefacturegarant) +{ + + + donnees = 'idGroupefacturegarant='+idGroupefacturegarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfichefacturegarant/groupefacture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_fiche_groupe_facture_modal").html(data); + + + $('#div_fiche_groupe_facture').modal("show"); + + + setTimeout(function() { + //your datatable code + dataTableMini(); + + }, 500); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function lister_encaissement_facture_garants() +{ + $("#div_liste_facture_garant").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/listerfactuegarantsencaissement/", + type: 'POST', + success: function(data) { + $('#div_liste_facture_garant').html(data); + + dataTab(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +function select_toutes_factures_edition_encaissement(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/toutesfactureseditionencaissement/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + + lister_encaissement_facture_garants(); + } + }); +} + +function select_facture_a_editer_encaissement(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/unefactureeditionencaissement/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + lister_encaissement_facture_garants(); + } + }); +} + +function creer_dossier_classique() +{ + idBeneficiaire = $("#idBeneficiaire").val(); + + ajax_context_adherent(idBeneficiaire); +} + +function ajax_context_adherent(idBeneficiaire) +{ + + + if (idBeneficiaire=="0") + { + v_msg="Veuillez sélectionner un assuré!"; + v_msgEng="Please select one person!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = "idBeneficiaire="+idBeneficiaire; + donnees_retour = ""; + + $("#div_attente").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextadherent/", + type : 'post', + data: donnees, + success: function(data) + { + + //$("#div_ajaxgabarit").html(data); + + $("#div_context_adherent").html(data); + + //$("#div_attente").html(''); + + var aBeneficiaireRemb = $("#aBeneficiaireRemb").val(); + //var idAdherent = $("#idAdherent").val(); + + if(aBeneficiaireRemb > "0") + { + window.location.assign($("#racineWeb" ).val()+"Creerdossierclassique/"); + + }else{ + v_msg="Aucun bénéficiaire de remboursement n'est enregistré pour cet assuré!"; + v_msgEng="No reimbursement beneficiary is registered for this insured"; + + alert_ebene(v_msg, v_msgEng); + return; + } + }, + error: function(errorData) { + }, + complete: function() { + + } + }); +} + + +function creer_dossier_classique_police() +{ + window.location.assign($("#racineWeb" ).val()+"Creerdossierclassiquepolice/"); +} + +function ajax_police_context() +{ + idPolice = $("#idPolice").val(); + + if (idPolice>"0") + { + $("#div_attente").html('
' + '
'); + + ajax_context_police(idPolice); + creer_dossier_classique_police(); + }else{ + v_msg="Veuillez sélectionner une police pour le remboursement direct!"; + v_msgEng="Please select a policy for direct reimbursement!"; + + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + } +} + +function affiche_pays_territoire() +{ + var codeTerritoire = $('#codeTerritoire').val(); + + donnees = 'codeTerritoire='+codeTerritoire; + + div_pays=$("#div_pays"); + + div_pays.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaysterritoire/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + + $('#div_pays').html(data); + datatab_plus(); + }, + complete: function() { + + } + }); +} + + +function ajouter_un_pays_territoire(codePays) +{ + + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire+'&codePays='+codePays; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaysterritoire/ajouterunpaysterritoire/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + affiche_pays_territoire(); + } + }); +} + +// +function ajouter_tous_pays_territoire() +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaysterritoire/ajoutertouspaysterritoire/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_pays_territoire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_pays_territoire() +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeTerritoire='+codeTerritoire; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaysterritoire/retirertouspaysterritoire/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_pays_territoire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function retirer_un_pays_territoire(idPays) +{ + codeTerritoire=$("#codeTerritoire").val(); + + if (codeTerritoire<=" ") + { + v_msg="Veuillez sélectionner un territoire!"; + v_msgEng="Please select a territory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idPays='+idPays; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaysterritoire/retirerunpaysterritoire/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affiche_pays_territoire(); + } + }); +} + +function annuler_facture_classique(idFactureClassique, idFacture) { + + v_msg="Confirmez-vous cette annulation?"; + v_msgEng="Do you confirm this cancellation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idFactureClassique=' + idFactureClassique+'&idFacture='+idFacture; + + $("#div_annuler_facture").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxannulationfacturerd/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_annuler_facture").html(data); + $("#div_annuler_facture").modal({backdrop: 'static', keyboard: false, show: true }); + $("#div_annuler_facture").modal("show"); + }, + complete: function () { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function valider_annulation_facture_classique() +{ + + + idFactureClassique = $("#idFactureClassique").val(); + + motif = $("#motif").val(); + + if(motif <=" ") + { + v_msg="Le motif est obligatoire!"; + v_msgEng="The pattern is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + + return; + } + + donnees = "idFactureClassique="+idFactureClassique+'&motif='+motif; + + v_msg="Validez-vous cette annulation?"; + v_msgEng="Do you validate this cancellation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxannulationfacturerd/annuler/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + afficher_dossier_classique(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function notificationcartesociete() +{ + donnees = ""; + + v_msg="Confirmez-vous l'envoi des numéros de carte aux assurés de toutes les polices?"; + v_msgEng="Do you confirm sending card numbers to policyholders of all policies?"; + + $("#div_patienter").html('
' + '
'); + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotificationcarte/societe/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + v_msg="Numéros de carte envoyés avec succès!"; + v_msgEng="Card numbers sent successfully!"; + + $("#div_patienter").empty(); + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function notificationcartepolice() +{ + donnees = ""; + + v_msg="Confirmez-vous l'envoi des numéros de carte aux assurés de la police?"; + v_msgEng="Do you confirm sending card numbers to policyholders?"; + + $("#div_patienter").html('
' + '
'); + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotificationcarte/police/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Numéros de carte envoyés avec succès!"; + v_msgEng="Card numbers sent successfully!"; + + $("#div_patienter").empty(); + + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function notificationcarteadherent() +{ + donnees = ""; + + v_msg="Confirmez-vous l'envoi des numéros de carte des membres de la famille à l'assuré principal?"; + v_msgEng="Do you confirm sending family members' card numbers to the primary insured?"; + + $("#div_patienter").html('
' + '
'); + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotificationcarte/adherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Numéros de carte envoyés avec succès!"; + v_msgEng="Card numbers sent successfully!"; + + $("#div_patienter").empty(); + + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function notificationcarte() +{ + donnees = ""; + + v_msg="Confirmez-vous l'envoi du numéro de carte au bénéficiaire?"; + v_msgEng="Do you confirm sending the card number to the beneficiary?"; + + $("#div_patienter").html('
' + '
'); + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotificationcarte/nocarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Numéros de carte envoyé avec succès!"; + v_msgEng="Card number sent successfully!"; + + $("#div_patienter").empty(); + + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + + +function ajouter_toutes_specialite() +{ + codeMedecin=$("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médécin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeMedecin='+codeMedecin; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitemedecin/ajoutertoutesspecialites/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_specialite_medecin(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_specialite_medecin() +{ + codeMedecin=$("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médécin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeMedecin='+codeMedecin; + + var div_attente = $('#div_specialite'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitemedecin/afficherspecialitemedecin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function retirer_toutes_specialites_medecin() +{ + codeMedecin=$("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médécin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeMedecin='+codeMedecin; + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitemedecin/retirertoutesspecialites/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_specialite_medecin(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_une_specialite_medecin(codeSpecialite) +{ + codeMedecin=$("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médécin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeMedecin='+codeMedecin+'&codeSpecialite='+codeSpecialite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitemedecin/ajouterunespecialite/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_specialite_medecin(); + } + }); +} + + +function retirer_une_specialite_medecin(idSpecialite) +{ + codeMedecin=$("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médécin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeMedecin='+codeMedecin+'&idSpecialite='+idSpecialite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitemedecin/retirerunespecialite/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_specialite_medecin(); + } + }); +} + + +function affiche_historique_prestations_beneficiaire(){ + + var numeroBeneficiaire = $('#numeroBeneficiaire').val(); + + + $("#div_patienter").html('
' + '
'); + + + donnees = 'numeroBeneficiaire='+numeroBeneficiaire; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriqueprestationsbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_historique_prestations').html(data); + $('#div_historique_prestations').modal("show"); + }, + complete: function() { + + } + }); +} + +function affiche_historique_prestations_famille(){ + + var numeroAdherent = $('#numeroAdherent').val(); + + + $("#div_patienter").html('
' + '
'); + + + donnees = 'numeroAdherent='+numeroAdherent; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriqueprestationsfamille/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_historique_prestations').html(data); + $('#div_historique_prestations').modal("show"); + }, + complete: function() { + + } + }); +} + + + +function afficherhistoriqueadherent(numeroAdherent){ + + d1=$("#d1").val(); + d2=$("#d2").val(); + + codeGarantie=$("#codeGarantie").val(); + + donnees = "numeroAdherent="+numeroAdherent+"&codeGarantie="+codeGarantie; + donnees += '&d1='+d1+'&d2='+d2; + + $("#div_prestation").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistoriqueprestationsfamille/prestations/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestation").html(data); + + setTimeout(function() { + functionDataTable(); + }, 500); + + + }, + complete: function() { + + } + }); + +} + +function consulter_detail_bareme_college(idBaremePriseEnCharge) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterdetailbaremecollege/"+idBaremePriseEnCharge+"/"); +} + +function retour_fiche_consulter_bareme() +{ + var retour = $('#retour').val(); + + if(retour=="Ficheadherent"){ + afficher_adherent_id(); + }else{ + afficher_beneficiaire_id(); + } + +} + +function afficher_consulter_actes_garantiebareme(idBaremePriseEnCharge, codeGarantie){ + + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $("#div_patienter").html(''); + + $("#div_patienter").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsulteractesgarantiebareme/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + + $('#div_actesgarantiebareme').html(data); + $('#div_actesgarantiebareme').modal("show"); + + appliquerDataTableBareme(); + + $('#div_actesgarantiebareme').on('shown.bs.modal', function(){ + stylechampsRequis(); + }); + + afficherMasquerGarantiesBaremeCollege(); + afficherMasquerGarantiesBaremeLienParenteCollege(); + afficherMasquerActeBaremeCollege(); + afficherMasquerActeBaremeLienParenteCollege(); + + $(".datepicker").datepicker(); + $("#codeActe").selectpicker(); + $("#codeActeLienParente").selectpicker(); + $("#div_patienter").html(''); + }, + complete: function() { + afficheNombreLigneBaremeCollege('garantiesbaremepriseencharge'); + afficheNombreLigneBaremeCollege('garantiesbaremepriseenchargelienparente'); + afficheNombreLigneBaremeCollege('actesbaremepriseencharge'); + afficheNombreLigneBaremeCollege('actesbaremepriseenchargelienparente'); + } + }); +} + +function changer_entite_portail() +{ + codeSociete=$("#codeSociete").val(); + + if (codeSociete<=" ") + { + v_msg="Veuillez indiquer une entité!"; + v_msgEng="Please indicate an entity!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSociete").focus(); + return; + } + + //alert(codeSociete); + //return; + + donnees = 'codeSociete='+codeSociete; + + v_url = $("#racineWeb").val()+"Ajaxchangerentiteportail/"; + + $("#div_login_portail").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + // alert('success :' + errorData); + $("#div_login_portail").html(errorData); + }, + success: function(data) { + // alert('success :' + data); + $("#div_login_portail").html(data); + societeExiste = $("#societeExiste").val(); + entiteActive = $("#entiteActive").val(); + + if(societeExiste=="1" && entiteActive=="1") + { + $("#btn_connexion").enable(); + $("#login").focus(); + + }else + { + $("#btn_connexion").disable(); + } + } + }); +} + + +function filtreproduitbareme(){ + + + var codeGcAssureur = $('#codeGcAssureur').val(); + + if(codeGcAssureur<=" "){ + $('#div_bareme').html(""); + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreproduitbareme/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_produit').html(data); + + $("#codeProduit").selectpicker(); + }, + complete: function() { + + } + }); + +} + +function afficher_bareme_produit() +{ + + + codeGcAssureur = $("#codeGcAssureur").val(); + codeProduit = $("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + $('#div_bareme').html(""); + + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeProduit='+codeProduit; + + var div_attente = $('#div_bareme'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremeproduit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + + }, + complete: function() { + } + }); +} + +function changer_langue_connexion() +{ + codeLangue = $("#langue").val(); + donnees = 'codeLangue='+codeLangue; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconnexioncookie/changerlangue/", + type : 'post', + data: donnees, + error: function(errorData) + { + }, + success: function(data) + { + $("#div_detail_connexion").html(data); + }, + complete: function() + { + $(".selectpicker").selectpicker(); + } + }); + +} + + +function ctrlkeypress_liste_clients(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_clients(); + } +} + +function afficher_liste_clients() +{ + donnees = ""; + donnees_retour = ""; + + typeClient = $("#typeClient").val(); + nom = $("#nom").val(); + numeroClient = $("#numeroClient").val(); + + /* + if(typeClient==''){ + typeClient=0; + } + */ + + if(numeroClient==''){ + numeroClient=0; + } + + donnees += 'typeClient=' + typeClient; + donnees += '&nom=' + nom; + donnees += '&numeroClient=' + numeroClient; + + //alert(donnees); + //return; + + $("#div_clients").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterclients/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_clients").html(donnees_retour); + + appliquerDataTable(); + } + }); +} + +function creer_client() +{ + window.location.assign($("#racineWeb" ).val()+"Creerclient/"); +} + +function messageproforma(){ + + + var demandeTraite = $("#demandeTraite").val(); + var numeroBonHospitalisation = $("#numeroBonHospitalisation").val(); + + if(demandeTraite > "0") { + if(numeroBonHospitalisation =="0"){ + + v_msg="Aucun Num\u00e9ro de bon d'hospitalisation n'est g\u00e9n\u00e9r\u00e9. Proforma refusé!"; + v_msgEng="No Hospitalization Voucher Number is generated. Proforma refused!"; + + faireDefileMessage(v_msg, v_msgEng); + + }else{ + + v_msg="Le bon d'hospitalisation No: "+numeroBonHospitalisation+" a été généré avec succès!"; + v_msgEng="Hospitalization voucher No: "+numeroBonHospitalisation+" has been successfully generated!"; + + faireDefileMessage(v_msg, v_msgEng); + } + } + +} + +function faireDefileMessage(p_msg, p_msg_eng){ + + if(p_msg!=""){ + codeLangue = $("#codeLangue").val(); + + if(codeLangue=="en_US") + { + $("#div_messages").html(''+p_msg_eng+''); + } + else + { + $("#div_messages").html(''+p_msg+''); + } + }else{ + + $("#div_messages").html(''); + + } + +} + +function ajouter_un_acte_proforma(codeActe) +{ + var idProforma = $("#idProforma").val(); + + donnees="" + + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeActe='+codeActe+'&idProforma='+idProforma; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/ajouteractes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + afficheractesproforma(idProforma); + }, + complete: function() { + + } + }); +} + + +function save_nv_consommable_proformahospit() +{ + idProforma = $("#idProforma ").val(); + libelleconsommable = $("#libelleconsommable").val(); + + + if (libelleconsommable<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter tyhe name!"; + alert_ebene(v_msg, v_msgEng); + $("#libelleconsommable").focus(); + return; + } + + quantiteconsommable=$("#quantiteconsommable").val(); + quantiteconsommable=quantiteconsommable.replace(",","."); + $("#quantiteconsommable").val(quantiteconsommable); + + if(isNaN(quantiteconsommable)) + { + v_msg="Valeur num\u00e9rique exig\u00e9e!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#quantiteconsommable").val("0"); + $("#quantiteconsommable").focus(); + return; + } + + if(quantiteconsommable==0) + { + $("#quantiteconsommable").focus(); + v_msg="Veuillez saisir la quantit\u00e9!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + prixconsommable=$("#prixconsommable").val(); + prixconsommable=prixconsommable.replace(",","."); + $("#prixconsommable").val(prixconsommable); + + if(isNaN(prixconsommable)) + { + v_msg="Valeur num\u00e9rique exig\u00e9e!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixconsommable").val("0"); + $("#prixconsommable").focus(); + return; + } + + if(prixconsommable==0) + { + $("#prixconsommable").focus(); + v_msg="Veuillez saisir le prix!"; + v_msgEng="Please enter the price!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = 'libelleconsommable='+libelleconsommable+'&prixconsommable='+prixconsommable+'&quantiteconsommable='+quantiteconsommable; + donnees += '&idProforma='+idProforma; + + $("#div_patienter_consommable").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtraitementproformahospitalisation/creerconsommableproformahospit/", + type: 'POST', + data: donnees, + success: function(data) { + afficheractesproforma(idProforma); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function genererfacturedeficitgarant() +{ + donnees = ''; + + v_msg="Confirmez-vous la génération de cette facture?"; + v_msgEng="Do you confirm the creation of this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturegarant/genererfacturedeficit/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + + }, + complete: function(){ + window.location.assign($("#racineWeb" ).val()+"Fichegroupefacturegarant/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function de_archiver_produit(idProduit, dansBareme) +{ + if (dansBareme == "1") + { + v_msg="Op\u00e9ration impossible \u00e0 cause de l'utilisation de ce produit dans un bar\u00e8me de prise en charge!"; + v_msgEng="Operation impossible due to the use of this product in a support scale!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous le d\u00e9sarchivage de ce produit?"; + v_msgEng="Do you confirm the unarchiving of this product?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduit/desarchiver/", + type : 'post', + data: "idProduit="+idProduit, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + window.location.assign($("#racineWeb" ).val()+"Produits/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function archiver_produit(idProduit) +{ + + v_msg="Confirmez-vous l'archivage de ce produit?"; + v_msgEng="Do you confirm archiving of this product?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduit/archiver/", + type : 'post', + data: "idProduit="+idProduit, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + window.location.assign($("#racineWeb" ).val()+"Produits/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function dupliquer_tarif_actes(idTarif, codeTarifActe) +{ + + + donnees = "codeTarifActe="+codeTarifActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcompteurdetailtarifacte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + + $('#div_compteur').html(data); + + compteur = parseInt($("#compteur").val()); + + if(compteur > 1){ + + v_msg="Confirmez-vous la duplication de ce tarif?"; + v_msgEng="Do you confirm the duplication of this rate?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Dupliquertarifacte/"+idTarif+"/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + }else{ + v_msg="Op\u00e9ration impossible! Veuillez ajouter du détail à ce tarif avant sa duplication."; + v_msgEng="Operation impossible! Please add detail to this rate before duplicating it."; + alert_ebene(v_msg, v_msgEng); + + return; + } + }, + complete: function() + { + + } + }); + +} + +function dupliquertarifacte(){ + + var codeTarifActeSource = $('#codeTarifActeSource').val(), + codeTarifActeCible = $('#codeTarifActeCible').val(), + + //dateEffet = $('#dateEffet').val(); + + donnees = 'codeTarifActeSource='+codeTarifActeSource; + donnees += '&codeTarifActeCible='+codeTarifActeCible; + //donnees += '&dateEffet='+dateEffet; + + $("#div_message").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdupliquertarif/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + + $('#div_message').html(data); + + + + /* + setTimeout(function() { + //your datatable code + lister_tarif_actes(); + }, 500); + */ + }, + complete: function() { + + } + }); + +} + +function ctrlkeypress_liste_prospects(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_prospects(); + } +} + +function afficher_liste_prospects() +{ + donnees = ""; + donnees_retour = ""; + + typeClient = $("#typeClient").val(); + nom = $("#nom").val(); + numeroClient = $("#numeroClient").val(); + + /* + if(typeClient==''){ + typeClient=0; + } + */ + + if(numeroClient==''){ + numeroClient=0; + } + + donnees += 'typeClient=' + typeClient; + donnees += '&nom=' + nom; + donnees += '&numeroClient=' + numeroClient; + + //alert(donnees); + //return; + + $("#div_prospects").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterprospects/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_prospects").html(donnees_retour); + + appliquerDataTable(); + } + }); +} + +function creer_prospect() +{ + window.location.assign($("#racineWeb" ).val()+"Creerprospect/"); +} + +function exporter_liste_prospects() +{ + var div_export = $('#div_export_prospects'); + div_export.html('
' + '
'); + + $("#btn_liste_prospects").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterlisteprospects/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // $("#btn_liste_clients").click(); + } + }); +} + +// devis + +function init_import_assures_d() +{ + + + idDevis = $("#idPolice_d_C").val(); + + transforme = $("#transforme").val(); + if (transforme=="1") + { + v_msg="Cotation déjà transformée!"; + v_msgEng="Quote already transformed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroOptionTarif = $("#numeroOptionTarif").val(); + donnees = 'idDevis='+idDevis+"&numeroOptionTarif="+numeroOptionTarif; + + if (numeroOptionTarif<="0") + { + v_msg="Aucune option!"; + v_msgEng="No option!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTypeContrat = $("#codeTypeContrat").val(); + policeGroupe = $("#policeGroupe").val(); + + /* + //if (codeTypeContrat!="G") + if (policeGroupe!="1") + { + v_msg="Ce n\'est pas une police GROUPE!"; + v_msgEng="This is not a GROUP policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + window.location.assign($("#racineWeb" ).val()+"Importassuredevis/"); +} + +function importer_modele_assure_d() +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_liste_assures'); + + cheminFichier=$("#cheminFichier").val(); + numeroOptionTarif = $("#numeroOptionTarif").val(); + + donnees = 'numeroOptionTarif='+numeroOptionTarif+'&cheminFichier='+cheminFichier; + + div_export.html('
' + '
'); + + $("#div_erreur_excel").html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/importermodele/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(''); + $("#div_erreur_excel").html(data); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + div_export.html(''); + + succes_impot_execl=$("#succes_impot_execl").val(); + + if (succes_impot_execl == "1") + { + maj_etape_3_import_assures_d(numeroOptionTarif); + } + } + }); +} + +function maj_etape_3_import_assures_d(numeroOptionTarif) +{ + donnees = 'numeroOptionTarif='+numeroOptionTarif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/majetape/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + window.location.assign($("#racineWeb" ).val()+"Listeimportassuredevis/"); + } + }); +} + +function afficher_adherent_importee_devis() +{ + idCollege=$("#idCollege").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollege='+idCollege; + + var div_attente = $('#div_adherents_importes'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/afficheradherentimportee/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function ajouter_tous_adherent_importe_college_devis() +{ + idCollege=$("#idCollege").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollege='+idCollege; + + + v_msg="Attention, cela va vider tous les autres collèges! Confirmez-vous?"; + v_msgEng="Be careful, this will empty all other colleges! Do you confirm?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/ajoutertousadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee_devis(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function ajouter_sans_college_adherent_importe_college_devis() +{ + idCollege=$("#idCollege").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollege='+idCollege; + + v_msg="Attention! Confirmez-vous cette opération?"; + v_msgEng="Warning! Do you confirm this operation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/ajoutersanscollegeadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee_devis(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_adherent_importe_college_devis() +{ + idCollege=$("#idCollege").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idCollege='+idCollege; + + v_msg="Attention, cela va vider ce collège! Confirmez-vous?"; + v_msgEng="Attention, this will empty this college! Do you confirm?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/retirertousadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_test_gabarit").html(data); + }, + error: function(data) { + // $("#div_test_gabarit").html(data); + }, + complete: function() { + afficher_adherent_importee_devis(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_adherent_importe_college_devis(idBeneficiairemodel) +{ + donnees = 'idBeneficiairemodel='+idBeneficiairemodel; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/retirerunadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + + }, + complete: function() { + afficher_adherent_importee_devis(); + } + }); +} + +function ajouter_un_adherent_importe_college_devis(idBeneficiairemodel) +{ + idCollege=$("#idCollege").val(); + + if (idCollege<=" ") + { + v_msg="Veuillez sélectionner un collège!"; + v_msgEng="Please select a college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idBeneficiairemodel='+idBeneficiairemodel+'&idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/ajouterunadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee_devis(); + } + }); +} + +function calculer_population_lien_parente_temp() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majpopulationcollegeliste/", + type: 'POST', + // data: donnees, + success: function(data) { + $("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function incorporer_assures_inmportes_devis() +{ + nb_adh=$("#nb_adh").val(); + + if (nb_adh>"0") + { + v_msg="Veuillez revoir les collèges et relancer le calcul des primes!"; + v_msgEng="Please review the colleges and restart the premium calculation!!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nb_ligne_ass=$("#nb_ligne_ass").val(); + + if (nb_ligne_ass=="0") + { + v_msg="Rien à importer!"; + v_msgEng="Nothing to import!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Avez-vous fait l\'étape 2 => calcul des primes?"; + v_msgEng="Did you do step 2 => premium calculation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + console.log("Confirmation confirmé"); + } else { + // L'utilisateur a annulé + return; + console.log("Confirmation refusée"); + } + }); + + primeTtcTotal=$("#primeTtcTotal").val(); + + if (primeTtcTotal=="0") + { + v_msg="Pas de primes! souhaitez-vous recalculer les primes?"; + v_msgEng="No premiums! do you want to recalculate the premiums?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + return; + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + v_msg="Notez que vous avez accepté l\'incorporation sans primes!"; + v_msgEng="Note that you accepted the incorporation without premium!"; + alert_ebene(v_msg, v_msgEng); + } + + nbBeneficiaireFamilleAtteint = $("#nbBeneficiaireFamilleAtteint").val(); + + if(nbBeneficiaireFamilleAtteint>"0"){ + v_msg = "Population maximum atteinte pour les lignes en rouge!"; + v_msgEng = "Maximum population reached for red lines!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbGgeMaxBeneficiaireAtteint = $("#nbGgeMaxBeneficiaireAtteint").val(); + + if(nbGgeMaxBeneficiaireAtteint>"0"){ + v_msg = "Âge limite atteinte pour certaines personnes!"; + v_msgEng = "Age limit reached for certain people!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous l\'incorporation de cette liste?"; + v_msgEng="Do you confirm the incorporation of this list?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + var div_attente = $('#div_liste_assure_importe'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/incorpoerassuresimportes/", + type: 'POST', + // data: donnees, + success: function(data) { + v_msg="Incorporation terminée avec succès!"; + v_msgEng="Incorporation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function() { + afficher_police_d_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function traiter_lignes_importees_d() +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + etape3=$("#etape3").val(); + + if (etape3 != "1") + { + v_msg="Etape 3 incomplète!"; + v_msgEng="Incomplete step 3!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Listeimportassuredevis/"); +} + +function lister_assures_devis() +{ + window.location.assign($("#racineWeb" ).val()+"Listeassuredevis/"); +} + +function calculer_population_lien_parente_valide() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majpopulationcollegelistevalide/", + type: 'POST', + // data: donnees, + success: function(data) { + $("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + + +function afficher_adherents_devis() +{ + $("#div_liste_adherent").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteadherentdevis/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_adherent").html(data); + $(".selectpicker").selectpicker(); + appliquerDataTable(); + } + }); +} + +function pop_adherent_devis(idAdherent) +{ + if (idAdherent>"0") + { + donnees = 'idAdherent='+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteadherentdevis/beneficiairesfamille/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $("#div_deatil_pop").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); + } +} + +function exporter_liste_assures_devis() +{ + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteadherentdevis/exporterlisteassuresdevis/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +function imprimer_liste_assures_devis() +{ + $("#div_deatil_pop").html('
' + '
'); + + $("#btn_pop").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteadherentdevis/imprimerlisteassuresdevis/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_deatil_pop").html(data); + }, + complete: function() { + } + }); +} + +// transformer devis en Contrat +function init_transformer_devis() +{ + + + idDevis = $("#idPolice_d_C").val(); + + transforme = $("#transforme").val(); + if (transforme=="1") + { + v_msg="Cotation déjà transformée!"; + v_msgEng="Quote already transformed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + primeTtc_total = $("#primeTtc_total").val(); + nbTotalCollege = $("#nbTotalCollege").val(); + + // if (primeTtc_total=="0") + if (nbTotalCollege=="0") + { + v_msg="Rien à transformer!"; + v_msgEng="Nothing to transform!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la transformation en contrat?"; + v_msgEng="Do you confirm the transformation into a contract?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#btn_pop").click(); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function clients_transformer_devis() +{ + idDevis = $("#idPolice_d_C").val(); + donnees = 'idDevis='+idDevis; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtransformerdevis/clientsexistants/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_clients_existants").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function transformer_devis(idClientExistant) +{ + idDevis = $("#idPolice_d_C").val(); + dateEffetContrat = $("#dateEffetContrat").val(); + + transforme = $("#transforme").val(); + if (transforme=="1") + { + v_msg="Cotation déjà transformée!"; + v_msgEng="Quote already transformed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + primeTtc_total = $("#primeTtc_total").val(); + nbTotalCollege = $("#nbTotalCollege").val(); + + // if (primeTtc_total=="0") + if (nbTotalCollege=="0") + { + v_msg="Rien à transformer!"; + v_msgEng="Nothing to transform!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la transformation en contrat?"; + v_msgEng="Do you confirm the transformation into a contract?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + numeroOptionTarif = $("#numeroOptionTarif").val(); + donnees = 'idDevis='+idDevis+"&numeroOptionTarif="+numeroOptionTarif; + donnees += '&idClientExistant='+idClientExistant+"&dateEffetContrat="+dateEffetContrat; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtransformerdevis/", + type: 'POST', + data: donnees, + success: function() { + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Fichepolice/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function enregistrer_college_temp_d() +{ + + idCollegeTemp = $('#idCollegeTemp').val(); + codeProduit = $('#codeProduit').val(); + codeCollegeType = $('#codeCollegeType').val(); + codeReseau = $('#codeReseau').val(); + codeTypeRemboursement = $('#codeTypeRemboursement').val(); + codeTerritoire = $('#codeTerritoire').val(); + codeLienParente = $('#codeLienParente').val(); + libelleCollege = $('#libelleCollege').val(); + ticketModerateurCollege = $('#ticketModerateurCollege').val(); + + delaiCarenceCollege = $('#delaiCarenceCollege').val(); + plafondCollege = parseInt($('#plafondCollege').val().replace(/ /g,""),10); + + plafondAdherent = parseInt($('#plafondAdherent').val().replace(/ /g,""),10); + + idPolice = $('#idPolice').val(); + numeroPolice = $('#numeroPolice').val(); + accessoireManuel = parseInt($('#accessoireManuel').val().replace(/ /g,""),10); + rachatTm = $('#rachatTm').val(); + tauxRachatTm = $('#tauxRachatTm').val(); + tauxPrimeRachatTm = $('#tauxPrimeRachatTm').val(); + budgetDefini = "0"; + montantBudget = "0"; + nbAdherent = $('#nbAdherent').val(); + nbAyantdroit = $('#nbAyantdroit').val(); + codeTypeTarifActe = $('#codeTypeTarifActe').val(); + codeTarifActe = $('#codeTarifActe').val(); + codeGcAssureur = $('#codeGcAssureur').val(); + + codeGcAssureur = $('#codeGcAssureur').val(); + idBaremePriseEnCharge = $('#idBaremePriseEnCharge').val(); + + codeBaseTarification = $('#codeBaseTarification').val(); + + seuilRdCollege = $('#seuilRdCollege').val(); + + numeroOptionTarif = $('#numeroOptionTarif').val(); + + + + forfaitHonoraire = 0; //parseInt($('#forfaitHonoraire').val().replace(/ /g,""),10); + forfaitAppelFond = 0; //parseInt($('#forfaitAppelFond').val().replace(/ /g,""),10); + forfaitAppelCotisation = 0; // parseInt($('#forfaitAppelCotisation').val().replace(/ /g,""),10); + + ticketModerateurHorsReseau = $('#ticketModerateurHorsReseau').val(); + ageLimiteEnfantEleve = $('#ageLimiteEnfantEleve').val(); + + donnees = 'id='+idCollegeTemp+'&codeProduit='+codeProduit+'&codeCollegeType='+codeCollegeType+'&codeReseau='+codeReseau; + donnees += '&codeTypeRemboursement='+codeTypeRemboursement+'&codeTerritoire='+codeTerritoire+'&codeLienParente='+codeLienParente; + donnees += '&libelleCollege='+libelleCollege+'&ticketModerateurCollege='+ticketModerateurCollege+'&delaiCarenceCollege='+delaiCarenceCollege; + donnees += '&plafondCollege='+plafondCollege+'&idPolice='+idPolice+'&numeroPolice='+numeroPolice+'&accessoireManuel='+accessoireManuel; + donnees += '&rachatTm='+rachatTm+'&tauxRachatTm='+tauxRachatTm+'&tauxPrimeRachatTm='+tauxPrimeRachatTm+'&budgetDefini='+budgetDefini; + donnees += '&montantBudget='+montantBudget+'&nbAdherent='+nbAdherent+'&nbAyantdroit='+nbAyantdroit+'&codeTypeTarifActe='+codeTypeTarifActe; + donnees += '&codeTarifActe='+codeTarifActe+'&codeGcAssureur='+codeGcAssureur+'&idBaremePriseEnCharge='+idBaremePriseEnCharge; + donnees += '&codeBaseTarification='+codeBaseTarification+'&seuilRdCollege='+seuilRdCollege+'&plafondAdherent='+plafondAdherent; + + //donnees += '&forfaitHonoraire='+forfaitHonoraire+'&forfaitAppelFond='+forfaitAppelFond+'&forfaitAppelCotisation='+forfaitAppelCotisation; + donnees += '&forfaitHonoraire='+forfaitHonoraire+'&forfaitAppelFond='+forfaitAppelFond+'&forfaitAppelCotisation='+forfaitAppelCotisation; + donnees += '&ticketModerateurHorsReseau='+ticketModerateurHorsReseau+'&ageLimiteEnfantEleve='+ageLimiteEnfantEleve; + donnees += '&numeroOptionTarif='+numeroOptionTarif; + + //console.log(donnees); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescolleged/enregistrercollegelienparentetemp/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + complete: function(data) + { + } + }); +} + +function change_categorie_college_temp_d() +{ + codeProduit = $('#codeProduit').val(); + + codeLienParente = "A"; + + codeBaseTarification = $('#codeBaseTarification').val(); + + + if($('#codeProduit').val()<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeProduit').focus(); + return; + } + + + if(codeBaseTarification=="AUC") + { + $("#div_prime_categorie").empty(); + $("#div_recapituler").empty(); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeBaseTarification='+codeBaseTarification; + + $("#div_prime_categorie").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategoried/", + type: 'POST', + data: donnees, + success: function(data) + { + // + $("#div_prime_categorie").html(data); + + enregistrer_college_temp_d(); + recapitulercollege_d(); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + + } + }); +} + +function init_prime_college_temp_d() +{ + codeProduit = $("#codeProduit").val(); + + donnees = 'codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategoried/initprimelienparente/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function init_trancheage_college_temp_d() +{ + codeProduit = $("#codeProduit").val(); + + donnees = 'codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategoried/inittrancheage/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function init_prime_college_base_tarif_d() +{ + + codeProduit = $("#codeProduit").val(); + codeBaseTarification = $("#codeBaseTarification").val(); + + donnees = 'codeProduit='+codeProduit+'&codeBaseTarification='+codeBaseTarification; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategoried/initprimebasetarif/", + type: 'POST', + data: donnees, + success: function(data) { + + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function init_bareme_d() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondfamilleproduitd/initbareme/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function recapitulercollege_d(){ + idCollegeTemp = $('#idCollegeTemp').val(); + codeProduit = $('#codeProduit').val(); + codeCollegeType = $('#codeCollegeType').val(); + codeReseau = $('#codeReseau').val(); + codeTypeRemboursement = $('#codeTypeRemboursement').val(); + codeTerritoire = $('#codeTerritoire').val(); + codeLienParente = $('#codeLienParente').val(); + libelleCollege = $('#libelleCollege').val(); + ticketModerateurCollege = $('#ticketModerateurCollege').val(); + delaiCarenceCollege = $('#delaiCarenceCollege').val(); + plafondCollege = parseInt($('#plafondCollege').val().replace(/ /g,""),10); + + plafondAdherent = parseInt($('#plafondAdherent').val().replace(/ /g,""),10); + + idPolice = $('#idPolice').val(); + numeroPolice = $('#numeroPolice').val(); + accessoireManuel = parseInt($('#accessoireManuel').val().replace(/ /g,""),10); + rachatTm = $('#rachatTm').val(); + tauxRachatTm = $('#tauxRachatTm').val(); + tauxPrimeRachatTm = $('#tauxPrimeRachatTm').val(); + budgetDefini = "0"; + montantBudget = "0"; + nbAdherent = $('#nbAdherent').val(); + nbAyantdroit = $('#nbAyantdroit').val(); + codeTypeTarifActe = $('#codeTypeTarifActe').val(); + codeTarifActe = $('#codeTarifActe').val(); + codeGcAssureur = $('#codeGcAssureur').val(); + idBaremePriseEnCharge = $('#idBaremePriseEnCharge').val(); + codeBaseTarification = $('#codeBaseTarification').val(); + seuilRdCollege = $('#seuilRdCollege').val(); + plafondAdherent = $('#plafondAdherent').val(); + + /* + forfaitHonoraire = parseInt($('#forfaitHonoraire').val().replace(/ /g,""),10); + forfaitAppelFond = parseInt($('#forfaitAppelFond').val().replace(/ /g,""),10); + forfaitAppelCotisation = parseInt($('#forfaitAppelCotisation').val().replace(/ /g,""),10); + */ + + + forfaitHonoraire = 0; //parseInt($('#forfaitHonoraire').val().replace(/ /g,""),10); + forfaitAppelFond = 0; //parseInt($('#forfaitAppelFond').val().replace(/ /g,""),10); + forfaitAppelCotisation = 0; //parseInt($('#forfaitAppelCotisation').val().replace(/ /g,""),10); + + numeroOptionTarif = $('#numeroOptionTarif').val(); + + + if(codeBaseTarification <=" " || codeBaseTarification ==undefined) + { + v_msg="Veuillez sélectionner la base de tarification!"; + v_msgEng="Please select pricing basis!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeBaseTarification').focus(); + return; + } + + $('#div_recapituler').html('
' + '
'); + + + donnees = 'id='+idCollegeTemp+'&codeProduit='+codeProduit+'&codeCollegeType='+codeCollegeType+'&codeReseau='+codeReseau; + donnees += '&codeTypeRemboursement='+codeTypeRemboursement+'&codeTerritoire='+codeTerritoire+'&codeLienParente='+codeLienParente; + donnees += '&libelleCollege='+libelleCollege+'&ticketModerateurCollege='+ticketModerateurCollege+'&delaiCarenceCollege='+delaiCarenceCollege; + donnees += '&plafondCollege='+plafondCollege+'&idPolice='+idPolice+'&numeroPolice='+numeroPolice+'&accessoireManuel='+accessoireManuel; + donnees += '&rachatTm='+rachatTm+'&tauxRachatTm='+tauxRachatTm+'&tauxPrimeRachatTm='+tauxPrimeRachatTm+'&budgetDefini='+budgetDefini; + donnees += '&montantBudget='+montantBudget+'&nbAdherent='+nbAdherent+'&nbAyantdroit='+nbAyantdroit+'&codeTypeTarifActe='+codeTypeTarifActe; + donnees += '&codeTarifActe='+codeTarifActe+'&codeGcAssureur='+codeGcAssureur+'&idBaremePriseEnCharge='+idBaremePriseEnCharge+'&codeBaseTarification='+codeBaseTarification; + donnees += '&seuilRdCollege='+seuilRdCollege+'&plafondAdherent='+plafondAdherent; + + //donnees += '&forfaitHonoraire='+forfaitHonoraire+'&forfaitAppelFond='+forfaitAppelFond+'&forfaitAppelCotisation='+forfaitAppelCotisation; + donnees += '&forfaitHonoraire='+forfaitHonoraire+'&forfaitAppelFond='+forfaitAppelFond+'&forfaitAppelCotisation='+forfaitAppelCotisation; + donnees += '&numeroOptionTarif='+numeroOptionTarif; + //console.log(donnees); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrecapitulercolleged/recapituler/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_recapituler').empty(); + $('#div_recapituler').html(data); + }, + complete: function(data) + { + enregistrer_college_temp_d(); + + actualisercollege_temp_d(); + } + }); + +} + +function affiche_garanties_par_statut_d() +{ + codeLienParente=$("#codeLienParente").val(); + + if($('#codeLienParente').val()<=" ") + { + v_msg="Veuillez revoir le status!"; + v_msgEng="Please review the status"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').focus(); + return; + } + + donnees = 'codeLienParente='+codeLienParente; + + //$("#div_garanties_status").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescolleged/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_garanties_status").html(data); + + + }, + complete: function(data) + { + enregistrer_college_temp_d(); + } + }); +} + +function actualisercollege_temp_d(){ + + donnees = "" + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmajcolleged/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_majcollege').empty(); + $('#div_majcollege').html(data); + $('.selectpicker').selectpicker(); + }, + complete: function(data) + { + + } + }); + +} + +function calculer_prime_inmportation_devis() +{ + nb_adh=$("#nb_adh").val(); + + if (nb_adh>"0") + { + v_msg="Veuillez lier toutes les famille à leur collège!"; + v_msgEng="Please link all the family to their college!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous le calcul de primes?"; + v_msgEng="Do you confirm the premium calculation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + var div_attente = $('#div_liste_assure_importe'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassuredevis/calculerprimeimportee/", + type: 'POST', + // data: donnees, + success: function(data) { + v_msg="Calcul de primes terminée avec succès!"; + v_msgEng="Premium calculation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Listeimportassuredevis/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function filtreadherentparcollege_d() +{ + + + var idCollegePolice = $('#idCollegePolice').val(); + + if(idCollegePolice ==""){ + idCollegePolice = "0"; + } + + donnees = 'idCollegePolice='+idCollegePolice; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreadherentparcollegedevis/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + afficher_adherents_devis(); + }, + complete: function() { + + } + }); + +} + +function transformer_client_d(idClient) +{ + donnees = 'idClient='+idClient; + + v_msg="Confirmez-vous la transformation de ce client en prospect?"; + v_msgEng="Do you confirm the transformation of this customer into a prospect?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterprospects/transformer/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_prospect').html(data); + + idProspect = $("#idProspect").val(); + numeroProspect = $("#numeroProspect").val(); + + $("#idClient_d_C").val(idProspect); + $("#numeroClient_d_C").val(numeroProspect); + + if (idProspect>"") + { + ajax_context_client_d_afficher(idProspect); + } + }, + complete: function() { + + } + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function filtre_facture_abonnement() +{ + codeExercice = $("#codeExercice").val(); + + donnees = 'codeExercice='+codeExercice; + + + var div_attente = $('#div_facture'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + div_attente.html(data); + }, + complete: function() { + + } + }); +} + +function facture_impayees_abonnement() +{ + + + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/listeimpayees/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_impayees').html(data); + }, + complete: function() { + $("#btn_modal").click(); + } + }); + +} + +function select_toutes_factures_impayees(p_choix) +{ + + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/selectiontoutes/", + type: 'POST', + data: donnees, + success: function(data) { + + $('#div_impayees').html(data); + + }, + error: function(data) { + }, + complete: function() { + + //affichertoutfacturationprime(); + } + }); +} + +function select_une_facture_impayee(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/selectionneune/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_impayees').html(data); + + + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function affiche_montant_a_payer_saas() +{ + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/montantapayer/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_historique').html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); + +} + +function proceder_paiement_saas() +{ + window.location.assign($("#racineWeb" ).val()+"Payerabonnement/"); +} + +function maj_facture_payer_saas() +{ + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefacturesabonnement/majfacturespayees/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Abonnement/"); + } + }); + +} + +function filtreproduitexclusion(){ + + + var codeGcAssureur = $('#codeGcAssureur').val(); + + if(codeGcAssureur<=" "){ + $('#div_actesproduit').html(""); + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltreproduitexclusion/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_produit').html(data); + + $("#codeProduit").selectpicker(); + }, + complete: function() { + + } + }); + +} + +function modifier_lien_parente(idLien) +{ + donnees = 'idLien='+idLien; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamlienparente/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() + { + $('#div_maj_lien').html(donnees_retour); + } + }); +} + +function enregistrer_modif_lien_parente() +{ + + + idLien = $("#idLien").val(); + enVigueur = $("#enVigueur").val(); + + + donnees = 'idLien='+idLien+'&enVigueur='+enVigueur; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamlienparente/historiser/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + //alert("Success : "+data); + // + + v_msg="Mis à jour effectuée avec succès!"; + v_msgEng="Updated successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + window.location.assign($("#racineWeb" ).val()+"Paramlienparente/"); + } + }); +} + +function activation_prestataire(codePrestataire){ + + let idPrestataire = $('#idPrestataire').val(); + + $("#div_patienter").html('
' + '
'); + + donnees = 'codePrestataire='+codePrestataire; + donnees += '&idPrestataire='+idPrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactivationprestataire/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_patienter").html(''); + $('#div_activation').html(data); + //appliquerDataTable(); + $('#div_activation').modal("show"); + + }, + complete: function() { + + } + }); +} + +function historique_activation_prestataire(codePrestataire) +{ + donnees = 'codePrestataire='+codePrestataire; + + $("#div_historique").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactivationprestataire/historique/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_historique').html(data); + }, + complete: function() { + retour_prestataire_id(); + } + }); +} + +function maj_authentification_otp() +{ + activerOtp = $("#activerOtp").val(); + + if(activerOtp == "1"){ + v_msg="Etes-vous sur de vouloir activer la double authentification?"; + v_msgEng="Are you sure you want to enable two-factor authentication?"; + }else{ + + v_msg="Etes-vous sur de vouloir désactiver la double authentification?"; + v_msgEng="Are you sure you want to disable two-factor authentication?"; + } + + donnees = 'activerOtp='+activerOtp; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametresgeneraux/majauthentification/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complexite_pass").html(data); + v_msg="Mise à jour effectuée avec succès!"; + v_msgEng="Update done successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Paramreinitmotpass/"); + } + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function modifier_param_filtrage_ip() +{ + + window.location.assign($("#racineWeb" ).val()+"Filtreadresseip/"); +} + +function consulter_param_filtrage_ip() +{ + window.location.assign($("#racineWeb" ).val()+"Filtreadresseipcons/"); +} + + +function retour_param_habilitation() +{ + window.location.assign($("#racineWeb" ).val()+"Paramhabilitation/"); +} + +function enregistrer_modif_param_filtreip() +{ + idSocieteuser = $("#idSocieteuser").val(); + donnees = 'idSocieteuser='+idSocieteuser; + + + + filtrerIp = $("#filtrerIp").val(); + filtrerIpPrestataire= $("#filtrerIpPrestataire").val(); + + donnees += '&filtrerIp='+filtrerIp; + donnees += '&filtrerIpPrestataire='+filtrerIpPrestataire; + + v_msg="Confirmez-vous ces modifications?"; + v_msgEng="Do you confirm these modifications?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametresgeneraux/majfiltreip/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + consulter_param_filtrage_ip(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function tester_disponibiliter_whatsapp() +{ + p_destinataires = $("#destinataires").val(); + if (p_destinataires<=" ") + { + v_msg="Veuillez saisir un destinataire!"; + v_msgEng="Please enter a recipient!"; + alert_ebene(v_msg, v_msgEng); + + $("#destinataires").focus(); + return; + } + + p_message = ""; + + p_message = "TESTS WHATSAPP INTER-SANTE"; + + // ajout KANE du 18/02/2025 + + // fournisseurWhatsApp = $("#fournisseurWhatsApp").val(); + fournisseurWhatsApp = 'waapi'; + + if (fournisseurWhatsApp<=" ") + { + v_msg="Fournisseur de WhatsApp non défini!"; + v_msgEng="WhatsApp provider not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if(fournisseurWhatsApp=="waapi") + { + p_message = "Fournisseur WhatsApp : waapi "; + } + else + if(fournisseurWhatsApp=="ultramsg") + { + p_message = "Fournisseur WhatsApp : ultramsg "; + } + else + { + v_msg=fournisseurWhatsApp+" => Fournisseur de WhatsApp inconnu!"; + v_msgEng=fournisseurWhatsApp+" => Unknown WhatsApp Provider!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = "destinataires="+p_destinataires+"&message="+p_message+"&fournisseurWhatsApp="+fournisseurWhatsApp; + + $("#div_test_gabarit").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtesterdisponiblitesms/envoyerlewhatsapp/", + type: 'POST', + data: donnees, + success: function(data) + { + // alert("success "+data); + $('#div_test_gabarit').html(data); + }, + error: function(errdata) + { + // alert("Error : "+errdata); + $('#div_test_gabarit').html(errdata); + }, + complete: function() + { + } + }); +} + + +function parametre_produit() +{ + var codeProduit = $('#codeProduit').val(); + + if(codeProduit<=" "){ + $('#div_parametres').html(""); + } + + donnees = 'codeProduit='+codeProduit; + + $("#div_parametres").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_parametres').html(data); + }, + complete: function() { + } + }); +} + +function retour_param_fact_garant() +{ + window.location.assign($("#racineWeb" ).val()+"Paramfacturegarantcons/"); +} + +function inserer_param_fact_produit() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + + gcTauxFraisReel = $('#gcTauxFraisReel').val(); + gcTauxRedressement = $('#gcTauxRedressement').val(); + gcTauxCommissionGerant = $('#gcTauxCommissionGerant').val(); + + + montantBudget = parseInt($("#montantBudget").val().replace(/ /g,""),10);; + montantBudgetEnfantSupl = parseInt($("#montantBudgetEnfantSupl").val().replace(/ /g,""),10); + montantBudgetConjointSupl = parseInt($("#montantBudgetConjointSupl").val().replace(/ /g,""),10); + + forfaitHonoraire = parseInt($("#forfaitHonoraire").val().replace(/ /g,""),10); + nbAdherent = parseInt($("#nbAdherent").val().replace(/ /g,""),10); + nbBeneficiaire = parseInt($("#nbBeneficiaire").val().replace(/ /g,""),10); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&gcTauxFraisReel='+gcTauxFraisReel; + + donnees += '&gcTauxRedressement='+gcTauxRedressement; + donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant; + donnees += '&montantBudget='+montantBudget; + donnees += '&montantBudgetEnfantSupl='+montantBudgetEnfantSupl; + donnees += '&montantBudgetConjointSupl='+montantBudgetConjointSupl; + donnees += '&forfaitHonoraire='+forfaitHonoraire; + donnees += '&nbAdherent='+nbAdherent; + donnees += '&nbBeneficiaire='+nbBeneficiaire; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/inserer/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + + v_msg="Paramètres insérés avec succès!"; + v_msgEng="Parameters inserted successfully!"; + alert_ebene(v_msg, v_msgEng); + + + }, + complete: function() { + retour_param_fact_garant(); + } + }); + +} + +function modifier_param_fact_produit(superUser) +{ + if (superUser != "1"){ + v_msg="Non autorisé!"; + v_msgEng="Unauthorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarant/"); +} + +function enregistrer_param_fact_produit() +{ + codeGcAssureur = $('#codeGcAssureur').val(); + codeProduit = $('#codeProduit').val(); + + gcTauxFraisReel = $('#gcTauxFraisReel').val(); + gcTauxRedressement = $('#gcTauxRedressement').val(); + gcTauxCommissionGerant = $('#gcTauxCommissionGerant').val(); + + montantBudget = parseInt($("#montantBudget").val().replace(/ /g,""),10);; + montantBudgetEnfantSupl = parseInt($("#montantBudgetEnfantSupl").val().replace(/ /g,""),10); + montantBudgetConjointSupl = parseInt($("#montantBudgetConjointSupl").val().replace(/ /g,""),10); + + forfaitHonoraire = parseInt($("#forfaitHonoraire").val().replace(/ /g,""),10); + nbAdherent = parseInt($("#nbAdherent").val().replace(/ /g,""),10); + nbBeneficiaire = parseInt($("#nbBeneficiaire").val().replace(/ /g,""),10); + + donnees = 'codeGcAssureur='+codeGcAssureur; + donnees += '&codeProduit='+codeProduit; + donnees += '&gcTauxFraisReel='+gcTauxFraisReel; + + donnees += '&gcTauxRedressement='+gcTauxRedressement; + donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant; + donnees += '&montantBudget='+montantBudget; + donnees += '&montantBudgetEnfantSupl='+montantBudgetEnfantSupl; + donnees += '&montantBudgetConjointSupl='+montantBudgetConjointSupl; + donnees += '&forfaitHonoraire='+forfaitHonoraire; + donnees += '&nbAdherent='+nbAdherent; + donnees += '&nbBeneficiaire='+nbBeneficiaire; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + + v_msg="Paramètres enregistrés avec succès!"; + v_msgEng="Settings saved successfully!"; + alert_ebene(v_msg, v_msgEng); + + + }, + complete: function() { + retour_param_fact_garant_cons(); + } + }); + +} + +function retour_param_fact_garant_cons() +{ + window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarantcons/"); +} + + +function ouvrir_parametre_produit() +{ + if ( $("#paramFacGcProduit").val() == "0") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarantcons/"); +} + +function change_password() +{ + + v_msg="Attention, vous serez déconnecté par la suite! Voulez-vous changer votre mot de passe?"; + v_msgEng="Attention, you will be logged out afterwards! Do you want to change your password?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Changermotpass/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function infos_entite() +{ + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosentite/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + // + $('#div_entite').html(data); + + delaiUsageSaas = $("#delaiUsageSaas").val(); + + //dateLimiteUsage = $("#dateLimiteUsage").val(); + + /* + v_msg="Dernière facture SAAS: "+delaiUsageSaas+"\nFin de licence: "+dateLimiteUsage; + v_msgEng="Latest SAAS invoice: "+delaiUsageSaas+"\nEnd of license: "+dateLimiteUsage; + */ + + v_msg="Fin d'abonnement: "+delaiUsageSaas; + v_msgEng="End of subscription: "+delaiUsageSaas; + + + alert_ebene(v_msg, v_msgEng); + + return; + + }, + complete: function() { + + } + }); +} + +function change_password() +{ + + v_msg="Attention, vous serez déconnecté par la suite! Voulez-vous changer votre mot de passe?"; + v_msgEng="Attention, you will be logged out afterwards! Do you want to change your password?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Changermotpass/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function annuler_facture_classique_police(idFactureClassique, idFacture) { + + v_msg="Confirmez-vous cette annulation?"; + v_msgEng="Do you confirm this cancellation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idFactureClassique=' + idFactureClassique+'&idFacture='+idFacture; + + $("#div_annuler_facture").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxannulationfacturerdpolice/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_annuler_facture").html(data); + $("#div_annuler_facture").modal({backdrop: 'static', keyboard: false, show: true }); + $("#div_annuler_facture").modal("show"); + }, + complete: function () { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function valider_annulation_facture_classique_police() +{ + + + idFactureClassique = $("#idFactureClassique").val(); + + motif = $("#motif").val(); + + if(motif <=" ") + { + v_msg="Le motif est obligatoire!"; + v_msgEng="The pattern is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + + return; + } + + donnees = "idFactureClassique="+idFactureClassique+'&motif='+motif; + + v_msg="Validez-vous cette annulation?"; + v_msgEng="Do you validate this cancellation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxannulationfacturerdpolice/annuler/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + afficher_dossier_classique_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function tarif_applique(tarif) +{ + v_msg="Tarif appliqué : "+tarif; + v_msgEng="Price applied : "+tarif; + + alert_ebene(v_msg, v_msgEng); + + return; + +} + +function consulter_envois_whatsapp() +{ + donnees = ""; + donnees_retour = ""; + + date1 = $("#date1").val(); + date2 = $("#date2").val(); + + donnees += 'date1=' + date1; + donnees += '&date2=' + date2; + + $("#div_sms").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulterwhatsapp/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_sms").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function genererQRCode(matricule) { + /* + + const container = document.getElementById('qr-code-container'); + container.innerHTML = '
Génération en cours...
'; + + donnees = "matricule="+matricule; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgenererqrcode/", + type : 'post', + dataType: 'json', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + + + if (data.success) { + // Recharger la page + //modifier_beneficiaire(); + location.reload(); + } else { + container.innerHTML = ` +
+ Erreur: ${data.error || 'Échec de génération'} + +
`; + } + + }, + complete: function() { + + } + }); + */ +} + +function regenererQRCode(matricule) { + /* + + v_msg="Voulez-vous vraiment régénérer ce QR Code ?"; + v_msgEng="Do you really want to regenerate this QR Code?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + genererQRCode(matricule); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + */ +} + +function listerremboursement() +{ + + + d1 = $("#d1").val(); + d2 = $("#d2").val(); + codeEtatDemandeRemboursement = $("#codeEtatDemandeRemboursement").val(); + + donnees = 'd1='+ d1+'&d2='+d2+'&codeEtatDemandeRemboursement='+codeEtatDemandeRemboursement; + + $("#div_dossiers").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemanderemboursement/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // alert(data); + + + $('#div_dossiers').html(data); + }, + complete: function() { + + } + }); +} + +function selectionner_remboursement(idDemande) +{ + donnees = 'idDemande='+idDemande; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemanderemboursement/selectionnerremb/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // alert(data); + + }, + complete: function() { + actualiser_remboursement(); + } + }); +} + +function actualiser_remboursement() +{ + window.location.assign($("#racineWeb" ).val()+"Demanderemboursement/"); + +} + +function valider_reponse_demande_rd() +{ + idDemandeRemboursement = $("#idDemandeRemboursement").val(); + idBeneficiaire = $("#idBeneficiaire").val(); + codeEtatDemandeRemboursement = $("#codeEtatDemandeRemboursement").val(); + motifReponseDemandeRemboursement = $("#motifReponseDemandeRemboursement").val(); + + nbreFichier = $("#nbreFichier").val(); + + if(codeEtatDemandeRemboursement=="0"){ + + v_msg="Un autre état de réponse est obligatoire!"; + v_msgEng="Another response status is required!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeEtatDemandeRemboursement").focus(); + + return; + } + + if(motifReponseDemandeRemboursement<=" "){ + + v_msg="Le motif est obligatoire!"; + v_msgEng="The pattern is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifReponseDemandeRemboursement").focus(); + + return; + } + + if(codeEtatDemandeRemboursement=="1" && nbreFichier=="0"){ + + v_msg="Au moins une facture doit être incluse à la demande !"; + v_msgEng="At least one invoice must be included with the request!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = 'idDemandeRemboursement='+idDemandeRemboursement; + donnees += '&codeEtatDemandeRemboursement='+codeEtatDemandeRemboursement; + donnees += '&motifReponseDemandeRemboursement='+motifReponseDemandeRemboursement; + + v_msg="Confirmez-vous cette réponse ?"; + v_msgEng="Do you confirm this answer?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemanderemboursement/majreponse/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // alert(data); + + + }, + complete: function() { + + if(codeEtatDemandeRemboursement=="1"){ + ajax_context_adherent(idBeneficiaire); + }else{ + window.location.assign($("#racineWeb" ).val()+"Historiqueremboursement/"); + + } + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_dossier_demande_rd() +{ + + idBeneficiaire = $("#idBeneficiaire").val(); + + v_msg="Confirmez-vous la création du dossier de remboursement ?"; + v_msgEng="Do you confirm the creation of the reimbursement file?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + ajax_context_adherent(idBeneficiaire); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function filtrespoliceencoursgarant(){ + + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrespoliceencoursgarant/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_policegarant').html(data); + + $("#idPolice" ).selectpicker(); + }, + complete: function() { + reinit_edition_carte(); + } + }); + +} + +function reinit_edition_carte(){ + idPolice =$("#idPolice").val(); + + $("#div_liste_carte").html('
' + '
'); + + donnees = 'idPolice='+idPolice; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/reinitedition/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_carte").html(''); + }, + complete: function() { + + } + }); + +} + +function filtrescollegepolicecarte() { + + donnees = "idPolice=" + $("#idPolice").val(); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxfiltrescollegepolicecarte/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_college").html(data); + $("#idCollege").selectpicker(); + }, + complete: function () { + + } + }); +} + +function select_tous_carte_a_editer(p_choix) +{ + + + donnees = 'choix='+p_choix; + + $("#div_liste_carte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/toutchoisir/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_liste_carte').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function select_un_assure_a_editer(p_choix, id) +{ + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + //$("#div_liste_carte").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/selectionunassure/", + type: 'POST', + data: donnees, + success: function(data) { + //$('#div_liste_carte').html(data); + //appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function confirmer_edition_carte(){ + + idPolice =$("#idPolice").val(); + typeEdition =$("#typeEdition").val(); + + $("#div_liste_carte").html('
' + '
'); + + donnees = 'idPolice='+idPolice; + + v_msg="Confirmez-vous l'édition de carte assuré ?"; + v_msgEng="Do you confirm the insured card edition?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + if (numeroBeneficiaire_C>"") + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/confirmedition/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + afficher_liste_carteassure_commun(); + } + }); + } + } else { + afficher_liste_carteassure_commun(); + } + }); + +} + +function actualiser_carte_assure() +{ + window.location.assign($("#racineWeb" ).val()+"Carteassures/"); +} + +function afficher_detail_emission(idEmission) +{ + if (idEmission>"0") + { + window.location.assign($("#racineWeb" ).val()+"Detailemission/"+idEmission+"/"); + } +} + + +function paiement_mobile_un_dossier() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + fraisRetenu=$("#fraisRetenu").val(); + if (fraisRetenu<=0) + { + v_msg="Rien à payer!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==0) + { + v_msg="Aucune Demande de Règlement!"; + v_msgEng="No request in progress!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Paiementmobile/"); +} + +function reinitialiser_changementcollege() +{ + v_msg="Confirmez-vous la réinitialisation?"; + v_msgEng="Do you confirm the reset?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + window.location.assign($("#racineWeb" ).val()+"Fichechangementcollege/"); + } + }); +} + +function lister_avenants_sans_primes() +{ + $("#div_page_complet").html('
' + '
'); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#avenant_a_facturer").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/listeravenantsanprime/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_page_complet").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + + +function cloturer_avenant_sans_prime(idAvenant) +{ + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Do you confirm this operation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + + $("#div_page_complet").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/clotureravenantsansprime/", + type : 'post', + data: "idAvenant="+idAvenant, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + lister_avenants_sans_primes(); + } + }); + } else { + } + }); + +} + +function tester_reconnaissance_faciale() +{ + alert("tester_reconnaissance_faciale"); + return; + + p_idReglement = $("#idReglement").val(); + p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); + p_prefixdestinataire = $("#prefixdestinataire").val(); + p_destinataires = $("#destinataires").val(); + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (p_idReglement<=" ") + { + v_msg="ID Règlement manquant!"; + v_msgEng="Missing Regulation ID!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (fournisseurPaiementMobile<=" ") + { + v_msg="Fournisseur de paiement mobile non défini!"; + v_msgEng="Mobile payment provide not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_prefixdestinataire<=" ") + { + v_msg="Veuillez saisir un préfixe!"; + v_msgEng="Please enter a prefix!"; + alert_ebene(v_msg, v_msgEng); + + $("#prefixdestinataire").focus(); + return; + } + + if (p_destinataires<=" ") + { + v_msg="Veuillez saisir un destinataire!"; + v_msgEng="Please enter a recipient!"; + alert_ebene(v_msg, v_msgEng); + + $("#destinataires").focus(); + return; + } + + const liste_fournisseurs = ["cinetpay", "paydunya", "waveci"]; + + if (!liste_fournisseurs.includes(p_fournisseurPaiementMobile)) + { + v_msg=p_fournisseurPaiementMobile+" => Fournisseur de paiement mobile inconnu!"; + v_msgEng=fournisseurPaiementMobile+" => Unknown Mobile payment provider!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = "idReglement="+p_idReglement; + donnees += "&fournisseurPaiementMobile="+p_fournisseurPaiementMobile; + donnees += "&prefixdestinataire="+p_prefixdestinataire; + donnees += "&destinataires="+p_destinataires; + + $("#div_test_gabarit").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtesterpaiementmobile/envoyerargent/", + type: 'POST', + data: donnees, + success: function(data) + { + // alert("success "+data); + $('#div_test_gabarit').html(data); + }, + error: function(errdata) + { + // alert("Error : "+errdata); + $('#div_test_gabarit').html(errdata); + }, + complete: function() + { + } + }); +} + +function tester_paiement_mobile() +{ + p_idReglement = $("#idReglement").val(); + p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); + p_prefixdestinataire = $("#prefixdestinataire").val(); + p_destinataires = $("#destinataires").val(); + p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (p_idReglement<=" ") + { + v_msg="ID Règlement manquant!"; + v_msgEng="Missing Regulation ID!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (fournisseurPaiementMobile<=" ") + { + v_msg="Fournisseur de paiement mobile non défini!"; + v_msgEng="Mobile payment provide not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_prefixdestinataire<=" ") + { + v_msg="Veuillez saisir un préfixe!"; + v_msgEng="Please enter a prefix!"; + alert_ebene(v_msg, v_msgEng); + + $("#prefixdestinataire").focus(); + return; + } + + if (p_destinataires<=" ") + { + v_msg="Veuillez saisir un destinataire!"; + v_msgEng="Please enter a recipient!"; + alert_ebene(v_msg, v_msgEng); + + $("#destinataires").focus(); + return; + } + + if (p_withdrawModePaiementMobile<=" ") + { + v_msg="Veuillez indiquer le withdraw mode!"; + v_msgEng="Please indicate the withdraw mode!"; + alert_ebene(v_msg, v_msgEng); + + $("#withdrawModePaiementMobile").focus(); + return; + } + + const liste_fournisseurs = ["cinetpay", "paydunya", "waveci"]; + + if (!liste_fournisseurs.includes(p_fournisseurPaiementMobile)) + { + v_msg=p_fournisseurPaiementMobile+" => Fournisseur de paiement mobile inconnu!"; + v_msgEng=fournisseurPaiementMobile+" => Unknown Mobile payment provider!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = "idReglement="+p_idReglement; + donnees += "&fournisseurPaiementMobile="+p_fournisseurPaiementMobile; + donnees += "&prefixdestinataire="+p_prefixdestinataire; + donnees += "&destinataires="+p_destinataires; + donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; + + $("#div_test_gabarit").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtesterpaiementmobile/envoyerargent/", + type: 'POST', + data: donnees, + success: function(data) + { + // alert("success "+data); + $('#div_test_gabarit').html(data); + }, + error: function(errdata) + { + // alert("Error : "+errdata); + $('#div_test_gabarit').html(errdata); + }, + complete: function() + { + } + }); +} + +function paiement_par_mobile() +{ + p_idReglement = $("#idReglement").val(); + p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); + p_prefixePaiementMobile = $("#prefixePaiementMobile").val(); + p_mobilePaiement = $("#mobilePaiement").val(); + p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + plafondPaiementMobile=$("#plafondPaiementMobile").val(); + plafondPaiementMobile = parseInt(plafondPaiementMobile); + + montantMobileMoney=$("#montantMobileMoney").val(); + montantMobileMoney = parseInt(montantMobileMoney); + + if (montantMobileMoney > plafondPaiementMobile) + { + v_msg="Plafond mobile monney dépassé!"; + v_msgEng="Mobile money ceiling exceeded!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (p_idReglement<=" ") + { + v_msg="Veuillez indiquer un décompte à payer!"; + v_msgEng="Please indicate a statement to pay!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_prefixePaiementMobile<=" ") + { + v_msg="L'indicatif du téléphonique est obligatoire!"; + v_msgEng="The telephone code is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (p_fournisseurPaiementMobile<=" ") + { + v_msg="Fournisseur de paiement mobile non défini!"; + v_msgEng="Mobile payment provide not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_mobilePaiement<=" ") + { + v_msg="Le numéro du téléphonique est obligatoire!"; + v_msgEng="The phone number is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (p_withdrawModePaiementMobile<=" ") + { + v_msg="Veuillez indiquer un oprérateur!"; + v_msgEng="Please specify an operator!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#btn_paiement").prop("disabled",true); + + donnees = "idReglement="+p_idReglement; + donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; + + // alert(donnees); + // return; + + v_msg="Confirmez-vous le paiement mobile?"; + v_msgEng="Do you confirm mobile payment?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + + $("#div_wait").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementmobile/envoyerargent/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_wait').html(data); + + $("#btn_paiement").prop("disabled",false); + + v_msg="Paiement mobile bien effectué!"; + v_msgEng="Mobile payment successful!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(errdata) + { + // alert("Error : "+errdata); + $('#div_test_gabarit').html(errdata); + }, + complete: function() + { + afficher_dossier_classique(); + } + }); + } else { + afficher_dossier_classique(); + } + }); +} + +function paiement_mobile_un_dossier_police() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + fraisRetenu=$("#fraisRetenu").val(); + if (fraisRetenu<=0) + { + v_msg="Rien à payer!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==0) + { + v_msg="Aucune Demande de Règlement!"; + v_msgEng="No request in progress!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Paiementmobilepolice/"); +} + + +function paiement_par_mobile_police() +{ + p_idReglement = $("#idReglement").val(); + p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); + p_prefixePaiementMobile = $("#prefixePaiementMobile").val(); + p_mobilePaiement = $("#mobilePaiement").val(); + p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); + + paiementMobileActif=$("#paiementMobileActif").val(); + paiementMobileActif = parseInt(paiementMobileActif); + + if (paiementMobileActif!=1) + { + v_msg="Module paiement mobile non activé!"; + v_msgEng="Mobile payment module not activated"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + plafondPaiementMobile=$("#plafondPaiementMobile").val(); + plafondPaiementMobile = parseInt(plafondPaiementMobile); + + montantMobileMoney=$("#montantMobileMoney").val(); + montantMobileMoney = parseInt(montantMobileMoney); + + if (montantMobileMoney > plafondPaiementMobile) + { + v_msg="Plafond mobile monney dépassé!"; + v_msgEng="Mobile money ceiling exceeded!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (p_idReglement<=" ") + { + v_msg="Veuillez indiquer un décompte à payer!"; + v_msgEng="Please indicate a statement to pay!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_prefixePaiementMobile<=" ") + { + v_msg="L'indicatif du téléphonique est obligatoire!"; + v_msgEng="The telephone code is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (p_fournisseurPaiementMobile<=" ") + { + v_msg="Fournisseur de paiement mobile non défini!"; + v_msgEng="Mobile payment provide not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if (p_mobilePaiement<=" ") + { + v_msg="Le numéro du téléphonique est obligatoire!"; + v_msgEng="The phone number is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (p_withdrawModePaiementMobile<=" ") + { + v_msg="Veuillez indiquer un oprérateur!"; + v_msgEng="Please specify an operator!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#btn_paiement").prop("disabled",true); + + donnees = "idReglement="+p_idReglement; + donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; + + // alert(donnees); + // return; + + v_msg="Confirmez-vous le paiement mobile?"; + v_msgEng="Do you confirm mobile payment?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + + $("#div_wait").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementmobile/envoyerargent/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_wait').html(data); + + $("#btn_paiement").prop("disabled",false); + + // $('#div_test_gabarit').html(data); + + v_msg="Paiement mobile bien effectué!"; + v_msgEng="Mobile payment successful!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(errdata) + { + $('#div_test_gabarit').html(errdata); + }, + complete: function() + { + afficher_dossier_classique_police(); + } + }); + } else { + afficher_dossier_classique_police(); + } + }); +} + + +function exporter_modele_tarif_acte() +{ + $('#div_form_upload').hide(); + + + var div_export = $('#div_exporter_tarif'); + + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifacte/exportermodele/", + type: 'POST', + //data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + } + }); +} + + +function init_import_tarif_actes() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe=$("#codeTarifActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/initimport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + //alert(data); + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Importertarifsactes/"); + } + }); +} + + +function charger_fichier_modele_tarifacte() +{ + $('#div_exporter_tarif').html(""); + + $('#div_form_upload').show(); + + // return; +} + +function importer_modele_tarif_acte() +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe=$("#codeTarifActe").val(); + cheminFichier=$("#cheminFichier").val(); + + donnees = 'codeTarifActe='+codeTarifActe+'&cheminFichier='+cheminFichier; + + + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_tarif'); + + div_export.html('
' + '
'); + + $("#div_erreur_excel").html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifacte/importermodele/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(''); + $("#div_erreur_excel").html(data); + + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + + div_export.html(''); + + succes_impot_execl=$("#succes_impot_execl").val(); + + if (succes_impot_execl == "1") + { + maj_etape_3_import_actes(); + } + + } + }); +} + +function maj_etape_3_import_actes() +{ + codeTarifActe=$("#codeTarifActe").val(); + + donnees = 'codeTarifActe='+codeTarifActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifacte/majetape/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + window.location.assign($("#racineWeb" ).val()+"Listeimporttarifacte/"); + } + }); +} + +function traiter_actes_importes() +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + etape3=$("#etape3").val(); + + if (etape3 != "1") + { + v_msg="Etape 3 incomplète!"; + v_msgEng="Incomplete step 3!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Listeimporttarifacte/"); +} + +function ajax_composante_tarif_acte_importe() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifacte/affichercomposantetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + $(".datepicker").datepicker(); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function valider_import_tarif_actes() +{ + codeTarifActe=$("#codeTarifActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe; + + v_msg="Validez-vous cette importation de tarif?"; + v_msgEng="Do you validate this tariff import?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifacte/validerimporttarifacte/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_test_gabarit').html(data); + }, + error: function(data) { + $('#div_test_gabarit').html(data); + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Compositiontarifactes/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function importer_tarif_medicaments_code() +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTarifMedicament=$("#codeTarifMedicament").val(); + + donnees = 'codeTarifMedicament='+codeTarifMedicament; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/initimportcode/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Importertarifmedicament/"); + } + }); +} + +function afficher_liste_carteassure_police() +{ + donnees = ""; + donnees_retour = ""; + + idPolice =$("#idPolice").val(); + if(idPolice<=' ') + { + v_msg="Veuillez saisir une police!"; + v_msgEng="Please select a police!"; + alert_ebene(v_msg, v_msgEng); + + $("#idPolice").focus(); + return; + } + + idCollege=$("#idCollege").val(); + + $("#div_export_a").html(""); + + $("#div_liste_carte").html('
' + '
'); + + donnees = 'idPolice='+idPolice+'&idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte").html(donnees_retour); + appliquerDataTable(); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function tester_edition_carteassure() +{ + idPolice =$("#idPolice").val(); + donnees = 'idPolice='+idPolice; + + $('#div_export_a').html(""); + $('#div_liste_carte').html(""); + + $("#div_liste_carte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/afficherliste/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + + nbChoix = $("#nbChoix").val(); + if (nbChoix<="0") + { + v_msg="Liste vide!"; + v_msgEng="Empty list!"; + alert_ebene(v_msg, v_msgEng); + appliquerDataTable(); + return false; + } + else + { + editer_carteassure(); + } + } + }); +} + +function editer_carteassure() +{ + nbChoix = $("#nbChoix").val(); + if (nbChoix<="0") + { + v_msg="Liste vide!"; + v_msgEng="Empty list!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + idPolice =$("#idPolice").val(); + idCollege=$("#idCollege").val(); + + $('#div_export_a').html(""); + $('#div_liste_carte').html(""); + + donnees = 'idPolice='+idPolice+'&idCollege='+idCollege; + + v_url = $("#racineWeb").val()+"Ajaxeditioncarteassure/"; + + $("#div_export_a").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_export_a").html(data); + } + }); +} + +function controler_piece_beneficiaire() +{ + v_codeNaturePiece = $("#codeNaturePiece").val(); + + if(v_codeNaturePiece<=' ') + { + v_msg="Veuillez sélection la nature de la pièce!"; + v_msgEng="Please select the type of document!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNaturePiece").focus(); + return; + } + + $('#numeroPiece').removeAttr('minlength'); + + if(v_codeNaturePiece=="CNI") + { + $('#div_controle_piece').html(""); + + v_numeroPiece = $("#numeroPiece").val(); + + $('#numeroPiece').attr('minlength', 9); + + donnees = "numeroPiece="+v_numeroPiece; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontrolepiece/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_controle_piece').html(data); + + var resultatPiece = $("#resultatPiece").val(); + + if(resultatPiece!="0") + { + $("#numeroPiece").focus(); + return; + } + }, + error: function(data) { + }, + complete: function() + { + } + }); + } +} + +function enregistrer_encaissement_quittance() +{ + anc_solde = $("#anc_solde").val(); + montant = $("#montant").val(); + montant_ecart = (montant-anc_solde); + montant_ecart = Math.abs(montant_ecart); + + montant = $("#montant").val(); + montant = montant.replace(" ", ""); + montant = parseInt(montant); + montant = Math.abs(montant); + + codeModePaiement = $("#codeModePaiement").val(); + codeMoyenPaiement = $("#codeMoyenPaiement").val(); + referencePaiement = $("#referencePaiement").val(); + libelleOperation = $("#libelleOperation").val(); + codeTypePaiement = $("#codeTypePaiement").val(); + banquePayeur = $("#banquePayeur").val(); + + if(codeModePaiement<=" ") + { + v_msg="Veuillez indiquer le mode de paiement!"; + v_msgEng="Please enter the method of payment"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if(codeMoyenPaiement<=" ") + { + v_msg="Veuillez indiquer le moyen de paiement!"; + v_msgEng="Please enter the method of payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMoyenPaiement").focus(); + return; + } + + if(referencePaiement<=" ") + { + v_msg="Veuillez indiquer la référence du paiement!"; + v_msgEng="Please enter the payment reference!"; + alert_ebene(v_msg, v_msgEng); + + $("#referencePaiement").focus(); + return; + } + + if(codeTypePaiement=="B" || codeTypePaiement=="M") + { + if (nomTireur<=" ") + { + v_msg="Veuillez saisir le tireur!"; + v_msgEng="Please enter the issuer of the check! "; + alert_ebene(v_msg, v_msgEng); + + $("#nomTireur").focus(); + return; + } + + if(banquePayeur<=" ") + { + v_msg="Veuillez indiquer l\'établissement payeur!"; + v_msgEng="Please indicate the paying institution!"; + alert_ebene(v_msg, v_msgEng); + + $("#banquePayeur").focus(); + return; + } + } + + if(montant_ecart>"100") + { + v_msg="Veuillez vérifier votre écart!"; + v_msgEng="Please check your gap!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // if(montant=="100") + if(montant<="100") + { + v_msg="Veuillez saisir un montant!"; + v_msgEng="Please enter an amount"; + alert_ebene(v_msg, v_msgEng); + + $("#montant").focus(); + return; + } + + if(libelleOperation<=" ") + { + v_msg="Veuillez saisir le libellé de l\'opération!"; + v_msgEng="Please enter the text of the transaction!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleOperation").focus(); + return; + } + + $("#formente_encaissement").submit(); +} + +function suite_encaissement_client() +{ + montant = $("#montant").val(); + montant = montant.replace(" ", ""); + montant = parseInt(montant); + montant = Math.abs(montant); + + codeModePaiement = $("#codeModePaiement").val(); + codeMoyenPaiement = $("#codeMoyenPaiement").val(); + referencePaiement = $("#referencePaiement").val(); + libelleOperation = $("#libelleOperation").val(); + codeTypePaiement = $("#codeTypePaiement").val(); + nomTireur = $("#nomTireur").val(); + banquePayeur = $("#banquePayeur").val(); + + if(codeModePaiement<=" ") + { + v_msg="Veuillez indiquer le mode de paiement!"; + v_msgEng="Please enter the method of payment"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if(codeMoyenPaiement<=" ") + { + v_msg="Veuillez indiquer le moyen de paiement!"; + v_msgEng="Please enter the method of payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMoyenPaiement").focus(); + return; + } + + if(referencePaiement<=" ") + { + v_msg="Veuillez indiquer la référence du paiement!"; + v_msgEng="Please enter the payment reference!"; + alert_ebene(v_msg, v_msgEng); + + $("#referencePaiement").focus(); + return; + } + + if(codeTypePaiement=="B" || codeTypePaiement=="M") + { + if (nomTireur<=" ") + { + v_msg="Veuillez saisir le tireur!"; + v_msgEng="Please enter the issuer of the check! "; + alert_ebene(v_msg, v_msgEng); + + $("#nomTireur").focus(); + return; + } + + if(banquePayeur<=" ") + { + v_msg="Veuillez indiquer l\'établissement payeur!"; + v_msgEng="Please indicate the paying institution!"; + alert_ebene(v_msg, v_msgEng); + + $("#banquePayeur").focus(); + return; + } + } + + if(montant<="0") + { + v_msg="Veuillez saisir un montant!"; + v_msgEng="Please enter an amount"; + alert_ebene(v_msg, v_msgEng); + + $("#montant").focus(); + return; + } + + + if(libelleOperation<=" ") + { + v_msg="Veuillez saisir le libellé de l\'opération!"; + v_msgEng="Please enter the text of the transaction!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleOperation").focus(); + return; + } + + $("#btn_suivant").click(); +} + + +function suite_encaissement_bordreau() +{ + montant = $("#montant").val(); + montant = montant.replace(" ", ""); + montant = parseInt(montant); + montant = Math.abs(montant); + + codeModePaiement = $("#codeModePaiement").val(); + codeMoyenPaiement = $("#codeMoyenPaiement").val(); + referencePaiement = $("#referencePaiement").val(); + libelleOperation = $("#libelleOperation").val(); + codeTypePaiement = $("#codeTypePaiement").val(); + nomTireur = $("#nomTireur").val(); + banquePayeur = $("#banquePayeur").val(); + + if(codeModePaiement<=" ") + { + v_msg="Veuillez indiquer le mode de paiement!"; + v_msgEng="Please enter the method of payment"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if(codeMoyenPaiement<=" ") + { + v_msg="Veuillez indiquer le moyen de paiement!"; + v_msgEng="Please enter the method of payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMoyenPaiement").focus(); + return; + } + + if(referencePaiement<=" ") + { + v_msg="Veuillez indiquer la référence du paiement!"; + v_msgEng="Please enter the payment reference!"; + alert_ebene(v_msg, v_msgEng); + + $("#referencePaiement").focus(); + return; + } + + if(codeTypePaiement=="B" || codeTypePaiement=="M") + { + if (nomTireur<=" ") + { + v_msg="Veuillez saisir le tireur!"; + v_msgEng="Please enter the issuer of the check! "; + alert_ebene(v_msg, v_msgEng); + + $("#nomTireur").focus(); + return; + } + + if(banquePayeur<=" ") + { + v_msg="Veuillez indiquer l\'établissement payeur!"; + v_msgEng="Please indicate the paying institution!"; + alert_ebene(v_msg, v_msgEng); + + $("#banquePayeur").focus(); + return; + } + } + + if(montant<="0") + { + v_msg="Veuillez saisir un montant!"; + v_msgEng="Please enter an amount"; + alert_ebene(v_msg, v_msgEng); + + $("#montant").focus(); + return; + } + + + if(libelleOperation<=" ") + { + v_msg="Veuillez saisir le libellé de l\'opération!"; + v_msgEng="Please enter the text of the transaction!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleOperation").focus(); + return; + } + + $("#btn_suivant").click(); +} + +function suite_encaissement_depot() +{ + montant = $("#montant").val(); + montant = montant.replace(" ", ""); + montant = parseInt(montant); + montant = Math.abs(montant); + + codeModePaiement = $("#codeModePaiement").val(); + codeMoyenPaiement = $("#codeMoyenPaiement").val(); + referencePaiement = $("#referencePaiement").val(); + libelleOperation = $("#libelleOperation").val(); + codeTypePaiement = $("#codeTypePaiement").val(); + nomTireur = $("#nomTireur").val(); + banquePayeur = $("#banquePayeur").val(); + + if(codeModePaiement<=" ") + { + v_msg="Veuillez indiquer le mode de paiement!"; + v_msgEng="Please enter the method of payment"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if(codeMoyenPaiement<=" ") + { + v_msg="Veuillez indiquer le moyen de paiement!"; + v_msgEng="Please enter the method of payment!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMoyenPaiement").focus(); + return; + } + + if(referencePaiement<=" ") + { + v_msg="Veuillez indiquer la référence du paiement!"; + v_msgEng="Please enter the payment reference!"; + alert_ebene(v_msg, v_msgEng); + + $("#referencePaiement").focus(); + return; + } + + if(codeTypePaiement=="B" || codeTypePaiement=="M") + { + if (nomTireur<=" ") + { + v_msg="Veuillez saisir le tireur!"; + v_msgEng="Please enter the issuer of the check! "; + alert_ebene(v_msg, v_msgEng); + + $("#nomTireur").focus(); + return; + } + + if(banquePayeur<=" ") + { + v_msg="Veuillez indiquer l\'établissement payeur!"; + v_msgEng="Please indicate the paying institution!"; + alert_ebene(v_msg, v_msgEng); + + $("#banquePayeur").focus(); + return; + } + } + + if(montant<="0") + { + v_msg="Veuillez saisir un montant!"; + v_msgEng="Please enter an amount"; + alert_ebene(v_msg, v_msgEng); + + $("#montant").focus(); + return; + } + + + if(libelleOperation<=" ") + { + v_msg="Veuillez saisir le libellé de l\'opération!"; + v_msgEng="Please enter the text of the transaction!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleOperation").focus(); + return; + } + + $("#btn_depot").click(); +} + +function liste_renouvellement_medicament() +{ + demandeTraite = $("#demandeTraite").val(); + debut = $("#debut").val(); + fin = $("#fin").val(); + + donnees = 'demandeTraite='+demandeTraite; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablespha/renouvellementmedicament/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + + } + }); +} + +function afficher_detail_ren_medicament(idPrescription) { + + + donnees = "idPrescription=" + idPrescription; + + + $("#div_patienter").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + //$('#div_test_gabarit').html(data); + //alert(data); + + $("#div_medicaments_prescrits").html(data); + $("#div_medicaments_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); + $("#div_medicaments_prescrits").modal("show"); + $("#div_patienter").empty(); + + //alert("afficherMasquerMedicaments"); + // afficherMasquerMedicaments(); + + }, + complete: function () { + + } + }); + +} + +function ajax_maj_qte_prescrit_medicament(idMedicament, quantite, controle) { + + donnee_a_affciher = ""; + + quantite = quantite.replace(",", "."); + controle.value = quantite; + + if (controle_numerique(controle)) { + if (quantite == 0) { + controle.focus(); + v_msg = "Veuillez saisir la quantit\u00e9!"; + v_msgEng = "Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idMedicament=' + idMedicament + "&quantite=" + quantite; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/majquantiteaccorde/", + type: 'POST', + data: donnees, + success: function (data) { + + }, + error: function (data) { + }, + complete: function () { + affiche_liste_phar_renouvellement_provisoire(); + } + }); + } +} + +function affiche_liste_phar_renouvellement_provisoire() +{ + $("#tab_liste").html('
' + '
'); + + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traitementprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#tab_liste").html(data); + }, + complete: function () { + + } + }); + +} + +function ajax_maj_duree_triatement_renouvelleemnt_medicament(idMedicament, dureeTraitement, controle) { + + donnee_a_affciher = ""; + + dureeTraitement = dureeTraitement.replace(",", "."); + controle.value = dureeTraitement; + + if (controle_numerique(controle)) { + if (dureeTraitement == 0) { + controle.focus(); + v_msg = "Veuillez saisir la durée!"; + v_msgEng = "Please enter the duration!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idMedicament=' + idMedicament + "&dureeTraitement=" + dureeTraitement; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/majdureetraitement/", + + type: 'POST', + data: donnees, + success: function (data) { + + }, + error: function (data) { + }, + complete: function () { + affiche_liste_phar_renouvellement_provisoire(); + } + }); + } +} + +function traitement_tous_ren_medic(codeReponseProvisoire) +{ + donnees = "codeReponseProvisoire=" + codeReponseProvisoire; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traitertousprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + // $('#div_test_gabarit').html(data); + affiche_liste_phar_renouvellement_provisoire(); + }, + complete: function () { + + } + }); + +} + +function traiter_un_provisoire_ren_medic(idMedicament, codeReponseProvisoire) +{ + donnees = "idMedicament=" + idMedicament + "&codeReponseProvisoire=" + codeReponseProvisoire; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traiterunprovisoire/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + affiche_liste_phar_renouvellement_provisoire(); + }, + complete: function () { + + } + }); + +} + +function valider_renouvellement_medicament() { + + observations = $("#observations").val(); + motifRefusAssure = $("#motifRefusAssure").val(); + + nombreRefus = $("#nombreRefus").val(); + nombreEnAttente = $("#nombreEnAttente").val(); + + if(nombreEnAttente>"0"){ + v_msg = "Veuillez traiter toutes les lignes!"; + v_msgEng = "Please process all lines!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (nombreRefus >"0" && motifRefusAssure <= " ") { + v_msg = "Veuillez saisir le motif pour les refus!"; + v_msgEng = "Please enter the reason for rejections!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifRefusAssure").focus(); + + return; + } + + v_msg = "Confirmez-vous cette validation?"; + v_msgEng = "Do you confirm this validation?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'observations=' + observations + '&motifRefusAssure=' + motifRefusAssure; + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/valider/", + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $('#div_resultat_validation').html(data); + valider = $("#valider").val(); + + if(valider=="1"){ + v_msg = "Validation réussie!"; + v_msgEng = "Validation succeed!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn-fermer-entente").click(); + }else{ + v_msg = "Echèc de la validation!"; + v_msgEng = "Validation failed!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + }, + complete: function () { + liste_renouvellement_medicament(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficherMasquerAntecedents() +{ + masquerAntecedents = $("#masquerAntecedents").val(); + + const element = document.getElementById("chevron-antecedents"); + + if(masquerAntecedents=="1"){ + $('#div_antecedents').hide(); + $("#masquerAntecedents").val("0"); + //$("#span_antecedents").text("Voir"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + }else{ + $('#div_antecedents').show(); + $("#masquerAntecedents").val("1"); + //$("#span_antecedents").text("Masquer"); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + + afficher_diagnostics_beneficiaire_entente(); + } + +} + + +function afficher_diagnostics_beneficiaire_entente() +{ + idBeneficiaire = $("#idBeneficiaire").val(); + + donnees = "idBeneficiaire=" + idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdiagnosticsbeneficiaireentente/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_dianostics").html(donnees_retour); + } + }); +} + +function afficher_liste_carteassure_adherent() +{ + donnees = ""; + donnees_retour = ""; + + idAdherent =$("#idAdherent").val(); + if(idAdherent<=' ') + { + v_msg="Veuillez sélectionner une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#div_export_a").html(""); + + $("#div_liste_carte").html('
' + '
'); + + donnees = 'idAdherent='+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecarteassure/indexadherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte").html(donnees_retour); + appliquerDataTable(); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function afficher_liste_carteassure_commun() +{ + typeEdition =$("#typeEdition").val(); + + switch(typeEdition) { + case "garant": + afficher_liste_carteassure(); + break; + case "police": + afficher_liste_carteassure_police(); + break; + case "adherent": + afficher_liste_carteassure_adherent(); + break; + default: + afficher_liste_carteassure(); + } +} + +function imprimer_carte_assure() +{ + prestationPossible = $("#prestationPossible").val(); + + if (prestationPossible!="1") + { + v_msg="Pas encore couvert!"; + v_msgEng="Not covered yet!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Carteassuresadherent/"); +} + +function afficherMasquerSituation() +{ + masquerSituation = $("#masquerSituation").val(); + + const element = document.getElementById("chevron-situation"); + + if(masquerSituation=="1"){ + $('#div_situation').hide(); + $("#masquerSituation").val("0"); + + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + }else{ + $('#div_situation').show(); + $("#masquerSituation").val("1"); + + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + + afficher_situation_beneficiaire(); + } + +} + +function afficherMasquerMedicaments() +{ + masquerMedicament = $("#masquerMedicament").val(); + + const element = document.getElementById("chevron-medicament"); + + if(masquerMedicament=="1"){ + $('#div_medicament').hide(); + $("#masquerMedicament").val("0"); + + element.classList.remove("bi-chevron-up"); + element.classList.add("bi-chevron-down"); + + }else{ + $('#div_medicament').show(); + $("#masquerMedicament").val("1"); + + element.classList.remove("bi-chevron-down"); + element.classList.add("bi-chevron-up"); + + afficher_ordonnance_beneficiaire(); + } +} + +function afficher_situation_beneficiaire() +{ + donnees_retour = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsituationbeneficiaire/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_situation").html(donnees_retour); + } + }); +} + +function afficher_ordonnance_beneficiaire() +{ + numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val(); + + donnees = "numeroFeuilleMaladie="+numeroFeuilleMaladie; + + donnees_retour = ''; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxordonnancebeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_medicament").html(donnees_retour); + } + }); +} + +// Fonction globale pour tes notifications AJAX (Wahoo Effect) +function notification(type, message) { + const Toast = Swal.mixin({ + toast: true, + position: 'top-end', + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer) + toast.addEventListener('mouseleave', Swal.resumeTimer) + } + }); + + Toast.fire({ + icon: type, // 'success', 'error', 'warning', 'info' + title: message + }); +} + +function gerer_garant_defaut() +{ + codeGcAssureurDefaut=$("#codeGcAssureurDefaut").val(); + codeGcAssureur=$("#codeGcAssureur").val(); + + if(codeGcAssureurDefaut>" ") + { + $('#codeGcAssureur').val(codeGcAssureurDefaut).trigger('change'); + selectionTauxGarant(); + } +} + +function toggleSidebar() { + document.body.classList.toggle('sidebar-collapsed'); +} + +function init_revoquer_htagcarte(idHtagcarte) { + $("#idHtagcarte").val(idHtagcarte); + $("#div_revoquer_carte").modal({backdrop: 'static', keyboard: false, show: true }); + $("#div_revoquer_carte").modal("show"); +} + +function enregistrer_modif_parametres_med() +{ + + idSocieteuser = $("#idSocieteuser").val(); + + envoismsactif = $("#s_envoismsactif").val(); + + smsAssure = $("#s_smsAssure").val(); + smsmParFacture = $("#s_smsmParFacture").val(); + + emailParFacture = $("#s_emailParFacture").val(); + copieSmsAssure = $("#s_copieSmsAssure").val(); + + seuilAlerteActif = $("#s_seuilAlerteActif").val(); + + montantTotalExamen = $("#s_montantTotalExamen").val(); + montantTotalMedicament = $("#s_montantTotalMedicament").val(); + + accorderMedecinSouscripteur = $("#s_accorderMedecinSouscripteur").val(); + delaisReponseMedecinSouscripteur = $("#s_delaisReponseMedecinSouscripteur").val(); + + tousActesSoumisOuinon = $("#s_tousActesSoumisOuinon").val(); + + envoismswhatsappactif = $("#s_envoismswhatsappactif").val(); + appliquerTarifBas = $("#s_appliquerTarifBas").val(); + nombreActeEntentePrealable = $("#s_nombreActeEntentePrealable").val(); + + donnees = 'idSocieteuser='+idSocieteuser; + donnees += '&envoismsactif='+envoismsactif; + donnees += '&smsAssure='+smsAssure+'&smsmParFacture='+smsmParFacture; + donnees += '&emailParFacture='+emailParFacture+'&copieSmsAssure='+copieSmsAssure; + donnees += '&seuilAlerteActif='+seuilAlerteActif; + donnees += '&montantTotalExamen='+montantTotalExamen; + donnees += '&montantTotalMedicament='+montantTotalMedicament; + + donnees += '&accorderMedecinSouscripteur='+accorderMedecinSouscripteur; + donnees += '&delaisReponseMedecinSouscripteur='+delaisReponseMedecinSouscripteur; + + donnees += '&tousActesSoumisOuinon='+tousActesSoumisOuinon; + + donnees += '&envoismswhatsappactif='+envoismswhatsappactif; + donnees += '&appliquerTarifBas='+appliquerTarifBas; + donnees += '&nombreActeEntentePrealable='+nombreActeEntentePrealable; + + v_msg="Confirmez-vous ces modifications?"; + v_msgEng="Do you confirm these modifications?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametresgeneraux/enregistrermodifmed/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + v_msg="Mise à jour effectuée avec succès!"; + v_msgEng="Update done successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + afficher_autres_parametresgeneraux(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_prix_autres_actes(idPrestationactes, prixSaisi, controle) { + donnees = 'idPrestationactes='+idPrestationactes+'&prixSaisi='+prixSaisi; + + if (prixSaisi <= "0"){ + v_msg="Rien à faire!"; + v_msgEng="Nothing to do!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + let donnee_a_afficher = ""; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesmedicauxselect/majprixautresactes/", + type: 'POST', + data: donnees, + success: function(data) { + donnee_a_afficher = data; + }, + complete: function() { + $("#div_prestations").html(donnee_a_afficher); + controle.focus(); + } + }); +} + +function afficher_facture_dec() +{ + alert("afficher_facture_dec"); + return; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherajoutactesdec/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnee_a_affciher = data; + + $("#searchInputActe").val(''); + $("#div_selection_acte").hide(); + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + } + }); +} + +function ajax_maj_prix_acte_dec(idPrestationactes, valeurActe, controle) +{ + valeurActe=valeurActe.replace(",","."); + controle.value=valeurActe; + + valeurActe=valeurActe.replace(/ /g,""); + valeurActe=parseInt(valeurActe.replace(",","."),10); + controle.value=valeurActe; + + if(controle_numerique(controle)) + { + donnees = 'idPrestationactes='+idPrestationactes+"&valeurActe="+valeurActe; + + donnee_a_affciher = ""; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherajoutactesdec/majvaleuracte/", + type: 'POST', + data: donnees, + success: function(data) { + donnee_a_affciher = data; + }, + error: function(data) { + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + + } + }); + } +} + + +function retour_bereme_initial() +{ + idBaremePriseEnCharge=$("#idBaremePriseEnCharge").val(); + + if (idBaremePriseEnCharge>"0") + { + detail_baremepriseencharge(idBaremePriseEnCharge); + } +} + +function supprimer_baremeacte_lettre_cle(adminProd, idActe) +{ + alert("supprimer_baremeacte_lettre_cle => "+idActe); + return; + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremelettrecle/supprimer/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + actualiser_bareme_acte_lettre_cle(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function actualiser_bareme_acte_lettre_cle() +{ + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + alert("actualiser_bareme_acte_lettre_cle => "+idBaremePriseEnCharge); + return; + + donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremelettrecle/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_detail_bareme').html(data); + }, + complete: function() { + + } + }); + +} + +function detail_baremeacte_lettre_cle(idActesbaremeinitiallettrecle) +{ + donnees = 'idActesbaremeinitiallettrecle='+idActesbaremeinitiallettrecle; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremelettrecle/detailactes/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + // $("#div_test_gabarit").html(data); + $('#div_detail_bareme_actes').html(data); + $("#div_detail_bareme_actes").modal({backdrop: 'static', keyboard: false, show: true }); + $('#div_detail_bareme_actes').modal("show"); + }, + complete: function() { + + } + }); + +} + +function supprimer_baremeacte_lettre_cle_detail(adminProd, idActe) +{ + alert("supprimer_baremeacte_lettre_cle_detail => "+idActe); + return; + + if (adminProd != "1"){ + v_msg="Vous n'\u00eates pas autoris\u00e9!"; + v_msgEng="You are not authorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette suppression?"; + v_msgEng="Do you confirm this deletion?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbaremelettrecle/supprimerdetailacte/", + type : 'post', + data: "idActe="+idActe, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + idActesbaremeinitiallettrecle = $("#idActesbaremeinitiallettrecle").val(); + + detail_baremeacte_lettre_cle(idActesbaremeinitiallettrecle); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} +