From 37e5b80acf1fdfe8e1d70aeb4bd5ee6ba2ef20a4 Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Mon, 13 Apr 2026 05:43:13 +0000 Subject: [PATCH] a --- Js/fonctions.js | 40898 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40898 insertions(+) diff --git a/Js/fonctions.js b/Js/fonctions.js index d1b7117c..4e9e014e 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -11077,3 +11077,40901 @@ function requetes_optique() donnees += '&libelleOptique=' + libelleOptique; $("#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()); + } + }); +} + +function requetes_optique_export() +{ + $('#div_detail_requete').html(''); + $('#div_export_a').html(""); + + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateLivraison1 = $("#dateLivraison1").val(); + dateLivraison2 = $("#dateLivraison2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + codeMedecin = $("#codeMedecin").val(); + + numeroBonConsultation1 = $("#numeroBonConsultation1").val(); + numeroBonConsultation2 = $("#numeroBonConsultation2").val(); + + numeroBonOptique1 = $("#numeroBonOptique1").val(); + numeroBonOptique2 = $("#numeroBonOptique2").val(); + + numeroFeuilleMaladie1 = $("#numeroFeuilleMaladie1").val(); + numeroFeuilleMaladie2 = $("#numeroFeuilleMaladie2").val(); + + codePrestatairePrescription = $("#codePrestatairePrescription").val(); + + // Ligne 3 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // Ligne 4 + libelleOptique = $("#libelleOptique").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1); + numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2); + + numeroBonOptique1 = convertir_en_entier(numeroBonOptique1); + numeroBonOptique2 = convertir_en_entier(numeroBonOptique2); + + numeroFeuilleMaladie1 = convertir_en_entier(numeroFeuilleMaladie1); + numeroFeuilleMaladie2 = convertir_en_entier(numeroFeuilleMaladie2); + // FIN convertir_en_entier + + // Ligne 1 + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateLivraison1=' + dateLivraison1; + donnees += '&dateLivraison2=' + dateLivraison2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&codeMedecin=' + codeMedecin; + + donnees += '&numeroBonConsultation1=' + numeroBonConsultation1; + donnees += '&numeroBonConsultation2=' + numeroBonConsultation2; + + donnees += '&numeroBonOptique1=' + numeroBonOptique1; + donnees += '&numeroBonOptique2=' + numeroBonOptique2; + + donnees += '&numeroFeuilleMaladie1=' + numeroFeuilleMaladie1; + donnees += '&numeroFeuilleMaladie2=' + numeroFeuilleMaladie2; + + donnees += '&codePrestatairePrescription=' + codePrestatairePrescription; + + // Ligne 3 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + // Ligne 4 + donnees += '&libelleOptique=' + libelleOptique; + + 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 requetes_assure() +{ + $('#div_export').html(""); + $('#div_export_a').html(""); + + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + // Ligne 1 + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // Ligne 2 + numeroPolice = $("#numeroPolice").val(); + codeProduit = $("#codeProduit").val(); + codeEtatPolice = $("#codeEtatPolice").val(); + codeLienParente = $("#codeLienParente").val(); + codeEtatBeneficiaire = $("#codeEtatBeneficiaire").val(); + sexe = $("#sexe").val(); + + // Ligne 3 + numeroClient1 = $("#numeroClient1").val(); + numeroClient2 = $("#numeroClient2").val(); + telephonePortableAdherent = $("#telephonePortableAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + decede = $("#decede").val(); + nomClient = $("#nomClient").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroClient1 = convertir_en_entier(numeroClient1); + numeroClient2 = convertir_en_entier(numeroClient2); + // FIN convertir_en_entier + + // Ligne 1 + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + // Ligne 2 + donnees += '&numeroPolice=' + numeroPolice; + donnees += '&codeProduit=' + codeProduit; + donnees += '&codeEtatPolice=' + codeEtatPolice; + donnees += '&codeLienParente=' + codeLienParente; + donnees += '&codeEtatBeneficiaire=' + codeEtatBeneficiaire; + donnees += '&sexe=' + sexe; + + // Ligne 3 + donnees += '&numeroClient1=' + numeroClient1; + donnees += '&numeroClient2=' + numeroClient2; + donnees += '&telephonePortableAdherent=' + telephonePortableAdherent; + donnees += '&emailAdherent=' + emailAdherent; + donnees += '&decede=' + decede; + donnees += '&nomClient=' + nomClient; + + $("#div_detail_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function(data) { + $("#div_detail_requete").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function requetes_assure_export() +{ + $('#div_detail_requete').html(''); + $('#div_export_a').html(""); + + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + // Ligne 1 + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // Ligne 2 + numeroPolice = $("#numeroPolice").val(); + codeProduit = $("#codeProduit").val(); + codeEtatPolice = $("#codeEtatPolice").val(); + codeLienParente = $("#codeLienParente").val(); + codeEtatBeneficiaire = $("#codeEtatBeneficiaire").val(); + sexe = $("#sexe").val(); + + // Ligne 3 + numeroClient1 = $("#numeroClient1").val(); + numeroClient2 = $("#numeroClient2").val(); + telephonePortableAdherent = $("#telephonePortableAdherent").val(); + emailAdherent = $("#emailAdherent").val(); + decede = $("#decede").val(); + nomClient = $("#nomClient").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroClient1 = convertir_en_entier(numeroClient1); + numeroClient2 = convertir_en_entier(numeroClient2); + // FIN convertir_en_entier + + // Ligne 1 + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + // Ligne 2 + donnees += '&numeroPolice=' + numeroPolice; + donnees += '&codeProduit=' + codeProduit; + donnees += '&codeEtatPolice=' + codeEtatPolice; + donnees += '&codeLienParente=' + codeLienParente; + donnees += '&codeEtatBeneficiaire=' + codeEtatBeneficiaire; + donnees += '&sexe=' + sexe; + + // Ligne 3 + donnees += '&numeroClient1=' + numeroClient1; + donnees += '&numeroClient2=' + numeroClient2; + donnees += '&telephonePortableAdherent=' + telephonePortableAdherent; + donnees += '&emailAdherent=' + emailAdherent; + donnees += '&decede=' + decede; + donnees += '&nomClient=' + nomClient; + + 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 consulter_limite_avant_facturation() +{ + facture=$("#facture").val(); + + if (facture==0) + { + v_msg="Pas encore facturée!"; + v_msgEng="Not yet charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturecons/"); +} + +function consulter_limite_avant_facturation_dec() +{ + window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturecdec/"); +} + +function limite_avant_facture_dec(idFacture) +{ + donnees = 'idFacture='+idFacture; + $.ajax({ + url: $("#racineWeb").val()+"AjaxPlafondavantfacturecdec/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_limites").html(data); + }, + complete: function() { + } + }); +} + +function afficher_pharmacien() +{ + window.location.assign($("#racineWeb" ).val()+"Pharmaciencons/"); +} + +function afficher_pharmacien_dec() +{ + window.location.assign($("#racineWeb" ).val()+"Pharmaciendec/"); +} + + +function consulter_limite_avant_facturation_pha() +{ + window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturephacons/"); +} + +function consulter_limite_avant_facturation_pha_dec() +{ + window.location.assign($("#racineWeb" ).val()+"Plafondavantfacturephadec/"); +} + + +function imprimer_livraison_bon() +{ + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlivraisonbons/", + type: 'POST', + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function convertir_en_entier(valeur) +{ + if(isNaN(valeur)) + { + valeur = "0"; + } + + if (valeur=="") + { + valeur="0"; + } + + valeur = parseInt(valeur); + + return valeur; +} + +function verifier_feuille_maladie_dec_opt(donnees) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxverifierfactureopt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_verification_facture").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); +} + +function valider_prestation_opt(idPrestationactes, p_choix) +{ + numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val(); + idFacture = $("#idFacture").val(); + + donnees = 'idPrestationactes='+idPrestationactes+"&choix="+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherverifierfactureopt/validerprestation/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_verification_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function maj_montantForce_prestation_opt(idPrestationactes, montantForce) +{ + donnees = 'idPrestationactes='+idPrestationactes+"&montantForce="+montantForce; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherverifierfactureopt/majmontantforce/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_verification_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function reinit_facture_dec_opt() +{ + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + idFacture = $("#idFacture").val(); + + donnees = 'idFacture='+idFacture+"&numeroFeuilleMaladie="+numeroFeuilleMaladie; + + v_msg="Confirmez-vous la ré-initialisation?"; + v_msgEng="Do you confirm the re-initialization?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherverifierfactureopt/reinitfacturedec/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_verification_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function valider_facture_dec_opt() +{ + ndPrestNonTraites=$("#ndPrestNonTraites").val(); + + if (ndPrestNonTraites>"0") + { + v_msg="Des prestations non traitées!"; + v_msgEng="Unprocessed benefits!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + idFacture = $("#idFacture").val(); + codeTypeFacture = $("#codeTypeFacture").val(); + + donnees = 'idFacture='+idFacture; + + var ctrl_montantForce = $("#montantForce"+idFacture); + var ctrl_montantApayer = $("#montantApayer"+idFacture); + var ctrl_montantRedresse = $("#montantRedresse"+idFacture); + + v_msg="Confirmez-vous ces montants?"; + v_msgEng="Do you confirm these amounts?"; + + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherverifierfactureopt/validerfacturedec/", + type: 'POST', + data: donnees, + success: function(data) { + montantForce_dec = $("#montantForce_dec").val(); + montantApayer_dec = $("#montantApayer_dec").val(); + montantRedresse_dec = $("#montantRedresse_dec").val(); + + ctrl_montantForce.html(montantForce_dec); + + c_html = " "; + + ctrl_montantApayer.html(c_html); + + ctrl_montantRedresse.html(montantRedresse_dec); + + $("#btn_close_pop").click(); + }, + error: function(data) { + }, + complete: function() { + afficher_recap_decompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function verifier_feuille_maladie_dec_opt_cons(donnees) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxverifierfactureoptcons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_verification_facture").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); +} + +function supprimer_empreinte_digitale() +{ + finger_id_C=$("#finger_id_C" ).val(); + + if(finger_id_C<1) + { + v_msg="Pas d\'empreinte digitale!"; + v_msgEng="No fingerprint!"; + 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 l\'empreinte digitale?"; + v_msgEng="Do you confirm the deletion of the fingerprint?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'motif='+motif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsupprimerempreinte/supprimerempreinte/", + type : 'post', + data: donnees, + success: function(data) { + v_msg="Empreinte digitale ré-initialisée avec succès!"; + v_msgEng="Fingerprint re-initialized successfully!"; + alert_ebene(v_msg, v_msgEng); + + }, + error: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Supprimerempreinte/"); + } + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function remboursement_classique() +{ + idDemandeRemboursement = $("#idDemandeRemboursement").val(); + + if(idDemandeRemboursement > "0"){ + selectionner_remboursement(idDemandeRemboursement); + }else{ + window.location.assign($("#racineWeb" ).val()+"Remboursementclassique/"); + } +} + +function creer_dossier_classique_assure() +{ + window.location.assign($("#racineWeb" ).val()+"Creerdossierclassique/"); +} + +function listerremboursementbeneficiaire() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesclassiques/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + +function nouvelle_facture_classique() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==1) + { + v_msg="Demande de règlement déjà effectuée!"; + v_msgEng="Request for payment already made!"; + alert_ebene(v_msg, v_msgEng); + + + return; + } + + if (appartient_a_un_bordereau_rbcl()) + { + v_msg="Fait partie d'un bordereau!"; + v_msgEng="Part of a slip!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Factureclassique/"); +} + + +function enregistrerfacture_classique() +{ + codePrestataire = $("#codePrestataire").val(); + if (codePrestataire<=" ") + { + v_msg="Veuillez indiquer le prestataire qui a consulté!"; + v_msgEng="Please indicate the provider who consulted!"; + alert_ebene(v_msg, v_msgEng); + + $("#button_popRecherchePrestataire").click(); + return; + } + + prestataire = $("#prestataire").val(); + if (prestataire<=" ") + { + v_msg="Veuillez indiquer le prestataire!"; + v_msgEng="Please indicate the provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#prestataire").focus(); + return; + } + + //alert(codePrestataire+'/'+prestataire); + //return; + + dateFacture=$("#dateFacture").val(); + + if (dateFacture<=" ") + { + v_msg="Veuillez saisir la date de la facture!"; + v_msgEng="Please enter the date of the invoice!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + var v_prixActe = $("#prixActe").val(); + var v_rejet = $("#v_rejet").val(); + var v_exclu = $("#v_exclu").val(); + + if (v_prixActe==0 && v_rejet==0 && v_exclu==0) + { + v_msg="Rien à enregistrer!"; + v_msgEng="Nothing to save!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette facture?"; + v_msgEng="Do you confirm this invoice?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'prestataire='+prestataire + donnees+='&dateFacture='+dateFacture; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/validerfactureclassique/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + v_msg="Facture ajoutée avec succès!"; + v_msgEng="Invoice added successfully!"; + alert_ebene(v_msg, v_msgEng); + + afficher_dossier_classique(); + } + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajax_maj_tm_facture(tm, controle) +{ + donnees = 'tm='+tm; + + tm=tm.replace(",","."); + controle.value=tm; + + if(controle_numerique(controle)) + { + enregistrerfacture_classique_temp("0"); + } +} + +function ajax_maj_prix_acte_classique(idPrestation, valeurActe, controle) +{ + valeurActe=valeurActe.replace(/ /g,""); + controle.value=valeurActe; + + if(controle_numerique(controle)) + { + donnees = 'idPrestation='+idPrestation+"&valeurActe="+valeurActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/majprix/", + 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_prix_acte_classique(idPrestation, valeurActe, controle) +{ + donnees = 'idPrestation='+idPrestation+"&valeurActe="+valeurActe; + + valeurActe=valeurActe.replace(",","."); + controle.value=valeurActe; + + if(controle_numerique(controle)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/majprix/", + 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 valider_facture_classique_temp() +{ + enregistrerfacture_classique_temp("1"); +} + +function modifier_facture_classique(idFacture){ + + prestataire = $("#prestataire").val(); + dateFacture = $("#dateFacture").val(); + hospitalisation = $("#hospitalisation").val(); + observations = $("#observations").val(); + + + donnees = 'prestataire='+prestataire+"&dateFacture="+dateFacture; + donnees += '&hospitalisation='+hospitalisation+"&observations="+observations; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierfactureclassique/modifierfacture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture").html(data); + $(".datepicker").datepicker(); + $("#prestataire").selectpicker(); + + v_msg="Enregistré avec succès!"; + v_msgEng="Successfully registered!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function(data) { + alerter_depassement_limite_classique(); + //consulter_facture_classique(idFacture); + window.location.assign($("#racineWeb" ).val()+"Dossierclassique/"); + } + }); + +} + + +function enregistrerfacture_classique_temp(v_entete) +{ + + codePrestataire = $("#codePrestataire").val(); + + /* + if (codePrestataire<=" ") + { + v_msg="Veuillez indiquer le prestataire qui a consulté!"; + v_msgEng="Please indicate the provider who consulted!"; + alert_ebene(v_msg, v_msgEng); + + $("#button_popRecherchePrestataire").click(); + return; + } + */ + prestataire = $("#prestataire").val(); + + + /*if (prestataire<=" ") + { + v_msg="Veuillez indiquer le prestataire!"; + v_msgEng="Please indicate the provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#prestataire").focus(); + return; + }*/ + + + dateFacture=$("#dateFacture").val(); + + if (dateFacture<=" ") + { + v_msg="Veuillez saisir la date de la facture!"; + v_msgEng="Please enter the date of the invoice!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + dateEffetPolice = $("#dateEffetPolice_C").val(); + dateEcheancePolice = $("#dateEcheancePolice_C").val(); + dateConsultation = $("#dateConsultation").val(); + + + + //var td0 = new Date(dateEffetPolice); + dateEntreeBeneficiaire= $("#dateEntreeBeneficiaire_C").val(); + var td0 = $("#dateEntreeBeneficiaire").datepicker("getDate");//new Date(dateEntreeBeneficiaire); + var td1 = $("#dateConsultation").datepicker("getDate");//new Date(dateConsultation); + var td2 = $("#datejourfr_C").datepicker("getDate"); + var td3 = $("#dateEcheancePolice").datepicker("getDate");//new Date(dateEcheancePolice); + var td4 = $("#dateFacture").datepicker("getDate"); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); + dt4=Math.round(Date.parse(td4)/(1000*3600*24)); + + + if (dt4dt2) + { + v_msg="La date des Prestations ne peut être supérieure à la date du jour!"; + v_msgEng="The date of the Services can not be greater than today"; + alert_ebene(v_msg, v_msgEng); + + $("#dateConsultation").focus(); + return; + } + + if (dt4>dt3 || dt40) + { + v_msg="Attention ! Dépassement de limite"; + v_msgEng="Warning ! Overflow"; + alert_ebene(v_msg, v_msgEng); + + return; + } +} + + + +function consulter_facture_classique(idFacture) +{ + window.location.assign($("#racineWeb" ).val()+"Consulteractureclassique/"+idFacture+"/"); +} + +function consulter_limite_avant_facturation_classique() +{ + idFacture=$("#idFacture_C").val(); + + if (idFacture==0) + { + v_msg="Pas encore facturée!"; + v_msgEng="Not yet charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Plafondavantfactureclassique/"); +} + +function retour_facture_classique() +{ + idFacture=$("#idFacture_C").val(); + window.location.assign($("#racineWeb" ).val()+"Consulteractureclassique/"+idFacture+"/"); +} + +function payerfactureclassique() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Payerfactureclassique/"); +} + + +function ajaxcommissionautre() +{ + donnees = "codeApporteur="+$("#codeCommercial").val()+"&codeEtape="+$("#codeEtape").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcommissionautre/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infocommautre").html(data); + }, + complete: function() { + $("#tauxCommissionAutre").val( $("#tauxCommissionautre_info").val()); + } + }); +} + +function creer_optiontarif() +{ + 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; + } + + v_msg="Confirmez-vous la création d\'une nouvelle option?"; + v_msgEng="Do you confirm the creation of a new option?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouvelleoptiontarif/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + v_msg="Nouvelle option créée avec succès!"; + v_msgEng="New option created successfully!"; + alert_ebene(v_msg, v_msgEng); + + // afficher_police_d_id(); + window.location.assign($("#racineWeb" ).val()+"Fichedevis/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function actualiser_liste_college_d() +{ + numeroOptionTarif = $("#numeroOptionTarif").val(); + + donnees = "numeroOptionTarif="+numeroOptionTarif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecolleged/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listecollege").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function supprimer_option() +{ + 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; + } + + nbPersonneReel_total = parseInt($("#nbPersonneReel_total").val()); + if(nbPersonneReel_total > 0) + { + v_msg="Incorporation d'assurés sur l'option. Suppression impossible!"; + v_msgEng="Incorporation of policyholders on the option. Cannot delete!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroOptionTarif = $("#numeroOptionTarif").val(); + + donnees = "numeroOptionTarif="+numeroOptionTarif; + + v_msg="Confirmez-vous la suppression de cette option?"; + v_msgEng="Do you confirm the deletion of this option?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistecolleged/supprimeroption/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + v_msg="Option supprimée avec succès!"; + v_msgEng="Option removed successfully!"; + alert_ebene(v_msg, v_msgEng); + + afficher_police_d_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function texte_cpd() +{ + window.location.assign($("#racineWeb" ).val()+"Textecpd/"); +} + +function prestataire_en_plus() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairenplus/"); +} + +function prestataire_en_moins() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairenmoins/"); +} + + +function ajouter_un_prestataire_en_plus(codePrestataire) +{ + donnees = 'codePrestataire='+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenplus/ajouterunprestataireenplus/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function retirer_un_prestataire_en_plus(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenplus/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajax_maj_tm_en_plus(idPrestation, tm, controle) +{ + tm=tm.replace(",","."); + controle.value=tm; + + donnees = 'idPrestation='+idPrestation+"&tm="+tm; + + if(controle_numerique(controle)) + { + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenplus/majtm/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); + } +} + +function ajouter_un_prestataire_en_moins(codePrestataire) +{ + donnees = 'codePrestataire='+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenmoins/ajouterunprestataireenmoins/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function retirer_un_prestataire_en_moins(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenmoins/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function prestataire_en_plus_cons() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairenpluscons/"); +} + +function afficher_prestataire_en_plus() +{ + idCollege = $("#idCollege").val(); + + donnees = 'idCollege='+idCollege; + + + $("#div_complet").html('
' + '
'); + + if(idCollege > "0") { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairenpluscons/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_complet").html(data); + //dataTableSpecialeMini(); + appliquerDataTableMini(); + }, + error: function(data) { + }, + complete: function() { + } + }); + }else{ + $("#div_complet").html(''); + + } +} +function exporter_liste_assures_sans_format() +{ + $('#div_export_assures_sans_format').html(''); + + $("#btn_liste_assures_sans_format").click(); +} + +// + +function requetes_demandederogations() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroDerogation1 = $("#numeroDerogation1").val(); + numeroDerogation2 = $("#numeroDerogation2").val(); + + // Ligne 3 + codeDerogation = $("#codeDerogation").val(); + codeReponseDerogation = $("#codeReponseDerogation").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroDerogation1 = convertir_en_entier(numeroDerogation1); + numeroDerogation2 = convertir_en_entier(numeroDerogation2); + + // FIN convertir_en_entier + + // Ligne 1 + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroDerogation1=' + numeroDerogation1; + donnees += '&numeroDerogation2=' + numeroDerogation2; + + // Ligne 3 + donnees += '&codeDerogation=' + codeDerogation; + donnees += '&codeReponseDerogation=' + codeReponseDerogation; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + $("#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()); + } + }); +} + + +function requetes_demandederogations_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroDerogation1 = $("#numeroDerogation1").val(); + numeroDerogation2 = $("#numeroDerogation2").val(); + + // Ligne 3 + codeDerogation = $("#codeDerogation").val(); + codeReponseDerogation = $("#codeReponseDerogation").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroDerogation1 = convertir_en_entier(numeroDerogation1); + numeroDerogation2 = convertir_en_entier(numeroDerogation2); + + // FIN convertir_en_entier + + // Ligne 1 + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroDerogation1=' + numeroDerogation1; + donnees += '&numeroDerogation2=' + numeroDerogation2; + + // Ligne 3 + donnees += '&codeDerogation=' + codeDerogation; + donnees += '&codeReponseDerogation=' + codeReponseDerogation; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + 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 requetes_ententeprealable() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroEntentePrealable1 = $("#numeroEntentePrealable1").val(); + numeroEntentePrealable2 = $("#numeroEntentePrealable2").val(); + + // Ligne 3 + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + libelleActe = $("#libelleActe").val(); + libelleFamilleActe = $("#libelleFamilleActe").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroEntentePrealable1 = convertir_en_entier(numeroEntentePrealable1); + numeroEntentePrealable2 = convertir_en_entier(numeroEntentePrealable2); + + // FIN convertir_en_entier + + // Ligne 1 + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroEntentePrealable1=' + numeroEntentePrealable1; + donnees += '&numeroEntentePrealable2=' + numeroEntentePrealable2; + + // Ligne 3 + donnees += '&codeReponseEntentePrealable=' + codeReponseEntentePrealable; + + // Ligne 4 + donnees += '&libelleActe=' + libelleActe; + donnees += '&beneficiaire=' + beneficiaire; + + donnees += '&adherent=' + adherent; + donnees += '&libelleFamilleActe=' + libelleFamilleActe; + + $("#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()); + } + }); +} + + +function requetes_ententeprealable_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroEntentePrealable1 = $("#numeroEntentePrealable1").val(); + numeroEntentePrealable2 = $("#numeroEntentePrealable2").val(); + + // Ligne 3 + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + libelleActe = $("#libelleActe").val(); + libelleFamilleActe = $("#libelleFamilleActe").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroEntentePrealable1 = convertir_en_entier(numeroEntentePrealable1); + numeroEntentePrealable2 = convertir_en_entier(numeroEntentePrealable2); + + // FIN convertir_en_entier + + // Ligne 1 + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroEntentePrealable1=' + numeroEntentePrealable1; + donnees += '&numeroEntentePrealable2=' + numeroEntentePrealable2; + + // Ligne 3 + donnees += '&codeReponseEntentePrealable=' + codeReponseEntentePrealable; + + // Ligne 4 + donnees += '&libelleActe=' + libelleActe; + donnees += '&beneficiaire=' + beneficiaire; + + donnees += '&adherent=' + adherent; + donnees += '&libelleFamilleActe=' + libelleFamilleActe; + + 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 statistiques() +{ + window.location.assign($("#racineWeb" ).val()+"Initstatistiques/"); +} + +function initierstatistiques() +{ + dateAnalyse = $("#dateAnalyse").val(); + debutArchivageFr = $("#debutArchivageFr").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var td0 = $("#datejourfr_C").datepicker("getDate"); + var td1 = $("#dateAnalyse").datepicker("getDate"); + var td2 = $("#debutArchivageFr").datepicker("getDate"); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); // datejourfr_C + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); // dateAnalyse + td2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutArchivageFr + + if ((dt1==dt0)) + { + v_msg="Journée non ecore archivée!"; + v_msgEng="No archived day!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if ((dt1>dt0)) + { + v_msg="Date trop grande!"; + v_msgEng="Date too big!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // /* mis en commentaire le 28/08/2018 pour les tests + if ((dt1dt0)) + { + v_msg="Date trop grande!"; + v_msgEng="Date too big!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinitstat/initstat/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficherstatnonarchives(); + } + }); +} + +function afficherstat() +{ + window.location.assign($("#racineWeb" ).val()+"Statistiques/"); +} + + +function afficherstatnonarchives() +{ + window.location.assign($("#racineWeb" ).val()+"Statistiquesnonarchives/"); +} + +function reinitialiser_prestataire() +{ + $("#codePrestataire").val(""); + $("#nomPrestataire").html("Tous / Rechercher Prestataire ..."); + $("#close_pop").click(); +} + +function ctrlkeypress_prestataire(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_prestataire(); + } +} + + +function ctrlkeypress_prestataire3(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_prestataire_enplus(); + } +} + +function ctrlkeypress_prestataire4(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_prestataire_enmoins(); + } +} + + +function reinitialiser_prestataire3() +{ + afficher_pop_recherche_prestataire_enplus(); + + +} + +function reinitialiser_prestataire4() +{ + afficher_pop_recherche_prestataire_enmoins(); + + +} + +function afficher_pop_recherche_prestataire_enplus() +{ + codesearch = $("#codesearch").val(); + nomsearch = $("#nomsearch").val(); + + if(codesearch+nomsearch<=" "){ + valid = 0; + }else{ + valid = 1; + } + + donnees = "valid="+valid+"&codesearch="+codesearch+"&nomsearch="+nomsearch; + + $("#div_listeprestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairesenplus/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires").html(data); + } + }); +} + + +function afficher_pop_recherche_prestataire_enmoins() +{ + codesearch = $("#codesearch2").val(); + nomsearch = $("#nomsearch2").val(); + + if(codesearch+nomsearch<=" "){ + valid = 0; + }else{ + valid = 1; + } + + donnees = "valid="+valid+"&codesearch="+codesearch+"&nomsearch="+nomsearch; + + //alert(donnees); + //return; + + $("#div_listeprestataires2").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairesenmoins/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires2").html(data); + } + }); +} + +function selectionner_prestataire(codePrestataire, nomPrestataire) +{ + + + $("#codePrestataire").val(codePrestataire); + $("#nomPrestataire").html(nomPrestataire); + + $("#prestataire").val(nomPrestataire); + + //alert(codePrestataire+'/'+nomPrestataire); + //return; + enregistrerfacture_classique_prestataire(codePrestataire, nomPrestataire); + + $("#close_pop").click(); + +} + +function enregistrerfacture_classique_prestataire(codePrestataire, prestataire) +{ + + + $("#codePrestataire").val(codePrestataire); + $("#prestataire").val(prestataire); + + donnees = "codePrestataire="+codePrestataire+"&prestataire="+prestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfactureclassique/modifierprestatairefacture/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataire").html(data); + }, + complete: function() { + + } + }); + +} + +function enregistrerfacture_classique_date() +{ + + enregistrerfacture_classique_temp("0"); + +} + +// 2 + +function reinitialiser_prestataire2() +{ + $("#codePrestataire").val(""); + $("#nomPrestataire").html("Tous / Rechercher Prestataire ..."); + $("#close_pop2").click(); +} + +function ajouter_prestatairesenplus(codePrestataire) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajouterprestatairesenplus/", + type : 'post', + data: 'codePrestataire='+codePrestataire, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataires_en_plus").html(data); + //dataTableSpecialeMini(); + } + }); + + $("#close_pop").click(); +} + +function ajouter_prestatairesenmoins(codePrestataire) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajouterprestatairesenmoins/", + type : 'post', + data: 'codePrestataire='+codePrestataire, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataires_en_moins").html(data); + //dataTableSpecialeMini(); + } + }); + + $("#close_pop2").click(); +} + +function ctrlkeypress_prestataire2(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_prestataire2(); + } +} + +function afficher_pop_recherche_prestataire() +{ + codesearch = $("#codesearch").val(); + nomsearch = $("#nomsearch").val(); + + if(codesearch+nomsearch<=" ") + return; + + donnees = "valid=1&codesearch="+codesearch+"&nomsearch="+nomsearch; + + $("#div_listeprestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataires/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires").html(data); + } + }); +} + +function afficher_pop_recherche_prestataire2() +{ + codesearch = $("#codesearch2").val(); + nomsearch = $("#nomsearch2").val(); + + if(codesearch+nomsearch<=" ") + return; + + donnees = "valid=1&codesearch="+codesearch+"&nomsearch="+nomsearch; + + $("#div_listeprestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairesb/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeprestataires").html(data); + } + }); +} + +function selectionner_prestataire2(codePrestataire, nomPrestataire) +{ + $("#codePrestataire").val(codePrestataire); + $("#nomPrestataire").html(nomPrestataire); + $("#close_pop2").click(); +} + +function prestataire_tm() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairetm/"); +} + +function ajouter_un_prestataire_tm(codePrestataire) +{ + var idCollege = $('#idCollege').val(); + + + donnees = 'codePrestataire='+codePrestataire+'&idCollege='+idCollege; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/ajouterunprestatairetm/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function retirer_un_prestataire_tm(idPrestation) +{ + donnees = 'idPrestation='+idPrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/retirer/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajax_maj_tm_tm(idPrestation, tm, controle) +{ + + tm=tm.replace(",","."); + controle.value=tm; + + donnees = 'idPrestation='+idPrestation+"&tm="+tm; + + if(controle_numerique(controle)) + { + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/majtm/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_complet").html(data); + //afficher_prestataire_tm(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } +} + +function prestataire_tm_cons() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairetmcons/"); +} + +function afficher_prestataire_tm() +{ + idCollege = $("#idCollege").val(); + + 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; + } + + var div_attente = $('#div_complet'); + + + div_attente.html('
' + '
'); + + + donnees = 'idCollege='+idCollege; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairetm/", + type: 'POST', + data: donnees, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + //$("#codeGarantie").selectpicker(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function de_archiver_garantie_college(idCollege) +{ + contratFacture=$("#contratFacture").val(); + if (contratFacture=="1") + { + v_msg="Contrat déjà facturé!"; + v_msgEng="Contract already billed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + contratConsomme=$("#contratConsomme").val(); + if (contratConsomme=="1") + { + v_msg="Contrat déjà consommé!"; + v_msgEng="Contract already consumed"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeTypeAvenant=$("#codeTypeAvenant").val(); + + if (codeTypeAvenant!="REN" && codeTypeAvenant!="AFN" && codeTypeAvenant!="CHE") + { + v_msg="Opréation impossible à causes des avenants au contrat!"; + v_msgEng="Impossible operation due to the state of the contract!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous l'invalidation de ce collège?"; + v_msgEng="Do you confirm the invalidation of this college?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/desarchivergarntie/", + type : 'post', + data: "idCollege="+idCollege, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + college_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajaxentetestat() +{ + 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; + } + + donnees = 'codeEtat='+codeEtat; + + v_url = $("#racineWeb").val()+"Ajaxetatentete"+codeEtat+"/"; + + $("#div_ente_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ente_requete").html(data); + $(".datepicker" ).datepicker(); + + $(".selectpicker").selectpicker(); + + } + }); +} + +function ajaxentetestatmaladiepolicemontantreferent() { + //////// + 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 (dt2 < dt0 || dt2 > dt1) { + 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 < dt0) { + 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 < dt2) { + v_msg = "Revoir les bornes de la période!"; + v_msgEng = "Review the boundaries of the period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + debutStat = $("#debutStat").val(); + finStat = $("#finStat").val(); + + idPolice = $("#idPolice").val(); + + codeGcAssureur = $("#codeGcAssureur").val(); + + + $('#div_export_a').html(""); + + donnees = 'debutStat=' + debutStat + "&finStat=" + finStat + "&idPolice=" + idPolice + "&codeGcAssureur=" + codeGcAssureur; + + + v_url = $("#racineWeb").val() + "Ajaxetatentetestatsmaladiepolice/calculermontantreferent/"; + + $("#div_ente_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type: 'post', + data: donnees, + error: function (errorData) { + }, + success: function (data) { + $("#div_ente_requete").html(data); + $(".datepicker").datepicker(); + $("#codeGcAssureur").selectpicker(); + $("#idPolice").selectpicker(); + filtrespolicegarant(); + + } + }); +} + +function etat_cumul_prestataire() +{ + 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(); + } + }); +} + + +function etat_cumul_prestataire_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); + } + }); +} + +// factures cleints + +function requetes_factures_client() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroBonConsultation1 = $("#numeroBonConsultation1").val(); + numeroBonConsultation2 = $("#numeroBonConsultation2").val(); + + numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val(); + numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val(); + + numeroBonHospitalisation1 = $("#numeroBonHospitalisation1").val(); + numeroBonHospitalisation2 = $("#numeroBonHospitalisation2").val(); + + numeroBonOptique1 = $("#numeroBonOptique1").val(); + numeroBonOptique2 = $("#numeroBonOptique2").val(); + + // Ligne 3 + codeTypePrestataire = $("#codeTypePrestataire").val(); + numeroDecompte1 = $("#numeroDecompte1").val(); + numeroDecompte2 = $("#numeroDecompte2").val(); + hospitalisation = $("#hospitalisation").val(); + numeroChambre = $("#numeroChambre").val(); + chirurgie = $("#chirurgie").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + + // FIN champs + + // DEBUT convertir_en_entier + numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1); + numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2); + + numeroBonOrdonnance1 = convertir_en_entier(numeroBonOrdonnance1); + numeroBonOrdonnance2 = convertir_en_entier(numeroBonOrdonnance2); + + numeroBonOptique1 = convertir_en_entier(numeroBonOptique1); + numeroBonOptique2 = convertir_en_entier(numeroBonOptique2); + + numeroBonHospitalisation1 = convertir_en_entier(numeroBonHospitalisation1); + numeroBonHospitalisation2 = convertir_en_entier(numeroBonHospitalisation2); + // FIN convertir_en_entier + + // Ligne 1 + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroBonConsultation1=' + numeroBonConsultation1; + donnees += '&numeroBonConsultation2=' + numeroBonConsultation2; + + donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1; + donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2; + + donnees += '&numeroBonHospitalisation1=' + numeroBonHospitalisation1; + donnees += '&numeroBonHospitalisation2=' + numeroBonHospitalisation2; + + donnees += '&numeroBonOptique1=' + numeroBonOptique1; + donnees += '&numeroBonOptique2=' + numeroBonOptique2; + + // Ligne 3 + donnees += '&codeTypePrestataire=' + codeTypePrestataire; + + donnees += '&numeroDecompte1=' + numeroDecompte1; + donnees += '&numeroDecompte2=' + numeroDecompte2; + + donnees += '&hospitalisation=' + hospitalisation; + donnees += '&numeroChambre=' + numeroChambre; + donnees += '&chirurgie=' + chirurgie; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + $("#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()); + } + }); +} + + +function requetes_factures_client_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + // Ligne 1 + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + numeroBonConsultation1 = $("#numeroBonConsultation1").val(); + numeroBonConsultation2 = $("#numeroBonConsultation2").val(); + + numeroBonOrdonnance1 = $("#numeroBonOrdonnance1").val(); + numeroBonOrdonnance2 = $("#numeroBonOrdonnance2").val(); + + numeroBonHospitalisation1 = $("#numeroBonHospitalisation1").val(); + numeroBonHospitalisation2 = $("#numeroBonHospitalisation2").val(); + + numeroBonOptique1 = $("#numeroBonOptique1").val(); + numeroBonOptique2 = $("#numeroBonOptique2").val(); + + // Ligne 3 + codeTypePrestataire = $("#codeTypePrestataire").val(); + numeroDecompte1 = $("#numeroDecompte1").val(); + numeroDecompte2 = $("#numeroDecompte2").val(); + hospitalisation = $("#hospitalisation").val(); + numeroChambre = $("#numeroChambre").val(); + chirurgie = $("#chirurgie").val(); + + // Ligne 4 + adherent = $("#adherent").val(); + beneficiaire = $("#beneficiaire").val(); + // FIN champs + + // DEBUT convertir_en_entier + numeroBonConsultation1 = convertir_en_entier(numeroBonConsultation1); + numeroBonConsultation2 = convertir_en_entier(numeroBonConsultation2); + + numeroBonOrdonnance1 = convertir_en_entier(numeroBonOrdonnance1); + numeroBonOrdonnance2 = convertir_en_entier(numeroBonOrdonnance2); + + numeroBonOptique1 = convertir_en_entier(numeroBonOptique1); + numeroBonOptique2 = convertir_en_entier(numeroBonOptique2); + + numeroBonHospitalisation1 = convertir_en_entier(numeroBonHospitalisation1); + numeroBonHospitalisation2 = convertir_en_entier(numeroBonHospitalisation2); + // FIN convertir_en_entier + + // Ligne 1 + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&numeroBonConsultation1=' + numeroBonConsultation1; + donnees += '&numeroBonConsultation2=' + numeroBonConsultation2; + + donnees += '&numeroBonOrdonnance1=' + numeroBonOrdonnance1; + donnees += '&numeroBonOrdonnance2=' + numeroBonOrdonnance2; + + donnees += '&numeroBonHospitalisation1=' + numeroBonHospitalisation1; + donnees += '&numeroBonHospitalisation2=' + numeroBonHospitalisation2; + + donnees += '&numeroBonOptique1=' + numeroBonOptique1; + donnees += '&numeroBonOptique2=' + numeroBonOptique2; + + // Ligne 3 + donnees += '&codeTypePrestataire=' + codeTypePrestataire; + + donnees += '&numeroDecompte1=' + numeroDecompte1; + donnees += '&numeroDecompte2=' + numeroDecompte2; + + donnees += '&hospitalisation=' + hospitalisation; + donnees += '&numeroChambre=' + numeroChambre; + donnees += '&chirurgie=' + chirurgie; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + 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 etat_cumul_type_prestataire() +{ + 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()); + } + }); +} + + +function etat_cumul_type_prestataire_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 etat_detail_facture_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); + } + }); +} + +// cumul par mois + +function etat_cumul_mois() +{ + 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()); + } + }); +} + + +function etat_cumul_mois_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); + } + }); +} + + +// raport SP + +function etat_rapport_sp_exo() +{ + $('#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()); + } + }); +} + + +function etat_rapport_sp_exo_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 etat_rapport_sp() +{ + $('#div_export_a').html(""); + + + 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; + } + + codeGcAssureur = $("#codeGcAssureur").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; + } + + donnees = "codeGcAssureur="+codeGcAssureur; + donnees_retour = ""; + + 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()); + } + }); +} + + +function etat_rapport_sp_export() +{ + $('#div_export_a').html(""); + + 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; + } + + codeGcAssureur = $("#codeGcAssureur").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; + } + + donnees = "codeGcAssureur="+codeGcAssureur; + + 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 charger_detail_stat_prestataire() +{ + $('#div_export_b').html(""); + codePrestataire = $("#codePrestataire").val(); + donnees = "codePrestataire="+codePrestataire; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrequetefactureprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function afficher_detail_stat_prestataire(codePrestataire) +{ + $('#div_export_b').html(""); + $("#codePrestataire").val(codePrestataire); + $("#btn_pop_detail").click(); +} + + +function afficher_detail_stat_type_prestataire(codeTypePrestataire) +{ + $('#div_export_b').html(""); + $("#codeTypePrestataire").val(codeTypePrestataire); + $("#btn_pop_detail").click(); +} + +function charger_detail_stat_type_prestataire() +{ + $('#div_export_b').html(""); + codeTypePrestataire = $("#codeTypePrestataire").val(); + donnees = "codeTypePrestataire="+codeTypePrestataire; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrequetefacturetypeprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + + +function afficher_detail_stat_prestataire_mois(codePrestataire, mois) +{ + $('#div_export_b').html(""); + $("#codePrestataire").val(codePrestataire); + $("#mois").val(mois); + $("#btn_pop_detail").click(); +} + +function charger_detail_stat_prestataire_mois() +{ + $('#div_export_b').html(""); + + codePrestataire = $("#codePrestataire").val(); + mois = $("#mois").val(); + + donnees = "codePrestataire="+codePrestataire+"&mois="+mois; + + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrequetefactureprestatairemois/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function maj_date_sortie() +{ + etat=$("#codeEtatPolice_C").val(); + + if (etat=="RE") + { + v_msg="Attention! Police résiliée!"; + v_msgEng="Warning! Terminated policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (etat=="SU") + { + v_msg="Attention! Police suspendue!"; + v_msgEng="Warning! Suspended policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (etat=="AN") + { + v_msg="Attention! Police annulée!"; + v_msgEng="Warning! Canceled policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Majdatesortie/"); +} + +function enregistrer_maj_date_sortie() +{ + codeEtatBeneficiaire=$("#codeEtatBeneficiaire").val(); + + motifSortie=$("#motifSortie").val(); + + if (motifSortie<" ") + { + v_msg="Veuillez indiquer le motif!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ce changement?"; + v_msgEng="Do you confirm this change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#btn_enreg").click(); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function etat_rapport_sp_cat() +{ + $('#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()); + } + }); +} + +function etat_rapport_sp_cat_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 etat_rapport_sp_pol_cat() +{ + $('#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()); + } + }); +} + +function etat_rapport_sp_pol_cat_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); + } + }); +} + +// etat DG + +function etat_rapport_sp_pol_cat_det() +{ + $('#div_export_a').html(""); + donnees = "codeProduit="+$("#codeProduit").val(); + 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()); + } + }); +} + + + +function etat_rapport_sp_pol_cat_det_export() +{ + + $('#div_export_a').html(""); + donnees = "codeProduit="+$("#codeProduit").val(); + 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 saisirefacdecompte() +{ + idSaisieDecompte = $("#idSaisieDecompte" ).val(); + lienPrestation_C = $("#lienPrestation_C" ).val(); + lienProduction_C = $("#lienProduction_C" ).val(); + + // + v_url = lienPrestation_C+"/Connexiondecompte/"+idSaisieDecompte; + + if (idSaisieDecompte>"") + { + window.location.assign(v_url); + } +} + +// etat 10 + +function etat_rapport_sp_cat_det() +{ + $('#div_export_a').html(""); + donnees = "codeProduit="+$("#codeProduit").val(); + 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()); + } + }); +} + +function etat_rapport_sp_cat_det_export() +{ + $('#div_export_a').html(""); + donnees = "codeProduit="+$("#codeProduit").val(); + 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 creer_substitut_non_assure() +{ + v_msg="Confirmez-vous la substitution?"; + v_msgEng="Do you confirm the substitution?"; + + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + nomSubstitut = $("#nomSubstitut").val(); + prenomsSubstitut = $("#prenomsSubstitut").val(); + codeLienSubstitut = $("#codeLienSubstitut").val(); + codeNaturePiece = $("#codeNaturePiece").val(); + numeroPieceSubstitut = $("#numeroPieceSubstitut").val(); + sexeSubstitut = $("#sexeSubstitut").val(); + dateNaissanceSubstitut = $("#dateNaissanceSubstitut").val(); + telephonePortableSubstitut = $("#telephonePortableSubstitut").val(); + + donnees = "nomSubstitut="+nomSubstitut; + donnees += "&prenomsSubstitut="+prenomsSubstitut; + + donnees += "&codeLienSubstitut="+codeLienSubstitut; + donnees += "&codeNaturePiece="+codeNaturePiece; + donnees += "&numeroPieceSubstitut="+numeroPieceSubstitut; + donnees += "&sexeSubstitut="+sexeSubstitut; + donnees += "&dateNaissanceSubstitut="+dateNaissanceSubstitut; + donnees += "&telephonePortableSubstitut="+telephonePortableSubstitut; + + $.ajax({ + + url: $("#racineWeb").val()+"Ajaxsubstitutnonassure/creersubstitutnonassure/", + type: 'POST', + data: donnees, + success: function(data) { + v_msg="Substitut créé avec succès!"; + v_msgEng="Substitute successfully created!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function() { + prestations(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function supprimer_substitut_non_assure() +{ + idSubstitut = $("#idSubstitut_C").val(); + + v_msg="Confirmez-vous la suppression du substitut?"; + v_msgEng="Do you confirm the removal of the substitute?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + let motifSortie = ""; + + let v_msg = "Supprimé pour quel motif?"; + let v_msgEng = "Deleted for what reason?"; + + prompt_ebene(v_msg, v_msgEng, "", function(motifSortie) { + if (motifSortie<=" ") + { + v_msg="Vous devez saisir un motif!"; + v_msgEng="You have to enter a reason!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + let donnees = 'idSubstitut='+idSubstitut; + donnees += '&motifSortie=' + encodeURIComponent(motifSortie); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsubstitutnonassure/supprimersubstitutnonassure/", + type: 'POST', + data: donnees, + success: function(data) { + v_msg="Substitut supprimé avec succès!"; + v_msgEng="Substitute successfully removed!"; + alert_ebene(v_msg, v_msgEng); + }, + error: function(data) { + }, + complete: function() { + prestations(); + } + }); + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// Polices non renouvellées + +function etat_polices_non_renouvellees() +{ + $('#div_export_a').html(""); + + donnees = "codeProduit="+$("#codeProduit").val(); + 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()); + } + }); +} + +function etat_polices_non_renouvellees_export() +{ + $('#div_export_a').html(""); + + donnees = "codeProduit="+$("#codeProduit").val(); + 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 maj_plafond_gar_opt(idGarantie, plafond, controle) +{ + if(controle_numerique(controle)) + { + donnees = 'idGarantie='+idGarantie+"&plafond="+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/majplafondopt/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + controle.focus(); + } + }); + } +} + +function derogation_medicament() +{ + window.location.assign($("#racineWeb" ).val()+"Derogationmedicement/"); +} + + +function refuser_derogation_medicament(idCollege) +{ + 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é + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/refuserderogationmedicament/", + type : 'post', + data: "idCollege="+idCollege, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + derogation_medicament(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function accorder_derogation_medicament(idCollege) +{ + 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é + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/accorderderogationmedicament/", + type : 'post', + data: "idCollege="+idCollege, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + derogation_medicament(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function afficher_detail_stat_police(idPolice, emailRapport, emailGarant) +{ + $('#div_export_b').html(""); + $("#idPolice").val(idPolice); + $("#emailRapport_0").val(emailRapport); + $("#emailGarant").val(emailGarant); + $("#emailRapport").val(emailRapport+';'+emailGarant); + + $("#btn_pop_detail").click(); +} + +function charger_detail_stat_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()+"Ajaxdetailrapportsp/", + 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_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()+"Ajaxdetailrapportsppdf/", + 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_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()+"Ajaxdetailrapportspfacture/", + 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_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()+"Ajaxdetailrapportspgarantie/", + 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_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()+"Ajaxdetailrapportspfacturepdf/", + 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_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()+"Ajaxdetailrapportspgarantiepdf/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function de_archiver_adherent(idAherent) +{ + v_msg="Confirmez-vous le désarchivage de cette famille?"; + v_msgEng="Do you confirm the unarchiving of this family?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/desarchiveradherent/", + type : 'post', + data: "idAherent="+idAherent, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + adherents_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function archiver_adherent(idAherent) +{ + v_msg="Confirmez-vous l\'archivage de cette famille?"; + v_msgEng="Do you confirm the archiving of this family?"; + + /* + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Fichelimiteadditionnelle/enregistrerlimiteadditionnelle/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + */ + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/archiveradherent/", + type : 'post', + data: "idAherent="+idAherent, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + adherents_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function archiver_adherent_fiche(idAherent) +{ + v_msg="Confirmez-vous l\'archivage de cette famille?"; + v_msgEng="Do you confirm the archiving of this family?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/archiveradherent/", + type : 'post', + data: "idAherent="+idAherent, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_adherent_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function de_archiver_adherent_fiche(idAherent) +{ + v_msg="Confirmez-vous le désarchivage de cette famille?"; + v_msgEng="Do you confirm the unarchiving of this family?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/desarchiveradherent/", + type : 'post', + data: "idAherent="+idAherent, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_adherent_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function archiver_beneficiaire(idBeneficiaire) +{ + v_msg="Confirmez-vous l\'archivage de cette personne?"; + v_msgEng="Do you confirm the archiving of this person?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/archiverbeneficiaire/", + type : 'post', + data: "idBeneficiaire="+idBeneficiaire, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_adherent_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function de_archiver_beneficiaire(idBeneficiaire) +{ + v_msg="Confirmez-vous le désarchivage de cette personne?"; + v_msgEng="Do you confirm the unarchiving of this person?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcollege/desarchiverbeneficiaire/", + type : 'post', + data: "idBeneficiaire="+idBeneficiaire, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_adherent_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_lite_prestataire() +{ + donnees = ""; + donnees_retour = ""; + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + libelle = $("#libelle").val(); + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + donnees += '&categoriePresataire=' + categoriePresataire; + donnees += '&libelle=' + libelle; + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + $("#div_liste_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataireparametrage/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_prestataire").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function afficher_lite_prestataire_lot() +{ + donnees = ""; + donnees_retour = ""; + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + libelle = $("#libelle").val(); + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + donnees += '&categoriePresataire=' + categoriePresataire; + donnees += '&libelle=' + libelle; + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + $("#div_liste_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataireparlot/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_prestataire").html(donnees_retour); + $("#nbligne").val("Lignes Filtrées : "+$("#nbligne_info").val()); + dataTableSpeciale(); + } + }); +} + + +function selection_prestataire_lot() +{ + var nbcoche = $('#nbcoche').val(); + + + donnees = ""; + donnees_retour = ""; + + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + libelle = $("#libelle").val(); + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + donnees += '&categoriePresataire=' + categoriePresataire; + donnees += '&libelle=' + libelle; + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + $("#div_liste_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataireparlot/selectionnetout/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_prestataire").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + dataTableSpeciale(); + } + }); +} + +function afficher_prestataire_id(idPrestataire) +{ + window.location.assign($("#racineWeb" ).val()+"Ficheprestataire/"+idPrestataire+"/"); +} + +function modifier_prestataire() +{ + idPrestataire = $("#idPrestataire" ).val(); + + if (idPrestataire>"0") + { + window.location.assign($("#racineWeb" ).val()+"Modifierprestataire/"+idPrestataire+"/"); + } +} + +function enregistrer_modif_prestataire() +{ + idPrestataire = $("#idPrestataire").val(); + libelle = $("#libelle").val(); + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + codeTarifActe = $("#codeTarifActe").val(); + codeTarifMedicament = $("#codeTarifMedicament").val(); + codeTarifOptique = $("#codeTarifOptique").val(); + codePays = $("#codePays").val(); + villeSignature = $("#villeSignature").val(); + codeTypeDecompte = $("#codeTypeDecompte").val(); + adresseGeo = $("#adresseGeo").val(); + numeroCompte = $("#numeroCompte").val(); + adressePost = $("#adressePost").val(); + conventionne = $("#conventionne").val(); + gestionreseau = $("#gestionreseau").val(); + emailGestionPrestataire = $("#emailGestionPrestataire").val(); + + prefixePaiementMobile = $("#prefixePaiementMobile").val(); + mobilePaiement = $("#mobilePaiement").val(); + + if(!verifMailValeur(emailGestionPrestataire)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailGestionPrestataire").focus(); + return; + } + + // Prise en compte des comptes bancaires prestataire + codeBanque = $("#codeBanque").val(); + codeBanqueInterne = $("#codeBanqueInterne").val(); + codeGuichet = $("#codeGuichet").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + cleRib = $("#cleRib").val(); + iban = $("#iban").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + // + + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + smsGestionPrestataire = $("#smsGestionPrestataire").val(); + registreCommerce = $("#registreCommerce").val(); + + codeLanguePrestataire = $("#codeLangueUser").val(); + + nomResponsable = $("#nomResponsable").val(); + nomInterlocuteur = $("#nomInterlocuteur").val(); + telephoneFixe = $("#telephoneFixe").val(); + + faxPrestataire = $("#faxPrestataire").val(); + telephonePortable = $("#telephonePortable").val(); + contactInterlocuteur = $("#contactInterlocuteur").val(); + + centreReference = $("#centreReference").val(); + + appliquerTarifNuit = $("#appliquerTarifNuit").val(); + + latitude = $("#latitude").val(); + longitude = $("#longitude").val(); + + filtreMedecin = $("#filtreMedecin").val(); + codeModeBiometrie = $("#codeModeBiometrie").val(); + + if(codeTypePrestataire=="PHA"){ + accesAjoutPh = $("#accesAjoutPh").val(); + ajoutPrescription = $("#ajoutPrescription").val(); + interdirVentePartielleMedicament = $("#interdirVentePartielleMedicament").val(); + }else{ + accesAjoutPh = "0"; + ajoutPrescription = "0"; + interdirVentePartielleMedicament = "0"; + } + + + pharmacieInterne = $("#pharmacieInterne").val(); + optiqueInterne = $("#optiqueInterne").val(); + + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom du prestataire!"; + v_msgEng="Please enter the name of the provider"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(codeTypePrestataire<=" ") + { + v_msg="Veuillez indiquer le type de prestataire!"; + v_msgEng="Please indicate the type of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestataire").focus(); + return; + } + + if(categoriePresataire<=" ") + { + v_msg="Veuillez indiquer la produit du prestataire!"; + v_msgEng="Please indicate the category of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + if (codeTypePrestataire=="CSO" || codeTypePrestataire=="DEN" || codeTypePrestataire=="HRW" || codeTypePrestataire=="LAB"|| codeTypePrestataire=="SEA") + { + if (codeTarifActe<" ") + { + v_msg="Veuillez fournir le tarif des actes!"; + v_msgEng="Please provide the rates of the acts!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + } + + + if (codeTypePrestataire=="PHA") + { + if (codeTarifMedicament<" ") + { + v_msg="Veuillez fournir le tarif des médicaments!"; + v_msgEng="Please provide the price of the drugs!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + } + + /* + if (codeTypePrestataire=="OPT") + { + if (codeTarifOptique<" ") + { + v_msg="Veuillez fournir le tarif optique!"; + v_msgEng="Please provide the optical rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + } + */ + + if(villeSignature<=" ") + { + v_msg="Veuillez indiquer la ville de signature!"; + v_msgEng="Please indicate the city of signature!"; + alert_ebene(v_msg, v_msgEng); + + $("#villeSignature").focus(); + return; + } + + if(codeTypeDecompte<=" ") + { + v_msg="Veuillez indiquer la type de décompte!"; + v_msgEng="Please indicate the type of count!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDecompte").focus(); + return; + } + + if(conventionne<=" ") + { + v_msg="Le prestataire est-il conventionné ou pas?"; + v_msgEng="Do the provider have an convetion or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#conventionne").focus(); + return; + } + + if(gestionreseau<=" ") + { + v_msg="Tenir compte des réseaux de soins ou pas?"; + v_msgEng="Consider care networks or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#gestionreseau").focus(); + return; + } + + if(codeLanguePrestataire<=" ") + { + v_msg="Veuillez sélectionner une langue"; + v_msgEng="Please select a language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + appliquerTarifPrestataire = $("#appliquerTarifPrestataire").val(); + + activerOtp = $("#activerOtp").val(); + filtrerIp = $("#filtrerIp").val(); + + autoriserUnBonPrincipal = $("#autoriserUnBonPrincipal").val(); + prixActeModifiable = $("#prixActeModifiable").val(); + + + donnees = 'idPrestataire='+idPrestataire+'&libelle='+libelle+'&codeTypePrestataire='+codeTypePrestataire; + donnees += '&categoriePresataire='+categoriePresataire+'&codeTarifActe='+codeTarifActe+'&codeTarifMedicament='+codeTarifMedicament; + donnees += '&codeTarifOptique='+codeTarifOptique+'&codePays='+codePays+'&villeSignature='+villeSignature; + donnees += '&codeTypeDecompte='+codeTypeDecompte+'&adresseGeo='+adresseGeo+'&numeroCompte='+numeroCompte; + donnees += '&adressePost='+adressePost+'&conventionne='+conventionne+'&gestionreseau='+gestionreseau+'&emailGestionPrestataire='+emailGestionPrestataire; + + donnees += '&codeBanque='+codeBanque+'&codeBanqueInterne='+codeBanqueInterne+'&codeGuichet='+codeGuichet; + donnees += '&numeroCompteBancaire='+numeroCompteBancaire+'&cleRib='+cleRib+'&iban='+iban+'&intituleCompteBancaire='+intituleCompteBancaire; + + donnees += '&codeVille='+codeVille+'&codeLocalite='+codeLocalite+'&smsGestionPrestataire='+smsGestionPrestataire+'®istreCommerce='+registreCommerce; + + donnees += '&codeLanguePrestataire='+codeLanguePrestataire; + + donnees += '&nomResponsable='+nomResponsable+'&nomInterlocuteur='+nomInterlocuteur+'&telephoneFixe='+telephoneFixe; + + donnees += '&faxPrestataire='+faxPrestataire+'&telephonePortable='+telephonePortable+'&contactInterlocuteur='+contactInterlocuteur; + + donnees += '¢reReference='+centreReference+'&appliquerTarifNuit='+appliquerTarifNuit+'&latitude='+latitude+'&longitude='+longitude; + + donnees += '&accesAjoutPh='+accesAjoutPh+'&ajoutPrescription='+ajoutPrescription+'&interdirVentePartielleMedicament='+interdirVentePartielleMedicament; + + donnees += '&filtreMedecin='+filtreMedecin+'&codeModeBiometrie='+codeModeBiometrie+'&pharmacieInterne='+pharmacieInterne+'&optiqueInterne='+optiqueInterne; + + donnees += '&appliquerTarifPrestataire='+appliquerTarifPrestataire; + + donnees += '&activerOtp='+activerOtp; + donnees += '&filtrerIp='+filtrerIp; + donnees += '&autoriserUnBonPrincipal='+autoriserUnBonPrincipal; + + donnees += '&mobilePaiement='+mobilePaiement; + donnees += '&prefixePaiementMobile='+prefixePaiementMobile; + donnees += '&prixActeModifiable='+prixActeModifiable; + + //console.log(donnees); + 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()+"Ajaxprestataire/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_prestataire_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function enreg_prestatairereseausoins() +{ + idPrestataire = $("#idPrestataire").val(); + libelle = $("#libelle").val(); + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + codeTarifActe = $("#codeTarifActe").val(); + codeTarifMedicament = $("#codeTarifMedicament").val(); + codeTarifOptique = $("#codeTarifOptique").val(); + codePays = $("#codePays").val(); + villeSignature = $("#villeSignature").val(); + codeTypeDecompte = $("#codeTypeDecompte").val(); + adresseGeo = $("#adresseGeo").val(); + numeroCompte = $("#numeroCompte").val(); + adressePost = $("#adressePost").val(); + conventionne = $("#conventionne").val(); + gestionreseau = $("#gestionreseau").val(); + emailGestionPrestataire = $("#emailGestionPrestataire").val(); + + if(!verifMailValeur(emailGestionPrestataire)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailGestionPrestataire").focus(); + return; + } + + // Prise en compte des comptes bancaires prestataire + codeBanque = $("#codeBanque").val(); + codeBanqueInterne = $("#codeBanqueInterne").val(); + codeGuichet = $("#codeGuichet").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + cleRib = $("#cleRib").val(); + iban = $("#iban").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + // + + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + smsGestionPrestataire = $("#smsGestionPrestataire").val(); + registreCommerce = $("#registreCommerce").val(); + + codeLanguePrestataire = $("#codeLangueUser").val(); + + nomResponsable = $("#nomResponsable").val(); + nomInterlocuteur = $("#nomInterlocuteur").val(); + telephoneFixe = $("#telephoneFixe").val(); + + faxPrestataire = $("#faxPrestataire").val(); + telephonePortable = $("#telephonePortable").val(); + contactInterlocuteur = $("#contactInterlocuteur").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom du prestataire!"; + v_msgEng="Please enter the name of the provider"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(codeTypePrestataire<=" ") + { + v_msg="Veuillez indiquer le type de prestataire!"; + v_msgEng="Please indicate the type of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestataire").focus(); + return; + } + + if(categoriePresataire<=" ") + { + v_msg="Veuillez indiquer la produit du prestataire!"; + v_msgEng="Please indicate the category of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + if (codeTypePrestataire=="CSO" || codeTypePrestataire=="DEN" || codeTypePrestataire=="HRW" || codeTypePrestataire=="LAB"|| codeTypePrestataire=="SEA") + { + if (codeTarifActe<" ") + { + v_msg="Veuillez fournir le tarif des actes!"; + v_msgEng="Please provide the rates of the acts!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + } + + if (codeTypePrestataire=="PHA") + { + if (codeTarifMedicament<" ") + { + v_msg="Veuillez fournir le tarif des médicaments!"; + v_msgEng="Please provide the price of the drugs!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + } + + if (codeTypePrestataire=="OPT") + { + if (codeTarifOptique<" ") + { + v_msg="Veuillez fournir le tarif optique!"; + v_msgEng="Please provide the optical rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + } + + if(villeSignature<=" ") + { + v_msg="Veuillez indiquer la ville de signature!"; + v_msgEng="Please indicate the city of signature!"; + alert_ebene(v_msg, v_msgEng); + + $("#villeSignature").focus(); + return; + } + + if(codeTypeDecompte<=" ") + { + v_msg="Veuillez indiquer la type de décompte!"; + v_msgEng="Please indicate the type of count!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDecompte").focus(); + return; + } + + if(conventionne<=" ") + { + v_msg="Le prestataire est-il conventionné ou pas?"; + v_msgEng="Do the provider have an convetion or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#conventionne").focus(); + return; + } + + if(gestionreseau<=" ") + { + v_msg="Tenir compte des réseaux de soins ou pas?"; + v_msgEng="Consider care networks or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#gestionreseau").focus(); + return; + } + + if(codeLanguePrestataire<=" ") + { + v_msg="Veuillez sélectionner une langue"; + v_msgEng="Please select a language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + donnees = 'idPrestataire='+idPrestataire+'&libelle='+libelle+'&codeTypePrestataire='+codeTypePrestataire; + donnees += '&categoriePresataire='+categoriePresataire+'&codeTarifActe='+codeTarifActe+'&codeTarifMedicament='+codeTarifMedicament; + donnees += '&codeTarifOptique='+codeTarifOptique+'&codePays='+codePays+'&villeSignature='+villeSignature; + donnees += '&codeTypeDecompte='+codeTypeDecompte+'&adresseGeo='+adresseGeo+'&numeroCompte='+numeroCompte; + donnees += '&adressePost='+adressePost+'&conventionne='+conventionne+'&gestionreseau='+gestionreseau+'&emailGestionPrestataire='+emailGestionPrestataire; + + donnees += '&codeBanque='+codeBanque+'&codeBanqueInterne='+codeBanqueInterne+'&codeGuichet='+codeGuichet; + donnees += '&numeroCompteBancaire='+numeroCompteBancaire+'&cleRib='+cleRib+'&iban='+iban+'&intituleCompteBancaire='+intituleCompteBancaire; + + donnees += '&codeVille='+codeVille+'&codeLocalite='+codeLocalite+'&smsGestionPrestataire='+smsGestionPrestataire+'®istreCommerce='+registreCommerce; + + donnees += '&codeLanguePrestataire='+codeLanguePrestataire; + + donnees += '&nomResponsable='+nomResponsable+'&nomInterlocuteur='+nomInterlocuteur+'&telephoneFixe='+telephoneFixe; + + donnees += '&faxPrestataire='+faxPrestataire+'&telephonePortable='+telephonePortable+'&contactInterlocuteur='+contactInterlocuteur; + + 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()+"Ajaxprestataire/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_prestatairereseausoins(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_prestataire_id() +{ + idPrestataire = $("#idPrestataire").val(); + afficher_prestataire_id(idPrestataire); +} + +function requetes_factures_leger() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + // Ligne 1 + donnees += 'dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#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()); + } + }); +} + +function requetes_factures_leger_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + // Ligne 1 + donnees += 'dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 liste_ententeprealables_pha() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablespha/"); +} + +function listeententeprealablespha() +{ + 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/entetesententeprealable/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + + } + }); +} + +function accepter_ententeprealable_pha(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Accepterententeprealablespha/"+idDemandeententeprealable+"/"); +} + +function refuser_ententeprealable_pha(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Refuserententeprealablespha/"+idDemandeententeprealable+"/"); +} + +function enregistreraccordententepreslable_pha() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").val(); + motifReel = $("#motifReel").val(); + prixAccorde = $("#prixAccorde").val(); + quantiteAccorde = $("#quantiteAccorde").val(); + + if (motifReel<=" ") + { + v_msg="Veuillez saisir le motif!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifReel").focus(); + return; + } + + prixAccorde=prixAccorde.replace(",","."); + $("#prixAccorde").val(prixAccorde); + + if(isNaN(prixAccorde)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixAccorde").val("0"); + $("#prixAccorde").focus(); + return; + } + + if(prixAccorde==0) + { + $("#prixAccorde").focus(); + v_msg="Veuillez saisir le prix!"; + v_msgEng="Please enter the price!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // qte accordee + + quantiteAccorde=quantiteAccorde.replace(",","."); + $("#quantiteAccorde").val(quantiteAccorde); + + if(isNaN(quantiteAccorde)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#quantiteAccorde").val("0"); + $("#quantiteAccorde").focus(); + return; + } + + if(quantiteAccorde==0) + { + $("#quantiteAccorde").focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // fin qte accordee + + 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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel+'&prixAccorde='+prixAccorde+'&quantiteAccorde='+quantiteAccorde; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='accordententeprealablepha'; + typeSms = "accordententeprealablepha"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistreraccordententeprealablepha/", + 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); + + liste_ententeprealables_pha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrerrefusententepreslable_pha() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel+'&motifRefusAssure='+motifRefusAssure; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='refusententeprealablepha'; + typeSms="refusententeprealablepha"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistrerrefusententeprealablepha/", + 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); + + liste_ententeprealables_pha(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function controle_longeur_passe(controle) +{ + longueur = controle.value.length; + + if(longueur==0) + { + return false; + } + + if(longueur<6) + { + v_msg="6 caractères minimum exigé!"; + v_msgEng="6 characters minmum required!"; + alert_ebene(v_msg, v_msgEng); + + controle.value=""; + controle.focus(); + return false; + } +} + +// 14/05/2018 + +function modifier_parametresgeneraux() +{ + window.location.assign($("#racineWeb" ).val()+"Modifierparametresgeneraux/"); +} + +function afficher_parametresgeneraux() +{ + window.location.assign($("#racineWeb" ).val()+"Parametresgeneraux/"); +} + +function enregistrer_modif_parametresgeneraux() +{ + idSocieteuser = $("#idSocieteuser").val(); + donnees = 'idSocieteuser='+idSocieteuser; + + 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 = 'idSocieteuser='+idSocieteuser+'&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_reply = ""; + + emailAlertLimiteConsommation = $("#emailAlertLimiteConsommation").val(); + + activerLogVisitePages = $("#activerLogVisitePages").val(); + alertLimiteConsommation = $("#alertLimiteConsommation").val(); + + emailRd = $("#emailRd").val(); + smsRd = $("#smsRd").val(); + + if (emailSociete<=" ") + { + v_msg="Veuillez indiquer les destinataires!"; + v_msgEng="Please indicate the recipients!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailSociete").focus(); + return; + } + + if (emailAlertLimiteConsommation <=" " && alertLimiteConsommation > "0") + { + v_msg="Veuillez indiquer l'e-mail de l'alerte de la limite de consommation !"; + v_msgEng="Please indicate the consumption limit alert email!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailAlertLimiteConsommation").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 = ""; + + + mauvais_emailAlertLimiteConsommation=false; + email_err_limiteConsommation= ""; + + mauvais_mail_rd=false; + email_err_rd = ""; + + 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(";"); + + addr_limiteConsommation = emailAlertLimiteConsommation.split(";"); + + addr_rd = emailRd.split(";"); + + emailSociete = emailSociete.trim(); + + + + + 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; + } + } + + if(emailAlertLimiteConsommation.length > 0){ + addr_limiteConsommation.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err_limiteConsommation = element; + mauvais_emailAlertLimiteConsommation = true; + // break; + return; + } + }); + + if(mauvais_emailAlertLimiteConsommation==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err_limiteConsommation; + v_msgEng="Please review this address : "+email_err_limiteConsommation; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + if(emailRd.length > 0){ + addr_rd.forEach(function(element) + { + if (test_adresse_email(element)==false) + { + email_err_rd = element; + mauvais_mail_rd = true; + // break; + return; + } + }); + + if(mauvais_mail_rd==true) + { + v_msg="Veuillez revoir cette adresse : "+email_err_rd; + v_msgEng="Please review this address : "+email_err_rd; + 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(); + fraisCarteAN = fraisCarteAN.replace(/ /g,""); + + 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; + + donnees += '&emailAlertLimiteConsommation='+emailAlertLimiteConsommation; + donnees += '&activerLogVisitePages='+activerLogVisitePages; + donnees += '&alertLimiteConsommation='+alertLimiteConsommation; + + donnees += '&emailRd='+emailRd+'&smsRd='+smsRd; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparametresgeneraux/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + console.log("error => "+errorData); + }, + success: function(data) { + }, + complete: function() { + afficher_parametresgeneraux(); + } + }); +} + +function changer_verificateur() +{ + userCourant = $("#userCourant").val(); + codeUtilisateur = $("#codeUtilisateur").val(); + + if(codeUtilisateur==userCourant) + { + v_msg="Vous êtes déjà le vérificateur!"; + v_msgEng="You are already the auditor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous être le vérificateur?"; + v_msgEng="Do you confirm to be the auditor?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/changerverificateur/", + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + + codeUtilisateur = $("#userCourant").val(); + + $("#codeUtilisateur").val(codeUtilisateur); + + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); +} + +function requetes_verification() +{ + + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").val(); + + donnees += 'codeExercice=' + codeExercice; + donnees += '&codeMois=' + codeMois; + + $("#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()); + } + }); +} + +function requetes_verificateur() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").val(); + + donnees += 'codeExercice=' + codeExercice; + donnees += '&codeMois=' + codeMois; + + // lert(donnees); + // return; + + $("#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()); + } + }); +} + +function requetes_verification_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").val(); + + donnees += 'codeExercice=' + codeExercice; + donnees += '&codeMois=' + codeMois; + + 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 requetes_verificateur_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").val(); + + donnees += 'codeExercice=' + codeExercice; + donnees += '&codeMois=' + codeMois; + + 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 etat_rapport_sp_adheleve() +{ + $('#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()); + } + }); +} + +function afficher_detail_factures_famille(idAdherent,emailAdherent) +{ + $('#div_export_b').html(""); + + $("#idAdherent").val(idAdherent); + + $("#emailAdherent_0").val(emailAdherent); + $("#emailAdherent").val(emailAdherent); + + $("#btn_pop_detail").click(); + +} + +function charger_detail_stat_adherent_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()+"Ajaxdetailrapportspfactureadhpdf/", + 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_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()+"Ajaxdetailrapportspgarantieadhpdf/", + 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_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()+"Ajaxdetailrapportspfactureadh/", + 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_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()+"Ajaxdetailrapportspgarantieadh/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function etat_rapport_sp_adheleve_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 users_prestataire() +{ + codePrestataire = $("#codePrestataire").val(); + + if (codePrestataire>" ") + { + window.location.assign($("#racineWeb" ).val()+"Usersprestaire/"); + } +} + +function reinitpaswd_prestataire(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()+"Ajaxprestataire/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); + + users_prestataire(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function ajouter_facture_dec() +{ + codePrestataire = $("#codePrestataire").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajoutactesdec/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ajout_actes").html(data); + + }, + complete: function() { + $("#div_selection_acte").hide(); + } + }); +} + +function ajax_actes_possibles_selection_dec() +{ + codeFamilleActe=$("#codeFamilleActe").val(); + + donnees = 'codeFamilleActe='+codeFamilleActe; + + $("#listeacte").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactespossiblesselectiondec/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#listeacte").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function recap_ajout_acte_dec() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherverifierfacture/", + type: 'POST', + success: function(data) { + $("#div_verification_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajouter_un_acte_selection_dec(codeActe) +{ + donnee_a_affciher = ""; + + donnees="" + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + //numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); + + donnees = 'codeActe='+codeActe; + + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherajoutactesdec/ajouteractedecompte/", + 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); + } + }); +} + +function retirer_un_acte_selection_dec(idActe) +{ + + donnee_a_affciher = ""; + + donnees = 'idActe='+idActe; + + $("#div_prestations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherajoutactesdec/retireractedecompte/", + type: 'post', + data: donnees, + success: function(data) { + donnee_a_affciher = data; + }, + error: function(data) { + }, + complete: function() { + $("#div_prestations").html(donnee_a_affciher); + } + }); +} + +function mail_detail_stat_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()+"Ajaxdetailrapportmail/", + 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_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()+"Ajaxdetailrapportspfacturemail/", + 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_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()+"Ajaxdetailrapportspgarantiemail/", + 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 test_adresse_email(email) +{ + var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i'); + + if(reg.test(email)==false) + { + return(false); + } +} + +function reinitialiser_email_rapport() +{ + emailRapport = $("#emailRapport_0").val(); + $("#emailRapport").val(emailRapport); +} + +function consulter_derogation_2(idDemandederogation) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterderogations/"+idDemandederogation+"/"); +} + +function consulter_derogation(idDemandederogation) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterderogation/"+idDemandederogation+"/"); +} + +function consulter_ententeprealable_2(idDemandeententeprealable) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterententeprealables/"+idDemandeententeprealable+"/"); +} + +function consulter_ententeprealable(idDemandeententeprealable) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterententeprealable/"+idDemandeententeprealable+"/"); +} + + +function consulter_ententeprealable_pha_2(idDemandeententeprealable) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterententeprealablespha/"+idDemandeententeprealable+"/"); +} + + +function pop_messagerie() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerieliste/", + error: function(errorData) { + }, + success: function(data) { + $("#div_messagerie").html(data); + }, + complete: function() { + $("#btn_pop_messagerie").click(); + } + }); +} + +function marquer_message_comme_lu(idMessagerie, controle) +{ + donnees = 'idMessagerie='+idMessagerie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerieliste/marquercommelu/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + controle.parentElement.removeChild(controle); + } + }); +} + +function envoyer_messagerie(textMessage, idParent) +{ + + codePrestataireExamen = $("#codePrestataireExamen").val(); + codePrestataireMedicament = $("#codePrestataireMedicament").val(); + + if(codePrestataireExamen!=undefined && codePrestataireExamen!="undefined") + { + codePrestataire = $("#codePrestataireExamen").val(); + + }else if(codePrestataireMedicament!=undefined && codePrestataireMedicament!="undefined") + { + codePrestataire = $("#codePrestataireMedicament").val(); + }else + { + codePrestataire = $("#codePrestataire").val(); + } + + donnees = 'textMessage='+textMessage+"&idParent="+idParent+"&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerie/creermessage/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + } + }); +} + +// gestion messagerie +function repondre_message(idMessagerie, idParent, codePrestataire, controle) +{ + donnees = 'idMessagerie='+idMessagerie+'&idParent='+idParent+'&codePrestataire='+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessageriereponse/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_messagerie_reponse").html(data); + }, + complete: function() { + repondu = $("#repondu").val(); + if(repondu=="1") + { + v_msg="Déjà répondu!"; + v_msgEng="Already answered!"; + alert_ebene(v_msg, v_msgEng); + + controle.parentElement.removeChild(controle); + return; + } + else + { + $("#btn_pop_messagerie_reponse").click(); + } + } + }); +} + +function gerer_messagerie() +{ + window.location.assign($("#racineWeb").val()+"Messagerie/"); +} + +function afficher_lite_messagerie() +{ + donnees = ""; + donnees_retour = ""; + + date1 = $("#date1").val(); + date2 = $("#date2").val(); + + messageLu = $("#messageLu").val(); + textMessage = $("#textMessage").val(); + codePrestataire = $("#codePrestataire").val(); + + donnees += 'date1=' + date1; + donnees += '&date2=' + date2; + donnees += '&messageLu=' + messageLu; + donnees += '&textMessage=' + textMessage; + donnees += '&codePrestataire=' + codePrestataire; + + $("#div_messagerie_gestion").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemessagerie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_messagerie_gestion").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function enregistrer_repondre_message() +{ + idMessagerie = $("#idMessagerie").val(); + idParent = $("#idParentReponse").val(); + + textMessage = $("#textMessageReponse").val(); + textMessage = textMessage.trim(); + + if (textMessage<=" ") + { + v_msg="Veuillez saisir la réponse!"; + v_msgEng="Please enter the answer!"; + alert_ebene(v_msg, v_msgEng); + + $("#textMessageReponse").focus(); + return; + } + + donnees = 'idMessagerie='+idMessagerie+"&idParent="+idParent+"&textMessage="+textMessage; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerie/repondremessage/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + $("#btn_pop_messagerie_reponse_quit").click(); + } + }); +} + +function historique_message(idParent) +{ + donnees = 'idParent='+idParent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessageriehistorique/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_messagerie_historique").html(data); + }, + complete: function() { + $("#btn_pop_messagerie_historique").click(); + } + }); +} + +// btn_pop_messagerie_new +function initiermessage() +{ + codePrestataire = $("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_search_prestataire").click(); + return; + } + + donnees = "codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerienew/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_messagerie_new").html(data); + }, + complete: function() { + $("#btn_pop_messagerie_new").click(); + } + }); +} + +function enregistrer_new_message() +{ + codePrestataire = $("#codePrestataire").val(); + + textMessage = $("#textMessageNew").val(); + textMessage = textMessage.trim(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_pop_messagerie_new_quit").click(); + return; + } + + if (textMessage<=" ") + { + v_msg="Veuillez saisir le message!"; + v_msgEng="Please enter the message!"; + alert_ebene(v_msg, v_msgEng); + + $("#textMessageNew").focus(); + return; + } + + donnees = "textMessage="+textMessage+"&idParent=0&codePrestataire="+codePrestataire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerie/creermessage/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + $("#btn_pop_messagerie_new_quit").click(); + } + }); +} + + +function imprimer_liste_assures_date() +{ + dateAnalyse = $("#dateAnalyse").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var div_export = $('#div_export_assures'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlisteassure/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function exporter_liste_assures_date() +{ + dateAnalyse = $("#dateAnalyse_export").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var div_export = $('#div_exporter_liste_assures'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterlisteassure/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function exporter_liste_assures_sans_format_date() +{ + dateAnalyse = $("#dateAnalyse_sans_format").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var div_export = $('#div_export_assures_sans_format'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterlisteassure/exportersansformat", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function liste_assures_actifs() +{ + dateAnalyse = $("#dateAnalyse").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var div_export = $('#div_assures_actifs'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxassuresactifs/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function liste_assures_actifs_export() +{ + dateAnalyse = $("#dateAnalyse").val(); + + if (dateAnalyse<=" ") + { + v_msg="Veuillez indiquer une date!"; + v_msgEng="Please enter a date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateAnalyse").focus(); + return; + } + + donnees = 'dateAnalyse='+dateAnalyse; + + var div_export = $('#div_assures_actifs'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxassuresactifsexport/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +// RENOUVELLEMENT COURTE DUREE => 06/07/2018 +/* +function CalculerEcheanceRen() +{ + $("#dateEcheanceRen").disable(); + + codePeriodicite=$("#codePeriodicite").val(); + + var typdate = $("#dateAvenant").datepicker("getDate"); + + switch (codePeriodicite) { + case "A": + typdate.addMonths(12); + break; + case "L": + $("#dateEcheanceRen").enable(); + typdate = $("#dateEcheanceRen").datepicker("getDate"); + break; + default: + typdate.addMonths(12); + } + + $( "#dateEcheanceRen").datepicker( "setDate", typdate ); +} +*/ + +function CalculerEcheanceRen() +{ + $("#dateEcheanceRen").disable(); + + codePeriodicite=$("#codePeriodicite").val(); + + var typdate = $("#dateAvenant").datepicker("getDate"); + + switch (codePeriodicite) { + case "A": + typdate.addMonths(12); + break; + case "S": + typdate.addMonths(6); + break; + case "T": + typdate.addMonths(3); + break; + case "M": + typdate.addMonths(1); + break; + case "L": + $("#dateEcheanceRen").enable(); + typdate = $("#dateEcheanceRen").datepicker("getDate"); + break; + default: + typdate.addMonths(12); + } + $( "#dateEcheanceRen" ).datepicker( "setDate", typdate ); +} + +function CalculerFinRen() +{ + $("#dateFinRen").disable(); + + codeFractionnement=$("#codeFractionnement").val(); + + var typdate = $("#dateAvenant").datepicker("getDate"); + var dtech = $("#dateEcheanceRen").datepicker("getDate"); + + switch (codeFractionnement) { + case "A": + typdate.addMonths(12); + break; + case "S": + typdate.addMonths(6); + break; + case "T": + typdate.addMonths(3); + break; + case "M": + typdate.addMonths(1); + break; + default: + typdate.addMonths(12); + } + if (typdate>dtech) + { + typdate=dtech; + } + $( "#dateFinRen" ).datepicker( "setDate", typdate ); +} + +function ControlerEcheanceRen() +{ + codePeriodicite=$("#codePeriodicite").val(); + if (codePeriodicite!="L") return true; + else { + var eff = $("#dateAvenant").datepicker("getDate"); + var ech = $("#dateEcheanceRen").datepicker("getDate"); + + if (echeff.addMonths(12)) { + v_msg="Période supérieur à un an!"; + v_msgEng="Period greater than one year!"; + alert_ebene(v_msg, v_msgEng); + } + } +} + +function verifier_Echeance_ren() +{ + codeTypeAvenant=$("#codeTypeAvenant").val(); + + if(codeTypeAvenant!="REN") + { + return; + } + + CalculerEcheanceRen(); + CalculerFinRen(); +} + +function factures_famille() +{ + window.location.assign($("#racineWeb" ).val()+"Facturesfamille/"); +} + + +function factures_famille_2() +{ + window.location.assign($("#racineWeb" ).val()+"Facturesfamilleadh/"); +} + +function listerfacturefamille() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesfamille/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + + +function ctrlkeypress_lite_prestataire(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_lite_prestataire(); + } +} + +function desactiver_user_prestataire(codeUtilisateur) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/desactiver/", + 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); + + users_prestataire(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_user_prestataire(codeUtilisateur) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/activer/", + 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); + + users_prestataire(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function consulter_une_factures() +{ + window.location.assign($("#racineWeb" ).val()+"Facturecons/"); +} + +function ctrlkeypressfacture(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#idFacture").blur(); + } +} + +function maj_date_reception_facture_decompte() +{ + dateReception = $("#dateReception_pop").val(); + + if(dateReception<=" ") + { + v_msg="Veuillez indicquer la date de réception!"; + v_msgEng="Please enter the date of receipt!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'dateReception='+dateReception; + + v_msg="Confirmez-vous cette date?"; + v_msgEng="Do you confirm this date?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/majdatereception/", + type: 'POST', + data: donnees, + success: function(data) { + $("#btn_close_pop_reception").click(); + }, + error: function(data) { + }, + complete: function() { + + dateReception = $("#dateReception_pop").val(); + + $("#dateReception").val(dateReception); + $("#btn_dateReception").val(dateReception); + + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function etatsproduction() +{ + window.location.assign($("#racineWeb" ).val()+"Etatsproduction/"); +} + +function ajaxenteteetatprod() +{ + 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; + } + + donnees = 'codeEtat='+codeEtat; + + v_url = $("#racineWeb").val()+"Ajaxentete"+codeEtat+"/"; + + $("#div_ente_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ente_requete").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + + +function etat_prod_par_client() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_prod_par_client_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_prod_par_mois() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_prod_par_mois_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_prod_par_emission() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_prod_par_emission_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 initiermessagecommun() +{ + window.location.assign($("#racineWeb" ).val()+"Messageriecommun/"); +} + +function enregistrer_message_commun() +{ + objet = $("#objet").val(); + textMessage = $("#textMessageCommun").val(); + textMessage = textMessage.trim(); + + if (objet<=" ") + { + v_msg="Veuillez saisir l\'objet!"; + v_msgEng="Please enter the object!"; + alert_ebene(v_msg, v_msgEng); + + $("#objet").focus(); + return; + } + + if (textMessage<=" ") + { + v_msg="Veuillez saisir le message!"; + v_msgEng="Please enter the message!"; + alert_ebene(v_msg, v_msgEng); + + $("#textMessageCommun").focus(); + return; + } + + donnees = "objet="+objet+"&textMessage="+textMessage; + + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessageriecommun/creermessagecommun/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_wait.html(data); + }, + complete: function() { + div_wait.html(''); + + v_msg="Message envoyé avec succès!"; + v_msgEng="Message sent successfully!"; + alert_ebene(v_msg, v_msgEng); + + gerer_messagerie(); + } + }); +} + +// + +function requetes_factures_mois() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + + idPolice = $("#idPolice").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += '&idPolice=' + idPolice; + donnees += '&codeGcAssureur=' + codeGcAssureur; + donnees += '&codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#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()); + $("#codeGcAssureur" ).selectpicker(); + $("#idPolice" ).selectpicker(); + } + }); +} + +function requetes_factures_mois_export() +{ + + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 desactiver_medicament(idDetail) +{ + v_msg="Confirmez-vous cette désactivation?"; + v_msgEng="Do you confirm this deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifmedicament/desactivermedicament/", + type : 'post', + data: "idDetail="+idDetail, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_tarifpharmacie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function activer_medicament(idDetail) +{ + v_msg="Confirmez-vous cette activation?"; + v_msgEng="Do you confirm this activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtarifmedicament/activermedicament/", + type : 'post', + data: "idDetail="+idDetail, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + afficher_tarifpharmacie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function init_supprimer_empreinte_digitale() +{ + window.location.assign($("#racineWeb" ).val()+"Supprimerempreinte/"); +} + + +function requetes_factures_jour() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + idPolice = $("#idPolice").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += '&idPolice=' + idPolice; + donnees += '&codeGcAssureur=' + codeGcAssureur; + donnees += '&codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#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()); + $("#codeGcAssureur" ).selectpicker(); + $("#idPolice" ).selectpicker(); + } + }); +} + +function requetes_factures_jour_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 ajax_liste_prestataires_messagerie() +{ + codeTypePrestataire=$("#codeTypePrestataire").val(); + + donnees = 'codeTypePrestataire='+codeTypePrestataire; + + $("#div_prestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairemessagerie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_prestataires").html(data); + }, + complete: function() { + } + }); +} + + +function ajouter_un_prestataire_mess(idPrestataire) +{ + donnees = 'idPrestataire='+idPrestataire; + + $("#div_prestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairemessagerie/ajouterprestaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + ajax_liste_prestataires_messagerie(); + } + }); +} + +function retirer_un_prestataire_mess(idPrestataire) +{ + donnees = 'idPrestataire='+idPrestataire; + + $("#div_prestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairemessagerie/retirerprestaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + ajax_liste_prestataires_messagerie(); + } + }); +} + + +function ajouter_tous_prestataire_mess() +{ + codeTypePrestataire=$("#codeTypePrestataire").val(); + + donnees = 'codeTypePrestataire='+codeTypePrestataire; + + $("#div_prestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairemessagerie/ajouterprestairetous/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + ajax_liste_prestataires_messagerie(); + } + }); +} + +function retirer_tous_prestataire_mess() +{ + codeTypePrestataire=$("#codeTypePrestataire").val(); + + donnees = 'codeTypePrestataire='+codeTypePrestataire; + + $("#div_prestataires").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestatairemessagerie/retirerprestairetous/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + ajax_liste_prestataires_messagerie(); + } + }); +} + + +// + +function requetes_ententeprealable_pha() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&codeReponseEntentePrealable=' + codeReponseEntentePrealable; + + $("#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()); + } + }); +} + + +function requetes_ententeprealable_pha_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codePrestataire = $("#codePrestataire").val(); + dateDemande1 = $("#dateDemande1").val(); + dateDemande2 = $("#dateDemande2").val(); + codeReponseEntentePrealable = $("#codeReponseEntentePrealable").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateDemande1=' + dateDemande1; + donnees += '&dateDemande2=' + dateDemande2; + donnees += '&codeReponseEntentePrealable=' + codeReponseEntentePrealable; + + 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 check_ged(idGed, cheminFichier, controle) +{ + donnees = "idGed="+idGed+"&cheminFichier="+cheminFichier; + + var ctrl_btn_ged = $("#btn_ged"+idGed); + var ctrl_mess_not_found= $("#mess_not_found"+idGed); + var ctrl_check = $("#ctrl_check"+idGed); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxged/verifierexistancefichier/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + donnees_retour = data; + + if(donnees_retour=="1") + { + ctrl_btn_ged.show(); + } + else + { + ctrl_mess_not_found.html("Not found"); + } + }, + complete: function() + { + controle.style.display = 'none'; + ctrl_check.show(); + } + }); +} + +function lister_ged_feuille_maladie() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedfeuillemaladie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function afficher_lite_messagerie_commun() +{ + donnees = ""; + donnees_retour = ""; + + date1 = $("#date1").val(); + date2 = $("#date2").val(); + + textMessage = $("#textMessage").val(); + + donnees += 'date1=' + date1; + donnees += '&date2=' + date2; + donnees += '&textMessage=' + textMessage; + + $("#div_messagerie_gestion").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemessageriecommun/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_messagerie_gestion").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function afficher_lite_messagerie_form_me() +{ + donnees = ""; + donnees_retour = ""; + + date1 = $("#date1").val(); + date2 = $("#date2").val(); + + messageLu = $("#messageLu").val(); + textMessage = $("#textMessage").val(); + codePrestataire = $("#codePrestataire").val(); + + donnees += 'date1=' + date1; + donnees += '&date2=' + date2; + donnees += '&messageLu=' + messageLu; + donnees += '&textMessage=' + textMessage; + donnees += '&codePrestataire=' + codePrestataire; + + $("#div_messagerie_gestion").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemessagerieforme/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_messagerie_gestion").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function lister_ged_beneficiaire_prest() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedbeneficiaireprest/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function lister_ged_beneficiaire_prod() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedbeneficiaireprod/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function lister_ged_adherent() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedadherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function lister_ged_police() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedpolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function lister_ged() +{ + d1 = $("#d1").val(); + d2 = $("#d2").val(); + nomOrigine = $("#nomOrigine").val(); + + donnees = 'd1='+d1+'&d2='+d2+'&nomOrigine='+nomOrigine; + + $("#div_ged").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteged/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_lister_ged(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + lister_ged(); + } +} + +function ajaxenteteetatsynthese() +{ + 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; + } + + donnees = 'codeEtat='+codeEtat; + + v_url = $("#racineWeb").val()+"Ajaxentete"+codeEtat+"/"; + + $("#div_ente_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ente_requete").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function etat_synthese_par_mois() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_synthese_par_mois_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 pop_ged_pharmacie() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegedpharmacie/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_ged").html(data); + }, + complete: function() { + $("#btn_pop_ged_pharmacie").click(); + } + }); +} + +function etat_synthese_par_mois_acqu() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_synthese_par_mois_acqu_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 demandesdecomptes() +{ + codePrestataire = $("#codePrestataire").val(); + codeExercice = $("#codeExercice").val(); + codeMois = $("#codeMois").val(); + + if (codeExercice<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice").focus(); + return; + } + + if (codeMois<=" ") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois").focus(); + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemandesdecomptes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function detail_demande_decompte(idDemandeDecompte, numeroDemandeDecompte) +{ + donnees = 'numeroDemandeDecompte='+numeroDemandeDecompte+'&idDemandeDecompte='+idDemandeDecompte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextdemandedecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Detaildemandedecompte/"); + } + }); +} + + +function imprimerbordereaudemandedecompte() +{ +} + + +function initierdecompte_demande_decompte() +{ + codePrestataire=$("#codePrestataire").val(); + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + if (codeExercice<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice").focus(); + return; + } + + if (codeMois<=" ") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois").focus(); + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/initierdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#inforegle").html(data); + }, + complete: function() { + regle=$("#regle").val(); + + if(regle==-1) + { + v_msg="Problème lors de l\'initialisation!"; + v_msgEng="Problem during initialization!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + else if(regle==0 || regle==2 || regle==3) + { + afficherdecompte(); + } + else + { + // 9 => Décompte validé mais en attente de règlemen + // 1 => Décompte réglé + consulterdecompte(); + } + } + }); +} + +function requetes_factures_police() +{ +} + + +function requetes_factures_police_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + numeroPolice = $("#numeroPolice").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroPolice=' + numeroPolice; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function requetes_factures_adherent_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + numeroAdherent = $("#numeroAdherent").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroAdherent=' + numeroAdherent; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 requetes_factures_beneficiaire_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroBeneficiaire=' + numeroBeneficiaire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 requetes_factures_police_gar() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"gar/"; + + numeroPolice = $("#numeroPolice").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroPolice=' + numeroPolice; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function requetes_factures_adherent_gar() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"gar/"; + + numeroAdherent = $("#numeroAdherent").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroAdherent=' + numeroAdherent; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 requetes_factures_beneficiaire_gar() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"gar/"; + + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'numeroBeneficiaire=' + numeroBeneficiaire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 appliquer_taux_ristourne() +{ + tauxRistourne = $("#tauxRistourne").val(); + + donnees = 'tauxRistourne=' + tauxRistourne; + + var div_assure_a_retirer = $('#div_assure_a_retirer'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailretrait/appliquertauxristourne/", + type : 'post', + data : donnees, + success: function(data) { + div_assure_a_retirer.html(data); + + var oTable = $('.tabliste').DataTable(); + oTable.destroy(); + + setTimeout(function() { + appliquerDataTable(); + }, 500); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function afficher_gc_assureur(idGc) +{ + if (idGc <=" ") + { + v_msg="Veuillez sélectionner un assureur!"; + v_msgEng="Please select an insurer!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Fichegcassureur/"+idGc+"/"); +} + +function modifier_gc_assureur() +{ + idGc = $("#idGc" ).val() + if (idGc>"0") + { + window.location.assign($("#racineWeb" ).val()+"Modifiergcassureur/"+idGc+"/"); + } +} + +function retour_gc_assureur() +{ + idGc = $("#idGc" ).val() + if (idGc>"0") + { + window.location.assign($("#racineWeb" ).val()+"Fichegcassureur/"+idGc+"/"); + } +} + +function enregistrer_modif_gc_assureur() +{ + // + idGc = $("#idGc").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + libelle = $("#libelle").val(); + email = $("#emailGcAssureur").val(); + gcTauxFraisReel = $("#gcTauxFraisReel").val(); + gcTauxRedressement = $("#gcTauxRedressement").val(); + gcTauxTva = $("#gcTauxTva").val(); + + adressePostale = $("#adressePostale").val(); + numerodeCompteComptableRD = $("#numerodeCompteComptableRD").val(); + adresseGeographique = $("#adresseGeographique").val(); + numerodeCompteComptableTP = $("#numerodeCompteComptableTP").val(); + numeroCompteContribuable = $("#numeroCompteContribuable").val(); + codeModePaiementDemande = $("#codeModePaiementDemande").val(); + + fraisCarteAfn = $("#fraisCarteAfn").val(); + fraisCarteAfn = fraisCarteAfn.replace(/ /g,""); + fraisCarteAfn = parseInt(fraisCarteAfn.replace(",","."),10); + + fraisCarteRen = $("#fraisCarteRen").val(); + fraisCarteRen = fraisCarteRen.replace(/ /g,""); + fraisCarteRen = parseInt(fraisCarteRen.replace(",","."),10); + + fraisCarteImp = $("#fraisCarteImp").val(); + fraisCarteImp = fraisCarteImp.replace(/ /g,""); + fraisCarteImp = parseInt(fraisCarteImp.replace(",","."),10); + + typeGarant = $("#typeGarant").val(); + telephoneGarant = $("#telephoneGarant").val(); + representant = $("#representant").val(); + siglerepresentant = $("#siglerepresentant").val(); + servicerepresentant = $("#servicerepresentant").val(); + telephonerepresentant = $("#telephonerepresentant").val(); + + gcTauxProvision = $("#gcTauxProvision").val(); + + gcForfaitProvision = $("#gcForfaitProvision").val(); + gcForfaitProvision = gcForfaitProvision.replace(/ /g,""); + gcForfaitProvision = parseInt(gcForfaitProvision.replace(",","."),10); + + gcTauxCommissionGerant = $("#gcTauxCommissionGerant").val(); + gcTauxRistourne = $("#gcTauxRistourne").val(); + gcLimiteConsommation = $("#gcLimiteConsommation").val(); + + + codeTarifActe = $("#codeTarifActe").val(); + + seuilRdGarant = $("#seuilRdGarant").val(); + + codeTypeRemboursement = $("#codeTypeRemboursement").val(); + + encaissementExige = $("#encaissementExige").val(); + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez indiquer le code!"; + v_msgEng="Please enter the code!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(typeGarant <=" ") + { + v_msg="Veuillez indiquer le type de garant!"; + v_msgEng="Please indicate the type of guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#typeGarant").focus(); + return; + } + + + donnees = 'idGc='+idGc+'&libelle='+libelle+'&codeGcAssureur='+codeGcAssureur; + donnees += '&email='+email+'&gcTauxFraisReel='+gcTauxFraisReel+'&gcTauxRedressement='+gcTauxRedressement +'&gcTauxTva='+gcTauxTva; + donnees += '&fraisCarteAfn='+fraisCarteAfn+'&fraisCarteRen='+fraisCarteRen+'&fraisCarteImp='+fraisCarteImp; + donnees += '&typeGarant='+typeGarant+'&telephoneGarant='+telephoneGarant+'&representant='+representant; + donnees += '&siglerepresentant='+siglerepresentant+'&servicerepresentant='+servicerepresentant+'&telephonerepresentant='+telephonerepresentant; + + donnees += '&gcTauxProvision='+gcTauxProvision+'&gcForfaitProvision='+gcForfaitProvision+'&codeTarifActe='+codeTarifActe; + + donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant+'&gcTauxRistourne='+gcTauxRistourne+'&gcLimiteConsommation='+gcLimiteConsommation; + + donnees += '&seuilRdGarant='+seuilRdGarant+'&codeTypeRemboursement='+codeTypeRemboursement; + + donnees += '&adressePostale='+adressePostale+'&numerodeCompteComptableRD='+numerodeCompteComptableRD; + donnees += '&adresseGeographique='+adresseGeographique+'&numerodeCompteComptableTP='+numerodeCompteComptableTP; + donnees += '&numeroCompteContribuable='+numeroCompteContribuable+'&codeModePaiementDemande='+codeModePaiementDemande; + donnees += '&encaissementExige='+encaissementExige; + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + retour_gc_assureur(); + } + }); +} + + + + +function maj_paramfacturegarant() +{ + + idGc = $("#idGc").val(); + codeConvention = "GAR"; //$("#codeConvention").val(); + codePeriodiciteFacturationDeficit = $("#codePeriodiciteFacturationDeficit").val(); + forfaitCautionPermanant = parseInt($("#forfaitCautionPermanant").val().replace(/ /g,""),10); + + + + gcTauxRedressement = $("#gcTauxRedressement").val(); + gcTauxTva = $("#gcTauxTva").val(); + + + nbMoisCaution = $("#nbMoisCaution").val(); + seuilComplementCaution = $("#seuilComplementCaution").val(); + + codeSourceFondGarantAppelFond = $("#codeSourceFondGarantAppelFond").val(); + codeAssietteFacturationGarantAppelFond = $("#codeAssietteFacturationGarantAppelFond").val(); + codePeriodiciteAppelFond = $("#codePeriodiciteAppelFond").val(); + + codeSourceFondGarantHonoraire = $("#codeSourceFondGarantHonoraire").val(); + codeAssietteFacturationGarantHonoraire = $("#codeAssietteFacturationGarantHonoraire").val(); + codePeriodiciteHonoraire = $("#codePeriodiciteAppelFond").val(); + + codeSourceFondGarantCaution = $("#codeSourceFondGarantCaution").val(); + codeAssietteFacturationGarantCaution = $("#codeAssietteFacturationGarantCaution").val(); + nbAdherent = parseInt($("#nbAdherent").val().replace(/ /g,""),10); + nbBeneficiaire = parseInt($("#nbBeneficiaire").val().replace(/ /g,""),10); + + + if (codeSourceFondGarantAppelFond == "BUD"){ + montantBudget = parseInt($("#montantBudget").val().replace(/ /g,""),10); + }else{ + + montantBudget = "0"; + } + + if (codeSourceFondGarantHonoraire=="BUD" || codeSourceFondGarantHonoraire=="SIN"){ + gcTauxFraisReel = $("#gcTauxFraisReel").val(); + }else{ + gcTauxFraisReel = "0"; + } + + if (codeSourceFondGarantHonoraire=="PRI"){ + gcTauxCommissionGerant = $("#gcTauxCommissionGerant").val(); + }else{ + gcTauxCommissionGerant = "0"; + } + + if (codeSourceFondGarantHonoraire=="FOR"){ + forfaitHonoraire = parseInt($("#forfaitHonoraire").val().replace(/ /g,""),10); + + }else{ + forfaitHonoraire = "0"; + } + + + if(codeConvention<=" ") + { + v_msg="Veuillez indiquer la Convention!"; + v_msgEng="Please enter the Convention!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeConvention").focus(); + return; + } + + + if(codePeriodiciteFacturationDeficit<=" ") + { + v_msg="Veuillez renseigner la périodicité de la Facturation Déficit!"; + v_msgEng="Please provide the frequency of Deficit Billing!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePeriodiciteFacturationDeficit").focus(); + return; + } + + + if(codePeriodiciteAppelFond<=" ") + { + v_msg="Veuillez renseigner la périodicité de l'appel de fonds!"; + v_msgEng="Please indicate the frequency of the fundraising appeal!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePeriodiciteAppelFond").focus(); + return; + } + + + if(codePeriodiciteHonoraire<=" ") + { + v_msg="Veuillez renseigner la périodicité des honoraires!"; + v_msgEng="Please provide the frequency of fees!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePeriodiciteHonoraire").focus(); + return; + } + + + donnees = 'idGc='+idGc+'&codeConvention='+codeConvention; + donnees += '&codePeriodiciteAppelFond='+codePeriodiciteAppelFond; + + donnees += '&codePeriodiciteFacturationDeficit='+codePeriodiciteFacturationDeficit; + donnees += '&codePeriodiciteHonoraire='+codePeriodiciteHonoraire; + donnees += '&montantBudget='+montantBudget; + + donnees += '&forfaitCautionPermanant='+forfaitCautionPermanant; + donnees += '&forfaitHonoraire='+forfaitHonoraire; + + + donnees += '&gcTauxFraisReel='+gcTauxFraisReel+'&gcTauxRedressement='+gcTauxRedressement; + donnees += '&gcTauxTva='+gcTauxTva+'&gcTauxCommissionGerant='+gcTauxCommissionGerant; + donnees += '&nbMoisCaution='+nbMoisCaution+'&seuilComplementCaution='+seuilComplementCaution; + + donnees += '&codeSourceFondGarantAppelFond='+codeSourceFondGarantAppelFond; + donnees += '&codeAssietteFacturationGarantAppelFond='+codeAssietteFacturationGarantAppelFond; + donnees += '&codeSourceFondGarantHonoraire='+codeSourceFondGarantHonoraire; + donnees += '&codeAssietteFacturationGarantHonoraire='+codeAssietteFacturationGarantHonoraire; + + donnees += '&codeSourceFondGarantCaution='+codeSourceFondGarantCaution; + donnees += '&codeAssietteFacturationGarantCaution='+codeAssietteFacturationGarantCaution; + donnees += '&nbAdherent='+nbAdherent; + donnees += '&nbBeneficiaire='+nbBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/majparamfacturegarant/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + }, + complete: function() { + // retour_fiche_garant(); + consulter_param_fact_garant(); + } + }); +} + + + +function creer_gc_assureur() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + libelle = $("#libelle").val(); + email = $("#emailGcAssureur").val(); + gcTauxFraisReel = $("#gcTauxFraisReel").val(); + gcTauxRedressement = $("#gcTauxRedressement").val(); + gcTauxTva = $("#gcTauxTva").val(); + + adressePostale = $("#adressePostale").val(); + numerodeCompteComptableRD = $("#numerodeCompteComptableRD").val(); + adresseGeographique = $("#adresseGeographique").val(); + numerodeCompteComptableTP = $("#numerodeCompteComptableTP").val(); + numeroCompteContribuable = $("#numeroCompteContribuable").val(); + codeModePaiementDemande = $("#codeModePaiementDemande").val(); + + fraisCarteAfn = $("#fraisCarteAfn").val(); + fraisCarteAfn = fraisCarteAfn.replace(/ /g,""); + fraisCarteAfn = parseInt(fraisCarteAfn.replace(",","."),10); + + fraisCarteRen = $("#fraisCarteRen").val(); + fraisCarteRen = fraisCarteRen.replace(/ /g,""); + fraisCarteRen = parseInt(fraisCarteRen.replace(",","."),10); + + fraisCarteImp = $("#fraisCarteImp").val(); + fraisCarteImp = fraisCarteImp.replace(/ /g,""); + fraisCarteImp = parseInt(fraisCarteImp.replace(",","."),10); + + typeGarant = $("#typeGarant").val(); + telephoneGarant = $("#telephoneGarant").val(); + representant = $("#representant").val(); + siglerepresentant = $("#siglerepresentant").val(); + servicerepresentant = $("#servicerepresentant").val(); + telephonerepresentant = $("#telephonerepresentant").val(); + + gcTauxProvision = "0"; //$("#gcTauxProvision").val(); + + gcForfaitProvision = "0"; /*$("#gcForfaitProvision").val(); + gcForfaitProvision = gcForfaitProvision.replace(/ /g,""); + gcForfaitProvision = parseInt(gcForfaitProvision.replace(",","."),10);*/ + + gcTauxCommissionGerant = $("#gcTauxCommissionGerant").val(); + gcTauxRistourne = $("#gcTauxRistourne").val(); + gcLimiteConsommation = $("#gcLimiteConsommation").val(); + + + codeTarifActe = $("#codeTarifActe").val(); + + seuilRdGarant = $("#seuilRdGarant").val(); + + codeTypeRemboursement = $("#codeTypeRemboursement").val(); + + encaissementExige = $("#encaissementExige").val(); + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez indiquer le code!"; + v_msgEng="Please enter the code!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + return; + } + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(typeGarant <=" ") + { + v_msg="Veuillez indiquer le type de garant!"; + v_msgEng="Please indicate the type of guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#typeGarant").focus(); + return; + } + + /* + if(gcTauxFraisReel<"0") + { + v_msg="Veuillez indiquer le taux frais réel!"; + v_msgEng="Please indicate the charge rate"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxFraisReel").focus(); + return; + } + + gcTauxFraisReel=gcTauxFraisReel.replace(",","."); + if(isNaN(gcTauxFraisReel)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxFraisReel").val("0"); + $("#gcTauxFraisReel").focus(); + return; + } + + if(gcTauxRedressement<"0") + { + v_msg="Veuillez indiquer le taux redressement!"; + v_msgEng="Please indicate the recovery rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxRedressement").focus(); + return; + } + + gcTauxRedressement=gcTauxRedressement.replace(",","."); + // $("#gcTauxRedressement").val(gcTauxRedressement); + if(isNaN(gcTauxRedressement)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxRedressement").val("0"); + $("#gcTauxRedressement").focus(); + return; + } + + if(gcTauxTva<"0") + { + v_msg="Veuillez indiquer le taux de TVA!"; + v_msgEng="Please indicate the VAT rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxTva").focus(); + return; + } + + gcTauxTva=gcTauxTva.replace(",","."); + if(isNaN(gcTauxTva)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#gcTauxTva").val("0"); + $("#gcTauxTva").focus(); + return; + } + + if(fraisCarteAfn<"0") + { + v_msg="Veuillez indiquer les frais pour une nouvelle carte!"; + v_msgEng="Please indicate the fees for a new card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteAfn").focus(); + return; + } + + if(fraisCarteRen<"0") + { + v_msg="Veuillez indiquer les frais pour un renouvellement de carte!"; + v_msgEng="Please indicate the fees for a card renewal!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteRen").focus(); + return; + } + + if(fraisCarteImp<"0") + { + v_msg="Veuillez indiquer les frais pour une ré-impression de carte!"; + v_msgEng="Please indicate the fees for a re-printing of the card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteImp").focus(); + return; + } + + */ + + donnees = 'libelle='+libelle+'&codeGcAssureur='+codeGcAssureur; + donnees += '&email='+email+'&gcTauxFraisReel='+gcTauxFraisReel+'&gcTauxRedressement='+gcTauxRedressement +'&gcTauxTva='+gcTauxTva; + donnees += '&fraisCarteAfn='+fraisCarteAfn+'&fraisCarteRen='+fraisCarteRen+'&fraisCarteImp='+fraisCarteImp; + donnees += '&typeGarant='+typeGarant+'&telephoneGarant='+telephoneGarant+'&representant='+representant; + donnees += '&siglerepresentant='+siglerepresentant+'&servicerepresentant='+servicerepresentant+'&telephonerepresentant='+telephonerepresentant; + + donnees += '&gcTauxProvision='+gcTauxProvision+'&gcForfaitProvision='+gcForfaitProvision+'&codeTarifActe='+codeTarifActe; + + donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant+'&gcTauxRistourne='+gcTauxRistourne+'&gcLimiteConsommation='+gcLimiteConsommation; + + donnees += '&seuilRdGarant='+seuilRdGarant+'&codeTypeRemboursement='+codeTypeRemboursement; + + donnees += '&adressePostale='+adressePostale+'&numerodeCompteComptableRD='+numerodeCompteComptableRD; + donnees += '&adresseGeographique='+adresseGeographique+'&numerodeCompteComptableTP='+numerodeCompteComptableTP; + donnees += '&numeroCompteContribuable='+numeroCompteContribuable+'&codeModePaiementDemande='+codeModePaiementDemande; + donnees += '&encaissementExige='+encaissementExige; + + + /* + alert(typeGarant); + return; + */ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/ajouter/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + }else{ + retour_liste_gc_assureur(); + } + }, + complete: function() { + retour_liste_gc_assureur(); + } + }); +} + +function retour_liste_gc_assureur() +{ + window.location.assign($("#racineWeb" ).val()+"Gcassureur/"); +} + +function activer_gestion_confiee() +{ + etat=$("#codeEtatPolice_C").val(); + + if (etat=="RE") + { + v_msg="Attention! Police résiliée!"; + v_msgEng="Warning! Terminated policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (etat=="AN") + { + v_msg="Attention! Police annulée!"; + v_msgEng="Warning! Canceled policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + gestionConfiee=$("#gestionConfiee").val(); + if (gestionConfiee=="1") + { + v_msg="Gestion confiée déjà activée!"; + v_msgEng="Management entrusted already activated!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la gestion confiée pour cette police?"; + v_msgEng="Do you confirm the management entrusted for this policy?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Fichepolice/activergc/"+$("#idPolice_C").val()+"/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function afficher_gc_police(idPolice, idGcpolice) +{ + if (idPolice <=" ") + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (idGcpolice=="0") + { + window.location.assign($("#racineWeb" ).val()+"Creergcpolice/"+idPolice+"/"); + } + else + { + window.location.assign($("#racineWeb" ).val()+"Fichegcpolice/"+idPolice+"/"); + } +} + + + +function retour_liste_gc_police() +{ + window.location.assign($("#racineWeb" ).val()+"Gcpolices/"); +} + +function creer_gc_police() +{ + idPolice = $("#idPolice").val(); + + codeGcAssureur = $("#codeGcAssureur").val(); + tauxFraisReel = $("#tauxFraisReel").val(); + tauxRedressement = $("#tauxRedressement").val(); + tauxTva = $("#tauxTva").val(); + + fraisCarteAfn = $("#fraisCarteAfn").val(); + fraisCarteRen = $("#fraisCarteRen").val(); + fraisCarteImp = $("#fraisCarteImp").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(tauxFraisReel<"0") + { + v_msg="Veuillez indiquer le taux frais réel!"; + v_msgEng="Please indicate the charge rate"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxFraisReel").focus(); + return; + } + + tauxFraisReel=tauxFraisReel.replace(",","."); + if(isNaN(tauxFraisReel)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxFraisReel").val("0"); + $("#tauxFraisReel").focus(); + return; + } + + if(tauxRedressement<"0") + { + v_msg="Veuillez indiquer le taux redressement!"; + v_msgEng="Please indicate the recovery rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxRedressement").focus(); + return; + } + + tauxRedressement=tauxRedressement.replace(",","."); + if(isNaN(tauxRedressement)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxRedressement").val("0"); + $("#tauxRedressement").focus(); + return; + } + + + if(tauxTva<"0") + { + v_msg="Veuillez indiquer le taux de TVA!"; + v_msgEng="Please indicate the VAT rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxTva").focus(); + return; + } + + tauxTva=tauxTva.replace(",","."); + if(isNaN(tauxTva)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxTva").val("0"); + $("#tauxTva").focus(); + return; + } + + if(fraisCarteAfn<"0") + { + v_msg="Veuillez indiquer les frais pour une nouvelle carte!"; + v_msgEng="Please indicate the fees for a new card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteAfn").focus(); + return; + } + + if(fraisCarteRen<"0") + { + v_msg="Veuillez indiquer les frais pour un renouvellement de carte!"; + v_msgEng="Please indicate the fees for a card renewal!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteRen").focus(); + return; + } + + if(fraisCarteImp<"0") + { + v_msg="Veuillez indiquer les frais pour une ré-impression de carte!"; + v_msgEng="Please indicate the fees for a re-printing of the card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteImp").focus(); + return; + } + + donnees = 'idPolice='+idPolice+'&codeGcAssureur='+codeGcAssureur; + donnees += '&tauxFraisReel='+tauxFraisReel+'&tauxRedressement='+tauxRedressement +'&tauxTva='+tauxTva; + donnees += '&fraisCarteAfn='+fraisCarteAfn+'&fraisCarteRen='+fraisCarteRen+'&fraisCarteImp='+fraisCarteImp; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcreergcpolice/creerpolicegc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_liste_gc_police(); + } + }); +} + +function choisir_gc_assureur() +{ + + idPolice=$("#idPolice").val(); + 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; + } + + donnees = 'idPolice='+idPolice+'&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcreergcpolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_gc").html(data); + }, + complete: function() { + } + }); +} + + +function modifier_gc_police(idPolice) +{ + idPolice = $("#idPolice").val(); + + if (idPolice <=" ") + { + v_msg="Veuillez sélectionner une police!"; + v_msgEng="Please select a policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Modifiergcpolice/"+idPolice+"/"); +} + +function enregistrer_modif_gc_police() +{ + idPolice = $("#idPolice").val(); + + tauxFraisReel = $("#tauxFraisReel").val(); + tauxRedressement = $("#tauxRedressement").val(); + tauxTva = $("#tauxTva").val(); + + fraisCarteAfn = $("#fraisCarteAfn").val(); + fraisCarteRen = $("#fraisCarteRen").val(); + fraisCarteImp = $("#fraisCarteImp").val(); + + if(tauxFraisReel<"0") + { + v_msg="Veuillez indiquer le taux frais réel!"; + v_msgEng="Please indicate the charge rate"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxFraisReel").focus(); + return; + } + + tauxFraisReel=tauxFraisReel.replace(",","."); + $("#tauxFraisReel").val(tauxFraisReel); + if(isNaN(tauxFraisReel)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxFraisReel").val("0"); + $("#tauxFraisReel").focus(); + return; + } + + if(tauxRedressement<"0") + { + v_msg="Veuillez indiquer le taux redressement!"; + v_msgEng="Please indicate the recovery rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxRedressement").focus(); + return; + } + + tauxRedressement=tauxRedressement.replace(",","."); + $("#tauxRedressement").val(tauxRedressement); + if(isNaN(tauxRedressement)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxRedressement").val("0"); + $("#tauxRedressement").focus(); + return; + } + + if(tauxTva<"0") + { + v_msg="Veuillez indiquer le taux de TVA!"; + v_msgEng="Please indicate the VAT rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxTva").focus(); + return; + } + + tauxTva=tauxTva.replace(",","."); + $("#tauxTva").val(tauxTva); + if(isNaN(tauxTva)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#tauxTva").val("0"); + $("#tauxTva").focus(); + return; + } + + if(fraisCarteAfn<"0") + { + v_msg="Veuillez indiquer les frais pour une nouvelle carte!"; + v_msgEng="Please indicate the fees for a new card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteAfn").focus(); + return; + } + + if(fraisCarteRen<"0") + { + v_msg="Veuillez indiquer les frais pour un renouvellement de carte!"; + v_msgEng="Please indicate the fees for a card renewal!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteRen").focus(); + return; + } + + if(fraisCarteImp<"0") + { + v_msg="Veuillez indiquer les frais pour une ré-impression de carte!"; + v_msgEng="Please indicate the fees for a re-printing of the card!"; + alert_ebene(v_msg, v_msgEng); + + $("#fraisCarteImp").focus(); + return; + } + + donnees = 'idPolice='+idPolice; + donnees += '&tauxFraisReel='+tauxFraisReel+'&tauxRedressement='+tauxRedressement +'&tauxTva='+tauxTva; + donnees += '&fraisCarteAfn='+fraisCarteAfn+'&fraisCarteRen='+fraisCarteRen+'&fraisCarteImp='+fraisCarteImp; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcreergcpolice/modifierpolicegc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_fiche_gc_police(); + } + }); +} + +function retour_fiche_gc_police() +{ + idPolice = $("#idPolice").val(); + window.location.assign($("#racineWeb" ).val()+"Fichegcpolice/"+idPolice+"/"); +} + +function desactiver_gestion_confiee() +{ + idPolice = $("#idPolice").val(); + + nbFactureGc = $("#nbFactureGc").val(); + + if (nbFactureGc!=0) + { + v_msg="Cette police possède des factures dejà traitées en gestion confiée!"; + v_msgEng="This policy has invoices already processed in entrusted management!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous le retrait de cette police de la gestion confiée?"; + v_msgEng="Do you confirm the withdrawal of this policy from the entrusted management?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Fichepolice/desactivergc/"+idPolice+"/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function requetes_factures_gc() +{ + $('#div_export_a').html(""); + + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#div_detail_requete").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefacturegc/"; + + $.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()); + } + }); +} + +function requetes_factures_gc_export() +{ + $('#div_export_a').html(""); + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefacturegcexport/"; + + $.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 afficher_facture_gc(idFacture) +{ +} + +// + +function affciher_factures_gc_payable() +{ +} + +function initier_gc_reglement() +{ + codeGcAssureur = $("#codeGcAssureur").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; + } + + donnees = 'codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/gcinitreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_new_gc_reglement(); + } + }); +} + +function afficher_new_gc_reglement() +{ + window.location.assign($("#racineWeb" ).val()+"Gcnewfacturation/"); +} + + +function confirmer_new_facturation_gc() +{ + observations = $("#observations").val(); + + if (observations<=" ") + { + v_msg="Veuillez saisir quelque chose!"; + v_msgEng="Please enter something!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + donnees = 'observations='+observations; + + v_msg="Confirmez-vous la nouvelle facturation?"; + v_msgEng="Do you confirm the new billing?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/confirminitreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_gc_reglement(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function lister_reglements_gc() +{ + codeGcAssureur = $("#codeGcAssureur").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; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees = 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistereglementsgc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function aller_a_gcfacturation() +{ + window.location.assign($("#racineWeb" ).val()+"Gcfacturation/"); +} + +// + +function recalculer_solde_famille() +{ + var div_test = $('#div_test'); + div_test.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxadherent/recalculersoldefamille/", + type: 'POST', + success: function(data) + { + div_test.html(""); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + window.location.assign($("#racineWeb" ).val()+"Plafondadherent/"); + } + }); +} + +function ajax_context_gc_reglement_id(idGcReglement) +{ + donnees = 'idGcReglement='+idGcReglement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfeuillemaladie/getcontextbayid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + } + }); +} + +function afficher_gc_reglement_id(idGcReglement, valide) +{ + donnees = 'idGcReglement='+idGcReglement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextgcreglement/getcontextbyid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + + if (valide!="1") + { + window.location.assign($("#racineWeb" ).val()+"Gcreglement/"); + } + else + { + window.location.assign($("#racineWeb" ).val()+"Gcreglementcons/"); + } + } + }); +} + +function afficher_gc_reglement() +{ + window.location.assign($("#racineWeb" ).val()+"Gcreglement/"); +} + + +function ajaxchangercompsantegcreglement() +{ + $("#detail_facture").html(''); + $("#div_entete_sel").html(''); + + codeComposante=$("#codeComposante").val(); + + if(codeComposante<=" ") + { + v_msg="Veuillez sélectionner une compsante!"; + v_msgEng="Please select a compsante!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeComposante").focus(); + return; + } + + donnees = 'codeComposante='+codeComposante; + + if(codeComposante=="SFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); + } + else + if(codeComposante=="SNFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonselentete/"; + + $("#div_entete_sel").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_entete_sel").html(data); + $(".datepicker" ).datepicker(); + } + }); + } + else + if(codeComposante=="CFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); + + } + else + if(codeComposante=="CNFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonselentete/"; + + $("#div_entete_sel").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_entete_sel").html(data); + $(".datepicker" ).datepicker(); + } + }); + } + +} + +function recharger_factures_gc_non_sel() +{ + $("#detail_facture").html(''); + // $("#div_entete_sel").html(''); + + codeGcAssureur = $("#codeGcAssureur").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees = 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/"; + + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + + +function valider_selection_factures_gc() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_factures_gc_non_sel(); + } + }); +} + +function selectionner_facture_gc(idFactureTemp, choix) +{ + donnees = 'idFactureTemp='+idFactureTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function reafficher_factures_gc_non_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +// +function selectionner_facture_sel_gc(idFactureTemp, choix) +{ + donnees = 'idFactureTemp='+idFactureTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function recharger_factures_gc_sel() +{ + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); +} + +function reafficher_factures_gc_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function valider_selection_factures_gc_sel() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_factures_gc_sel(); + } + }); +} + +// + +function requetes_cartes_gc() +{ + $('#div_export_a').html(""); + + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#div_detail_requete").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetecartegc/"; + + $.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()); + } + }); +} + +function requetes_cartes_gc_export() +{ + $('#div_export_a').html(""); + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetecartegcexport/"; + + $.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 ged_carte_gc(idGcCarte) +{ + if (idGcCarte>"0") + { + } +} + +// +function recharger_cartes_gc_non_sel() +{ + $("#detail_facture").html(''); + + codeGcAssureur = $("#codeGcAssureur").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees = 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/"; + + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function valider_selection_cartes_gc() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_cartes_gc_non_sel(); + } + }); +} + +function reafficher_cartes_gc_non_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function selectionner_carte_gc(idCarteTemp, choix) +{ + donnees = 'idCarteTemp='+idCarteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function selectionner_carte_sel_gc(idCarteTemp, choix) +{ + donnees = 'idCarteTemp='+idCarteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function recharger_cartes_gc_sel() +{ + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); +} + +function reafficher_cartes_gc_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function valider_selection_cartes_gc_sel() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_cartes_gc_sel(); + } + }); +} + +function selectionner_carte_sel_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxcartegcsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_cartes_gc_sel(); + } + }); +} + +function selectionner_carte_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxcartegcnonsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_cartes_gc_non_sel(); + } + }); +} + +// factures + +function selectionner_facture_sel_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxfacturegcsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_factures_gc_sel(); + } + }); +} + +function selectionner_facture_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxfacturegcnonsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_factures_gc_non_sel(); + } + }); +} + +function modifier_facturation_gc() +{ + observations = $("#observations").val(); + + if (observations<=" ") + { + v_msg="Veuillez saisir quelque chose!"; + v_msgEng="Please enter something!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + donnees = 'observations='+observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/enregistrermodificationgcreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_gc_reglement(); + } + }); +} + + +function valider_gc_rglement_premier() +{ + valide0=$("#valide0").val(); + valide0 = parseInt(valide0); + + if (valide0==1) + { + v_msg="1ère validation déjà effectuée!"; + v_msgEng="1st validation already done!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + montantDu=$("#montantDu").val(); + montantDu = parseInt(montantDu); + + if (montantDu<=0) + { + v_msg="Rien à valider, revoir le total de la facture!"; + v_msgEng="Nothing to validate, review the total bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (valide0==0) + { + v_msg="quesConfirmez-vous la 1ère validation de cette facturation?tion"; + v_msgEng="Do you confirm the 1st validation of this billing?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/validerdecomptepremier/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + v_msg="1ère validation effectuée avec succès!"; + v_msgEng="1st validation done successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + afficher_gc_reglement(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } +} + +// + +function valider_gc_rglement() +{ + valide0=$("#valide0").val(); + valide0 = parseInt(valide0); + + if (valide0!=1) + { + v_msg="Veuillez procéder à la 1ère validation!"; + v_msgEng="Please proceed to the 1st validation!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + valideAs=$("#valideAs").val(); + valideAs = parseInt(valideAs); + + if (valideAs!=1) + { + v_msg="En attente de la validation de l\'assureur!"; + v_msgEng="Waiting for the validation of the insurer!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + montantDu=$("#montantDu").val(); + montantDu = parseInt(montantDu); + + if (montantDu<=0) + { + v_msg="Rien à valider, revoir le total de la facture!"; + v_msgEng="Nothing to validate, review the total bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + valide=$("#valide").val(); + valide = parseInt(valide); + + if (valide==0) + { + v_msg="Confirmez-vous la 2ème validation de cette facturation?"; + v_msgEng="Do you confirm the 2nd validation of this billing?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/validerdecompte/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + v_msg="2ème validation effectuée avec succès!"; + v_msgEng="2nd validation done successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + consulter_gc_reglement(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } +} + +function consulter_gc_reglement() +{ + window.location.assign($("#racineWeb" ).val()+"Gcreglementcons/"); +} + +function consulter_gc_reglement_id(idGcReglement) +{ + donnees = 'idGcReglement='+idGcReglement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextgcreglement/getcontextbyid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Gcreglementcons/"); + } + }); +} + +function encaisser_gc() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà encaissé!"; + v_msgEng="Already cashed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Encaissergc/"); +} + +function imprimer_detail_cartes_gc() +{ +} + + +function imprimer_detail_factures_gc() +{ +} + +function ajaxchangercompsantegcreglementcons() +{ + $("#detail_facture").html(''); + + codeComposante=$("#codeComposante").val(); + + if(codeComposante<=" ") + { + v_msg="Veuillez sélectionner une compsante!"; + v_msgEng="Please select a compsante!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeComposante").focus(); + return; + } + + donnees = 'codeComposante='+codeComposante; + + if(codeComposante=="SFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfacturegccons/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); + } + else + if(codeComposante=="CFACT") + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongccons/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); + + } +} + +function enregistrer_encaissement_gc() +{ + codeModePaiement = $("#codeModePaiement").val(); + referencePaiement = $("#referencePaiement").val(); + + nomTireur = $("#nomTireur").val(); + banquePayeur = $("#banquePayeur").val(); + + montantDu = $("#montantDu").val(); + dateComptable = $("#dateComptable").val(); + + if (codeModePaiement<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").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 (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 saisir la banque payeur!"; + v_msgEng="Please enter the paying bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#banquePayeur").focus(); + return; + } + + if (dateComptable<=" ") + { + v_msg="Veuillez saisir la date comptable!"; + v_msgEng="Please enter the posting date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateComptable").focus(); + return; + } + + if(montantDu<=" ") + { + montantDu = "0"; + } + + if(montantDu==0) + { + v_msg="Rien à régler!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cet encaissement?"; + v_msgEng="Do you confirm this receipt?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'codeModePaiement='+codeModePaiement+'&referencePaiement='+referencePaiement; + donnees += '&nomTireur='+nomTireur+'&banquePayeur='+banquePayeur; + donnees += '&montantDu='+montantDu+'&dateComptable='+dateComptable; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcregelement/enregistrerencaissementgc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + consulter_gc_reglement(); + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function imprimer_detail_facture_gc() +{ + $('#div_export_b').html(""); + $("#btn_pop_imprimer_detail_gc").click(); +} + +/* +function reinitialiser_emailgcassureur) +{ + emailgcassureur = $("#emailgcassureur_0").val(); + $("#emailgcassureur").val(emailgcassureur); +} +*/ + +function charger_detail_facture_gc_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfacturegcpdf/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function ctrlkeypress_liste_carte_gc(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_carte_gc(); + } +} + +function afficher_liste_carte_gc() +{ + donnees = ""; + donnees_retour = ""; + + + numeroBeneficiaire = $("#numeroBeneficiaire_gc").val(); + numeroBeneficiaire = numeroBeneficiaire.trim(); + + donnees = 'numeroBeneficiaire=' + numeroBeneficiaire; + + $("#div_liste_carte_gc").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartegc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte_gc").html(donnees_retour); + } + }); +} + +function init_creer_carte_gc(idBeneficiaire) +{ + $("#idBeneficiaire_gc").val(idBeneficiaire); + + $("#btn_new_carte").click(); +} + +function creer_carte_gc() +{ + 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é + idBeneficiaire = $("#idBeneficiaire_gc").val(); + dateCarte = $("#dateCarte").val(); + + donnees = 'idBeneficiaire=' + idBeneficiaire+"&dateCarte="+dateCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartegc/creercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_carte").click(); + }, + complete: function() { + afficher_liste_carte_gc(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_carte_gc(idGcCarte, facture) +{ + if (facture==1) + { + v_msg="Carte déjà facturée!"; + v_msgEng="Card already billed!"; + 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é + donnees = 'idGcCarte=' + idGcCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartegc/supprimercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_liste_carte_gc(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function init_modif_carte_gc(idGcCarte, dateCarte, montantCarte, montantCarte_f, facture) +{ + if (facture==1) + { + v_msg="Carte déjà facturée!"; + v_msgEng="Card already billed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#idGcCarte_gc").val(idGcCarte); + $("#dateCarte_gc").val(dateCarte); + $("#montantCarte_gc").val(montantCarte); + $("#montantCarte_f").val(montantCarte_f); + + $("#btn_modif_carte").click(); +} + +function modifier_carte_gc() +{ + v_msg="Confirmez-vous cette modification?"; + v_msgEng="Do you confirm this change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + idGcCarte = $("#idGcCarte_gc").val(); + dateCarte = $("#dateCarte_gc").val(); + montantCarte = $("#montantCarte_gc").val(); + + donnees = 'idGcCarte='+idGcCarte+"&dateCarte="+dateCarte+"&montantCarte="+montantCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartegc/modifiercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_modif_carte").click(); + }, + complete: function() { + afficher_liste_carte_gc(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_carte_gc_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailcartegcpdf/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_detail_tous_gc_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailtousgcpdf/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +// + +function selectionner_tous_compte() +{ + v_msg="Validation des factures non traitées. Confirmez-vous cette opération?"; + v_msgEng="Validation of unprocessed invoices. Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/validertouteslesfacturesdecompte/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + afficherdecompte(); + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function charger_detail_facture_gc_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfacturegcxls/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_detail_carte_gc_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailcartegcxls/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + + +function charger_detail_tous_gc_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailtousgcxls/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function imprimer_recu_gc() +{ + regle=$("#regle").val(); + + if (regle!=1) + { + v_msg="Pas encore encaissé!"; + v_msgEng="Not yet cashed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrecugc/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function cartes_beneficiaire() +{ + window.location.assign($("#racineWeb" ).val()+"Cartesbenficiaire/"); +} + +function afficher_liste_carte_beneficiaire() +{ + donnees_retour = ""; + + $("#div_liste_carte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartebeneficiaire/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_carte").html(donnees_retour); + } + }); +} + +function init_modif_carte_beneficiaire(idBeneficiaireCarte, dateCarte, montantCarte, montantCarte_f, facture) +{ + if (facture==1) + { + v_msg="Carte déjà facturée!"; + v_msgEng="Card already billed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#idBeneficiaireCarte").val(idBeneficiaireCarte); + $("#dateCarteModif").val(dateCarte); + $("#montantCarteModif").val(montantCarte); + $("#montantCarte_f").val(montantCarte_f); + + $("#btn_modif_carte").click(); +} + +// maintenant + +function init_creer_carte() +{ + $("#btn_new_carte").click(); +} + +function creer_carte() +{ + 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é + montantCarte = $("#montantCarteNew").val(); + dateCarte = $("#dateCarteNew").val(); + + donnees = 'dateCarte='+dateCarte+"&montantCarte="+montantCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartebeneficiaire/creercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_carte").click(); + }, + complete: function() { + afficher_liste_carte_beneficiaire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_carte(idBeneficiaireCarte, facture) +{ + if (facture==1) + { + v_msg="Carte déjà facturée!"; + v_msgEng="Card already billed!"; + 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é + donnees = 'idBeneficiaireCarte=' + idBeneficiaireCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartebeneficiaire/supprimercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_liste_carte_beneficiaire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_carte_beneficiaire() +{ + v_msg="Confirmez-vous cette modification?"; + v_msgEng="Do you confirm this change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + idBeneficiaireCarte = $("#idBeneficiaireCarte").val(); + dateCarte = $("#dateCarteModif").val(); + montantCarte = $("#montantCarteModif").val(); + + donnees = 'idBeneficiaireCarte='+idBeneficiaireCarte+"&dateCarte="+dateCarte+"&montantCarte="+montantCarte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisterecherchecartebeneficiaire/modifiercarte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_modif_carte").click(); + }, + complete: function() { + afficher_liste_carte_beneficiaire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function maj_champ_application_plafond(idGarantie, choix) +{ + donnees = 'idGarantie='+idGarantie+'&choix='+choix; + + v_msg = "Vous venez de conformer que cette limite est par tête!"; + v_msgEng="You just complied that this limit is per head!"; + + if(choix=="0") + { + v_msg = "Vous venez de conformer que cette limite est par famille!"; + v_msgEng="You have just complied that this limit is per family!"; + } + + v_url = $("#racineWeb").val()+"Ajaxgarantiescollege/majchampapplicationplafond/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(errordata) { + }, + complete: function() { + alert_ebene(v_msg, v_msgEng); + } + }); +} + +function requetes_factures_accident() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#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()); + } + }); +} + +function requetes_factures_accident_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 init_imprimer_demande_decompte() +{ + regle=$("#regle").val(); + regle = parseInt(regle); + + if (regle==0) + { + v_msg="Veuillez procéder à la 1ère validation!"; + v_msgEng="Please proceed to the 1st validation!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + if (regle==2) + { + v_msg="En attente de la validation du prestataire!"; + v_msgEng="Waiting for the validation of the provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if ($("#montantApayer").val()<="0") + { + v_msg="Rien à payer!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (regle==1) + { + v_msg="Déjà réglé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $('#div_export_demande_reglement').html(''); + + $("#btn_demande_reglement").click(); +} + + +function imprimer_demande_reglement() +{ + + codePrestataire = $("#codePrestataire").val(); + a_enreg = $("#a_enreg").val(); + + codeBanque = $("#codeBanque").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + + if (codeBanque<=" ") + { + v_msg="Veuillez sélectionner une banque!"; + v_msgEng="Please select a bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanque").focus(); + + return; + } + + if (numeroCompteBancaire<=" ") + { + v_msg="Veuillez indiquer le No de compte bancaire!";; + v_msgEng="Please enter the bank account No"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroCompteBancaire").focus(); + return; + } + + if (intituleCompteBancaire<=" ") + { + v_msg="Veuillez indiquer intitulé du compte!"; + v_msgEng="Please enter the owner of the account!"; + alert_ebene(v_msg, v_msgEng); + + $("#intituleCompteBancaire").focus(); + return; + } + + idReglement = $("#idReglement").val(); + if (idReglement>"0") + { + var div_export_demande_reglement = $('#div_export_demande_reglement'); + div_export_demande_reglement.html('
' + '
'); + + if (a_enreg=="1") + { + codePrestataire = $("#codePrestataire").val(); + codeBanque = $("#codeBanque").val(); + codeBanqueInterne = $("#codeBanqueInterne").val(); + codeGuichet = $("#codeGuichet").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + cleRib = $("#cleRib").val(); + iban = $("#iban").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + + donnees = 'codePrestataire='+codePrestataire; + donnees += '&codeBanque='+codeBanque+'&codeBanqueInterne='+codeBanqueInterne+'&codeGuichet='+codeGuichet; + donnees += '&numeroCompteBancaire='+numeroCompteBancaire+'&cleRib='+cleRib+'&iban='+iban+'&intituleCompteBancaire='+intituleCompteBancaire ; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/majcomptebancaire/", + type : 'post', + data: donnees, + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } + }); + + } + else + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } + } +} + +function novalidprestataire() +{ +/* +0 Décompte en cours + +2 Attente Valid. prestat. / Waiting for provider s valid. + +3 Validé par le prestataire + +8 Pas besoin de valid prestat / Provid valid not needed + +9 En attente de règelment + +1 Réglé / Payé +*/ + + regle=$("#regle").val(); + regle = parseInt(regle); + + if (regle==0) + { + v_msg="Veuillez procéder à la 1ère validation!"; + v_msgEng="Please proceed to the 1st validation!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (regle==3) + { + v_msg="Déjà validé par le prestataire!"; + v_msgEng="Already validated by the provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (regle==8) + { + v_msg="Déjà effectué!"; + v_msgEng="Already done!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if ($("#montantApayer").val()<="0") + { + v_msg="Rien à valider!"; + v_msgEng="Nothing to validate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (regle==2) + { + v_msg="Confirmez-vous que la validation du prestataire n\'est pas nécessaire?"; + v_msgEng="Do you confirm that provider validation is not necessary?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/novalidprestataire/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + afficherdecompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + } +} + +function listerdecomptes() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + codeEtatDecompte = $("#codeEtatDecompte").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2+'&codeEtatDecompte='+codeEtatDecompte; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistedecomptes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function listerdecomptes_export() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + codeEtatDecompte = $("#codeEtatDecompte").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2+'&codeEtatDecompte='+codeEtatDecompte; + + var div_export = $('#div_detail'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxlistedecomptesexport/"; + + $.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 maj_reception_facture_decompte() +{ + dateReception = $("#dateReception_pop").val(); + montantPrestataire = $("#montantPrestataire_pop").val(); + + + if(dateReception<=" ") + { + v_msg="Veuillez indicquer la date de réception!"; + v_msgEng="Please enter the date of receipt!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateReception_pop").focus(); + return; + } + + if (montantPrestataire<=" ") + { + montantPrestataire = "0"; + } + + montantPrestataire = montantPrestataire.replace(" ", ""); + montantPrestataire = parseInt(montantPrestataire); + + if (montantPrestataire=="0") + { + v_msg="Veuillez indicquer le montant de la facture du prestataire!"; + v_msgEng="Please enter the invoice amount of the service provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire_pop").focus(); + return; + } + + donnees = 'dateReception='+dateReception+'&montantPrestataire='+montantPrestataire; + + 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()+"Ajaxdecompte/majreceptionfactureprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $("#btn_close_pop_reception").click(); + }, + error: function(erreur) { + }, + complete: function() { + + dateReception = $("#dateReception_pop").val(); + + $("#dateReception").val(dateReception+" / "+montantPrestataire); + $("#btn_dateReception").val(dateReception+" / "+montantPrestataire); + + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + re_afficherdecompte(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); +} + +// + + +function imprimer_lite_prestataire() +{ + donnees = ""; + donnees_retour = ""; + + + donnees = ""; + donnees_retour = ""; + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + libelle = $("#libelle").val(); + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + donnees += '&categoriePresataire=' + categoriePresataire; + donnees += '&libelle=' + libelle; + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + $("#div_liste_prestataire").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdlisteprestataireparametrage/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_liste_prestataire").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + + +function exporter_lite_prestataire() +{ + donnees = ""; + donnees_retour = ""; + + + donnees = ""; + donnees_retour = ""; + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + categoriePresataire = $("#categoriePresataire").val(); + libelle = $("#libelle").val(); + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + donnees += '&categoriePresataire=' + categoriePresataire; + donnees += '&libelle=' + libelle; + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + $("#div_liste_prestataire").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdlisteprestataireparametrageexport/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_liste_prestataire").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function exporter_lite_prestataire_actif() +{ + donnees = ""; + donnees_retour = ""; + + + codeTypePrestataire = $("#codeTypePrestataire").val(); + //codeReseau = $("#codeReseau").val(); + libelle = $("#libelle").val(); + + donnees += 'codeTypePrestataire=' + codeTypePrestataire; + //donnees += '&codeReseau=' + codeReseau; + donnees += '&libelle=' + libelle; + + $("#div_liste_prestataire").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdlisteprestataireparametrageexport/actif/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_liste_prestataire").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function creer_prestataire() +{ + idPrestataire = $("#idPrestataire").val(); + libelle = $("#libelle").val(); + categoriePresataire = $("#categoriePresataire").val(); + codeTypePrestataire = $("#codeTypePrestataire").val(); + codeTarifActe = $("#codeTarifActe").val(); + codeTarifMedicament = $("#codeTarifMedicament").val(); + codeTarifOptique = $("#codeTarifOptique").val(); + codePays = $("#codePays").val(); + villeSignature = $("#villeSignature").val(); + codeTypeDecompte = $("#codeTypeDecompte").val(); + adresseGeo = $("#adresseGeo").val(); + numeroCompte = $("#numeroCompte").val(); + adressePost = $("#adressePost").val(); + conventionne = $("#conventionne").val(); + gestionreseau = $("#gestionreseau").val(); + emailGestionPrestataire = $("#emailGestionPrestataire").val(); + + + if(!verifMailValeur(emailGestionPrestataire)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#emailGestionPrestataire").focus(); + return; + } + + // Prise en compte des comptes bancaires prestataire + codeBanque = $("#codeBanque").val(); + codeBanqueInterne = $("#codeBanqueInterne").val(); + codeGuichet = $("#codeGuichet").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + cleRib = $("#cleRib").val(); + iban = $("#iban").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + // + + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + smsGestionPrestataire = $("#smsGestionPrestataire").val(); + registreCommerce = $("#registreCommerce").val(); + + codeLanguePrestataire = $("#codeLangueUser").val(); + + nomResponsable = $("#nomResponsable").val(); + nomInterlocuteur = $("#nomInterlocuteur").val(); + telephoneFixe = $("#telephoneFixe").val(); + + + faxPrestataire = $("#faxPrestataire").val(); + telephonePortable = $("#telephonePortable").val(); + contactInterlocuteur = $("#contactInterlocuteur").val(); + + centreReference = $("#centreReference").val(); + + appliquerTarifNuit = $("#appliquerTarifNuit").val(); + + latitude = $("#latitude").val(); + longitude = $("#longitude").val(); + + filtreMedecin = $("#filtreMedecin").val(); + codeModeBiometrie = $("#codeModeBiometrie").val(); + + prefixePaiementMobile = $("#prefixePaiementMobile").val(); + mobilePaiement = $("#mobilePaiement").val(); + + if(codeTypePrestataire=="PHA"){ + accesAjoutPh = $("#accesAjoutPh").val(); + ajoutPrescription = $("#ajoutPrescription").val(); + interdirVentePartielleMedicament = $("#interdirVentePartielleMedicament").val(); + }else{ + accesAjoutPh = "0"; + ajoutPrescription = "0"; + interdirVentePartielleMedicament = "0"; + } + + pharmacieInterne = $("#pharmacieInterne").val(); + optiqueInterne = $("#optiqueInterne").val(); + + appliquerTarifPrestataire = $("#appliquerTarifPrestataire").val(); + + activerOtp = $("#activerOtp").val(); + filtrerIp = $("#filtrerIp").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom du prestataire!"; + v_msgEng="Please enter the name of the provider"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(categoriePresataire<=" ") + { + v_msg="Veuillez indiquer la produit du prestataire!"; + v_msgEng="Please indicate the category of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(codeTypePrestataire<=" ") + { + v_msg="Veuillez indiquer le type de prestataire!"; + v_msgEng="Please indicate the type of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestataire").focus(); + return; + } + + + if (codeTypePrestataire=="CSO" || codeTypePrestataire=="CME" || codeTypePrestataire=="DEN" || codeTypePrestataire=="HRW" || codeTypePrestataire=="LAB"|| codeTypePrestataire=="SEA") + { + if (codeTarifActe<" ") + { + v_msg="Veuillez fournir le tarif des actes!"; + v_msgEng="Please provide the rates of the acts!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + } + + + if (codeTypePrestataire=="PHA") + //if (codeTypePrestataire=="CSO" || codeTypePrestataire=="CME" || codeTypePrestataire=="PHA") + { + if (codeTarifMedicament<" ") + { + v_msg="Veuillez fournir le tarif des médicaments!"; + v_msgEng="Please provide the price of the drugs!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + } + + /* + if (codeTypePrestataire=="OPT") + { + if (codeTarifOptique<" ") + { + v_msg="Veuillez fournir le tarif optique!"; + v_msgEng="Please provide the optical rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + } + */ + + if(codePays<=" ") + { + v_msg="Veuillez indiquer le pays!"; + v_msgEng="Please indicate the country!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePays").focus(); + return; + } + + if (codeVille<=" ") + { + v_msg="Veuillez préciser la localisation!"; + v_msgEng="Please specify the location!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeVille").focus(); + return; + } + + if (codeLocalite<=" ") + { + v_msg="Veuillez préciser la localisation!"; + v_msgEng="Please specify the location!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLocalite").focus(); + return; + } + + if(villeSignature<=" ") + { + v_msg="Veuillez indiquer la ville de signature!"; + v_msgEng="Please indicate the city of signature!"; + alert_ebene(v_msg, v_msgEng); + + $("#villeSignature").focus(); + return; + } + + if(codeTypeDecompte<=" ") + { + v_msg="Veuillez indiquer la type de décompte!"; + v_msgEng="Please indicate the type of count!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDecompte").focus(); + return; + } + + if(conventionne<=" ") + { + v_msg="Le prestataire est-il conventionné ou pas?"; + v_msgEng="Do the provider have an convetion or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#conventionne").focus(); + return; + } + + if(gestionreseau<=" ") + { + v_msg="Tenir compte des réseaux de soins ou pas?"; + v_msgEng="Consider care networks or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#gestionreseau").focus(); + return; + } + + if(codeLanguePrestataire<=" ") + { + v_msg="Veuillez sélectionner une langue"; + v_msgEng="Please select a language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + autoriserUnBonPrincipal = $("#autoriserUnBonPrincipal").val(); + prixActeModifiable = $("#prixActeModifiable").val(); + + + donnees = 'libelle='+libelle+'&codeTypePrestataire='+codeTypePrestataire; + donnees += '&categoriePresataire='+categoriePresataire+'&codeTarifActe='+codeTarifActe+'&codeTarifMedicament='+codeTarifMedicament; + donnees += '&codeTarifOptique='+codeTarifOptique+'&codePays='+codePays+'&villeSignature='+villeSignature; + donnees += '&codeTypeDecompte='+codeTypeDecompte+'&adresseGeo='+adresseGeo+'&numeroCompte='+numeroCompte; + donnees += '&adressePost='+adressePost+'&conventionne='+conventionne+'&gestionreseau='+gestionreseau+'&emailGestionPrestataire='+emailGestionPrestataire; + + donnees += '&codeBanque='+codeBanque+'&codeBanqueInterne='+codeBanqueInterne+'&codeGuichet='+codeGuichet; + donnees += '&numeroCompteBancaire='+numeroCompteBancaire+'&cleRib='+cleRib+'&iban='+iban+'&intituleCompteBancaire='+intituleCompteBancaire; + + donnees += '&codeVille='+codeVille+'&codeLocalite='+codeLocalite+'&smsGestionPrestataire='+smsGestionPrestataire+'®istreCommerce='+registreCommerce; + + donnees += '&codeLanguePrestataire='+codeLanguePrestataire; + + donnees += '&nomResponsable='+nomResponsable+'&nomInterlocuteur='+nomInterlocuteur+'&telephoneFixe='+telephoneFixe; + + donnees += '&faxPrestataire='+faxPrestataire+'&telephonePortable='+telephonePortable+'&contactInterlocuteur='+contactInterlocuteur; + + donnees += '¢reReference='+centreReference+'&appliquerTarifNuit='+appliquerTarifNuit+'&latitude='+latitude+'&longitude='+longitude; + + donnees += '&accesAjoutPh='+accesAjoutPh+'&ajoutPrescription='+ajoutPrescription+'&interdirVentePartielleMedicament='+interdirVentePartielleMedicament; + + donnees += '&filtreMedecin='+filtreMedecin+'&codeModeBiometrie='+codeModeBiometrie+'&pharmacieInterne='+pharmacieInterne+'&optiqueInterne='+optiqueInterne; + + donnees += '&appliquerTarifPrestataire='+appliquerTarifPrestataire; + + donnees += '&activerOtp='+activerOtp; + donnees += '&filtrerIp='+filtrerIp; + + donnees += '&autoriserUnBonPrincipal='+autoriserUnBonPrincipal; + + donnees += '&mobilePaiement='+mobilePaiement; + donnees += '&prefixePaiementMobile='+prefixePaiementMobile; + + donnees += '&prixActeModifiable='+prixActeModifiable; + + v_msg="Confirmez-vous ce nouveau prestataire?"; + v_msgEng="Do you confirm this new provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/creerprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_idPrestataire').html(data); + }, + complete: function() + { + idPrestataire = $("#idPrestataire").val(); + + afficher_prestataire_id(idPrestataire); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrer_prestataire() +{ + idPrestataire = $("#idPrestataire").val(); + libelle = $("#libelle").val(); + categoriePresataire = $("#categoriePresataire").val(); + codeTypePrestataire = $("#codeTypePrestataire").val(); + codeTarifActe = $("#codeTarifActe").val(); + codeTarifMedicament = $("#codeTarifMedicament").val(); + codeTarifOptique = $("#codeTarifOptique").val(); + codePays = $("#codePays").val(); + villeSignature = $("#villeSignature").val(); + codeTypeDecompte = $("#codeTypeDecompte").val(); + adresseGeo = $("#adresseGeo").val(); + numeroCompte = $("#numeroCompte").val(); + adressePost = $("#adressePost").val(); + conventionne = $("#conventionne").val(); + gestionreseau = $("#gestionreseau").val(); + emailGestionPrestataire = $("#emailGestionPrestataire").val(); + + // Prise en compte des comptes bancaires prestataire + codeBanque = $("#codeBanque").val(); + codeBanqueInterne = $("#codeBanqueInterne").val(); + codeGuichet = $("#codeGuichet").val(); + numeroCompteBancaire = $("#numeroCompteBancaire").val(); + cleRib = $("#cleRib").val(); + iban = $("#iban").val(); + intituleCompteBancaire = $("#intituleCompteBancaire").val(); + // + + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + smsGestionPrestataire = $("#smsGestionPrestataire").val(); + registreCommerce = $("#registreCommerce").val(); + + codeLanguePrestataire = $("#codeLangueUser").val(); + + nomResponsable = $("#nomResponsable").val(); + nomInterlocuteur = $("#nomInterlocuteur").val(); + telephoneFixe = $("#telephoneFixe").val(); + + + faxPrestataire = $("#faxPrestataire").val(); + telephonePortable = $("#telephonePortable").val(); + contactInterlocuteur = $("#contactInterlocuteur").val(); + + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom du prestataire!"; + v_msgEng="Please enter the name of the provider"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(categoriePresataire<=" ") + { + v_msg="Veuillez indiquer la catégorie du prestataire!"; + v_msgEng="Please indicate the category of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(codeTypePrestataire<=" ") + { + v_msg="Veuillez indiquer le type de prestataire!"; + v_msgEng="Please indicate the type of provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestataire").focus(); + return; + } + + + if (codeTypePrestataire=="CSO" || codeTypePrestataire=="DEN" || codeTypePrestataire=="HRW" || codeTypePrestataire=="LAB"|| codeTypePrestataire=="SEA") + { + if (codeTarifActe<" ") + { + v_msg="Veuillez fournir le tarif des actes!"; + v_msgEng="Please provide the rates of the acts!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + } + + + // if (codeTypePrestataire=="PHA") + if (codeTypePrestataire=="CSO" || codeTypePrestataire=="PHA") + { + if (codeTarifMedicament<" ") + { + v_msg="Veuillez fournir le tarif des médicaments!"; + v_msgEng="Please provide the price of the drugs!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + } + + if (codeTypePrestataire=="OPT") + { + if (codeTarifOptique<" ") + { + v_msg="Veuillez fournir le tarif optique!"; + v_msgEng="Please provide the optical rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + } + + if(codePays<=" ") + { + v_msg="Veuillez indiquer le pays!"; + v_msgEng="Please indicate the country!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePays").focus(); + return; + } + + if (codeVille<=" ") + { + v_msg="Veuillez préciser la localisation!"; + v_msgEng="Please specify the location!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeVille").focus(); + return; + } + + if (codeLocalite<=" ") + { + v_msg="Veuillez préciser la localisation!"; + v_msgEng="Please specify the location!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLocalite").focus(); + return; + } + + if(villeSignature<=" ") + { + v_msg="Veuillez indiquer la ville de signature!"; + v_msgEng="Please indicate the city of signature!"; + alert_ebene(v_msg, v_msgEng); + + $("#villeSignature").focus(); + return; + } + + if(codeTypeDecompte<=" ") + { + v_msg="Veuillez indiquer la type de décompte!"; + v_msgEng="Please indicate the type of count!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDecompte").focus(); + return; + } + + if(conventionne<=" ") + { + v_msg="Le prestataire est-il conventionné ou pas?"; + v_msgEng="Do the provider have an convetion or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#conventionne").focus(); + return; + } + + if(gestionreseau<=" ") + { + v_msg="Tenir compte des réseaux de soins ou pas?"; + v_msgEng="Consider care networks or not?"; + alert_ebene(v_msg, v_msgEng); + + $("#gestionreseau").focus(); + return; + } + + if(codeLanguePrestataire<=" ") + { + v_msg="Veuillez sélectionner une langue"; + v_msgEng="Please select a language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + donnees = 'libelle='+libelle+'&codeTypePrestataire='+codeTypePrestataire; + donnees += '&categoriePresataire='+categoriePresataire+'&codeTarifActe='+codeTarifActe+'&codeTarifMedicament='+codeTarifMedicament; + donnees += '&codeTarifOptique='+codeTarifOptique+'&codePays='+codePays+'&villeSignature='+villeSignature; + donnees += '&codeTypeDecompte='+codeTypeDecompte+'&adresseGeo='+adresseGeo+'&numeroCompte='+numeroCompte; + donnees += '&adressePost='+adressePost+'&conventionne='+conventionne+'&gestionreseau='+gestionreseau+'&emailGestionPrestataire='+emailGestionPrestataire; + + donnees += '&codeBanque='+codeBanque+'&codeBanqueInterne='+codeBanqueInterne+'&codeGuichet='+codeGuichet; + donnees += '&numeroCompteBancaire='+numeroCompteBancaire+'&cleRib='+cleRib+'&iban='+iban+'&intituleCompteBancaire='+intituleCompteBancaire; + + donnees += '&codeVille='+codeVille+'&codeLocalite='+codeLocalite+'&smsGestionPrestataire='+smsGestionPrestataire+'®istreCommerce='+registreCommerce; + + donnees += '&codeLanguePrestataire='+codeLanguePrestataire; + + donnees += '&nomResponsable='+nomResponsable+'&nomInterlocuteur='+nomInterlocuteur+'&telephoneFixe='+telephoneFixe; + + donnees += '&faxPrestataire='+faxPrestataire+'&telephonePortable='+telephonePortable+'&contactInterlocuteur='+contactInterlocuteur; + + + v_msg="Confirmez-vous ce nouveau prestataire?"; + v_msgEng="Do you confirm this new provider?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/creerprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_idPrestataire').html(data); + }, + complete: function() + { + idPrestataire = $("#idPrestataire").val(); + + retour_prestatairereseausoins(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function param_prestataire() +{ + window.location.assign($("#racineWeb" ).val()+"Prestataires/"); +} + +function retour_prestatairereseausoins() +{ + window.location.assign($("#racineWeb" ).val()+"Prestatairesreseau/"); +} + +function creer_user_prestataire() +{ + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + telephone = $("#telephone").val(); + email = $("#email").val(); + + codeLangue = $("#codeLangueUser").val(); + actVisible = $("#actVisibleUser").val(); + AffectionVisible = $("#AffectionVisible").val(); + + nvmdp = $("#nvmdp").val(); + cfnvmdp = $("#cfnvmdp").val(); + + codeModeGenerationPass = $("#codeModeGenerationPass").val(); + codeModeEnvoiPass = $("#codeModeEnvoiPass").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisible").focus(); + return; + } + + if ( (codeModeEnvoiPass=="1" || codeModeEnvoiPass=="2") && (telephone <=" ") ) + { + v_msg="Veuillez revoir le téléphone!"; + v_msgEng="Please review the phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + + if ( (codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") ) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass=="0") + { + if(nvmdp<=" ") + { + v_msg="Veuillez indiquer le mot de passe!"; + v_msgEng="Please enter the password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return; + } + + if(nvmdp != cfnvmdp) + { + v_msg="Veuillez confirmer votre mot de passe!"; + v_msgEng="Please confirm your password!"; + alert_ebene(v_msg, v_msgEng); + + $("#cfnvmdp").focus(); + return; + } + } + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass<=" ") + { + v_msg="Veuillez revoir le mode de génération!"; + v_msgEng="Please review the generation mode!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModeGenerationPass").focus(); + return; + } + + if(codeModeEnvoiPass<=" ") + { + v_msg="Veuillez revoir le mode envoi!"; + v_msgEng="Please review the sending mode!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModeEnvoiPass").focus(); + return; + } + + motPass = nvmdp; + donnees = 'nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email+'&motPass='+motPass; + donnees += '&codeLangue='+codeLangue+'&actVisible='+actVisible+'&AffectionVisible='+AffectionVisible; + donnees += '&codeModeGenerationPass='+codeModeGenerationPass; + donnees += '&codeModeEnvoiPass='+codeModeEnvoiPass; + + //alert(donnees); + //return; + + v_msg="Confirmez-vous ce nouvel utilisateur?"; + v_msgEng="Do you confirm this new user?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/creeruserprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + users_prestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function controle_new_pass() +{ + if ($("#nvmdp" ).val()<=' ') + { + v_msg="Veuillez saisir un mot de passe!"; + v_msgEng="Please enter a password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return false; + } + + longueur = $("#nvmdp").val().length; + + if(longueur>0 && longueur<6) + { + v_msg="6 caractères minimum exigé!"; + v_msgEng="6 characters minmum required!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return false; + } + + if ($("#cfnvmdp" ).val()!=$("#nvmdp" ).val()) + { + v_msg="Veuillez confirmer votre mot de passe!"; + v_msgEng="Please confirm your password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return false; + } +} + +// + +function desactiver_prestataire(codePrestataire) +{ + let motif = $("#motif").val(); + + if(motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codePrestataire="+codePrestataire; + donnees += "&motif="+motif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/desactiverprestataire/", + 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); + + historique_activation_prestataire(codePrestataire); + + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_prestataire(codePrestataire) +{ + let motif = $("#motif").val(); + + if(motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif").focus(); + return; + } + + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codePrestataire="+codePrestataire; + donnees += "&motif="+motif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/activerprestataire/", + 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); + + historique_activation_prestataire(codePrestataire); + + //retour_prestataire_id(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function demander_reglement() +{ + regle=$("#regle").val(); + regle = parseInt(regle); + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==1) + { + v_msg="Demande déjà effectuée!"; + v_msgEng="Request already made!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (regle==1) + { + v_msg="Déjà réglé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la demande de règlement?"; + v_msgEng="Do you confirm the request of payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/demanderreglement/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + consulterdecompte(); + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function demandesreglement() +{ + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxldemandesteglement/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function demandesreglement_export() +{ + $('#div_detail').html(""); + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxldemandesteglementexport/"; + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +// + +function initierdecompte_liste(codePrestataire, codeExercice, codeMois) +{ + donnees = 'codePrestataire='+codePrestataire+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/initierdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#inforegle").html(data); + }, + complete: function() { + regle=$("#regle").val(); + + if(regle==-1) + { + v_msg="Problème lors de l\'initialisation!"; + v_msgEng="Problem during initialization!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + else if(regle==0 || regle==2 || regle==3 || regle==8) + { + afficherdecompte(); + } + else + { + // 9 => Décompte validé mais en attente de règlemen + // 1 => Décompte réglé + consulterdecompte(); + } + } + }); +} + +function releve_compte_prestataire() +{ + codePrestataire = $("#codePrestataire").val(); + + if (codePrestataire>" ") + { + window.location.assign($("#racineWeb" ).val()+"Relevecompteprestaire/"); + } +} + +function detail_releve_compte_prestataire() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrelevecompteprestaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function detail_releve_compte_prestataire_export() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + var div_export = $('#div_detail'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrelevecompteprestaireexport/"; + + $.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 detail_releve_compte_prestataire_global() +{ + codePrestataire = $("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + detail_releve_compte_prestataire(); +} + +function detail_releve_compte_prestataire_export_global() +{ + codePrestataire = $("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + detail_releve_compte_prestataire_export(); +} + +function imprimer_demande_reglement_ff() +{ + fraisFuneraireDemande=$("#fraisFuneraireDemande_C").val(); + fraisFunerairePaye=$("#fraisFunerairePaye_C").val(); + + if (fraisFuneraireDemande!=1) + { + v_msg="Aucune demande en cours!"; + v_msgEng="No request in progress!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (fraisFunerairePaye==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + var div_export_demande_reglement = $('#div_export_demande_reglement'); + div_export_demande_reglement.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglementff/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function imprimer_releve_ff() +{ + fraisFuneraireDemande=$("#fraisFuneraireDemande_C").val(); + fraisFunerairePaye=$("#fraisFunerairePaye_C").val(); + + if (fraisFuneraireDemande!=1) + { + v_msg="Aucune demande en cours!"; + v_msgEng="No request in progress!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + var div_export_demande_reglement = $('#div_export_demande_reglement'); + div_export_demande_reglement.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglementff/imprimerreleve/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function enregistrer_dossier_classique() +{ + + + enVigueur=$("#enVigueur_C").val(); + codeEtatBeneficiaire=$("#codeEtatBeneficiaire_C").val(); + etatbeneficiaire=$("#etatbeneficiaire_C").val(); + + + + if (enVigueur!="1") + { + v_msg="Attention! cette personne n'est pas en vigueur"; + v_msgEng="Warning! This person is not in force"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + codePrestataire = $("#codePrestataire").val(); + if (codePrestataire<=" ") + { + v_msg="Veuillez indiquer le prestataire qui a consulté!"; + v_msgEng="Please indicate the provider who consulted!"; + alert_ebene(v_msg, v_msgEng); + + $("#button_popRecherchePrestataire").click(); + return; + } + + prestataireConsultation = $("#prestataireConsultation").val(); + if (prestataireConsultation<=" ") + { + v_msg="Veuillez indiquer le prestataire qui a consulté!"; + v_msgEng="Please indicate the provider who consulted!"; + alert_ebene(v_msg, v_msgEng); + + $("#prestataireConsultation").focus(); + return; + // $("#button_popRecherchePrestataire").click(); + } + + codeAffection = $("#codeAffection").val(); + if (codeAffection<=" ") + { + v_msg="Veuillez indiquer l'affection de l'assuré!"; + v_msgEng="Please indicate the insured person's condition!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeAffection").focus(); + return; + } + + + demandeur = $("#demandeur").val(); + codeLienDemandeur = $("#codeLienDemandeur").val(); + + beneficiaireReglement = $("#beneficiaireReglement").val(); + codeLienBeneficiaire = $("#codeLienBeneficiaire").val(); + + observations = $("#observations").val(); + + codeModePaiementDemande = $("#codeModePaiementDemande").val(); + codeBanqueBeneficiaire = $("#codeBanqueBeneficiaire").val(); + numeroCompteBeneficiaire = $("#numeroCompteBeneficiaire").val(); + + + if (demandeur<=" ") + { + v_msg="Veuillez saisir le nom du demandeur!"; + v_msgEng="Please enter the name of the payment requestor"; + alert_ebene(v_msg, v_msgEng); + + $("#demandeur").focus(); + return; + } + + if (codeLienDemandeur<=" ") + { + v_msg="Veuillez sélectionner le lien de parenté avec le demandeur!"; + v_msgEng="Please select the relationship with the requestor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienDemandeur").focus(); + return; + } + + dateConsultation=$("#dateConsultation").val(); + if (dateConsultation<=" ") + { + v_msg="Veuillez saisir la date de consultation de la facture!"; + v_msgEng="Please enter the invoice consultation date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateConsultation").focus(); + return; + } + + codeRaisonConsultation = $("#codeRaisonConsultation").val(); + + if (codeRaisonConsultation<=" ") + { + v_msg="Veuillez sélectionner une raison pour la consultation!"; + v_msgEng="Please select a reason for the consultation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRaisonConsultation").focus(); + return; + } + + hospitalisation = $("#hospitalisation").val(); + if (hospitalisation<=" ") + { + v_msg="Veuillez indiquer si hospitalisation ou pas!"; + v_msgEng="Please indicate whether hospitalization or not!"; + alert_ebene(v_msg, v_msgEng); + + $("#hospitalisation").focus(); + return; + } + + if (beneficiaireReglement<=" ") + { + v_msg="Veuillez saisir le nom du bénéficiaire du règlement!"; + v_msgEng="Please enter the name of the payee!"; + alert_ebene(v_msg, v_msgEng); + + $("#beneficiaireReglement").focus(); + return; + } + + if (codeLienBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner le lien avec le bénéficiaire du règlement!"; + v_msgEng="Please select the relationship with the payee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienBeneficiaire").focus(); + return; + } + + if (codeModePaiementDemande<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiementDemande").focus(); + return; + } + + if (codeModePaiementDemande=="VR") + { + if (codeBanqueBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner la banque du bénéficiaire!"; + v_msgEng="Please select the beneficiary\'s bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanqueBeneficiaire").focus(); + return; + } + + if (numeroCompteBeneficiaire<=" ") + { + v_msg="Veuillez saisir le No de compte du bénéficiaire!"; + v_msgEng="Please enter the beneficiary\'s account number"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroCompteBeneficiaire").focus(); + return; + } + } + + dateEffetPolice = $("#dateEffetPolice_C").val(); + dateEcheancePolice = $("#dateEcheancePolice_C").val(); + + dateEffetInitialPolice = $("#dateEffetInitialPolice_C").val(); + dateAvenantPolice = $("#dateAvenantPolice_C").val(); + + // var td0 = new Date(dateEffetPolice); + dateEntreeBeneficiaire = $("#dateEntreeBeneficiaire_C").val(); + + var td0 = $("#dateEntreeBeneficiaire").datepicker("getDate");//new Date(dateEntreeBeneficiaire); + var td1 = $("#dateConsultation").datepicker("getDate"); + var td2 = $("#datejourfr_C").datepicker("getDate"); + var td3 = $("#dateEcheancePolice").datepicker("getDate");//new Date(dateEcheancePolice); + + var td4 = $("#dateEffetInitialPolice").datepicker("getDate");//new Date(dateEffetInitialPolice); + var td5 = $("#dateAvenantPolice").datepicker("getDate");//new Date(dateAvenantPolice); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); + + dt4=Math.round(Date.parse(td4)/(1000*3600*24)); + dt5=Math.round(Date.parse(td5)/(1000*3600*24)); + + if (codeEtatBeneficiaire!="V") + { + if(codeEtatBeneficiaire=="SP"){ + if (!(dt1>=dt4 && dt1dt2) + { + v_msg="Veuillez revoir la date de consultation!"; + v_msgEng="Please review the date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateConsultation").focus(); + return; + } + + if (dt1>dt3 || dt1 { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'demandeur='+demandeur+'&codeLienDemandeur='+codeLienDemandeur; + donnees += '&beneficiaireReglement='+beneficiaireReglement+'&codeLienBeneficiaire='+codeLienBeneficiaire; + + donnees += '&codeModePaiementDemande='+codeModePaiementDemande; + donnees += '&codeBanqueBeneficiaire='+codeBanqueBeneficiaire+'&numeroCompteBeneficiaire='+numeroCompteBeneficiaire; + + donnees += '&prestataireConsultation=' +prestataireConsultation; + donnees += '&dateConsultation=' +dateConsultation; + donnees += '&codeRaisonConsultation=' +codeRaisonConsultation; + donnees += '&hospitalisation=' +hospitalisation; + donnees += '&observations=' +observations; + donnees += '&codePrestataire=' +codePrestataire; + donnees += '&codeAffection=' +codeAffection; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/enregistrerdossierclassique/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + + //$("#div_ajaxgabarit").html(data); + + + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + + }, + complete: function() { + afficher_dossier_classique(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function lister_dossiers_classiques(filtre) +{ + var libelle = ""; + + d1 = $("#d1").val(); + d2 = $("#d2").val(); + + codeLangue = $("#codeLangue").val(); + + + if(filtre=="0"){ + libelle = "Filtre tous"; + }else if(filtre=="1"){ + libelle = "Filtre assurés"; + }else if(filtre=="2"){ + libelle = "Filtre polices"; + } + + if(codeLangue=="en_US") + { + if(filtre=="0"){ + libelle = "Filter all"; + }else if(filtre=="1"){ + libelle = "Filter insured"; + }else if(filtre=="2"){ + libelle = "Insurance policy filter"; + } + + } + + $("#libelleFiltre").val(libelle); + $("#filtre").val(filtre); + + donnees = 'd1='+d1+'&d2='+d2+'&filtre='+filtre; + + $("#div_export_a").html(''); + + $("#div_dossiers").html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesclassiques/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); + +} + +function afficher_dossier_classique() +{ + window.location.assign($("#racineWeb" ).val()+"Dossierclassique/"); +} + +function consulter_dossier_classique(idDossierClassique) +{ + donnees = 'idDossierClassique='+idDossierClassique; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/getcontextbyid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + afficher_dossier_classique(); + } + }); +} + +function payerdossierclassique() +{ + 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; + } + + window.location.assign($("#racineWeb" ).val()+"Payerdossierclassique/"); +} + +function modifierdossierclassique() +{ + regle=$("#regle").val(); + + if (regle==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==1) + { + v_msg="Demande de règlement déjà effectuée!"; + v_msgEng="Request for payment already made!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Modifierdossierclassique/"); +} + +function imprimer_releve_dc() +{ + fraisRetenu=$("#fraisRetenu").val(); + + if (fraisRetenu<=0) + { + v_msg="Rien à imprimer!"; + v_msgEng="Nothing to print!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (appartient_a_un_bordereau_rbcl()) + { + v_msg="Fait partie d'un bordereau!"; + v_msgEng="Part of a slip!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + var div_export_demande_reglement = $('#div_export_demande_reglement'); + div_export_demande_reglement.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglementdc/imprimerreleve/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function imprimer_demande_reglement_dc() +{ + 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 à imprimer!"; + v_msgEng="Nothing to print!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + var div_export_demande_reglement = $('#div_export_demande_reglement'); + div_export_demande_reglement.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglementdc/", + type: 'POST', + success: function(data) + { + div_export_demande_reglement.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function enregistrermodificationsdossierclassique() +{ + + + enVigueur=$("#enVigueur_C").val(); + codeEtatBeneficiaire=$("#codeEtatBeneficiaire_C").val(); + etatbeneficiaire=$("#etatbeneficiaire_C").val(); + + if (enVigueur!="1") + { + v_msg="Attention! cette personne n'est pas en vigueur"; + v_msgEng="Warning! This person is not in force"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (codeEtatBeneficiaire!="V") + { + v_msg="Attention! "+etatbeneficiaire; + v_msgEng="Warning! "+etatbeneficiaire; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeur = $("#demandeur").val(); + codeLienDemandeur = $("#codeLienDemandeur").val(); + + beneficiaireReglement = $("#beneficiaireReglement").val(); + codeLienBeneficiaire = $("#codeLienBeneficiaire").val(); + + observations = $("#observations").val(); + + codeModePaiementDemande = $("#codeModePaiementDemande").val(); + codeBanqueBeneficiaire = $("#codeBanqueBeneficiaire").val(); + numeroCompteBeneficiaire = $("#numeroCompteBeneficiaire").val(); + + + if (demandeur<=" ") + { + v_msg="Veuillez saisir le nom du demandeur!"; + v_msgEng="Please enter the name of the payment requestor"; + alert_ebene(v_msg, v_msgEng); + + $("#demandeur").focus(); + return; + } + + if (codeLienDemandeur<=" ") + { + v_msg="Veuillez sélectionner le lien de parenté avec le demandeur!"; + v_msgEng="Please select the relationship with the requestor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienDemandeur").focus(); + return; + } + + prestataireConsultation = $("#prestataireConsultation").val(); + + if (prestataireConsultation<=" ") + { + v_msg="Veuillez indiquer le prestataire qui a consulté!"; + v_msgEng="Please indicate the provider who consulted!"; + alert_ebene(v_msg, v_msgEng); + + $("#prestataireConsultation").focus(); + return; + } + + dateConsultation=$("#dateConsultation").val(); + + if (dateConsultation<=" ") + { + v_msg="Veuillez saisir la date de la facture!"; + v_msgEng="Please enter the date of the invoice!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateConsultation").focus(); + return; + } + + codeRaisonConsultation = $("#codeRaisonConsultation").val(); + + if (codeRaisonConsultation<=" ") + { + v_msg="Veuillez sélectionner une raison pour la consultation!"; + v_msgEng="Please select a reason for the consultation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRaisonConsultation").focus(); + return; + } + + hospitalisation = $("#hospitalisation").val(); + if (hospitalisation<=" ") + { + v_msg="Veuillez indiquer si hospitalisation ou pas!"; + v_msgEng="Please indicate whether hospitalization or not!"; + alert_ebene(v_msg, v_msgEng); + + $("#hospitalisation").focus(); + return; + } + + if (beneficiaireReglement<=" ") + { + v_msg="Veuillez saisir le nom du bénéficiaire du règlement!"; + v_msgEng="Please enter the name of the payee!"; + alert_ebene(v_msg, v_msgEng); + + $("#beneficiaireReglement").focus(); + return; + } + + if (codeLienBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner le lien avec le bénéficiaire du règlement!"; + v_msgEng="Please select the relationship with the payee!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLienBeneficiaire").focus(); + return; + } + + if (codeModePaiementDemande<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiementDemande").focus(); + return; + } + + if (codeModePaiementDemande=="VR") + { + if (codeBanqueBeneficiaire<=" ") + { + v_msg="Veuillez sélectionner la banque du bénéficiaire!"; + v_msgEng="Please select the beneficiary\'s bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanqueBeneficiaire").focus(); + return; + } + + if (numeroCompteBeneficiaire<=" ") + { + v_msg="Veuillez saisir le No de compte du bénéficiaire!"; + v_msgEng="Please enter the beneficiary\'s account number"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroCompteBeneficiaire").focus(); + return; + } + } + + dateEffetPolice = $("#dateEffetPolice_C").val(); + dateEcheancePolice = $("#dateEcheancePolice_C").val(); + + dateEffetInitialPolice = $("#dateEffetInitialPolice_C").val(); + dateAvenantPolice = $("#dateAvenantPolice_C").val(); + + // var td0 = new Date(dateEffetPolice); + dateEntreeBeneficiaire= $("#dateEntreeBeneficiaire_C").val(); + + var td0 = $("#dateEntreeBeneficiaire").datepicker("getDate");//new Date(dateEntreeBeneficiaire); + var td1 = $("#dateConsultation").datepicker("getDate"); + var td2 = $("#datejourfr_C").datepicker("getDate"); + var td3 = $("#dateEcheancePolice").datepicker("getDate");//new Date(dateEcheancePolice); + + var td4 = $("#dateEffetInitialPolice").datepicker("getDate");//new Date(dateEffetInitialPolice); + var td5 = $("#dateAvenantPolice").datepicker("getDate");//new Date(dateAvenantPolice); + + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); + dt3=Math.round(Date.parse(td3)/(1000*3600*24)); + + dt4=Math.round(Date.parse(td4)/(1000*3600*24)); + dt5=Math.round(Date.parse(td5)/(1000*3600*24)); + + if (codeEtatBeneficiaire!="V") + { + if(codeEtatBeneficiaire=="SP"){ + if (!(dt1>=dt4 && dt1dt3 || dt1dt3) + { + v_msg="Attention! cette police n'est pas couverte à cette date!"; + v_msgEng="Warning! This insurance policy is not valid on this date!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous ces modificatons?"; + v_msgEng="Do you confirm these changes?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'demandeur='+demandeur+'&codeLienDemandeur='+codeLienDemandeur; + donnees += '&beneficiaireReglement='+beneficiaireReglement+'&codeLienBeneficiaire='+codeLienBeneficiaire; + + + donnees += '&codeModePaiementDemande='+codeModePaiementDemande; + donnees += '&codeBanqueBeneficiaire='+codeBanqueBeneficiaire+'&numeroCompteBeneficiaire='+numeroCompteBeneficiaire; + + donnees += '&prestataireConsultation=' +prestataireConsultation; + donnees += '&dateConsultation=' +dateConsultation; + donnees += '&codeRaisonConsultation=' +codeRaisonConsultation; + donnees += '&hospitalisation=' +hospitalisation; + donnees += '&observations=' +observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/enregistrermodificationsdossierclassique/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Modifications effectuées avec succès!"; + v_msgEng="Changes made successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + afficher_dossier_classique(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrerpaiementfraisfuneraire() +{ + idFraisfuneraire = $("#idFraisfuneraire").val(); + dateComptable = $("#dateComptable").val(); + montantPaye = $("#montantPaye").val(); + codeModePaiement = $("#codeModePaiement").val(); + referencePaiement = $("#referencePaiement").val(); + + codeBanquePayeur = $("#codeBanquePayeur").val(); + + if (codeModePaiement<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if (codeBanquePayeur<=" ") + { + v_msg="Veuillez sélectionner la banque de paiement!"; + v_msgEng="Please select the payment bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanquePayeur").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 (dateComptable<=" ") + { + v_msg="Veuillez saisir la date comptable!"; + v_msgEng="Please enter the posting date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateComptable").focus(); + return; + } + + if(montantPaye<=" ") + { + montantPaye = "0"; + } + + if(montantPaye==0) + { + v_msg="Veuillez revoir le montant!"; + v_msgEng="Please review the amount!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPaye").focus(); + + return; + } + + v_msg="Confirmez-vous ce paiement?"; + v_msgEng="Do you confirm this payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idFraisfuneraire='+idFraisfuneraire+'&codeModePaiement='+codeModePaiement; + donnees += '&referencePaiement='+referencePaiement+'&montantPaye='+montantPaye; + donnees += '&dateComptable='+dateComptable; + donnees += '&codeBanquePayeur='+codeBanquePayeur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxenregistrerdemandefraisfuneraire/enregistrerpaiementfraisfuneraire/", + 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); + }, + complete: function() { + fraisfuneraire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrer_paiement_dossier_classique() +{ + idDossierClassique = $("#idDossierClassique").val(); + dateComptable = $("#dateComptable").val(); + montantPaye = $("#montantPaye").val(); + codeModePaiement = $("#codeModePaiement").val(); + referencePaiement = $("#referencePaiement").val(); + + codeBanquePayeur = $("#codeBanquePayeur").val(); + + if (codeModePaiement<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if (codeBanquePayeur<=" ") + { + v_msg="Veuillez sélectionner la banque de paiement!"; + v_msgEng="Please select the payment bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanquePayeur").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 (dateComptable<=" ") + { + v_msg="Veuillez saisir la date comptable!"; + v_msgEng="Please enter the posting date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateComptable").focus(); + return; + } + + if(montantPaye<=" ") + { + montantPaye = "0"; + } + + if(montantPaye==0) + { + v_msg="Veuillez revoir le montant!"; + v_msgEng="Please review the amount!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPaye").focus(); + + return; + } + + v_msg="Confirmez-vous ce paiement?"; + v_msgEng="Do you confirm this payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idDossierClassique='+idDossierClassique+'&codeModePaiement='+codeModePaiement; + donnees += '&referencePaiement='+referencePaiement+'&montantPaye='+montantPaye; + donnees += '&dateComptable='+dateComptable; + donnees += '&codeBanquePayeur='+codeBanquePayeur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/enregistrerpaiementdossierclassique/", + 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); + }, + complete: function() { + afficher_dossier_classique(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function rechercher_dossier_classique(numeroDecompte, idBeneficiaire) +{ + donnees = "numeroDecompte="+numeroDecompte+"&idBeneficiaire="+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/getcontextbyidreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_dossier_classique(); + } + }); +} + +function rechercher_frais_funeraire(idReglement, idBeneficiaire) +{ + donnees = "idReglement="+idReglement+"&idBeneficiaire="+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfraisfuneraire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + fraisfuneraire(); + } + }); +} + +function demander_reglement_ff() +{ + fraisFuneraireDemande=$("#fraisFuneraireDemande_C").val(); + fraisFunerairePaye=$("#fraisFunerairePaye_C").val(); + + if (fraisFuneraireDemande!=1) + { + v_msg="Aucune demande en cours!"; + v_msgEng="No request in progress!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (fraisFunerairePaye==1) + { + v_msg="Déjà payé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + regle=$("#regle").val(); + regle = parseInt(regle); + + if (regle==1) + { + v_msg="Déjà réglé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==1) + { + v_msg="Demande de règlement déjà effectuée!"; + v_msgEng="Request for payment already made!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la demande de règlement?"; + v_msgEng="Do you confirm the request of payment?"; + + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + idFraisfuneraire = $("#idFraisfuneraire").val(); + donnees = 'idFraisfuneraire='+idFraisfuneraire; + + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxenregistrerdemandefraisfuneraire/demanderreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Demande de Règlement effectuée avec succès!"; + v_msgEng="Request of payment successfully completed!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + fraisfuneraire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function demander_reglement_dc() +{ + fraisRetenu=$("#fraisRetenu").val(); + if (fraisRetenu<=0) + { + v_msg="Rien à régler!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + regle=$("#regle").val(); + regle = parseInt(regle); + + if (regle==1) + { + v_msg="Déjà réglé!"; + v_msgEng="Already paid!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + demandeReglement=$("#demandeReglement").val(); + demandeReglement = parseInt(demandeReglement); + + if (demandeReglement==1) + { + v_msg="Demande de règlement déjà effectuée!"; + v_msgEng="Request for payment already made!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (appartient_a_un_bordereau_rbcl()) + { + v_msg="Fait partie d'un bordereau!"; + v_msgEng="Part of a slip!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous la demande de règlement?"; + v_msgEng="Do you confirm the request of payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + idDossierClassique = $("#idDossierClassique").val(); + donnees = 'idDossierClassique='+idDossierClassique; + + $("#detail_reglement").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/demanderreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + v_msg="Demande de Règlement effectuée avec succès!"; + v_msgEng="Request of payment successfully completed!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() { + afficher_dossier_classique(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function initierdecompte_liste_cpt(codePrestataire, codeExercice, codeMois) +{ + donnees = 'codePrestataire='+codePrestataire+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/initierdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + consulterdecompte_cpt(); + } + }); +} + +// +function consulterdecompte_cpt() +{ + var div_wait = $('#detail_reglement'); + div_wait.html('
' + '
'); + + window.location.assign($("#racineWeb" ).val()+"Decomptecpt/"); +} + +function initierpaimentdecompte() +{ + v_msg="Confirmez-vous l\'initiaition d\'un nouveau paiement?"; + v_msgEng="Do you confirm the initiation of a new payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementdecompte/initierpaimentdecompte/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + paiement_decompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function paiement_decompte() +{ + window.location.assign($("#racineWeb" ).val()+"Paiementdecompte/"); +} + +function consulterpaiements() +{ + window.location.assign($("#racineWeb" ).val()+"Consulterpaiementdecompte/"); +} + + +function imprimer_detail_paiement_decompte() +{ + $('#div_export_b').html(""); + $("#btn_pop_imprimer_detail_pdc").click(); +} + +function ajaxchangercompsantepaiement_decompte() +{ + $("#div_detail_paiement_decompte").html(''); + + codeComposante=$("#codeComposante").val(); + + if(codeComposante<=" ") + { + v_msg="Veuillez sélectionner une compsante!"; + v_msgEng="Please select a compsante!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeComposante").focus(); + return; + } + + donnees = 'codeComposante='+codeComposante; + + if(codeComposante=="DP") + { + // DP => Décomptes à payer + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/"; + + $("#div_detail_paiement_decompte").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); + } + else + { + // DNP => Décomptes non payés + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/"; + + $("#div_detail_paiement_decompte").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); + } +} + +function lister_paiement_decompte() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + valide=$("#valide").val(); + + donnees = 'debut='+debut+'&fin='+fin+'&valide='+valide; + + // alert(donnees); + // return; + + $("#div_detail_paiement_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementdecompte/listerpaiementdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + }, + complete: function() { + } + }); +} + +function get_contexte_paiement_decompte(idPaiementDecompte) +{ + donnees = 'idPaiementDecompte='+idPaiementDecompte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementdecompte/getcontextbyid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + } + }); +} + +function conulter_paiement_decompte() +{ + window.location.assign($("#racineWeb" ).val()+"Paiementdecomptecons/"); +} + +function get_contexte_paiement_decompte_et_afficher(idPaiementDecompte, valide) +{ + donnees = 'idPaiementDecompte='+idPaiementDecompte+'&valide='+valide; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementdecompte/getcontextbyid/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + if(valide=="1") + { + conulter_paiement_decompte(); + } + else + { + paiement_decompte(); + } + } + }); +} + +function recharger_paiement_decompte_non_sel() +{ + $("#div_detail_paiement_decompte").html(''); + + $("#div_detail_paiement_decompte").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/"; + + + $.ajax({ + url: v_url, + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + + +function selectionner_paiement_decompte_non_sel_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_paiement_decompte_non_sel(); + + } + }); +} + +function reafficher_paiement_decompte_non_sel() +{ + $("#div_detail_paiement_decompte").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function selectionner_paiement_decompte_non_sel(idDecompteTemp, choix) +{ + donnees = 'idDecompteTemp='+idDecompteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(ErrorData) { + }, + complete: function() { + } + }); +} + +// + +function anomaliesdecomptes() +{ + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxanomaliesdecomptes/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function anomaliesdecomptes_export() +{ + $('#div_detail').html(""); + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxanomaliesdecomptesexport/"; + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + + +function valider_selection_paiement_decompte_non_sel() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptenonsel/validerselection/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_paiementdecompte").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + /* + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + */ + + reafficher_paiement_decompte_non_sel(); + } + }); +} + +function recharger_paiement_decompte_sel() +{ + $("#div_detail_paiement_decompte").html(''); + + $("#div_detail_paiement_decompte").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/"; + + + $.ajax({ + url: v_url, + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function reafficher_paiement_decompte_sel() +{ + $("#div_detail_paiement_decompte").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_paiement_decompte").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function selectionner_paiement_decompte_sel_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_paiement_decompte_sel(); + + } + }); +} + +function selectionner_paiement_decompte_sel(idDecompteTemp, choix) +{ + donnees = 'idDecompteTemp='+idDecompteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function valider_selection_paiement_decompte_sel() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxpaiementdecomptesel/validerselection/"; + + $.ajax({ + url: v_url, + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_paiementdecompte").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + /* + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + */ + reafficher_paiement_decompte_sel(); + } + }); +} + +function paiement_decompte_courant() +{ + idPaiementDecompte_courant=$("#idPaiementDecompte_C").val(); + + if(idPaiementDecompte_courant==0) + { + v_msg="Veuillez sélectionner un paiement!"; + v_msgEng="Please select a payment!"; + alert_ebene(v_msg, v_msgEng); + + consulterpaiements(); + + return; + } + + paiement_decompte(); + +} + +// + +function valider_paiement_decompte() +{ + valide=$("#valide").val(); + montantApayer=$("#montantApayer").val(); + + if (valide==1) + { + v_msg="Déjà Validé!"; + v_msgEng="Already validated!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(montantApayer<=" ") + { + montantApayer = "0"; + } + + if(montantApayer==0) + { + v_msg="Rien à valider!"; + v_msgEng="Nothing to validate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Validerpaiementdecompte/"); +} + +function demandesreglement_cpt() +{ + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxldemandesteglementcpt/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function rechercher_frais_funeraire_cpt(idReglement, idBeneficiaire) +{ + donnees = "idReglement="+idReglement+"&idBeneficiaire="+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfraisfuneraire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + fraisfuneraire_cpt(); + } + }); +} + +function fraisfuneraire_cpt() +{ + window.location.assign($("#racineWeb" ).val()+"Fraisfunerairecpt/"); +} + +function rechercher_dossier_classique_cpt(numeroDecompte, idBeneficiaire) +{ + donnees = "numeroDecompte="+numeroDecompte+"&idBeneficiaire="+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossierclassique/getcontextbyidreglement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_dossier_classique_cpt(); + } + }); +} + +function afficher_dossier_classique_cpt() +{ + window.location.assign($("#racineWeb" ).val()+"Dossierclassiquecpt/"); +} + +function enregistrer_valider_paiement_decompte() +{ + valide=$("#valide").val(); + montantApayer=$("#montantApayer").val(); + + if (valide==1) + { + v_msg="Déjà Validé!"; + v_msgEng="Already validated!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idPaiementDecompte = $("#idPaiementDecompte").val(); + dateComptable = $("#dateComptable").val(); + montantPaye = $("#montantPaye").val(); + codeModePaiement = $("#codeModePaiement").val(); + referencePaiement = $("#referencePaiement").val(); + + codeBanquePayeur = $("#codeBanquePayeur").val(); + + if (codeModePaiement<=" ") + { + v_msg="Veuillez sélectionner le mode de paiement!"; + v_msgEng="Please select the payment method!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModePaiement").focus(); + return; + } + + if (codeBanquePayeur<=" ") + { + v_msg="Veuillez sélectionner la banque de paiement!"; + v_msgEng="Please select the payment bank!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeBanquePayeur").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 (dateComptable<=" ") + { + v_msg="Veuillez saisir la date comptable!"; + v_msgEng="Please enter the posting date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateComptable").focus(); + return; + } + + if(montantPaye<=" ") + { + montantPaye = "0"; + } + + if(montantPaye==0) + { + v_msg="Rien à régler!"; + v_msgEng="Nothing to pay!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ce règelement?"; + v_msgEng="Do you confirm this payment?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idPaiementDecompte='+idPaiementDecompte+'&codeModePaiement='+codeModePaiement; + donnees += '&referencePaiement='+referencePaiement+'&montantPaye='+montantPaye; + donnees += '&dateComptable='+dateComptable; + donnees += '&codeBanquePayeur='+codeBanquePayeur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxpaiementdecompte/enregistrervaliderpaiementdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + conulter_paiement_decompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function imprimer_detail_paiement_decompte_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpaiementdecomptepdf/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function imprimer_detail_paiement_decompte_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpaiementdecomptexls/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function en_attente_demandesreglement() +{ + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxattentedemandesteglement/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function en_attente_demandesreglement_export() +{ + $('#div_detail').html(""); + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxattentedemandesteglementexport/"; + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function rattrapage_reception_facture_decompte() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/initrattrapagereceptionfactureprestataire/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_rattrapage_reception").html(data); + $(".datepicker" ).datepicker(); + }, + complete: function() { + $('#btn_pop_rattrapage_reception').click(); + } + }); + + +} + +function maj_rattrapage_reception_facture_decompte() +{ + dateReception = $("#dateReception_pop_rattrapage").val(); + montantPrestataire = $("#montantPrestataire_pop_rattrapage").val(); + + + if(dateReception<=" ") + { + v_msg="Veuillez indicquer la date de réception!"; + v_msgEng="Please enter the date of receipt!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateReception_pop_rattrapage").focus(); + return; + } + + if (montantPrestataire<=" ") + { + montantPrestataire = "0"; + } + + montantPrestataire = montantPrestataire.replace(" ", ""); + montantPrestataire = parseInt(montantPrestataire); + + if (montantPrestataire=="0") + { + v_msg="Veuillez indicquer le montant de la facture du prestataire!"; + v_msgEng="Please enter the invoice amount of the service provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire_pop_rattrapage").focus(); + return; + } + + motif=$("#motif_rattrapage").val(); + + if (motif<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#motif_rattrapage").focus(); + return; + } + + donnees = 'dateReception='+dateReception+'&montantPrestataire='+montantPrestataire+'&motif='+motif; + + 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()+"Ajaxdecompte/rattrapagereceptionfactureprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $("#close_pop_rattrapage_reception").click(); + $('#reglement').html(data); + + }, + error: function(erreur) { + }, + complete: function() { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); +} + +// Etats MUGABO + +function propositions_paiement_prestataire() +{ + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxemandesreglementsglobal/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function propositions_paiement_prestataire_export() +{ + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + var div_export = $('#div_detail'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxemandesreglementsglobalexport/"; + + $.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 imprimerdecompteprestataireaccord() +{ + idReglement = $("#idReglement").val(); + + if (idReglement>"0") + { + var div_wait = $('#div_wait'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/imprimerdecompteprestataireaccord", + type: 'POST', + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } +} + +function chercher_facture(idFacture) +{ + + $("#div_facture_detail").html(''); + + $("#div_consulter_facture").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_consulter_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfacturefeuillemaladie() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/feuillemaladie/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfactureprestationactes() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/prestationactes/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfacturemedicaments() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/medicaments/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulter_facture_pop(idFacture) +{ + + $("#div_facture_detail").html(''); + + $("#div_consulter_facture_pop").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_consulter_facture_pop").html(data); + }, + error: function(data) { + }, + complete: function() { + $('#btn_pop_consulter_facture').click(); + } + }); +} + +function consulterfacturefeuillemaladie_pop() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/feuillemaladie/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfactureprestationactes_pop() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/prestationactes/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + $(".datepicker" ).datepicker(); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajax_maj_dateprestation(idPrestation, datePrestation) +{ + idFacture = $("#idFacture").val(); + + donnees = 'idFacture='+idFacture; + donnees += '&idPrestation='+idPrestation; + donnees += '&datePrestation='+datePrestation; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/majdateprestation/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + $(".datepicker" ).datepicker(); + + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfacturemedicaments_pop() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/medicaments/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ged_decompte_gc(idFacture) +{ + numeroDecompte = $("#numeroDecompte").val(); + + if (idFacture>"0") + { + donnees = 'numeroDecompte='+numeroDecompte+'&idFacture='+idFacture; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgedfacturegc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + $("#btn_pop_ged").click(); + } + }); + } +} + +function valider_ged_decompte_gc() +{ + idFacture = $("#idFactureGed").val(); + v_url = $("#racineWeb").val()+"Ajaxgedfacturegc/chargerged"; + + donnees = ""; + + donnees = new FormData($("#ajax_form_upload")[0]); + + $.ajax({ + type: "POST", + url: v_url, + data: donnees, + contentType: false, + cache: false, + processData :false, + + success: function(message){ + alert(message); + $("#btn_close_pop_ged_facture").click(); + }, + error: function(errorData){ + }, + complete: function() { + } + }); +} + +function consulterfactureged_pop() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/geds/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function reafficher_ged_facture(idFacture) +{ + if (idFacture>"0") + { + donnees = 'idFacture='+idFacture; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgedfacture/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ged").html(data); + }, + complete: function() { + } + }); + } +} + +function valider_ged_facture() +{ + idFacture = $("#idFactureGed").val(); + v_url = $("#racineWeb").val()+"Ajaxgedfacture/chargerged"; + + donnees = ""; + + donnees = new FormData($("#ajax_form_upload")[0]); + + $.ajax({ + type: "POST", + url: v_url, + data: donnees, + contentType: false, + cache: false, + processData :false, + + success: function(message){ + alert(message); + }, + error: function(errorData){ + }, + complete: function() { + // reafficher_ged_facture(idFacture); + } + }); +} + +function consulterfactureged() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/geds/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +// factures GC cumulées +function requetes_factures_gc_cumul() +{ + $('#div_export_a').html(""); + + 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); + + $("#codeGcAssureur").focus(); + return; + } + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + $("#div_detail_requete").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefacturegccumul/"; + + $.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()); + } + }); +} + +function requetes_factures_gc_cumul_export() +{ + 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); + + $("#codeGcAssureur").focus(); + return; + } + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefacturegccumulexport/"; + + $.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 liste_ententeprealables_opt() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablesopt/"); +} + +function listeententeprealablesopt() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesopt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function consulter_ententeprealable_opt_2(idDemandeententeprealable) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterententeprealablesopt/"+idDemandeententeprealable+"/"); +} + +function demandesreglement_filtre() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxldemandesteglementfiltre/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + + +function demandesreglement_filtre_export() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + var div_export = $('#div_detail'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxldemandesteglementfiltreexport/"; + + $.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 demandesreglement_filtre_cpt() +{ + codePrestataire = $("#codePrestataire").val(); + + codeExercice1 = $("#codeExercice1").val(); + codeMois1 = $("#codeMois1").val(); + + codeExercice2 = $("#codeExercice2").val(); + codeMois2 = $("#codeMois2").val(); + + if (codeMois1<=" ") + { + v_msg="Veuillez sélectionner le mois de départ!"; + v_msgEng="Please select the month of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois1").focus(); + return; + } + + if (codeExercice1<=" ") + { + v_msg="Veuillez sélectionner exercice de départ!"; + v_msgEng="Please select the exercise of start!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice1").focus(); + return; + } + + if (codeMois2<=" ") + { + v_msg="Veuillez sélectionner le mois de fin!"; + v_msgEng="Please select the month of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois2").focus(); + return; + } + + if (codeExercice2<=" ") + { + v_msg="Veuillez sélectionner exercice de fin!"; + v_msgEng="Please select the exercise of end!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice2").focus(); + return; + } + + codePerdiode1 = codeExercice1+codeMois1; + + codePerdiode2 = codeExercice2+codeMois2; + + donnees = 'codePrestataire='+codePrestataire+'&codePerdiode1='+codePerdiode1+'&codePerdiode2='+codePerdiode2; + + $("#div_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxldemandesteglementcpt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function accepter_ententeprealable_opt(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Accepterententeprealablesopt/"+idDemandeententeprealable+"/"); +} + +function refuser_ententeprealable_opt(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Refuserententeprealablesopt/"+idDemandeententeprealable+"/"); +} + +// +function enregistreraccordententepreslable_opt() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").val(); + motifReel = $("#motifReel").val(); + //prixAccorde = $("#prixAccorde").val(); + + if (motifReel == undefined || motifReel == "" || motifReel<=" ") + { + motifReel = "BON POUR ACCORD"; + } + + + 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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel; + //donnees +='&prixAccorde='+prixAccorde; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='accordententeprealableopt'; + typeSms = "accordententeprealableopt"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistreraccordententeprealableopt/", + 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); + + liste_ententeprealables_opt(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// +function enregistrerrefusententepreslable_opt() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel+'&motifRefusAssure='+motifRefusAssure; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='refusententeprealableopt'; + typeSms="refusententeprealableopt"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistrerrefusententeprealableopt/", + 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); + + liste_ententeprealables_opt(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function liste_ententeprealables_mont() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablesmont/"); +} + +function listeententeprealablesmont() +{ + codeReponseEntentePrealable=$("#codeReponseEntentePrealable").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'codeReponseEntentePrealable='+codeReponseEntentePrealable; + donnees += '&debut='+debut+'&fin='+fin; + + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesmont/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function consulter_ententeprealable_mont_2(idDemandeententeprealable) +{ + window.location.assign($("#racineWeb" ).val()+"Consulterententeprealablesmont/"+idDemandeententeprealable+"/"); +} + +function accepter_ententeprealable_mont(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Accepterententeprealablesmont/"+idDemandeententeprealable+"/"); +} + + +function enregistreraccordententepreslable_mont() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").val(); + motifReel = $("#motifReel").val(); + prixAccorde = $("#prixAccorde").val(); + + if (motifReel<=" ") + { + v_msg="Veuillez saisir le motif!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifReel").focus(); + return; + } + + prixAccorde=prixAccorde.replace(",","."); + $("#prixAccorde").val(prixAccorde); + + if(isNaN(prixAccorde)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixAccorde").val("0"); + $("#prixAccorde").focus(); + return; + } + + if(prixAccorde==0) + { + $("#prixAccorde").focus(); + v_msg="Veuillez saisir le prix!"; + v_msgEng="Please enter the price!"; + alert_ebene(v_msg, v_msgEng); + + 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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel+'&prixAccorde='+prixAccorde; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='accordententeprealablemont'; + typeSms = "accordententeprealablemont"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistreraccordententeprealablemont/", + 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); + + liste_ententeprealables_mont(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function refuser_ententeprealable_mont(idDemandeententeprealable, facture) +{ + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + window.location.assign($("#racineWeb" ).val()+"Refuserententeprealablesmont/"+idDemandeententeprealable+"/"); +} + + +function enregistrerrefusententepreslable_mont() +{ + idDemandeententeprealable = $("#idDemandeententeprealable").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 = 'idDemandeententeprealable='+idDemandeententeprealable+'&motifReel='+motifReel+'&motifRefusAssure='+motifRefusAssure; + donnees += '&codePrestataire='+codePrestataire; + + donnees_sav = donnees; + typeMail='refusententeprealablemont'; + typeSms="refusententeprealablemont"; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/enregistrerrefusententeprealablemont/", + 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); + + liste_ententeprealables_mont(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function histsupprempreinte() +{ + $("#div_detail_suppr_empreinte").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_detail_suppr_empreinte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprempreinte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail_suppr_empreinte").html(data); + }, + complete: function() { + } + }); +} + +function histsupprempreinte_export() +{ + $("#div_detail_suppr_empreinte").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + donnees_retour = ""; + + $("#div_detail_suppr_empreinte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprempreinteexport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_suppr_empreinte").html(donnees_retour); + } + }); +} + +function liste_ententeprealables_pha() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealablespha/"); +} + +function exporter_modele_assure() +{ + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_liste_assures'); + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/exportermodele/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function init_importer_modele_assure() +{ + 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'); + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/initimportermodele/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + $(".datepicker" ).datepicker(); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function init_importer_modele_assure_importation() +{ + 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'); + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/initimportermodeleimportation/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + $(".datepicker" ).datepicker(); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + + + + +function traiter_lignes_importees() +{ + 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()+"Listeimportassure/"); +} + + +function afficher_une_ligne_importee(idBeneficiairemodel) +{ +} + + +function exclure_ligne_assure_importee(idBeneficiairemodel, exclure) +{ + donnees = 'idBeneficiairemodel='+idBeneficiairemodel+'&exclure='+exclure; + + v_url = $("#racineWeb").val()+"Ajaximporterlisteassure/exclureligneimportee/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function calculer_prime_inmportation() +{ + 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()+"Ajaximporterlisteassure/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()+"Listeimportassure/"); + } + }); + } else { + // L'utilisateur a annulé + // console.log("Confirmation refusée"); + } + }); + +} + +function charger_fichier_modele_assure() +{ + $('#div_exporter_liste_assures').html(""); + + $('#div_form_upload').show(); + + // return; +} + + +function afficher_adherent_importee() +{ + 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()+"Ajaximporterlisteassure/afficheradherentimportee/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function retirer_un_adherent_importe_college(idBeneficiairemodel) +{ + donnees = 'idBeneficiairemodel='+idBeneficiairemodel; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/retirerunadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee(); + } + }); +} + +function ajouter_un_adherent_importe_college(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()+"Ajaximporterlisteassure/ajouterunadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee(); + } + }); +} + +function incorporer_assures_inmportes() +{ + 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()+"Ajaximporterlisteassure/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_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + +function ajouter_tous_adherent_importe_college() +{ + 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()+"Ajaximporterlisteassure/ajoutertousadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_sans_college_adherent_importe_college() +{ + 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()+"Ajaximporterlisteassure/ajoutersanscollegeadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function retirer_tous_adherent_importe_college() +{ + 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()+"Ajaximporterlisteassure/retirertousadherentaucollege/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_adherent_importee(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function maj_etape_3_import_assures() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterlisteassure/majetape/", + type: 'POST', + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + window.location.assign($("#racineWeb" ).val()+"Listeimportassure/"); + } + }); +} + +function retour_tarifs_medicaments() +{ + window.location.assign($("#racineWeb" ).val()+"Tarifsmedicaments/"); +} + +function creer_tarif_medicaments() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'libelle='+libelle+'&libelleEng='+libelleEng; + + v_msg="Confirmez-vous ce nouveau tarif?"; + v_msgEng="Do you confirm this new rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveautarifmedicament/creertarifmedicaments/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + //$('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_tarifs_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_tarif_medicaments(idTarif) +{ + window.location.assign($("#racineWeb" ).val()+"Modifiertarifmedicament/"+idTarif+"/"); +} + +function enregistrer_modif_tarif_medicaments() +{ + idTarif = $("#idTarif").val(); + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'idTarif='+idTarif+'&libelle='+libelle+'&libelleEng='+libelleEng; + + 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()+"Ajaxnouveautarifmedicament/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function lister_tarif_medicaments() +{ + window.location.assign($("#racineWeb" ).val()+"Listetarifmedicament/"); +} + +function supprimer_tarif_medicaments(idTarif) +{ + 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()+"Ajaxnouveautarifmedicament/supprimer/", + type : 'post', + data: "idTarif="+idTarif, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function importer_tarif_medicaments(idTarif) +{ + adminSin=$("#adminSin").val(); + + if (adminSin!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + donnees = 'idTarif='+idTarif; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/initimport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Importertarifmedicament/"); + } + }); +} + + +function exporter_modele_tarif_medicament() +{ + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_tarif'); + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifmedicament/exportermodele/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + } + }); +} + +function charger_fichier_modele_tarif_medicament() +{ + $('#div_exporter_tarif').html(""); + + $('#div_form_upload').show(); + + // return; +} + +function importer_modele_tarif_medicament() +{ + etape2=$("#etape2").val(); + + if (etape2 != "1") + { + v_msg="Etape 2 incomplète!"; + v_msgEng="Incomplete step 2!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + idTarif=$("#idTarif").val(); + codeTarifMedicament=$("#codeTarifMedicament").val(); + cheminFichier=$("#cheminFichier").val(); + + donnees = 'idTarif='+idTarif+'&codeTarifMedicament='+codeTarifMedicament+'&cheminFichier='+cheminFichier; + + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_tarif'); + + div_export.html('
' + '
'); + + $("#div_erreur_excel").html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifmedicament/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_medicaments(); + } + } + }); +} + + +function ajax_maj_plafond_famille_temp(plafond) +{ + + donnees = "plafond="+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/majplafondfamille/", + type: 'POST', + data: donnees, + success: function(data) { + + }, + error: function(data) { + + }, + complete: function() { + enregistrer_college_temp(); + } + }); + +} + + +function ajax_maj_plafond_individu_temp(plafond) +{ + + donnees = "plafond="+plafond; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/majplafondindividu/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_prime_categorie").html(data); + }, + error: function(data) { + + }, + complete: function() { + enregistrer_college_temp(); + } + }); + +} + +function change_categorie_college_temp() +{ + + + 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()+"Ajaxprimescategorie/", + type: 'POST', + data: donnees, + success: function(data) + { + // + $("#div_prime_categorie").html(data); + + enregistrer_college_temp(); + recapitulercollege(); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + + } + }); +} + +function affiche_garanties_par_statut() +{ + 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()+"Ajaxgarantiescollege/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_garanties_status").html(data); + + + }, + complete: function(data) + { + enregistrer_college_temp(); + } + }); +} + + + +function changer_lien_parente_college_temp() +{ + codeLienParente = $("#codeLienParente").val(); + idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val(); + + if($('#codeLienParente').val()<=" ") + { + v_msg="Veuillez revoir le statut!"; + v_msgEng="Please review the status"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').focus(); + return; + } + + if($('#idBaremePriseEnCharge').val()<=" ") + { + v_msg="Vous devez selectionner un barème afin d'afficher les garanties."; + v_msgEng="You must a scale in order to display the guarantees."; + alert_ebene(v_msg, v_msgEng); + + $('#idBaremePriseEnCharge').focus(); + return; + } + + donnees = 'codeLienParente='+codeLienParente; + + $("#div_garanties_status").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_garanties_status").html(data); + + + }, + complete: function(data) + { + enregistrer_college_temp(); + } + }); +} + +function affiche_particularite_statut(){ + enregistrer_college_temp(); + + 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_particularite_status").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/", + type: 'POST', + data: donnees, + success: function(data) + { + + $("#div_particularite_status").html(data); + + }, + complete: function(data) + { + + } + }); + + +} + + +function particularite_lien_parente_college_temp() +{ + + enregistrer_college_temp(); + + 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; + + //alert(donnees); + //return; + $("#div_particularite_status").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/", + type: 'POST', + data: donnees, + success: function(data) + { + + $("#div_particularite_status").html(data); + + }, + complete: function(data) + { + + } + }); +} + + +function traiter_medicaments_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()+"Listeimporttarifmedicament/"); +} + + +function maj_etape_3_import_medicaments() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + + donnees = 'codeTarifMedicament='+codeTarifMedicament; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifmedicament/majetape/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + window.location.assign($("#racineWeb" ).val()+"Listeimporttarifmedicament/"); + } + }); +} + +function retour_importer_tarif_medicaments() +{ + idTarif=$("#idTarif").val(); + + importer_tarif_medicaments(idTarif); +} + +function incorporer_medicaments_inmportes() +{ + nb_ligne_med=$("#nb_ligne_med").val(); + + if (nb_ligne_med==0) + { + v_msg="Rien à importer!"; + v_msgEng="Nothing to import!"; + 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_medicament_importe'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximportertarifmedicament/incorporermedicamentsimportes/", + type: 'POST', + // data: donnees, + success: function(data) { + + }, + error: function(data) { + + }, + complete: function() { + lister_tarif_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function controle_bornes_primes() +{ + primeFamille = $("#primeFamille").val(); + primeMin = $("#primeMin").val(); + primeMax = $("#primeMax").val(); + + + primeFamille = parseInt(primeFamille); + primeMin = parseInt(primeMin); + primeMax = parseInt(primeMax); + + if((primeMin>0) && (primeFamille0) && (primeFamille>primeMax)) + { + v_msg="Attention, prime maximum catégorie => " + primeMax.toLocaleString(); + v_msgEng="Warning, premium maximum category => " + primeMax.toLocaleString(); + alert_ebene(v_msg, v_msgEng); + + return; + } + +} + +function modifier_produit(idProduit) +{ + window.location.assign($("#racineWeb" ).val()+"Modifierproduit/"+idProduit+"/"); +} + +function supprimer_produit(idProduit) +{ + 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()+"Ajaxnouveauproduit/supprimer/", + type : 'post', + data: "idProduit="+idProduit, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_liste_produits(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_produit() +{ + codeProduit = $("#codeProduit").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + + codeModecalculPrime = $("#codeModecalculPrime").val(); + + codeEnteteTrancheAge = $("#codeEnteteTrancheAge").val(); + + if(codeEnteteTrancheAge==undefined) + { + codeEnteteTrancheAge = ""; + } + + if(codeProduit==undefined) + { + codeProduit=""; + } + + libelle = $("#libelle").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom du produit!"; + v_msgEng="Please enter the product name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + donnees = 'codeProduit='+codeProduit+'&libelle='+libelle+'&codeGcAssureur='+codeGcAssureur; + + plafondAdherent = $("#plafondAdherent").val(); + plafondAdherent = plafondAdherent.replace(/ /g,""); + plafondAdherent = parseInt(plafondAdherent.replace(",","."),10); + + /* Ne pas rendre la plfond adherent obligatoire + if(plafondAdherent==0) + { + v_msg="Le plafond Adhérent est obligatoire!"; + v_msgEng="The Member cap is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#plafondAdherent").focus(); + return; + } + */ + + codeEtatProduit = $("#codeEtatProduit").val(); + + donnees += '&plafondAdherent='+plafondAdherent; + donnees += '&codeEtatProduit='+codeEtatProduit; + donnees += '&codeModecalculPrime='+codeModecalculPrime; + + donnees += '&codeEnteteTrancheAge='+codeEnteteTrancheAge; + + //alert(donnees); + //return; + + v_msg="Confirmez-vous cet nouveau produit?"; + v_msgEng="Do you confirm this new category?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveauproduit/creerproduit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + retour_liste_produits(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_liste_produits() +{ + window.location.assign($("#racineWeb" ).val()+"Produits/"); +} + +function enregistrer_modif_produit() +{ + idProduit = $("#idProduit").val(); + + libelle = $("#libelle").val(); + + codeGcAssureur = $("#codeGcAssureur").val(); + + codeModecalculPrime = $("#codeModecalculPrime").val(); + + codeEnteteTrancheAge = $("#codeEnteteTrancheAge").val(); + if(codeEnteteTrancheAge==undefined) + { + codeEnteteTrancheAge = ""; + } + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le libellé!"; + v_msgEng="Please enter the label!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + + donnees = 'idProduit='+idProduit+'&libelle='+libelle+'&codeGcAssureur='+codeGcAssureur; + + codeProduit = $("#codeProduit").val(); + + + plafondAdherent = $("#plafondAdherent").val(); + plafondAdherent = plafondAdherent.replace(/ /g,""); + plafondAdherent = parseInt(plafondAdherent.replace(",","."),10); + + /* Ne pas rendre plafondAdherent obligatoire + if(plafondAdherent==0) + { + v_msg="Le plafond Adhérent est obligatoire!"; + v_msgEng="The Member cap is mandatory!"; + alert_ebene(v_msg, v_msgEng); + + $("#plafondAdherent").focus(); + return; + } + */ + + codeEtatProduit = $("#codeEtatProduit").val(); + + + donnees += '&codeProduit='+codeProduit; + donnees += '&plafondAdherent='+plafondAdherent; + donnees += '&codeEtatProduit='+codeEtatProduit; + donnees += '&codeModecalculPrime='+codeModecalculPrime; + + donnees += '&codeEnteteTrancheAge='+codeEnteteTrancheAge; + + 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()+"Ajaxnouveauproduit/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_liste_produits(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_reseau(idReseau) +{ + window.location.assign($("#racineWeb" ).val()+"Modifierreseausoins/"+idReseau+"/"); +} + +function supprimer_reseau(idReseau) +{ + 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()+"Ajaxnouveaureseau/supprimer/", + type : 'post', + data: "idReseau="+idReseau, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_liste_reseaus(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_reseau() +{ + codeReseau = $("#codeReseau").val(); + + if(codeReseau==undefined) + { + codeReseau=""; + } + + libelle = $("#libelle").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le libellé!"; + v_msgEng="Please enter the label!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + donnees = 'codeReseau='+codeReseau+'&libelle='+libelle; + + //tm = $("#tm").val(); + + tm = "0"; + + donnees += '&tm='+tm; + + v_msg="Confirmez-vous ce nouveau réseau de soins?"; + v_msgEng="Do you confirm this new healthcare network?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveaureseau/creerreseau/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + retour_liste_reseaus(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_liste_reseaus() +{ + window.location.assign($("#racineWeb" ).val()+"Reseausoins/"); +} + +function enregistrer_modif_reseaus() +{ + idReseau = $("#idReseau").val(); + + libelle = $("#libelle").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le libellé!"; + v_msgEng="Please enter the label!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + donnees = 'idReseau='+idReseau+'&libelle='+libelle; + + tm = $("#tm").val(); + + donnees += '&tm='+tm; + + 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()+"Ajaxnouveaureseau/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_liste_reseaus(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_reseau_categorie() +{ + + + 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_produitreseau').html(""); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + var div_attente = $('#div_produitreseau'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/afficherreseaucategorie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + + }, + complete: function() { + } + }); +} + +function ajouter_tous_reseaus_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + v_msg="Attention, cela va rendre tous les réseaux accessibles pour cet produit! Confirmez-vous?"; + v_msgEng="Be careful, this will make all networks accessible for this product! Do you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/ajoutertousreseauproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_reseau_categorie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_reseau_produit(codeReseau) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeReseau='+codeReseau; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/ajouterunreseauproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_reseau_categorie(); + } + }); +} + +function retirer_tous_reseau_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + v_msg="Attention, cela va vider cette produit! Confirmez-vous?"; + v_msgEng="Be careful, this will empty this category! Do you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/retirertousreseauproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_reseau_categorie(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function maj_tm_produit_reseau(codeReseau, tm) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeReseau='+codeReseau+"&tm="+tm; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/majtm/", + type: 'POST', + data: donnees, + success: function(data) { + }, + complete: function(data) + { + } + }); +} + +function retirer_un_reseau_produit(codeReseau) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeReseau='+codeReseau; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxproduitreseau/retirerunreseauproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_reseau_categorie(); + } + }); +} + +function afficher_facturation_police() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + idAvenant = $('#idAvenant').val(); + + if(idAvenant==""){ + idAvenant=0; + } + + donnees = 'debut='+debut+'&fin='+fin+'&idAvenant='+idAvenant; + + //alert(donnees); + //return; + $("#div_page_complet").html('
' + '
'); + // + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/afficher_detail_facturation_prime", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_page_complet").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function select_tous_beneficiaire_a_facturer(p_choix) +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + idAvenant = $("#idAvenant").val(); + + donnees = 'choix='+p_choix+'&debut='+debut+'&fin='+fin+'&idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/selectionnertoutlignesafacturer/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_facturation_police(); + } + }); +} + +function select_beneficiaire_a_facturer(p_choix, idBeneficiairePrimeTemp) +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + idAvenant = $("#idAvenant").val(); + + donnees = 'idBeneficiairePrimeTemp='+idBeneficiairePrimeTemp; + donnees += '&choix='+p_choix+'&debut='+debut+'&fin='+fin; + donnees += '&idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/selectionner/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_entete_prime_a_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +//FACTURE POLICE +//SELECT D'UN AVENANT +function select_avenant_a_facturer(p_choix, id) +{ + // alert('p_choix: '+p_choix); + // alert('id: '+id); + donnees = 'id='+id; + donnees += '&choix='+p_choix; + + + // debugger + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/selectionavenant/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + affichertoutfacturationprime(); + } + }); +} + +function lister_avenants_a_facturer() +{ + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#avenant_a_facturer").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/listeravenantafacturer/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + affichertoutfacturationprime(); + } + }); +} + + +function ajax_maj_accessoire_facture_prime(controle,p_accessoire, id) +{ + // p_accessoire=p_accessoire.replace(",","."); + controle.value=p_accessoire; + + if(controle_numerique(controle)) + { + donnees = 'id='+id; + donnees += '&accessoire='+p_accessoire; + + + // debugger + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majAccessoirePrime/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_entete_prime_a_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); + } +} + +function ajax_maj_accessoire_facture_prime_garant(controle,p_accessoire, id) +{ + // p_accessoire=p_accessoire.replace(",","."); + controle.value=p_accessoire; + + if(controle_numerique(controle)) + { + donnees = 'id='+id; + donnees += '&accessoire='+p_accessoire; + + + // debugger + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majAccessoirePrimeGarant/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_entete_prime_a_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + affichertoutfacturationprime(); + } + }); + } +} + + +function ajax_maj_accessoire_facture_prime_gestionnaire(controle,p_accessoire, id) +{ + // p_accessoire=p_accessoire.replace(",","."); + controle.value=p_accessoire; + + if(controle_numerique(controle)) + { + donnees = 'id='+id; + donnees += '&accessoire='+p_accessoire; + + + // debugger + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majAccessoirePrimeGestionnaire/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_entete_prime_a_facture").html(data); + }, + error: function(data) { + }, + complete: function() { + affichertoutfacturationprime(); + + } + }); + } +} + +function afficher_facturation_police_prime() +{ + // debut=$("#debut").val(); + // fin=$("#fin").val(); + // idAvenant = $('#idAvenant').val(); + + // if(idAvenant==""){ + // idAvenant=0; + // } + + // donnees = 'debut='+debut+'&fin='+fin+'&idAvenant='+idAvenant; + + //alert(donnees); + //return; + $("#div_page_complet").html('
' + '
'); + // + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/afficherdetailfacturationprime/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_page_complet").html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function select_tous_beneficiaire_a_facturer_prime(p_choix) +{ + + donnees = 'choix='+p_choix; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/selectionnertoutlignesafacturerprime/", + type: 'POST', + data: donnees, + success: function(data) { + // alert(data); + }, + error: function(data) { + }, + complete: function() { + afficher_facturation_police_prime(); + } + }); +} + + +//FIN + +function lancer_facturation_police() +{ + nblignes_a_facturer=$("#nblignes_a_facturer").val(); + + if (nblignes_a_facturer=="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to charge!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette sélection?"; + v_msgEng="Do you confirm this selection?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + + $("#div_bouton_selection").html(""); + $("#div_detail_prime_a_facture").html(""); + + $("#div_echeancier").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/initecheancierfacturation/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error: function(data) + { + }, + complete: function() { + afficherecheancierfacturation_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function lancer_facturation_police_prime() +{ + nblignes_a_facturer=$("#nblignes_a_facturer").val(); + + if (nblignes_a_facturer=="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to charge!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette sélection?"; + v_msgEng="Do you confirm this selection?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_bouton_selection").html(""); + $("#div_detail_prime_a_facture").html(""); + + $("#div_echeancier").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/initecheancierfacturationprime/", + + type: 'POST', + data: donnees, + success: function(data) + { + }, + error: function(data) + { + }, + complete: function() { + afficherecheancierfacturation_temp(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// +function ajax_init_echancier_temp() +{ + $("#div_echeancier_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/getnbecheancier/", + type : 'post', + data: "codeTypeEcheancier="+$("#codeTypeEcheancier").val(), + error: function(errorData) { + }, + success: function(data) { + $("#infonbEcheance").html(data); + }, + complete: function() { + $("#nbEcheance").val( $("#nbEcheance_info").val()); + ajax_maj_echancier_temp(); + } + }); +} + +function ajax_maj_echancier_temp() +{ + codeTypeEcheancier = $("#codeTypeEcheancier").val(); + nbEcheance = $("#nbEcheance").val(); + tauxInteret = $("#tauxInteret").val(); + + donnees = "codeTypeEcheancier="+codeTypeEcheancier+"&nbEcheance="+nbEcheance+"&tauxInteret="+tauxInteret; + + $("#div_echeancier_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majecheancier/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + }, + complete: function() { + afficherecheancierfacturation_temp(); + } + }); +} + +function ajax_maj_date_echancier_temp(idEcheancier, datePaiement) +{ + donnees = "idEcheancier="+idEcheancier+"&datePaiement="+datePaiement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majdatepaiement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + }, + complete: function() + { + } + }); +} + +function ajax_maj_taux_echancier_temp(idEcheancier, tauxEcheance) +{ + nbEcheance = $("#nbEcheance").val(); + + donnees = "idEcheancier="+idEcheancier+"&tauxEcheance="+tauxEcheance+"&nbEcheance="+nbEcheance; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majtauxecheance/", + type : 'post', + data: donnees, + error: function(errorData) + { + }, + success: function(data) + { + }, + complete: function() + { + afficherecheancierfacturation_temp(); + } + }); +} + +function ajax_maj_lib_echancier_temp(idEcheancier, libelleEcheance) +{ + donnees = "idEcheancier="+idEcheancier+"&libelleEcheance="+libelleEcheance; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majlibelle/", + type : 'post', + data: donnees, + error: function(errorData) + { + }, + success: function(data) + { + }, + complete: function() + { + } + }); +} + +function valider_facturation_police() +{ + debugger + dateemission=$("#dateemission").val(); + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin+'&dateemission='+dateemission; + + v_msg="Confirmez-vous cet échéancier?"; + v_msgEng="Do you confirm this payment schedule?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + v_msg="Facturation terminée avec succès!"; + v_msgEng="Billing successfully completed!"; + alert_ebene(v_msg, v_msgEng); + + afficher_police_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function valider_facturation_police_prime() +{ + // debugger + dateemission=$("#dateemission").val(); + + donnees = 'dateemission='+dateemission; + + v_msg="Confirmez-vous cet échéancier?"; + v_msgEng="Do you confirm this payment schedule?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/enregistrerprime/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + v_msg="Facturation terminée avec succès!"; + v_msgEng="Billing successfully completed!"; + alert_ebene(v_msg, v_msgEng); + + afficher_police_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficherecheancierfacturation_temp() +{ + $("#div_echeancier_detail").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/afficherecheancierfacturation/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_page_complet").html(""); + $("#div_filtre_avenant_prime").html(""); + + $("#div_echeancier").html(data); + //caher avenants + + + + + }, + complete: function() + { + $(".datepicker" ).datepicker(); + } + }); +} + +// 29/03/2019 +function requetes_factures_verif_gc() +{ + $('#div_export_a').html(""); + + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + $("#div_detail_requete").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefactureverifgc/"; + + $.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()); + } + }); +} + +function requetes_factures_gc_verif_export() +{ + $('#div_export_a').html(""); + 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); + + $("#codeGcAssureur").focus(); + return; + } + + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxrequetefactureverifgcexport/"; + + $.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); + } + }); +} + +// 31/03/2019 => Rapport SP par police dans un meme exercice + +function etat_rapport_sp_exercice() +{ + $('#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()); + } + }); +} + + +function etat_rapport_sp_exercice_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 afficher_detail_stat_police_exercice(idPolice, debutSinistre, finSinistre) +{ + $('#div_export_b').html(""); + $("#idPolice").val(idPolice); + $("#debutSinistre").val(debutSinistre); + $("#finSinistre").val(finSinistre); + /* + $("#emailRapport").val(emailRapport); + $("#emailRapport_0").val(emailRapport); + */ + $("#btn_pop_detail").click(); +} + +function charger_detail_stat_police_facture_exercice_pdf() +{ + $('#div_export_b').html(""); + + idPolice = $("#idPolice").val(); + debutSinistre = $("#debutSinistre").val(); + finSinistre = $("#finSinistre").val(); + + donnees = "idPolice="+idPolice+"&debutSinistre="+debutSinistre+"&finSinistre="+finSinistre; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureexercicepdf/", + 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_police_facture_exercice() +{ + $('#div_export_b').html(""); + + idPolice = $("#idPolice").val(); + debutSinistre = $("#debutSinistre").val(); + finSinistre = $("#finSinistre").val(); + + donnees = "idPolice="+idPolice+"&debutSinistre="+debutSinistre+"&finSinistre="+finSinistre; + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailrapportspfactureexercice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function sinistres_a_prime_police() +{ + $("#div_detail_sp").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsppolice/police/", + type: 'POST', + success: function(data) { + $("#div_detail_sp").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function sinistres_a_prime_categorie() +{ + $("#div_detail_sp").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsppolice/categorie/", + type: 'POST', + success: function(data) { + $("#div_detail_sp").html(data); + }, + error: function(data) { + }, + complete: function() { + return; + } + }); +} + +function sinistres_a_prime_college() +{ + $("#div_detail_sp").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsppolice/college/", + type: 'POST', + success: function(data) { + $("#div_detail_sp").html(data); + }, + error: function(data) { + }, + complete: function() { + return; + } + }); +} + +function maj_libelle_college() +{ + libelleCollege = $("#libelleCollege").val(); + + $("#btn_pop_lib_college").click(); +} + +function enregistrer_maj_libelle_college() +{ + libelleCollege = $("#libelleCollege").val(); + nouvLibelleCollege = $("#nouvLibelleCollege").val(); + + if(libelleCollege==nouvLibelleCollege) + { + v_msg="Aucune modification!!"; + v_msgEng="No modification!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(nouvLibelleCollege<=" ") + { + v_msg="Veuillez saisir le nouveau libellé!"; + v_msgEng="Please enter the new label!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette modification?"; + v_msgEng="Do you confirm this change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "nouvLibelleCollege="+nouvLibelleCollege; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmajlibellecollege/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#libelleCollege").val(nouvLibelleCollege); + $("#ancLibelleCollege").val(nouvLibelleCollege); + }, + complete: function() + { + $("#btn_actualiser_college").click(); + $("#btn_close_pop_maj_libelle").click(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// 06/04/2019 +function changer_langue() +{ + codeLangue = $("#codeLangue").val(); + + v_msg="Attention, vous serez déconnecté! Confirmez-vous le changement de langue?"; + v_msgEng="Attention, you will be logged out! Do you confirm the language change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxchangerlangue/changerlangue/", + type : 'post', + // data: donnees, + error: function(errorData) + { + }, + success: function(data) + { + // $("#div_test_gabarit").html(data); + }, + complete: function() + { + window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function envoyersms(p_destinataires, p_message, creation_message) +{ + if(creation_message=="1") + { + envoyer_messagerie(p_message, "0"); + } + + envoismsactif = $("#envoismsactif").val(); + if(envoismsactif=="0") + { + return; + } + + if(p_destinataires.length<5) + { + return; + } + + fournisseurSms = $("#fournisseurSms").val(); + + if (fournisseurSms<=" ") + { + v_msg="Fournisseur de SMS non défini!"; + v_msgEng="SMS provider not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if(fournisseurSms=="esicia") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="blive") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="hooza") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="skysms") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="satelcom") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="noah") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="nerhysms") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="emisms") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="erling") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="ovh") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="afriksms") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + if(fournisseurSms=="ekotech") + { + ajouter_sms_attente(p_destinataires, p_message); + return; + } + else + { + v_msg=fournisseurSms+" => Fournisseur de SMS inconnu!"; + v_msgEng=fournisseurSms+" => Unknown SMS Provider!"; + alert_ebene(v_msg, v_msgEng); + return; + } + +} + + +function ajouter_sms_attente(p_destinataires, p_message) +{ + donnees = "destinataires="+p_destinataires+"&message="+p_message; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsmsattente/ajouter/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error: function(errdata) + { + }, + complete: function() + { + } + }); +} + +function ajouter_sms_attente_singleton(p_destinataires, p_message) +{ + donnees = "destinataires="+p_destinataires+"&message="+p_message; + + var addr = p_destinataires.split(","); + + addr.forEach(function(element) + { + p_dest = element; + + if(p_dest.length>4) + { + donnees = "destinataires="+p_dest+"&message="+p_message; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsmsattente/ajouter/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); + } + else + { + v_msg=p_dest+" => Mauvais format!"; + v_msgEng=p_dest+" => wrong phone format!"; + alert_ebene(v_msg, v_msgEng); + } + }); +} + +// 2ème fonction à mettre à jour +function tester_disponibiliter_sms() +{ + 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 = ""; + + fournisseurSms = $("#fournisseurSms").val(); + + if (fournisseurSms<=" ") + { + v_msg="Fournisseur de SMS non défini!"; + v_msgEng="SMS provider not defined!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + if(fournisseurSms=="esicia") + { + p_message = "Fournisseur : esicia "; + } + else + if(fournisseurSms=="blive") + { + p_message = "Fournisseur : blive "; + } + else + if(fournisseurSms=="hooza") + { + p_message = "Fournisseur : hooza "; + } + else + if(fournisseurSms=="skysms") + { + p_message = "Fournisseur : skysms "; + } + else + if(fournisseurSms=="satelcom") + { + p_message = "Fournisseur : satelcom "; + } + else + if(fournisseurSms=="noah") + { + p_message = "Fournisseur : noah "; + } + else + if(fournisseurSms=="nerhysms") + { + p_message = "Fournisseur : nerhysms "; + } + else + if(fournisseurSms=="emisms") + { + p_message = "Fournisseur : emisms "; + } + else + if(fournisseurSms=="erling") + { + p_message = "Fournisseur : erling "; + } + else + if(fournisseurSms=="ovh") + { + p_message = "Fournisseur : ovh "; + } + else + if(fournisseurSms=="afriksms") + { + p_message = "Fournisseur : afriksms"; + } + else + if(fournisseurSms=="ekotech") + { + p_message = "Fournisseur : ekotech"; + } + else + { + v_msg=fournisseurSms+" => Fournisseur de SMS inconnu!"; + v_msgEng=fournisseurSms+" => Unknown SMS Provider!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = "destinataires="+p_destinataires+"&message="+p_message+"&fournisseurSms="+fournisseurSms; + + alert(donnees); + + $("#div_test_gabarit").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxtesterdisponiblitesms/envoyerlesms/", + 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() + { + /* + v_msg="Opération terminée avec succès!"; + v_msgEng="Operation completed successfully!"; + alert_ebene(v_msg, v_msgEng); + */ + } + }); +} + +function ajouter_destinataire_sms_adherent(p_destinataires) +{ + envoismsactif = $("#envoismsactif").val(); + if(envoismsactif=="0") + { + return p_destinataires; + } + + smsAssure = $("#smsAssure").val(); + if(smsAssure=="0") + { + return p_destinataires; + } + + tel_adh = $("#telephonePortableAdherent").val(); + + if(tel_adh.length>4) + { + return p_destinataires+","+tel_adh; + } + + return p_destinataires; +} + +function ajouter_mail_attente(emailAdherent, p_objet_email_adh, p_messageemail_adh) +{ + donnees = "email="+emailAdherent+"&objet="+p_objet_email_adh+"&message="+p_messageemail_adh; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsmailadhattente/ajouter/", + type: 'POST', + data: donnees, + success: function(data) + { + }, + error: function(errdata) + { + }, + complete: function() + { + } + }); +} + +function maj_acess_facturation() +{ + alert("maj_acess_facturation"); + return; +} + +function maj_cartes_facturation() +{ + nv_access=$("#nv_access").val(); + if(isNaN(nv_access)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#nv_access").val("0"); + $("#nv_access").focus(); + return; + } + + if(nv_access<"0") + { + v_msg="Veuillez saisir une valeur!"; + v_msgEng="Please enter a value!"; + alert_ebene(v_msg, v_msgEng); + + $("#nv_access").val("0"); + $("#nv_access").focus(); + return; + } + + if(nv_access==0) + { + v_msg="Attention! Confirmez-vous les accessoires à zéro?"; + v_msgEng="Warning! Do you confirm the accessories at zero?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + console.log("Confirmation confirmée"); + } else { + // L'utilisateur a annulé + + $("#nv_access").focus(); + return; + } + }); + + + } + + debut=$("#debut").val(); + fin=$("#fin").val(); + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Reset the counts. Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'fraisCarte='+nv_access+'&debut='+debut+'&fin='+fin; + + $("#div_page_complet").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majaccessoiresfacturation/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#btn_close_pmaj_access").click(); + }, + error: function(data) { + }, + complete: function() { + afficher_facturation_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function maj_prime_base_facturation() +{ + 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); + + $("#idCollege").focus(); + + return; + } + + old_primeNette=$("#old_primeNette").val(); + if(isNaN(old_primeNette)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#old_primeNette").val("0"); + $("#old_primeNette").focus(); + return; + } + + if(old_primeNette<"0") + { + v_msg="Veuillez saisir une valeur!"; + v_msgEng="Please enter a value!"; + alert_ebene(v_msg, v_msgEng); + + $("#old_primeNette").val("0"); + $("#old_primeNette").focus(); + return; + } + + + if(old_primeNette==0) + { + v_msg="Attention! Confirmez-vous la mise à jour des anciennes primes nulles?"; + v_msgEng="Warning! Do you confirm the update of old zero premium?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + console.log("Confirmation confirmée"); + } else { + // L'utilisateur a annulé + + $("#old_primeNette").focus(); + return; + } + }); + } + + // + + nv_primeNette=$("#nv_primeNette").val(); + if(isNaN(nv_primeNette)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#nv_primeNette").val("0"); + $("#nv_primeNette").focus(); + return; + } + + if(nv_primeNette<"0") + { + v_msg="Veuillez saisir une valeur!"; + v_msgEng="Please enter a value!"; + alert_ebene(v_msg, v_msgEng); + + $("#nv_primeNette").val("0"); + $("#nv_primeNette").focus(); + return; + } + + if(nv_primeNette==0) + { + v_msg="Attention! Confirmez-vous les primes à zéro?"; + v_msgEng="Warning! Do you confirm the premium at zero?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + console.log("Confirmation"); + } else { + // L'utilisateur a annulé + + $("#nv_primeNette").focus(); + return; + } + }); + } + + if(nv_primeNette==old_primeNette) + { + v_msg="Veuillez revoir vos primes!"; + v_msgEng="Please review your premiums!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + debut=$("#debut").val(); + fin=$("#fin").val(); + + v_msg="Confirmez-vous cette opération?"; + v_msgEng="Reset the counts. Do you confirm this operation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idCollege='+idCollege+'&old_primeNette='+old_primeNette+'&nv_primeNette='+nv_primeNette+'&debut='+debut+'&fin='+fin; + + $("#div_page_complet").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturerpolice/majprimesfacturation/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#btn_close_pmaj_prime").click(); + }, + error: function(data) { + }, + complete: function() { + afficher_facturation_police(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function desactiver_click_droit() +{ + if (document.addEventListener) { + document.addEventListener('contextmenu', function (e) { + e.preventDefault(); + }, false); + } else { + document.attachEvent('oncontextmenu', function () { + window.event.returnValue = false; + }); + } +} + +function requetes_factures(p_chrono) +{ + + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"/"; + + + codeGcAssureur = $("#codeGcAssureur").val(); + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + idPolice = $("#idPolice").val(); + + donnees += 'codeGcAssureur=' + codeGcAssureur; + donnees += '&codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + donnees += '&chrono=' + p_chrono; + donnees += '&idPolice=' + idPolice; + + + $("#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()); + } + }); +} + + +function requetes_factures_export() +{ + $('#div_export_a').html(""); + donnees = ""; + donnees_retour = ""; + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + v_url = $("#racineWeb").val()+"Ajaxrequete"+codeRequete+"export/"; + + codePrestataire = $("#codePrestataire").val(); + dateFacture1 = $("#dateFacture1").val(); + dateFacture2 = $("#dateFacture2").val(); + + donnees += 'codePrestataire=' + codePrestataire; + donnees += '&dateFacture1=' + dateFacture1; + donnees += '&dateFacture2=' + dateFacture2; + + 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 ajouter_tous_medecins_prestataire() +{ + codePrestataire=$("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codePrestataire='+codePrestataire; + + v_msg="Attention, cela va associer tous les praticiens disponibles à ce prestataire! Confirmez le vous?"; + v_msgEng="Please note, this will associate all available practitioners with this service provider! Do you confirm it?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_medecins_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinsprestataire/ajoutertousmedecinsprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_medecins_prestataire').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function retirer_tous_medecins_prestataire() +{ + codePrestataire=$("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codePrestataire='+codePrestataire; + + v_msg="Attention, cela va vider ce prestataire de tous ses médecins! Confirmez-vous?"; + v_msgEng="Be careful, this will empty this provider of all its doctors! Do you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_medecins_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinsprestataire/retirertousmedecinsprestataire/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_medecins_prestataire').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function specialite_contextuelle_medecin(codeMedecin, nomMedecin, codeMetier, codeSpecialite, specialite, codePrestataire){ + + + nomPrestataire = $("#nomPrestataire").val(); + + donnees = "codeMedecin="+codeMedecin+"&nomMedecin="+nomMedecin+"&codeMetier="+codeMetier+"&codeSpecialite="+codeSpecialite+"&specialite="+specialite+"&codePrestataire="+codePrestataire; + //alert(donnees); + //return; + $('#div_ajouter_praticien').empty(); + $('#div_modifier_praticien').empty(); + + if (codeMetier == "MED") + { + v_msg="Si Oui, le médecin sera associé avec la spécialité "+specialite+" sinon vous pourrez la changer ou annuler l'association."; + v_msgEng="If Yes, the doctor will be associated with the specialty "+specialite+" otherwise you can change it or cancel the association."; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + ajouter_un_medecin_prestataire(codeMedecin, codeSpecialite, codePrestataire); + } else { + // L'utilisateur a annulé + donnees = "codeSpecialite="+codeSpecialite+"&codeMedecin="+codeMedecin+"&codePrestataire="+codePrestataire; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxspecialitecontextuelle/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + //alert(data); + //return; + $('#div_specialite_praticien').html(data); + $(".selectpicker").selectpicker(); + $('#div_specialite_praticien').modal("show"); + $('#div_specialite_praticien').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeSpecialite').focus(); + }); + + }, + complete: function() { + + } + }); + } + }); + + } else{ + + ajouter_un_medecin_prestataire(codeMedecin, codeSpecialite, codePrestataire); + } + + +} + +function medecin_specialite_prestataire(codeMedecin, codePrestataire){ + + codeSpecialite=$("#codeSpecialite").val(); + + if (codeSpecialite<=" ") + { + v_msg="Veuillez sélectionner une spécialité!"; + v_msgEng="Please select a specialty!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + ajouter_un_medecin_prestataire(codeMedecin, codeSpecialite, codePrestataire); + + $("#div_specialite_praticien .close").click(); + +} + + +function ajouter_un_medecin_prestataire(codeMedecin, codeSpecialite, codePrestataire) +{ + //codePrestataire=$("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codePrestataire='+codePrestataire+'&codeMedecin='+codeMedecin+"&codeSpecialite="+codeSpecialite; + + $("#div_medecins_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinsprestataire/ajouterunmedecinprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_medecins_prestataire').html(data); + appliquerDataTable(); + + valid = $("#valid").val(); + + if(valid == "0"){ + v_msg="Association impossible! Le praticien et sa spécialité existe déjà!"; + v_msgEng="Impossible association! The practitioner and his specialty already exist!"; + + alert_ebene(v_msg, v_msgEng); + + return; + } + + }, + error: function(data) { + }, + complete: function() + { + majmedecinsprestataire(); + + } + }); +} + +function majmedecinsprestataire() +{ + window.location.assign($("#racineWeb" ).val()+"Majmedecinsprestataire/"); + +} + +function retirer_un_medecin_prestataire(codeMedecin) +{ + codePrestataire=$("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous le retrait de ce praticien?"; + v_msgEng="Do you confirm the withdrawal of this practitioner?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'codePrestataire='+codePrestataire+'&codeMedecin='+codeMedecin; + + $("#div_medecins_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinsprestataire/retirerunmedecinprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_medecins_prestataire').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + majmedecinsprestataire(); + } + }); + + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function enregistrer_new_notes() +{ + notesNew = $("#notesNew").val(); + notesNew = notesNew.trim(); + + if (notesNew<=" ") + { + v_msg="Veuillez saisir la note!"; + v_msgEng="Please enter the note!"; + alert_ebene(v_msg, v_msgEng); + + $("#notesNew").focus(); + return; + } + + donnees = 'notesNew='+notesNew; + + v_msg="Confirmez-vous cette note?"; + v_msgEng="Do you confirm this note?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/creernote/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#btn_pop_note_new_quit").click(); + }, + complete: function() { + afficher_notes_feuille(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_notes_feuille() +{ + $("#div_notes").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_notes").html(donnees_retour); + } + }); +} + +function initiernotesfeuille() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotesfeuillemaladie/nouvellenote/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_note_new").html(data); + }, + complete: function() { + $("#btn_pop_note_new").click(); + } + }); +} + + +function afficher_medecins_prestataire() +{ + codePrestataire=$("#codePrestataire").val(); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codePrestataire='+codePrestataire; + + $("#div_medecins_prestataire").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinsprestataire/ajouterunmedecinprestataire/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_medecins_prestataire').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); +} + + +function initier_gc_frais_gestion() +{ + codeGcAssureur=$("#codeGcAssureur").val(); + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").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 (codeExercice<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice").focus(); + return; + } + + if (codeMois<=" ") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMois").focus(); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + var div_wait = $('#div_liste_entete_gc_frais_gestion'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/initiergcfraisgestion/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#inforegle").html(data); + }, + complete: function() + { + regle=$("#regle").val(); + + if(regle==-1) + { + v_msg="Problème lors de l\'initialisation!"; + v_msgEng="Problem during initialization!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + else if(regle==0) + { + affichergcfraisgestion(); + } + else + { + consultergcfraisgestion(); + } + } + }); +} + +function affichergcfraisgestion() +{ + window.location.assign($("#racineWeb" ).val()+"Gcfraisgestion/"); +} + +function re_affichergcfraisgestion() +{ + $("#detail_reglement").html('
' + '
'); + + affichergcfraisgestion(); +} + +function rechargergcfraisgestion() +{ + $("#div_detail_fraisgestion").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/rechargergcfraisgestion/", + type : 'post', + error: function(errorData) { + }, + success: function(data) + { + $("#div_detail_fraisgestion").html(''); + + v_msg="Rechargement terminé avec succès!"; + v_msgEng="Reloading completed successfully!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + afficher_detail_gcfraisgestion(); + } + }); +} + +function consultergcfraisgestion() +{ +} + +function afficher_detail_gcfraisgestion() +{ + var div_wait = $('#div_detail_fraisgestion'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/affichergcfraisgestion/", + type : 'post', + error: function(errorData) { + }, + success: function(data) + { + $("#div_fraisgestion").html(data); + }, + complete: function() + { + } + }); +} + +function cumul_gc_frais_gestion_par_client() +{ + var div_wait = $('#div_detail_fraisgestion'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/affichergcfraisgestioncumul/", + type : 'post', + error: function(errorData) { + }, + success: function(data) + { + $("#div_fraisgestion").html(data); + }, + complete: function() + { + } + }); +} + +function lister_entete_gc_frais_gestion() +{ + codeGcAssureur=$("#codeGcAssureur").val(); + codeExercice=$("#codeExercice").val(); + codeMois=$("#codeMois").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 (codeExercice<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice").focus(); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeExercice='+codeExercice; + + var div_wait = $('#div_liste_entete_gc_frais_gestion'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/listeentetegcfraisgestion/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + div_wait.html(data); + }, + complete: function() + { + } + }); +} + +function initier_gc_frais_gestion_sel(codeMois, regle) +{ + codeGcAssureur=$("#codeGcAssureur").val(); + codeExercice=$("#codeExercice").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 (codeExercice<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeExercice").focus(); + return; + } + + if (codeMois<=" ") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeExercice='+codeExercice+'&codeMois='+codeMois; + + var div_wait = $('#div_liste_entete_gc_frais_gestion'); + div_wait.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcfraisgestion/initiergcfraisgestion/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + }, + complete: function() + { + if(regle==0) + { + affichergcfraisgestion(); + } + else + { + consultergcfraisgestion(); + } + } + }); +} + +function recharger_frais_gestion_gc_non_sel() +{ + $("#detail_facture").html(''); + + codeGcAssureur = $("#codeGcAssureur").val(); + + donnees = 'codeGcAssureur=' + codeGcAssureur; + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function reafficher_frais_gestion_gc_non_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function valider_selection_frais_gestion_gc() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_frais_gestion_gc_non_sel(); + } + }); +} + +function selectionner_frais_gestion_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_frais_gestion_gc_non_sel(); + } + }); +} + + +function selectionner_frais_gestion_gc(idCarteTemp, choix) +{ + donnees = 'idCarteTemp='+idCarteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcnonsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function recharger_frais_gestion_gc_sel() +{ + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/"; + + $("#detail_facture").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + } + }); +} + +function reafficher_frais_gestion_gc_sel() +{ + $("#detail_facture").html(''); + + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/reafficher/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#detail_facture").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function valider_selection_frais_gestion_gc_sel() +{ + $("#detail_facture").html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/validerselection"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement_gc").html(data); + // $(".datepicker" ).datepicker(); + }, + complete: function() { + $("#detail_facture").html(''); + + v_msg="Validation terminée avec succès!"; + v_msgEng="Validation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + reafficher_frais_gestion_gc_sel(); + } + }); +} + +function selectionner_frais_gestion_sel_gc(idCarteTemp, choix) +{ + donnees = 'idCarteTemp='+idCarteTemp+'&choix='+choix; + + if(choix==0) + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/deselectionner/"; + } + else + { + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/selectionner/"; + } + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function selectionner_frais_gestion_sel_gc_tout(choix) +{ + donnees = 'choix='+choix; + + v_url = $("#racineWeb").val()+"Ajaxfraisgestiongcsel/selectionnertout/"; + + $.ajax({ + url: v_url, + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + reafficher_frais_gestion_gc_sel(); + } + }); +} + +function charger_frais_gestion_mois_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfraisgestiongcpdf/", + + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_frais_gestion_mois_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailfraisgestiongcxls/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_frais_gestion_souscripteur_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfraisgestiongcsouscripteurpdf/", + + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_frais_gestion_souscripteur_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfraisgestiongcsouscripteurxls/", + + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + + +function charger_frais_gestion_detail_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfraisgestiongcdetailpdf/", + + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_frais_gestion_detail_xls() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfraisgestiongcdetailxls/", + + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_synthese_gc_pdf() +{ + donnees_retour = ""; + + var div_export = $('#div_export_b'); + div_export.html('
' + '
'); + + $.ajax({ + // url: $("#racineWeb").val()+"Ajaxdetailfraisgestiongcpdf/", + url: $("#racineWeb").val()+"Ajaxsynthsegcpdf/", + + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + div_export.html(donnees_retour); + } + }); +} + +function charger_synthese_gc_xls() +{ +} + +function remplacer_adherent() +{ + nbAdh = $("#nbAdh_C").val(); + codeTypeContrat = $("#codeTypeContrat_C").val(); + + //if ( (codeTypeContrat!="G") && (nbAdh>0) ) + if ( (codeTypeContrat=="P") && (nbAdh>0) ) + { + v_msg="Ce n\'est pas une police GROUPE!"; + v_msgEng="This is not a GROUP policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if ($("#idAdherent_C" ).val()<= " ") + { + v_msg="Veuillez sélectionner une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + remplacementAdherent=$("#remplacementAdherent").val(); + if (remplacementAdherent!="1") + { + v_msg="Remplacement de famille non actif pour cette police!"; + v_msgEng="Family replacement inactive for this policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + remplace=$("#remplace").val(); + remplacant=$("#remplacant").val(); + + if (remplacant=="1") + { + if (remplace=="1") + { + v_msg="Famille déjà remplacée!"; + v_msgEng="Family already replaced!"; + alert_ebene(v_msg, v_msgEng); + + consulter_remplacement_adherent(); + } + else + { + v_msg="Cette famille en a déjà remplacé une autre, confirmez-vous son remplacement à son tour?"; + v_msgEng="This family has already replaced another, do you confirm its replacement in turn?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + fiche_remplacer_adherent(); + } else { + // L'utilisateur a annulé + consulter_remplacant_adherent(); + } + }); + + } + } + else + if (remplace=="1") + { + v_msg="Famille déjà remplacée!"; + v_msgEng="Family already replaced!"; + alert_ebene(v_msg, v_msgEng); + + consulter_remplacement_adherent(); + } + else + { + fiche_remplacer_adherent(); + // window.location.assign($("#racineWeb" ).val()+"Remplaceradherent/"); + } +} + +function init_remplacement_adherent() +{ + dateSortieAdh = $("#dateSortieAdh").datepicker("getDate"); + dateRemplacement = $("#dateRemplacement").datepicker("getDate"); + + dateEffetPolice = $("#dateEffetPolice_C").val(); + + dateEffetAdherent = $("#dateEffetAdherent").val(); + + dateEcheancePolice = $("#dateEcheancePolice_C").val(); + + var td0 = new Date(dateEffetAdherent); + var td1 = new Date(dateSortieAdh); + var td11 = new Date(dateRemplacement); + var td2 = new Date(dateEcheancePolice); + + dt0=Math.round(Date.parse(td0)/(1000*3600*24)); + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); + dt11=Math.round(Date.parse(td11)/(1000*3600*24)); + dt2=Math.round(Date.parse(td2)/(1000*3600*24)); + + if (td11<=td1) + { + v_msg="Attention! Veuiilez revoir vos dates!"; + v_msgEng="Warning! Please review your dates!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + if (dt1>dt2 || dt1"2000-01-01") + { + var tdd = new Date(dateSortieAdherent); + dtd=Math.round(Date.parse(tdd)/(1000*3600*24)); + + if (dt1>dtd) + { + v_msg="Attention! cette personne n'est pas couverte à cette date!"; + v_msgEng="Warning! This person is not valid on this date!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + } + */ + + etatRetrait = $("#etatRetrait").val(); + dateRetrait = $("#dateRetrait").val(); + ristourneRetrait = $("#ristourneRetrait").val(); + ristourneRetrait = parseInt(ristourneRetrait); + + if(etatRetrait=="R" && ristourneRetrait<0) + { + v_msg="Attention! cette personne a été retirée avec une ristourne!"; + v_msgEng=" Warning! this person was withdrawn with premium!"; + alert_ebene(v_msg, v_msgEng); + return false; + } + + motifAvenant=$("#motifAvenant").val(); + + if ($("#motifAvenant").val()<" ") + { + v_msg="Veuillez fournir le motif!"; + v_msgEng="Please provide the reason"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + dateS = $("#dateSortieAdh").val(); + dateR = $("#dateRemplacement").val(); + + fraisCarte = $("#fraisCarte").val(); + + donnees = 'dateSortie='+dateS+'&dateRemplacement='+dateR+'&motifAvenant='+motifAvenant+'&fraisCarte='+fraisCarte; + + $("#div_remplacement_adherent").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremplaceradherent/init/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#div_remplacement_adherent").html(data); + }, + complete: function() { + $(".datepicker" ).datepicker(); + } + }); +} + +function enregistrer_remplacement_adherent() +{ + nom = $("#nom").val(); + if ($("#nom").val()<" ") + { + v_msg="Veuillez saisir le nom de famille!"; + v_msgEng="Please enter the last name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + prenoms = $("#prenoms").val(); + if ($("#prenoms").val()<" ") + { + v_msg="Veuillez saisir le prénom!"; + v_msgEng="Please enter the first name!"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + codeNaturePiece = $("#codeNaturePiece").val(); + if ($("#codeNaturePiece").val()<" ") + { + v_msg="Veuillez saisir la nature de pièce d\'identité!"; + v_msgEng="Please enter the nature of ID!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeNaturePiece").focus(); + return; + } + + numeroPiece = $("#numeroPiece").val(); + if ($("#numeroPiece").val()<" ") + { + v_msg="Veuillez saisir le No de la pièce d\'identité!"; + v_msgEng="Please enter the ID number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroPiece").focus(); + return; + } + + sexe = $("#sexe").val(); + if ($("#sexe").val()<" ") + { + v_msg="Veuillez saisir le sexe!"; + v_msgEng="Please enter the sex!"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + dateNaissance = $("#dateNaissance").val(); + if ($("#dateNaissance").val()<" ") + { + v_msg="Veuillez saisir la date de naissance!"; + v_msgEng="Please enter the date of birth!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateNaissance").focus(); + return; + } + + codeGroupeSanguin = $("#codeGroupeSanguin").val(); + if ($("#codeGroupeSanguin").val()<" ") + { + v_msg="Veuillez saisir le groupe sanguin!"; + v_msgEng="Please enter the blood type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGroupeSanguin").focus(); + return; + } + + codeSituationFamille = $("#codeSituationFamille").val(); + if ($("#codeSituationFamille").val()<" ") + { + v_msg="Veuillez saisir la situation familiale!"; + v_msgEng="Please enter the family situation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSituationFamille").focus(); + return; + } + + nombreEnfants = $("#nombreEnfants").val(); + adresseGeo = $("#adresseGeo").val(); + adressePostale = $("#adressePostale").val(); + + codePays = $("#codePays").val(); + if ($("#codePays").val()<" ") + { + v_msg="Veuillez indiquer le pays!"; + v_msgEng="Please indicate the country!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePays").focus(); + return; + } + + telephonFixe = $("#telephonFixe").val(); + telephonePortable = $("#telephonePortable").val(); + email = $("#email").val(); + + fraisCarte = $("#fraisCarte").val(); + + donnees = 'nom='+nom+'&prenoms='+prenoms+'&codeNaturePiece='+codeNaturePiece; + + donnees += '&numeroPiece='+numeroPiece+'&sexe='+sexe+'&dateNaissance='+dateNaissance; + + donnees += '&codeGroupeSanguin='+codeGroupeSanguin+'&codeSituationFamille='+codeSituationFamille+'&nombreEnfants='+nombreEnfants; + + donnees += '&adresseGeo='+adresseGeo+'&adressePostale='+adressePostale+'&codePays='+codePays; + + donnees += '&telephonFixe='+telephonFixe+'&telephonePortable='+telephonePortable+'&email='+email+'&fraisCarte='+fraisCarte; + + v_msg="Confirmez-vous le remplacement de famille?"; + v_msgEng="Do you confirm family replacement?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_remplacement_adherent").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxremplaceradherent/enregistrerremplacementadherent/", + 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); + + consulter_remplacement_adherent(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function consulter_remplacement_adherent() +{ + idAdherent = $("#idAdherent_C" ).val(); + + if (idAdherent>"0") + { + window.location.assign($("#racineWeb" ).val()+"Remplaceradherentcons/"); + } +} + +function consulter_remplacant_adherent() +{ + idAdherent = $("#idAdherent_C" ).val(); + + if (idAdherent>"0") + { + window.location.assign($("#racineWeb" ).val()+"Remplaceradherentcons/remplacant/"); + } +} + + +function fiche_remplacer_adherent() +{ + etat=$("#codeEtatPolice_C").val(); + + if (etat=="RE") + { + v_msg="Attention! Police résiliée!"; + v_msgEng="Warning! Terminated policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (etat=="SU") + { + v_msg="Attention! Police suspendue!"; + v_msgEng="Warning! Suspended policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (etat=="AN") + { + v_msg="Attention! Police annulée!"; + v_msgEng="Warning! Canceled policy!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Remplaceradherent/"); +} + +function ajaxListerVilleConsultation() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxville/consultation/", + type : 'post', + data: "codePays="+$("#codePays").val(), + error: function(errorData) { + }, + success: function(data) { + $("#listeville").html(data); + }, + complete: function() { + } + }); +} + +function ajaxListerLocaliteConsultation() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlocalite/consultation/", + type : 'post', + data: "codePays="+$("#codePays").val()+"&codeVille="+$("#codeVille").val(), + error: function(errorData) { + }, + success: function(data) { + $("#listelocalite").html(data); + } + }); +} + +function imprimer_feuille_maladie() +{ + /* + + facture=$("#facture").val(); + + if (facture!=1) + { + v_msg="Pas encore facturée!"; + v_msgEng="Not yet charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + */ + + donnees_retour = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerfeuillemaladie/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_export_a").html(donnees_retour); + $("#btn_imprimer_feuille_maladie").click(); + } + }); +} + +function enregistrer_modif_parametres_prod() +{ + idSocieteuser = $("#idSocieteuser").val(); + donnees = 'idSocieteuser='+idSocieteuser; + + tauxHonoraires = $("#tauxHonoraires").val(); + spMax = $("#spMax").val(); + fraisCarteAN = $("#fraisCarteAN").val(); + donnees += '&tauxHonoraires='+tauxHonoraires+'&spMax='+spMax+'&fraisCarteAN='+fraisCarteAN; + + fraisCarteREN = $("#fraisCarteREN").val(); + fraisCarteImp = $("#fraisCarteImp").val(); + spAlertAdherent = $("#spAlertAdherent").val(); + donnees += '&fraisCarteREN='+fraisCarteREN+'&fraisCarteImp='+fraisCarteImp+'&spAlertAdherent='+spAlertAdherent; + + tauxRistourne = $("#tauxRistourne").val(); + seuilRistourne = $("#seuilRistourne").val(); + + archivageAutomatiquePrime = $("#archivageAutomatiquePrime").val(); + ecartEncaissementTolerable= $("#ecartEncaissementTolerable").val(); + + donnees += '&tauxRistourne='+tauxRistourne+'&seuilRistourne='+seuilRistourne; + donnees += '&archivageAutomatiquePrime='+archivageAutomatiquePrime; + donnees += '&ecartEncaissementTolerable='+ecartEncaissementTolerable; + + notificationSmsNumeroAssure = $("#notificationSmsNumeroAssure").val(); + notificationGroupeNumeroAssure = $("#notificationGroupeNumeroAssure").val(); + lettrageAutoGarant = $("#lettrageAutoGarant").val(); + + parametresFacturationGarantProduit = $("#parametresFacturationGarantProduit").val(); + + assureAjoutPhoto = $("#assureAjoutPhoto").val(); + + donnees += '¬ificationSmsNumeroAssure='+notificationSmsNumeroAssure; + donnees += '¬ificationGroupeNumeroAssure='+notificationGroupeNumeroAssure; + donnees += '&lettrageAutoGarant='+lettrageAutoGarant; + + donnees += '¶metresFacturationGarantProduit='+parametresFacturationGarantProduit; + donnees += '&assureAjoutPhoto='+assureAjoutPhoto; + + + 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/enregistrermodifprod/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_autres_parametresgeneraux(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_autres_parametresgeneraux() +{ + window.location.assign($("#racineWeb" ).val()+"Autresparametresgeneraux/"); +} + +function controle_numerique_new(idControle, oldValue) +{ + controle = document.getElementById(idControle); + + valeur = controle.value; + + if(isNaN(valeur)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + controle.value=oldValue; + controle.focus(); + return false; + } + return true; +} + +function enregistrer_modif_parametres_sin() +{ + idSocieteuser = $("#idSocieteuser").val(); + filtreMedecin = $("#s_filtreMedecin").val(); + prixActeModifiable = $("#s_prixActeModifiable").val(); + permettrePrescriptionSiCritereBareme = $("#s_permettrePrescriptionSiCritereBareme").val(); + autoriserUnBonPrincipal = $("#s_autoriserUnBonPrincipal").val(); + + autoriserBonHospitAvantDate = $("#s_autoriserBonHospitAvantDate").val(); + encaissementExige = $("#s_encaissementExige").val(); + nbConsultationSpecialisteJour = $("#s_nbConsultationSpecialisteJour").val(); + nombreFeuilleGratuitJour = $("#s_nombreFeuilleGratuitJour").val(); + ageMaxiPediatrie = $("#s_ageMaxiPediatrie").val(); + + nbMedicamentMax = $("#s_nbMedicamentMax").val(); + quantiteMedicamentPermise = $("#s_quantiteMedicamentPermise").val(); + nbTentativeBiometrie = $("#s_nbTentativeBiometrie").val(); + codeModeBiometrie = $("#s_codeModeBiometrie").val(); + codeActeConsultationGratuite = $("#s_codeActeConsultationGratuite").val(); + + accesAjoutPh = $("#s_accesAjoutPh").val(); + ajoutPrescription = $("#s_ajoutPrescription").val(); + appliquerMargePrixMedicament = $("#s_appliquerMargePrixMedicament").val(); + appliquerMargePrixSubstitutMedicament = $("#s_appliquerMargePrixSubstitutMedicament").val(); + interdirVentePartielleMedicament = $("#s_interdirVentePartielleMedicament").val(); + + prixMedicamentModifiable = $("#s_prixMedicamentModifiable").val(); + typeMargePrixMedicament = $("#s_typeMargePrixMedicament").val(); + margePrixMedicament = $("#s_margePrixMedicament").val(); + margePrixSubstitutMedicament = $("#s_margePrixSubstitutMedicament").val(); + ajoutPrescriptionExam = $("#s_ajoutPrescriptionExam").val(); + + donnees = 'idSocieteuser='+idSocieteuser; + donnees += '&filtreMedecin='+filtreMedecin+'&prixActeModifiable='+prixActeModifiable; + donnees += '&permettrePrescriptionSiCritereBareme='+permettrePrescriptionSiCritereBareme; + donnees += '&autoriserUnBonPrincipal='+autoriserUnBonPrincipal; + + donnees += '&autoriserBonHospitAvantDate='+autoriserBonHospitAvantDate; + donnees += '&encaissementExige='+encaissementExige; + donnees += '&nbConsultationSpecialisteJour='+nbConsultationSpecialisteJour; + donnees += '&nombreFeuilleGratuitJour='+nombreFeuilleGratuitJour; + donnees += '&ageMaxiPediatrie='+ageMaxiPediatrie; + + donnees += '&nbMedicamentMax='+nbMedicamentMax; + donnees += '&quantiteMedicamentPermise='+quantiteMedicamentPermise; + donnees += '&nbTentativeBiometrie='+nbTentativeBiometrie; + donnees += '&codeModeBiometrie='+codeModeBiometrie; + donnees += '&codeActeConsultationGratuite='+codeActeConsultationGratuite; + + donnees += '&accesAjoutPh='+accesAjoutPh; + donnees += '&ajoutPrescription='+ajoutPrescription; + donnees += '&appliquerMargePrixMedicament='+appliquerMargePrixMedicament; + donnees += '&appliquerMargePrixSubstitutMedicament='+appliquerMargePrixSubstitutMedicament; + donnees += '&interdirVentePartielleMedicament='+interdirVentePartielleMedicament; + + donnees += '&prixMedicamentModifiable='+prixMedicamentModifiable; + donnees += '&typeMargePrixMedicament='+typeMargePrixMedicament; + donnees += '&margePrixMedicament='+margePrixMedicament; + donnees += '&margePrixSubstitutMedicament='+margePrixSubstitutMedicament; + donnees += '&ajoutPrescriptionExam='+ajoutPrescriptionExam; + + 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/enregistrermodifsin/", + 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 maj_duree_vie_bon(idTypebon, dureeVie) +{ + donnees = 'idTypebon='+idTypebon+'&dureeVie='+dureeVie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamdureeviebon/majdureevie/", + type: 'POST', + data: donnees, + success: function(data) { + }, + complete: function(data) + { + } + }); +} + +function afficher_garantie_produit_cons() +{ + + + codeGcAssureur =$("#codeGcAssureur").val(); + + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez s\u00e9lectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + + $('#div_garantieproduit').html(""); + + return; + } + + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez s\u00e9lectionner un produit!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $('#div_garantieproduit').html(""); + return; + } + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeProduit='+codeProduit; + + var div_attente = $('#div_garantieproduit'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/affichergarantieproduitcons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function afficher_garantie_produit() +{ + codeGcAssureur =$("#codeGcAssureur").val(); + + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez s\u00e9lectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGcAssureur").focus(); + + $('#div_garantieproduit').html(""); + + return; + } + + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez s\u00e9lectionner un produit!"; + v_msgEng="Please select a product!"; + alert_ebene(v_msg, v_msgEng); + + $('#div_garantieproduit').html(""); + return; + } + donnees = 'codeProduit='+codeProduit; + + var div_attente = $('#div_garantieproduit'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/affichergarantieproduit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + + +function ajouter_tous_garantie_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + 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()+"Ajaxparamseuilalerte/ajoutertousgarantieproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantie_produit(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_garantie_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + 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()+"Ajaxparamseuilalerte/retirertousgarantieproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantie_produit(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_garantie_produit(id_garantie_produit) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&idGarantieProduit='+id_garantie_produit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/retirerungarantieproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantie_produit(); + } + }); +} + +function ajouter_un_garantie_produit(codeGarantie) +{ + + + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/ajouterungarantieproduit/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_garantie_produit(); + } + }); +} + +function maj_taux_seuil_alerte_garantie(id_garantie_produit, tauxSeuilAlerte) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&idGarantieProduit='+id_garantie_produit+"&tauxSeuilAlerte="+tauxSeuilAlerte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/majtauxseuilalertegarantie/", + type: 'POST', + data: donnees, + success: function(data) { + }, + complete: function(data) + { + } + }); +} + +function maj_seuil_alerte_garantie(id_garantie_produit, seuilAlerte) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + donnees = 'codeProduit='+codeProduit+'&idGarantieProduit='+id_garantie_produit+"&seuilAlerte="+seuilAlerte; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamseuilalerte/majseuilalertegarantie/", + type: 'POST', + data: donnees, + success: function(data) { + }, + complete: function(data) + { + } + }); +} + +// + +function requetes_synthese_consommation_police() +{ + v_url = $("#racineWeb").val()+"Ajaxsyntheseconsopolice/"; + + $("#div_detail_exp").html(''); + + $("#div_detail_sp").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) + { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() + { + $("#div_detail_sp").html(donnees_retour); + } + }); +} + + +function requetes_synthese_consommation_police_export() +{ + v_url = $("#racineWeb").val()+"Ajaxsyntheseconsopolice/exportxls/"; + + $("#div_detail_exp").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + error: function(errorData) + { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() { + $('#div_detail_exp').html(donnees_retour); + } + }); +} + +function modifier_type_bon(idTypebon) +{ + donnees = 'idTypebon='+idTypebon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparambons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() + { + $('#div_maj_type_bon').html(donnees_retour); + } + }); +} + +function enregistrer_modif_type_bon() +{ + + idTypebon = $("#idTypebon").val(); + dureeVie = $("#dureeVie").val(); + codeGestionBon = $("#codeGestionBon").val(); + + if (dureeVie<="0") + { + v_msg="Veuillez donner une durée de vie au bon!"; + v_msgEng="Please give a lifetime to the form!"; + alert_ebene(v_msg, v_msgEng); + + $("#dureeVie").focus(); + return; + } + + if (codeGestionBon<=" ") + { + v_msg="Veuillez sélectionner un type de gestion!"; + v_msgEng="Please select a management type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGestionBon").focus(); + return; + } + + donnees = 'idTypebon='+idTypebon+'&dureeVie='+dureeVie+'&codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparambons/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(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()+"Parambons/"); + } + }); +} + +function gerer_acces_actes_prestataire(codeUtilisateur, actVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&actVisible="+actVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/gereraccesactes/", + 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); + + users_prestataire(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function afficher_utilsateur_actesvisibles() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + var div_attente = $('#div_liste'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamactesvisible/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function gerer_acces_actes_assureur(codeUtilisateur, actVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&actVisible="+actVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamactesvisible/gereraccesactes/", + 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); + + afficher_utilsateur_actesvisibles(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function lister_provisions() +{ + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxprovisonssin/"; + + $.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 lister_provisions_cpt() +{ + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxprovisonssincpt/"; + + $.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 lister_provisions_sys() +{ + debutAnalyse = $("#debutAnalyse").val(); + dateAnalyse = $("#dateAnalyse").val(); + + donnees = 'debutAnalyse='+debutAnalyse+'&dateAnalyse='+dateAnalyse; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + v_url = $("#racineWeb").val()+"Ajaxprovisonssinsys/"; + + $.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 afficher_user_profil_ass() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + var div_attente = $('#div_liste'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + dataTableSpeciale(); + }, + complete: function() { + } + }); +} + +function gerer_acces_actes_assureur_hab(codeUtilisateur, actVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&actVisible="+actVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamactesvisible/gereraccesactes/", + 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); + + afficher_user_profil_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 reinitpaswd_assureur(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); + + afficher_user_profil_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 desactiver_user_assureur(codeUtilisateur) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/desactiver/", + 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); + + afficher_user_profil_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 activer_user_assureur(codeUtilisateur) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/activer/", + 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); + + afficher_user_profil_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 afficher_attribution_profil_assureur() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + var div_attente = $('#div_utilisateur_profil'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/afficherattributionprofilassureur/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ajouter_un_utilisateur_profil_ass(codeUtilisateur) +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil+'&codeUtilisateur='+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajouterunutilisateurprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_attribution_profil_assureur(); + } + }); +} + +function ajouter_tous_utilisateur_profil_ass() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + 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()+"Ajaxparamhabilitationass/ajoutertousutilisateurprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_attribution_profil_assureur(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_menu_principal_profil_assureur() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + var div_attente = $('#div_menu_profil'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/afficheraccesmenuprincipalass/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + dataTableSpeciale(); + }, + complete: function() { + } + }); +} + +function ajouter_un_meunu_principal_profil_ass(codeMenu) +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil+'&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajouterunmenuprincipalprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_principal_profil_assureur(); + } + }); +} + +function retirer_un_meunu_principal_profil_ass(codeMenu) +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil+'&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/retirerunmenuprincipalprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_principal_profil_assureur(); + } + }); +} + +function ajouter_tous_menus_principal_profil_ass() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajoutertousmenuprincipalprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_principal_profil_assureur(); + } + }); +} + +function retirer_tous_menus_principal_profil_ass() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/retirerousmenuprincipalprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_principal_profil_assureur(); + } + }); +} + +function ajaxListerVueModule() +{ + codeModule=$("#codeModule").val(); + donnees = 'codeModule='+codeModule; + + var div_attente = $('#listevue'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/listervuemodule/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + $('.selectpicker').selectpicker(); + }, + complete: function() + { + vider_menu_vue_module_assureur(); + } + }); +} + +function afficher_menu_vue_module_assureur() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + codeModule=$("#codeModule").val(); + + if (codeModule<=" ") + { + v_msg="Veuillez sélectionner un module!"; + v_msgEng="Please select a module!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModule").focus(); + return; + } + + vue=$("#vue").val(); + + if (vue<=" ") + { + v_msg="Veuillez sélectionner une vue!"; + v_msgEng="Please select a view!"; + alert_ebene(v_msg, v_msgEng); + + $("#vue").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + donnees += '&codeModule='+codeModule; + donnees += '&vue='+vue; + + var div_attente = $('#div_menu_profil'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/afficheraccessousmenusass/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + div_attente.html(data); + dataTableSpeciale(); + }, + complete: function() { + } + }); +} + +function vider_menu_vue_module_assureur() +{ + var div_attente = $('#div_menu_profil'); + + div_attente.html('
' + '
'); + + div_attente.html(""); +} + +function ajouter_tous_menu_vue_module_assureur() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + codeModule=$("#codeModule").val(); + + if (codeModule<=" ") + { + v_msg="Veuillez sélectionner un module!"; + v_msgEng="Please select a module!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModule").focus(); + return; + } + + vue=$("#vue").val(); + + if (vue<=" ") + { + v_msg="Veuillez sélectionner une vue!"; + v_msgEng="Please select a view!"; + alert_ebene(v_msg, v_msgEng); + + $("#vue").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + donnees += '&codeModule='+codeModule; + donnees += '&vue='+vue; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajoutertoussousmenusass/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_module_assureur(); + } + }); +} + +function retirer_tous_menu_vue_module_assureur() +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + codeModule=$("#codeModule").val(); + + if (codeModule<=" ") + { + v_msg="Veuillez sélectionner un module!"; + v_msgEng="Please select a module!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModule").focus(); + return; + } + + vue=$("#vue").val(); + + if (vue<=" ") + { + v_msg="Veuillez sélectionner une vue!"; + v_msgEng="Please select a view!"; + alert_ebene(v_msg, v_msgEng); + + $("#vue").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + donnees += '&codeModule='+codeModule; + donnees += '&vue='+vue; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/retirertoussousmenusass/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_module_assureur(); + } + }); +} + +function ajouter_un_menu_vue_module_assureur(codeMenu) +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + codeModule=$("#codeModule").val(); + + if (codeModule<=" ") + { + v_msg="Veuillez sélectionner un module!"; + v_msgEng="Please select a module!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModule").focus(); + return; + } + + vue=$("#vue").val(); + + if (vue<=" ") + { + v_msg="Veuillez sélectionner une vue!"; + v_msgEng="Please select a view!"; + alert_ebene(v_msg, v_msgEng); + + $("#vue").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + donnees += '&codeModule='+codeModule; + donnees += '&vue='+vue; + + donnees += '&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajouterunsousmenusass/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_module_assureur(); + } + }); +} + +function retirer_un_menu_vue_module_assureur(codeMenu) +{ + codeProfil=$("#codeProfil").val(); + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + codeModule=$("#codeModule").val(); + + if (codeModule<=" ") + { + v_msg="Veuillez sélectionner un module!"; + v_msgEng="Please select a module!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModule").focus(); + return; + } + + vue=$("#vue").val(); + + if (vue<=" ") + { + v_msg="Veuillez sélectionner une vue!"; + v_msgEng="Please select a view!"; + alert_ebene(v_msg, v_msgEng); + + $("#vue").focus(); + return; + } + + donnees = 'codeProfil='+codeProfil; + donnees += '&codeModule='+codeModule; + donnees += '&vue='+vue; + + donnees += '&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/retirerunsousmenusass/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_module_assureur(); + } + }); +} + +function users_gc() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + + if (codeGcAssureur>" ") + { + window.location.assign($("#racineWeb" ).val()+"Usersgcassureur/"); + } +} + +function reinitpaswd_gc(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()+"Ajaxgcassureur/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); + + users_gc(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + + +} + +function desactiver_user_gc(codeUtilisateur) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/desactiver/", + 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); + + users_gc(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_user_gc(codeUtilisateur) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeUtilisateur="+codeUtilisateur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/activer/", + 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); + + users_gc(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function gerer_acces_actes_gc(codeUtilisateur, actVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&actVisible="+actVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/gereraccesactes/", + 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); + + users_gc(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function retour_au_profil_ass() +{ + window.location.assign($("#racineWeb" ).val()+"Listeprofilass/"); +} + +function creer_profil_ass() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name of the profil in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en anglais!"; + v_msgEng="Please enter the name of the profil in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'libelle='+libelle+'&libelleEng='+libelleEng; + + v_msg="Confirmez-vous ce nouveau profil?"; + v_msgEng="Do you confirm this new profile?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/creerprofilass/", + 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_au_profil_ass(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +// tranferer_droits_profil_ass +function tranferer_droits_profil_ass() +{ + codeProfilSource=$("#codeProfilSource").val(); + + if (codeProfilSource<=" ") + { + v_msg="Veuillez sélectionner le profil source!"; + v_msgEng="Please select the source profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfilSource").focus(); + return; + } + + codeProfilDest=$("#codeProfilDest").val(); + + if (codeProfilDest<=" ") + { + v_msg="Veuillez sélectionner le profil de destination!"; + v_msgEng="Please select the destination profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfilDest").focus(); + return; + } + + if (codeProfilDest==codeProfilSource) + { + v_msg="Veuillez changer le profil de destination!"; + v_msgEng="Please change the destination profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfilDest").focus(); + return; + } + + donnees = 'codeProfilSource='+codeProfilSource; + donnees += '&codeProfilDest='+codeProfilDest; + + 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()+"Ajaxparamhabilitationass/transfererdroitsprofilassureur/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: 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_au_profil_ass(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function batch_vider_droits_profil_assureur(codeProfil) +{ + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProfil='+codeProfil; + + 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é + var div_attente = $('#div_liste'); + sav_div_liste_htm = div_attente.html(); + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/batchviderprofilass/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() + { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + div_attente.html(sav_div_liste_htm); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function batch_atrtribuer_droits_reference_profil_assureur(codeProfil) +{ + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProfil='+codeProfil; + + 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é + var div_attente = $('#div_liste'); + sav_div_liste_htm = div_attente.html(); + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/batchattribuerdroitsreferenceass/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() + { + v_msg="Opération effectuée avec succès!"; + v_msgEng="Operation successfully completed"; + alert_ebene(v_msg, v_msgEng); + + div_attente.html(sav_div_liste_htm); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function reinitpaswd_assure(idAdherent) +{ + 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 = "idAdherent="+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitationadherent/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_extranet_adh(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function retour_a_extranet_adh() +{ + window.location.assign($("#racineWeb" ).val()+"Extranetadherent/"); +} + +function desactiver_user_assure(idAdherent) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitationadherent/desactiver/", + 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_extranet_adh(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_user_assure(idAdherent) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idAdherent="+idAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitationadherent/activer/", + 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_extranet_adh(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function ctrlkeypress_liste_users_ass(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_users_ass(); + } +} + +function afficher_liste_users_ass() +{ + donnees = ""; + donnees_retour = ""; + + codeProfil = $("#codeProfil").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codePointVente = $("#codePointVente").val(); + + if (codeProfil+nom+prenoms+codePointVente<=" ") + { + v_msg="Veuillez indiquer au moins un critère de recherche!"; + v_msgEng="Please enter at least one search criteria!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + donnees += 'codeProfil=' + codeProfil; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&codePointVente=' + codePointVente; + + // alert(donnees); + // return; + + $("#div_liste_users").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/ajaxlisteusersass/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_users").html(donnees_retour); + } + }); +} + + +function afficher_users_ass_id(idUtilisateur) +{ + window.location.assign($("#racineWeb" ).val()+"Ficheusersass/"+idUtilisateur+"/"); +} + +function retour_a_usersassureur() +{ + window.location.assign($("#racineWeb" ).val()+"Usersassureur/"); +} + +function enregistrer_modif_usersassureur() +{ + idUtilisateur = $("#idUtilisateur").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codeProfil = $("#codeProfil").val(); + actif = $("#actif").val(); + telephone = $("#telephone").val(); + email = $("#email").val(); + codeLangue = $("#codeLangueUser").val(); + actVisible = $("#actVisibleUser").val(); + AffectionVisible = $("#AffectionVisible").val(); + + codePointVente = $("#codePointVente").val(); + filtrePointVente = $("#filtrePointVente").val(); +/* +-- nom +-- prenoms +-- codeProfil +-- actif +-- telephone +-- email +-- codeLangue +-- actVisible +-- AffectionVisible +-- codePointVente +-- filtrePointVente +*/ + + if (nom<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if (codeProfil<=" ") + { + v_msg="Veuillez sélectionner un profil!"; + v_msgEng="Please select a user profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + if (actif<=" ") + { + v_msg="Utilisateur actif oui ou non?"; + v_msgEng="Is the user active yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actif").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisible").focus(); + return; + } + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codePointVente<=" ") + { + v_msg="Veuillez revoir le point de vente par défaut!"; + v_msgEng="Please review the default point of Sales!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePointVente").focus(); + return; + } + + if (filtrePointVente<=" ") + { + v_msg="Filtrer les points de vente oui ou non?"; + v_msgEng="Filter the point of sales yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#filtrePointVente").focus(); + return; + } + + donnees = 'idUtilisateur=' + idUtilisateur; + donnees += '&codeProfil=' + codeProfil; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&actif=' + actif; + donnees += '&actVisible=' + actVisible; + donnees += '&codeLangue=' + codeLangue; + donnees += '&AffectionVisible=' + AffectionVisible; + + donnees += '&email=' + email; + donnees += '&telephone=' + telephone; + + donnees += '&codePointVente='+codePointVente; + donnees += '&filtrePointVente='+filtrePointVente; + + // alert(donnees); + // return; + + 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()+"Ajaxparamhabilitationass/enregistrermodifusersass/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_test_gabarit").html(data); + }, + complete: function() { + retour_a_usersassureur(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + + + +function creer_user_assureur() +{ + codeProfil = $("#codeProfil").val(); + codeUtilisateur = $("#codeUtilisateur").val(); + codeUtilisateur = codeUtilisateur.trim(); + codeUtilisateur = supprimer_espace_string(codeUtilisateur); + codeUtilisateur = codeUtilisateur.toLowerCase(); + + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + telephone = $("#telephone").val(); + email = $("#email").val(); + + codeLangue = $("#codeLangueUser").val(); + actVisible = $("#actVisibleUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + nvmdp = $("#nvmdp").val(); + cfnvmdp = $("#cfnvmdp").val(); + + codeModeGenerationPass = $("#codeModeGenerationPass").val(); + codeModeEnvoiPass = $("#codeModeEnvoiPass").val(); + + codePointVente = $("#codePointVente").val(); + filtrePointVente = $("#filtrePointVente").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(codeProfil<=" ") + { + v_msg="Veuillez sélectionner le profil source!"; + v_msgEng="Please select the source profile!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProfil").focus(); + return; + } + + if(codeUtilisateur<=" ") + { + v_msg="Veuillez indiquer le login!"; + v_msgEng="Please enter the login!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + return; + } + + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisibleUser").focus(); + return; + } + + if ((codeModeEnvoiPass=="1" || codeModeEnvoiPass=="2") && (telephone <=" ") ) + { + v_msg="Veuillez revoir le téléphone!"; + v_msgEng="Please review the phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + + if ((codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") ) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass=="0") + { + if(nvmdp<=" ") + { + v_msg="Veuillez indiquer le mot de passe!"; + v_msgEng="Please enter the password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return; + } + + if(nvmdp != cfnvmdp) + { + v_msg="Veuillez confirmer votre mot de passe!"; + v_msgEng="Please confirm your password!"; + alert_ebene(v_msg, v_msgEng); + + $("#cfnvmdp").focus(); + return; + } + } + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass<=" ") + { + v_msg="Veuillez revoir le mode de génération!"; + v_msgEng="Please review the generation mode!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModeGenerationPass").focus(); + return; + } + + if(codeModeEnvoiPass<=" ") + { + v_msg="Veuillez revoir le mode envoi!"; + v_msgEng="Please review the sending mode!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeModeEnvoiPass").focus(); + return; + } + + if(codePointVente<=" ") + { + v_msg="Veuillez revoir le point de vente par défaut!"; + v_msgEng="Please review the default point of Sales!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePointVente").focus(); + return; + } + + if (filtrePointVente<=" ") + { + v_msg="Filtrer les points de vente oui ou non?"; + v_msgEng="Filter the point of sales yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#filtrePointVente").focus(); + return; + } + + motPass = nvmdp; + + donnees = 'codeProfil='+codeProfil+'&codeUtilisateur='+codeUtilisateur; + donnees += '&nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email+'&motPass='+motPass; + donnees += '&codeLangue='+codeLangue+'&actVisible='+actVisible+'&AffectionVisible='+AffectionVisible; + donnees += '&codeModeGenerationPass='+codeModeGenerationPass; + donnees += '&codeModeEnvoiPass='+codeModeEnvoiPass; + donnees += '&codePointVente='+codePointVente; + donnees += '&filtrePointVente='+filtrePointVente; + + v_msg="Confirmez-vous ce nouvel utilisateur?"; + v_msgEng="Do you confirm this new user?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamhabilitationass/creeruserassureur/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_unicite_login').html(data); + }, + complete: function() + { + + uniciteLogin = $("#uniciteLogin").val(); + + + if(uniciteLogin==1) + { + v_msg="Utilisateur ( "+codeUtilisateur+" ) créé avec succès!"; + v_msgEng="User ( "+codeUtilisateur+" ) created succssfully!"; + alert_ebene(v_msg, v_msgEng); + + retour_a_usersassureur(); + } + else + { + v_msg="Login " + codeUtilisateur +" déjà utilisé!"; + v_msgEng="Login " + codeUtilisateur +" already in use!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + } + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_espace_string(p_mot) +{ + p_mot = p_mot.trim(); + p_mot = p_mot.replace(/ /g, ""); + return p_mot; +} + +function enregistrer_modif_user_prestataire() +{ + idUtilisateur = $("#idUtilisateur").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + actif = $("#actif").val(); + actVisible = $("#actVisibleUser").val(); + codeLangue = $("#codeLangueUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + telephone = $("#telephone").val(); + email = $("#email").val(); + + if (nom<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + + if (actif<=" ") + { + v_msg="Utilisateur actif oui ou non?"; + v_msgEng="Is the user active yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actif").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisible").focus(); + return; + } + + + donnees = 'idUtilisateur=' + idUtilisateur; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&actif=' + actif; + donnees += '&actVisible=' + actVisible; + donnees += '&codeLangue=' + codeLangue; + donnees += '&AffectionVisible=' + AffectionVisible; + + 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()+"Ajaxprestataire/enregistrermodifuserprestataire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + users_prestataire(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_users_prestataire_id(idUtilisateur) +{ + window.location.assign($("#racineWeb" ).val()+"Ficheuserprestataire/"+idUtilisateur+"/"); +} + +function afficher_users_gc_id(idUtilisateur) +{ + window.location.assign($("#racineWeb" ).val()+"Ficheusergc/"+idUtilisateur+"/"); +} + +function retour_a_users_gc() +{ + window.location.assign($("#racineWeb" ).val()+"Usersgcassureur/"); +} + +function enregistrer_modif_user_gc() +{ + idUtilisateur = $("#idUtilisateur").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + actif = $("#actif").val(); + actVisible = $("#actVisibleUser").val(); + codeLangue = $("#codeLangueUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + telephone = $("#telephone").val(); + email = $("#email").val(); + + + if (nom<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if (actif<=" ") + { + v_msg="Utilisateur actif oui ou non?"; + v_msgEng="Is the user active yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actif").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisible").focus(); + return; + } + + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + donnees = 'idUtilisateur=' + idUtilisateur; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&actif=' + actif; + donnees += '&actVisible=' + actVisible; + donnees += '&codeLangue=' + codeLangue; + donnees += '&AffectionVisible=' + AffectionVisible; + donnees += '&telephone='+telephone+'&email='+email; + + 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()+"Ajaxgcassureur/enregistrermodifusergc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + retour_a_users_gc(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_user_gc() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeUtilisateur = $("#codeUtilisateur").val(); + codeUtilisateur = codeUtilisateur.trim(); + codeUtilisateur = supprimer_espace_string(codeUtilisateur); + codeUtilisateur = codeUtilisateur.toLowerCase(); + + codeModeGenerationPass = $("#codeModeGenerationPass").val(); + codeModeEnvoiPass = $("#codeModeEnvoiPass").val(); + + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + telephone = $("#telephone").val(); + email = $("#email").val(); + + codeLangue = $("#codeLangueUser").val(); + actVisible = $("#actVisibleUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + nvmdp = $("#nvmdp").val(); + cfnvmdp = $("#cfnvmdp").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(codeUtilisateur<=" ") + { + v_msg="Veuillez indiquer le login!"; + v_msgEng="Please enter the login!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + return; + } + + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisibleUser").focus(); + return; + } + + if ((codeModeEnvoiPass=="1" || codeModeEnvoiPass=="2") && (telephone <=" ") ) + { + v_msg="Veuillez revoir le téléphone!"; + v_msgEng="Please review the phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + + if ((codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") ) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass=="0") + { + if(nvmdp<=" ") + { + v_msg="Veuillez indiquer le mot de passe!"; + v_msgEng="Please enter the password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return; + } + + if(nvmdp != cfnvmdp) + { + v_msg="Veuillez confirmer votre mot de passe!"; + v_msgEng="Please confirm your password!"; + alert_ebene(v_msg, v_msgEng); + + $("#cfnvmdp").focus(); + return; + } + } + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + motPass = nvmdp; + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeUtilisateur='+codeUtilisateur; + donnees += '&nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email+'&motPass='+motPass; + donnees += '&codeLangue='+codeLangue+'&actVisible='+actVisible; + donnees += '&AffectionVisible='+AffectionVisible; + donnees += '&codeModeGenerationPass='+codeModeGenerationPass; + donnees += '&codeModeEnvoiPass='+codeModeEnvoiPass; + + v_msg="Confirmez-vous ce nouvel utilisateur?"; + v_msgEng="Do you confirm this new user?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/creerusergc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_unicite_login').html(data); + }, + complete: function() + { + uniciteLogin = $("#uniciteLogin").val(); + if(uniciteLogin==1) + { + v_msg="Utilisateur ( "+codeUtilisateur+" ) créé avec succès!"; + v_msgEng="User ( "+codeUtilisateur+" ) created succssfully!"; + alert_ebene(v_msg, v_msgEng); + + retour_a_users_gc(); + } + else + { + v_msg="Login " + codeUtilisateur +" déjà utilisé!"; + v_msgEng="Login " + codeUtilisateur +" already in use!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + } + } + }); + } + }); +} + +function notesfeuillemaladie() +{ + actVisible=$("#actVisible").val(); + + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Notesfeuillemaladie/"); +} + +function changer_avenant_incorporation() +{ + idAvenant = $("#idAvenant").val(); + + if(idAvenant<=" ") + { + v_msg="Veuillez sélectionner un avenant!"; + v_msgEng="Please select an Amendment!"; + alert_ebene(v_msg, v_msgEng); + + $("#idAvenant").focus(); + return; + } + + donnees = 'idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxavenant/getdateavenant/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_date_avenant").html(data); + $(".datepicker" ).datepicker(); + $("#dateSouscription").val($("#dateAvenant").val()); + }, + complete: function() + { + prorater_prime_adherent(); + } + }); +} + + +function changer_avenant_incorporation_beneficiaire() +{ + idAvenant = $("#idAvenant").val(); + + if(idAvenant<=" ") + { + v_msg="Veuillez sélectionner un avenant!"; + v_msgEng="Please select an Amendment!"; + alert_ebene(v_msg, v_msgEng); + + $("#idAvenant").focus(); + return; + } + + donnees = 'idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxavenant/getdateavenantbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_date_avenant").html(data); + $(".datepicker" ).datepicker(); + $("#dateSouscription").val($("#dateAvenant").val()); + }, + complete: function() + { + prorater_prime_beneficiaire(); + } + }); +} + +function param_requeteperso() +{ + window.location.assign($("#racineWeb" ).val()+"Paramerequeteperso/"); +} + +function creer_requeteperso() +{ + nomRequete = $("#nomRequete").val(); + nomRequeteEng = $("#nomRequeteEng").val(); + descriptionRequete = $("#descriptionRequete").val(); + sourceDonnees = $("#sourceDonnees").val(); + ordre = $("#ordreRequete").val(); + + if(nomRequete<=" ") + { + v_msg="Veuillez indiquer le nom de la requête en Français!"; + v_msgEng="Please enter the name of the request in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomRequete").focus(); + return; + } + + if(nomRequeteEng<=" ") + { + v_msg="Veuillez indiquer le nom de la requête en Anglais!"; + v_msgEng="Please enter the name of the request in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomRequeteEng").focus(); + return; + } + + if(descriptionRequete<=" ") + { + v_msg="Veuillez entrer une description!"; + v_msgEng="Please enter a description!"; + alert_ebene(v_msg, v_msgEng); + + $("#descriptionRequete").focus(); + return; + } + + if(sourceDonnees<=" ") + { + v_msg="Veuillez sélectionner une source de données!"; + v_msgEng="Please select a data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if(ordre<1) + { + v_msg="Veuillez donner un ordre à la requête!"; + v_msgEng="Please give an order to the query!"; + alert_ebene(v_msg, v_msgEng); + + $("#ordreRequete").focus(); + return; + } + + donnees = 'nomRequete='+nomRequete; + donnees += '&nomRequeteEng='+nomRequeteEng; + donnees += '&descriptionRequete='+descriptionRequete; + donnees += '&sourceDonnees='+sourceDonnees; + donnees += '&ordre='+ordre; + + v_msg="Confirmez-vous cette nouvelle requête?"; + v_msgEng="Do you confirm this new qurey?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/creerrequeteperso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + param_requeteperso_liste(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function param_requeteperso_liste() +{ + window.location.assign($("#racineWeb" ).val()+"Listerequeteperso/"); +} + +function afficher_requeteperso_id(idrequete) +{ + window.location.assign($("#racineWeb" ).val()+"Ficherequetesperso/"+idrequete+"/"); +} + +function desactiver_requeteperso(codeRequete) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeRequete="+codeRequete; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/desactiver/", + 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); + + param_requeteperso_liste(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_requeteperso(codeRequete) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "codeRequete="+codeRequete; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/activer/", + 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); + + param_requeteperso_liste(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function afficher_sourcedonneesrequeteperso_id(idsourcerequete) +{ + window.location.assign($("#racineWeb" ).val()+"Fichesourcedonneesrequetesperso/"+idsourcerequete+"/"); +} + + +function param_sourcedonneesrequeteperso_liste() +{ + window.location.assign($("#racineWeb" ).val()+"Sourcerequetesperso/"); +} + + +function enregistrer_modif_sourcedonneesrequeteperso() +{ + idsourcerequete = $("#idsourcerequete").val(); + sourceDonnees = $("#sourceDonnees").val(); + sourceDonnees = supprimer_espace_string(sourceDonnees); + + if (sourceDonnees<=" ") + { + v_msg="Veuillez saisir la source de données!"; + v_msgEng="Please enter the data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if (sourceDonnees.substring(0, 9)!="sp_perso_") + { + v_msg="Doit commencer par (sp_perso_)!"; + v_msgEng="Must start by (sp_perso_)!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if (sourceDonnees=="sp_perso_") + { + v_msg="Veuillez saisir la source de données!"; + v_msgEng="Please enter the data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + donnees = 'idsourcerequete=' + idsourcerequete; + donnees += '&sourceDonnees=' + sourceDonnees; + + 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()+"Ajaxparamrequeteperso/enregistrermodifsourcedonneesrequeteperso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + param_sourcedonneesrequeteperso_liste(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function desactiver_sourcedonneesrequeteperso(sourceDonnees) +{ + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "sourceDonnees="+sourceDonnees; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/desactiversourcedonnees/", + 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); + + param_sourcedonneesrequeteperso_liste(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_sourcedonneesrequeteperso(sourceDonnees) +{ + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "sourceDonnees="+sourceDonnees; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/activersourcedonnees/", + 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); + + param_sourcedonneesrequeteperso_liste(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function creer_sourcedonneesrequeteperso() +{ + sourceDonnees = $("#sourceDonnees").val(); + sourceDonnees = supprimer_espace_string(sourceDonnees); + + if (sourceDonnees<=" ") + { + v_msg="Veuillez saisir la source de données!"; + v_msgEng="Please enter the data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if (sourceDonnees.substring(0, 9)!="sp_perso_") + { + v_msg="Doit commencer par (sp_perso_)!"; + v_msgEng="Must start by (sp_perso_)!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if (sourceDonnees=="sp_perso_") + { + v_msg="Veuillez saisir la source de données!"; + v_msgEng="Please enter the data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + donnees = 'sourceDonnees=' + sourceDonnees; + + 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()+"Ajaxparamrequeteperso/creersourcedonneesrequeteperso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + param_sourcedonneesrequeteperso_liste(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrer_modif_requeteperso() +{ + idrequete = $("#idrequete").val(); + codeRequete = $("#codeRequete").val(); + + nomRequete = $("#nomRequete").val(); + nomRequeteEng = $("#nomRequeteEng").val(); + descriptionRequete = $("#descriptionRequete").val(); + sourceDonnees = $("#sourceDonnees").val(); + ordre = $("#ordreRequete").val(); + + if(nomRequete<=" ") + { + v_msg="Veuillez indiquer le nom de la requête en Français!"; + v_msgEng="Please enter the name of the request in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomRequete").focus(); + return; + } + + if(nomRequeteEng<=" ") + { + v_msg="Veuillez indiquer le nom de la requête en Anglais!"; + v_msgEng="Please enter the name of the request in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomRequeteEng").focus(); + return; + } + + if(descriptionRequete<=" ") + { + v_msg="Veuillez entrer une description!"; + v_msgEng="Please enter a description!"; + alert_ebene(v_msg, v_msgEng); + + $("#descriptionRequete").focus(); + return; + } + + if(sourceDonnees<=" ") + { + v_msg="Veuillez sélectionner une source de données!"; + v_msgEng="Please select a data source!"; + alert_ebene(v_msg, v_msgEng); + + $("#sourceDonnees").focus(); + return; + } + + if(ordre<1) + { + v_msg="Veuillez donner un ordre à la requête!"; + v_msgEng="Please give an order to the query!"; + alert_ebene(v_msg, v_msgEng); + + $("#ordreRequete").focus(); + return; + } + + donnees = 'idrequete='+idrequete; + donnees += '&codeRequete='+codeRequete; + + donnees += '&nomRequete='+nomRequete; + donnees += '&nomRequeteEng='+nomRequeteEng; + donnees += '&descriptionRequete='+descriptionRequete; + donnees += '&sourceDonnees='+sourceDonnees; + donnees += '&ordre='+ordre; + + v_msg="Confirmez-vous cette nouvelle requête?"; + v_msgEng="Do you confirm this new qurey?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamrequeteperso/enregistrermodifrequeteperso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + param_requeteperso_liste(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function parametres_sourcedonneesrequeteperso(idsourcerequete) +{ + window.location.assign($("#racineWeb" ).val()+"Paramsourcedonneesrequetesperso/"+idsourcerequete+"/"); +} + +function reconstruire_param_requeteperso(idsourcerequete) +{ + donnees = 'idsourcerequete=' + idsourcerequete; + + 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()+"Ajaxparamrequeteperso/reconstruireparamrequeteperso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + parametres_sourcedonneesrequeteperso(idsourcerequete); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajaxenteteetatperso() +{ + $("#div_ente_requete").html(""); + + codeRequete=$("#codeRequete").val(); + + if (codeRequete<=" ") + { + v_msg="Veuillez sélectionner une requête!"; + v_msgEng="Please select a query!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeRequete").focus(); + return; + } + + donnees = 'codeRequete='+codeRequete; + + v_url = $("#racineWeb").val()+"Ajaxenteteetatperso/"; + + $("#div_ente_requete").html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ente_requete").html(data); + $(".datepicker").datepicker({dateFormat: 'yy-mm-dd'}); + $("#codeGcAssureur" ).selectpicker(); + $("#idPolice" ).selectpicker(); + filtrespolicegarant(); + } + }); +} + + +function executer_etat_perso() +{ + donnees_retour = ""; + + donnees = $("#frm_requete_perso").serialize(); + + $('#div_export_a').html(""); + + 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()+"Ajaxetatperso/"; + + // + + 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); + $("#codeGcAssureur" ).selectpicker(); + $("#idPolice" ).selectpicker(); + } + }); +} +function ctrlkeypress_familleacte(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_caracteristiques_acte(); + } +} + +function afficher_caracteristiques_acte() +{ + effacer_caracteristiques_un_acte(); + + codeFamilleActe=$("#codeFamilleActe").val(); + libelleActe=$("#libelleActe").val(); + + if(libelleActe<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleActe").focus(); + return; + } + + donnees = 'codeFamilleActe='+codeFamilleActe+'&libelleActe='+libelleActe; + + var div_detail_actes = $('#div_detail_actes'); + div_detail_actes.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxacracteristiquesacte/", + type: 'POST', + data: donnees, + success: function(data) { + div_detail_actes.html(data); + dataTableSpeciale(); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + } + }); +} +//requetespersopdf +function executer_etat_persopdf() +{ + donnees_retour = ""; + + donnees = $("#frm_requete_perso").serialize(); + + $('#div_export_a').html(""); + + 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()+"Ajaxetatpersopdf/"; + + // + + + + 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(""); + $("#codeGcAssureur" ).selectpicker(); + $("#idPolice" ).selectpicker(); + $('#div_export_a').html(donnees_retour); + } + }); +} + +function afficher_caracteristiques_un_acte(idActe) +{ + donnees = 'idActe='+idActe; + donnees_retour = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxacracteristiquesacte/fichecracteristiquesacte/", + type: 'POST', + data: donnees, + success: function(data) + { + donnees_retour = data; + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + $('#div_fiche_acte').html(donnees_retour); + } + }); +} + +function init_import_assures() +{ + nbAdh = $("#nbAdh_C").val(); + codeTypeContrat = $("#codeTypeContrat_C").val(); + + // if ( (codeTypeContrat!="G") && (nbAdh>0) ) + //if (codeTypeContrat!="G") + if (codeTypeContrat=="P") + { + 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()+"Importassure/"); +} + +function desactiver_derogation_permanente(idBeneficiaire) +{ + observations=$("#observations").val(); + + if (observations<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + v_msg="Confirmez-vous la désactivation?"; + v_msgEng="Do you confirm the deactivation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idBeneficiaire="+idBeneficiaire; + donnees += '&observations='+observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxderogationsbenficiaire/desactiverderogationpermanente/", + 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); + + liste_derogation_permanente(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function activer_derogation_permanente(idBeneficiaire) +{ + observations=$("#observations").val(); + + if (observations<=" ") + { + v_msg="Veuillez saisir un motif!"; + v_msgEng="Please enter a reaon!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idBeneficiaire="+idBeneficiaire; + donnees += '&observations='+observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxderogationsbenficiaire/activerderogationpermanente/", + 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); + + liste_derogation_permanente(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + +function liste_derogation_permanente() +{ + window.location.assign($("#racineWeb" ).val()+"Derogationpermanente/"); +} + +function raffraichier_gabarit() +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgabarit/", + success: function(data) + { + $("#div_ajaxgabarit").html(data); + + //codeSociete = $("#codeSociete").val(); + //codeLangue = $("#codeLangue").val(); + + fusionConsOrd = $("#fusionConsOrd").val(); + vue = $("#vue").val(); + + if(fusionConsOrd != "1" && vue !="Connexion"){ + + window.location.assign($("#racineWeb" ).val()+"Connexion/"); + } + + }, + error: function(errorData) + { + }, + complete: function() + { + $(".datepicker" ).datepicker(); + + raffraichier_messagerie(); + } + }); +} + +function connexion_cookie() +{ + msgErreur=$("#msgErreur").val(); + + donnees = 'msgErreur='+msgErreur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconnexioncookie/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_ajaxconnexion").html(data); + $(".selectpicker").selectpicker(); + }, + error: function(errorData) + { + }, + complete: function() + { + var login = document.getElementById("login").value; + if (login>" ") + { + $("#mdp").focus(); + } + else + { + $("#codeSociete").focus(); + } + } + }); +} + +function afficher_quittances_police_periode() +{ + idPolice = $("#idPolice_C" ).val(); + debut = $("#debut" ).val(); + fin = $("#fin" ).val(); + + donnees = 'idPolice='+idPolice; + donnees += '&debut='+debut; + donnees += '&fin='+fin; + + // alert("donnees => "+donnees); + // return; + + $("#div_quittancepolice").html('
' + '
'); + + if (numeroPolice>" ") + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfichepolice/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_quittancepolice").html(data); + } + }); + } +} + +function afficher_adherents_police() +{ + $("#div_liste_adherent").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteadherent/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_adherent").html(data); + $("#idCollegePolice").selectpicker(); + appliquerDataTable(); + } + }); +} + +function diagnosticsfeuillemaladie() +{ + /* + actVisible=$("#actVisible").val(); + + if (actVisible!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + window.location.assign($("#racineWeb" ).val()+"Diagnosticscons/"); +} + +function afficher_diagnostics_feuille() +{ + $("#div_dianostics").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdiagnosticscons/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_dianostics").html(donnees_retour); + } + }); +} + +function afficher_ecarts_facture() +{ + $("#div_ecart_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/ecartfacture/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_ecart_decompte").html(donnees_retour); + } + }); +} + +function ecarts_facture_non_saisies() +{ + $("#div_ecart_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/ecartnonsaisi/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_ecart_decompte").html(donnees_retour); + } + }); +} + +function maj_observations_ecart_facture(idEcart, observations) +{ + let v_msg = "Veuillez saisir ou modifier les observations!"; + let v_msgEng = "Please enter or edit comments!"; + + prompt_ebene(v_msg, v_msgEng, "", function(observations) { + if(observations==null) + { + return; + } + + 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é + let donnees = 'idEcart='+idEcart; + donnees += "&observations=" + encodeURIComponent(observations); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/majobservations/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + }); + +} + +function recapituler_ecarts_décompte() +{ + // alert("recapituler_ecarts_décompte"); + + $("#div_entete_ecart_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/recapecratdecompte/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_entete_ecart_decompte").html(donnees_retour); + } + }); +} + +function init_new_ecart_decompte_non_saisi() +{ + $('#div_saisie_ecart').html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/initnewecart/", + type : 'post', + error: function(errorData) { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() + { + $('#div_saisie_ecart').html(donnees_retour); + // $this->executerAction("index"); + } + }); +} + +function maj_ecart_facture(idEcart) +{ + donnees = 'idEcart='+idEcart; + + $('#div_saisie_ecart').html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/initmajecartnonsaisi/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + donnees_retour = data; + }, + complete: function() + { + $('#div_saisie_ecart').html(donnees_retour); + $(".datepicker" ).datepicker(); + } + }); + +} + +function ctrlkeypressbeneficiaireecart(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#numeroBeneficiaire").blur(); + } +} + +function chercher_beneficiaireecart(numeroBeneficiaire) +{ + $("#div_saisie_ecart").html('
' + '
'); + + donnees = 'numeroBeneficiaire='+numeroBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/rechercherbeneficiaireecart/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_saisie_ecart").html(data); + }, + error: function(data) { + }, + complete: function() { + $(".datepicker" ).datepicker(); + } + }); +} + + +function ajouter_ecartdecompte_non_saisi() +{ + idBeneficiaire = $("#idBeneficiaireEcart" ).val(); + dateFacture = $("#dateFacture" ).val(); + montantPrestataire = $("#montantPrestataire" ).val(); + observations = $("#observations" ).val(); + + if(idBeneficiaire<="0") + { + v_msg="Bénéficiaire manquant!"; + v_msgEng="Missing beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBeneficiaire").focus(); + return; + } + + if(dateFacture<=" ") + { + v_msg="Date manquant!"; + v_msgEng="Missing date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + if(isNaN(montantPrestataire)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire").val("0"); + $("#montantPrestataire").focus(); + return; + } + + if(Math.abs(montantPrestataire)=="0") + { + v_msg="Montant manquant!"; + v_msgEng="Missing amount!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire").val("0"); + $("#montantPrestataire").focus(); + return; + } + + if(observations<=" ") + { + v_msg="observations manquant!"; + v_msgEng="Missing observations!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + $("#dateFactureReelle").val(dateFacture); + + if (date_inclus_mois_decompte()) + { + donnees = 'idBeneficiaire='+idBeneficiaire; + donnees += '&dateFacture='+dateFacture; + donnees += '&montantPrestataire='+montantPrestataire; + donnees += '&observations='+observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/ajouterecartdecomptenonsaisi/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#div_saisie_ecart").html(data); + }, + error: function(data) { + }, + complete: function() { + ecarts_facture_non_saisies(); + recapituler_ecarts_décompte(); + } + }); + } +} + +function supprimer_ecart_facture(idEcart) +{ + 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 = 'idEcart='+idEcart; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/supprimerecart/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ecarts_facture_non_saisies(); + recapituler_ecarts_décompte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function maj_ecartdecompte_non_saisi() +{ + idEcart = $("#idEcart" ).val(); + idBeneficiaire = $("#idBeneficiaireEcart" ).val(); + dateFacture = $("#dateFacture" ).val(); + montantPrestataire = $("#montantPrestataire" ).val(); + observations = $("#observations" ).val(); + + if(idBeneficiaire<="0") + { + v_msg="Bénéficiaire manquant!"; + v_msgEng="Missing beneficiary!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(idEcart<="0") + { + v_msg="Veuillez sélectionner la ligne à modifier!"; + v_msgEng="Please select the line to edit!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(dateFacture<=" ") + { + v_msg="Date manquant!"; + v_msgEng="Missing date!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateFacture").focus(); + return; + } + + if(isNaN(montantPrestataire)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire").val("0"); + $("#montantPrestataire").focus(); + return; + } + + if(Math.abs(montantPrestataire)=="0") + { + v_msg="Montant manquant!"; + v_msgEng="Missing amount!"; + alert_ebene(v_msg, v_msgEng); + + $("#montantPrestataire").val("0"); + $("#montantPrestataire").focus(); + return; + } + + if(observations<=" ") + { + v_msg="observations manquant!"; + v_msgEng="Missing observations!"; + alert_ebene(v_msg, v_msgEng); + + $("#observations").focus(); + return; + } + + $("#dateFactureReelle").val(dateFacture); + if (date_inclus_mois_decompte()) + { + donnees = 'idEcart='+idEcart; + donnees += '&idBeneficiaire='+idBeneficiaire; + donnees += '&dateFacture='+dateFacture; + donnees += '&montantPrestataire='+montantPrestataire; + donnees += '&observations='+observations; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecompte/majecartnonsaisi/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ecarts_facture_non_saisies(); + recapituler_ecarts_décompte(); + } + }); + } +} + +function imprimer_ecarts_decompte() +{ + var div_export = $('#div_export_ecart_decompte'); + + div_export.html('
' + '
'); + + $("#btn_imprimer_ecart_decompte").click(); + + // alert("Ajaximprimerecartdecompte"); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerecartdecompte/", + type: 'POST', + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // $("#btn_imprimer_ecart_decompte").click(); + } + }); + +} + +function afficher_ecarts_facture_cons() +{ + $("#div_ecart_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecomptecons/ecartfacture/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_ecart_decompte").html(donnees_retour); + } + }); +} + +function ecarts_facture_non_saisies_cons() +{ + $("#div_ecart_decompte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxecartdecomptecons/ecartnonsaisi/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_ecart_decompte").html(donnees_retour); + } + }); +} + +function etat_prod_situation_clients() +{ + dateAnalyse = $("#dateAnalyse").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'dateAnalyse='+dateAnalyse; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_prod_situation_clients_export() +{ + dateAnalyse = $("#dateAnalyse").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'dateAnalyse='+dateAnalyse; + + 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()+"Ajax"+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 etat_sin_paiementprestationcumul() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); + +} + +function etat_sin_paiementprestationcumul_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_sin_paiementprestationdet() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); + +} + +function etat_sin_paiementprestationdet_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 gerer_acces_affection_prestataire(codeUtilisateur, AffectionVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&AffectionVisible="+AffectionVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/gereraccesaffection/", + 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); + + users_prestataire(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); +} + +function gerer_acces_affection_assureur_hab(codeUtilisateur, AffectionVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&AffectionVisible="+AffectionVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparamactesvisible/gereraccesaffection/", + 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); + + afficher_user_profil_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 gerer_acces_affection_gc(codeUtilisateur, AffectionVisible) +{ + 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é + donnees = "codeUtilisateur="+codeUtilisateur+"&AffectionVisible="+AffectionVisible; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/gereraccesaffection/", + 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); + + users_gc(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + +} + + +function desactiver_derogation_finger_prestataire(codePrestataire) { + let v_msg = "Veuillez saisir le motif de désactivation de la biométrie!"; + let v_msgEng = "Please enter the reason for deactivating biometrics!"; + + prompt_ebene(v_msg, v_msgEng, "", function(motif_activation) { + if (!motif_activation || motif_activation.trim() === "") { + v_msg = "Vous devez saisir un motif!"; + v_msgEng = "You have to enter a reason!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg = "Confirmez-vous la désactivation?"; + v_msgEng = "Do you confirm the deactivation?"; + + confirm_ebene(v_msg, v_msgEng).then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + let donnees = "codePrestataire=" + codePrestataire; + donnees += "&motif=" + encodeURIComponent(motif_activation); + + $.ajax({ + url: $("#racineWeb").val() + "Ajaxprestataire/desactiverderogationfinger/", + 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_prestataire_id(); + } + }); + } else { + // L'utilisateur a annulé + v_msg = "Opération annulée!"; + v_msgEng = "Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + } + }); + }); +} + + +function activer_derogation_finger_prestataire(codePrestataire) +{ + let v_msg = "Veuillez saisir le motif de l\'activation de la biométrie!"; + let v_msgEng = "Please enter the reason for activating biometrics!"; + + prompt_ebene(v_msg, v_msgEng, "", function(motif_activation) { + if (!motif_activation || motif_activation.trim() === "") { + v_msg = "Vous devez saisir un motif!"; + v_msgEng = "You have to enter a reason!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg="Confirmez-vous l\'activation?"; + v_msgEng="Do you confirm the activation?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + let donnees = "codePrestataire=" + codePrestataire; + donnees += "&motif=" + encodeURIComponent(motif_activation); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestataire/activerderogationfinger/", + 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_prestataire_id(); + } + }); + return; + } else { + // L'utilisateur a annulé + v_msg="Opération annulée!"; + v_msgEng="Operation canceled!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + }); + }); +} + + +function exporter_liste_clients() +{ + var div_export = $('#div_export_clients'); + div_export.html('
' + '
'); + + $("#btn_liste_clients").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterlisteclients/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + // $("#btn_liste_clients").click(); + } + }); +} + + +function etat_fact_par_client() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_fact_par_client_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_fact_par_mois() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_fact_par_mois_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_fact_par_emission() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_fact_par_emission_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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_emission_prime() +{ + idEmission=$("#idEmission").val(); + idPolice=$("#idPolice").val(); + + donnees = "idEmission="+idEmission+"&idPolice="+idPolice; + + var div_export = $('#div_export_emissions'); + div_export.html('
' + '
'); + + $("#btn_export_emissions").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterquittancesemission/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function imprimer_quittance(idQuittance) +{ + if (idQuittance>"0") + { + donnees = "idQuittance="+idQuittance; + + + var div_export = $('#div_export_quittance'); + div_export.html('
' + '
'); + + $("#btn_export_quittance").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterunequittance/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.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; + } +} + +// etatprod_encaissement +function etat_enc_par_client() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_enc_par_client_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_enc_par_mois() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_enc_par_mois_export() +{ + + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 etat_borderau_encissements() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_borderau_encissements_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 ctrlkeypressemission(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#numeroEmission").blur(); + } +} + +function requete_chercher_emission(numeroEmission) +{ + $("#div_consulter_resultat").html(''); + + $("#div_consulter_resultat").html('
' + '
'); + + donnees = 'numeroEmission='+numeroEmission; + + + if(isNaN(numeroEmission)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroEmission").val("0"); + $("#numeroEmission").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrechercheemission/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_consulter_resultat").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ctrlkeypressquittance(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#idQuittance").blur(); + } +} + +function requete_chercher_quittance(idQuittance) +{ + $("#div_consulter_resultat").html(''); + + $("#div_consulter_resultat").html('
' + '
'); + + donnees = 'idQuittance='+idQuittance; + + if(isNaN(idQuittance)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idQuittance").val("0"); + $("#idQuittance").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrecherchequittance/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_consulter_resultat").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ctrlkeypressencaissement(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#numeroEncaissement").blur(); + } +} + +function requete_chercher_encaissement(numeroEncaissement) +{ + $("#div_consulter_resultat").html(''); + + $("#div_consulter_resultat").html('
' + '
'); + + donnees = 'numeroEncaissement='+numeroEncaissement; + + if(isNaN(numeroEncaissement)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroEncaissement").val("0"); + $("#numeroEncaissement").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxrechercheencaissement/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_consulter_resultat").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function afficher_emission_retour() +{ + idEmission = $("#idEmission").val(); + + if (idEmission>"0") + { + window.location.assign($("#racineWeb" ).val()+"Detailemission/"+idEmission+"/"); + } +} + +function etat_enc_par_mois() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function afficher_beneficiare_prime_adherent() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $("#div_detail_requete").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireprimeadherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_requete").html(donnees_retour); + } + }); +} + +function afficher_beneficiare_prime_beneficiaire() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $("#div_detail_requete").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxbeneficiaireprimebeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_requete").html(donnees_retour); + } + }); +} + +function maj_motif_non_paiement(idReglement, motifNonPaiement) +{ + let v_msg = "Veuillez saisir ou modifier le commentaire!"; + let v_msgEng = "Please enter or edit comments!"; + + prompt_ebene(v_msg, v_msgEng, "", function(motifNonPaiement) { + if(motifNonPaiement==null) + { + return; + } + + 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é + let donnees = 'idReglement='+idReglement; + donnees += "&motifNonPaiement="+encodeURIComponent(motifNonPaiement); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxldemandesteglementcpt/majmotifnonpaiement/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + }); + +} + +function afficher_garantieadherent_exo() +{ + var div_attente = $('#div_gar_exo'); + + exercieReference=$("#exercieReference").val(); + + if (exercieReference<=" ") + { + v_msg="Veuillez sélectionner un exercice!"; + v_msgEng="Please select an exercise!"; + alert_ebene(v_msg, v_msgEng); + + $("#exercieReference").focus(); + + div_attente.html(''); + + return; + } + + donnees = 'exercieReference='+exercieReference; + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondadherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function afficher_garantieadherent_entete_contrat() +{ + var div_attente = $('#div_gar_exo'); + + idEntetecontrat=$("#idEntetecontrat").val(); + + if (idEntetecontrat<="0") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#idEntetecontrat").focus(); + + div_attente.html(''); + + return; + } + + // donnees = 'exercieReference='+exercieReference; + donnees = 'idEntetecontrat='+idEntetecontrat; + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondadherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function ajaxdelaicarencetypecontrat() +{ + codeTypeContrat=$("#codeTypeContrat").val(); + + donnees = 'codeTypeContrat='+codeTypeContrat; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdelaicarencetypecontrat/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infodelaicarence").html(data); + }, + complete: function() { + $("#delaiCarencePolice").val( $("#delaiCarencePolice_info").val()); + } + }); +} + +function afficher_liste_medecins() +{ + donnees = ""; + donnees_retour = ""; + + codeMetier = $("#codeMetier").val(); + codeSpecialite = $("#codeSpecialite").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + + + + if(codeMetier<=" " && codeSpecialite<=" " && nom<=" " && prenoms<=" " && noOrdreMedecin<=" ") + { + v_msg="Veuillez saisir au moins un critère de recherche!"; + v_msgEng="Please enter at least one search criteria!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + donnees += 'codeMetier='+codeMetier; + donnees += '&codeSpecialite='+codeSpecialite; + donnees += '&nom='+nom; + donnees += '&prenoms='+prenoms; + donnees += '&noOrdreMedecin='+noOrdreMedecin; + + //alert(donnees); + //return; + + $("#div_liste_medeins").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemedecinsparametrage/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_liste_medeins").html(donnees_retour); + $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); + + appliquerDataTable(); + } + }); +} + +function ctrlkeypress_liste_medecins(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_medecins(); + } +} + +function imprimer_liste_medecins() +{ + donnees = ""; + donnees_retour = ""; + + codeMetier = $("#codeMetier").val(); + codeSpecialite = $("#codeSpecialite").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + + + + if(codeMetier<=" " && codeSpecialite<=" " && nom<=" " && prenoms<=" " && noOrdreMedecin<=" ") + { + v_msg="Veuillez saisir au moins un critère de recherche!"; + v_msgEng="Please enter at least one search criteria!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + donnees += 'codeMetier='+codeMetier; + donnees += '&codeSpecialite='+codeSpecialite; + donnees += '&nom='+nom; + donnees += '&prenoms='+prenoms; + donnees += '&noOrdreMedecin='+noOrdreMedecin; + + $("#div_liste_medeins").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlistemedecins/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_liste_medeins").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function exporter_liste_medecins() +{ + donnees = ""; + donnees_retour = ""; + + codeMetier = $("#codeMetier").val(); + codeSpecialite = $("#codeSpecialite").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + + + + if(codeMetier<=" " && codeSpecialite<=" " && nom<=" " && prenoms<=" " && noOrdreMedecin<=" ") + { + v_msg="Veuillez saisir au moins un critère de recherche!"; + v_msgEng="Please enter at least one search criteria!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + donnees += 'codeMetier='+codeMetier; + donnees += '&codeSpecialite='+codeSpecialite; + donnees += '&nom='+nom; + donnees += '&prenoms='+prenoms; + donnees += '&noOrdreMedecin='+noOrdreMedecin; + + $("#div_liste_medeins").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlistemedecinsexport/", + type: 'POST', + data: donnees, + success: function(data) + { + $("#div_liste_medeins").html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function afficher_medecin_id(idMedecin) +{ + window.location.assign($("#racineWeb" ).val()+"Fichemedecin/"+idMedecin+"/"); +} + +function modifier_medecin() +{ + idMedecin = $("#idMedecin" ).val(); + + if (idMedecin>"0") + { + window.location.assign($("#racineWeb" ).val()+"Modifiermedecin/"+idMedecin+"/"); + } +} + +function creer_medecin() +{ + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codeSpecialite = $("#codeSpecialite").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + telephone = $("#telephone").val(); + codeMetier = $("#codeMetier").val(); + adresse = $("#adresse").val(); + email = $("#email").val(); + sexe = $("#sexe").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez indiquer le prénoms!"; + v_msgEng="Please give the first names"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + if(codeMetier<=" ") + { + v_msg="Veuillez sélectionner la corporation!"; + v_msgEng="Please select the corporation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + if(codeMetier == "MED" || codeMetier == "PRO"){ + if(codeSpecialite<=" ") + { + v_msg="Veuillez sélectionner la spécialité!"; + v_msgEng="Please select the specialty"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + } + + if(sexe<=" ") + { + v_msg="Veuillez indiquer le sexe!"; + v_msgEng="Please indicate sex"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email; + donnees += '&codeSpecialite='+codeSpecialite+'&noOrdreMedecin='+noOrdreMedecin+'&sexe='+sexe; + donnees += '&codeMetier='+codeMetier+'&adresse='+adresse; + + // alert(donnees); + //return; + + v_msg="Confirmez-vous ce nouveau praticien?"; + v_msgEng="Do yo confirm this new practitioner?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinparam/creermedecin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_unicite_medecin').html(data); + //retour_a_medecins(); + }, + complete: function() + { + unicitemedecin = $("#unicitemedecin").val(); + if(unicitemedecin==1) + { + v_msg="Praticien créé avec succès!"; + v_msgEng="Doctor created succssfully!"; + alert_ebene(v_msg, v_msgEng); + + retour_a_medecins(); + } + else + { + v_msg="No Ordre " + noOrdreMedecin +" déjà utilisé!"; + v_msgEng="Doctor Order No " + noOrdreMedecin +" already in use!"; + alert_ebene(v_msg, v_msgEng); + + $("#noOrdreMedecin").focus(); + } + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_a_medecins() +{ + window.location.assign($("#racineWeb" ).val()+"Medecins/"); +} + +function retour_medecin_id() +{ + idMedecin = $("#idMedecin").val(); + afficher_medecin_id(idMedecin); +} + +function enregistrer_modif_medecin() +{ + idMedecin = $("#idMedecin").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codeSpecialite = $("#codeSpecialite").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + telephone = $("#telephone").val(); + + codeMetier = $("#codeMetier").val(); + adresse = $("#adresse").val(); + + email = $("#email").val(); + sexe = $("#sexe").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez indiquer le prénoms!"; + v_msgEng="Please give the first names"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + if(codeMetier<=" ") + { + v_msg="Veuillez sélectionner la corporation!"; + v_msgEng="Please select the corporation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + if(codeSpecialite<=" ") + { + v_msg="Veuillez sélectionner la spécialité!"; + v_msgEng="Please select the specialty"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + + if(sexe<=" ") + { + v_msg="Veuillez indiquer le sexe!"; + v_msgEng="Please indicate sex"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'idMedecin='+idMedecin+'&nom='+nom; + donnees += '&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email; + donnees += '&codeSpecialite='+codeSpecialite+'&noOrdreMedecin='+noOrdreMedecin+'&sexe='+sexe; + donnees += '&codeMetier='+codeMetier+'&adresse='+adresse; + + 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()+"Ajaxmedecinparam/enregistrermodifmedecin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_medecin_id(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function reposmedical() +{ + actVisible=$("#actVisible").val(); + + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Reposmedical/"); +} + +function afficher_repos_medical() +{ + $("#div_notes").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreposmedical/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_notes").html(donnees_retour); + } + }); +} + +function initier_repos_medical() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreposmedical/nouveaureposmedical/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_note_new").html(data); + }, + complete: function() { + $("#btn_pop_note_new").click(); + } + }); +} + +function enregistrer_new_repos_medical() +{ + notesNew = $("#notesNew").val(); + notesNew = notesNew.trim(); + + if (notesNew<=" ") + { + v_msg="Veuillez saisir la note!"; + v_msgEng="Please enter the note!"; + alert_ebene(v_msg, v_msgEng); + + $("#notesNew").focus(); + return; + } + + nbJour = $("#nbJour").val(); + + if(isNaN(nbJour)) + { + v_msg="Veuillez revoir la duréee!"; + v_msgEng="Please review the duration!"; + alert_ebene(v_msg, v_msgEng); + + $("#nbJour").focus(); + return; + } + + if (nbJour<="0") + { + v_msg="Veuillez revoir la duréee!"; + v_msgEng="Please review the duration!"; + alert_ebene(v_msg, v_msgEng); + + $("#nbJour").focus(); + return; + } + + donnees = 'notesNew='+notesNew+"&nbJour="+nbJour; + + v_msg="Confirmez-vous ce repos médical?"; + v_msgEng="Do you confirm this medical rest?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxreposmedical/creerreposmedical/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#btn_pop_note_new_quit").click(); + }, + complete: function() { + afficher_repos_medical(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} +// +function charger_detail_stat_police_anomalies() +{ + $('#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()+"Ajaxdetailrapportspanomalie/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $('#div_export_b').html(donnees_retour); + } + }); +} + +function imprimer_quittance_client(idQuittance) +{ + if (idQuittance>"0") + { + donnees = "idQuittance="+idQuittance; + + + var div_export = $('#div_export_quittance'); + div_export.html('
' + '
'); + + $("#btn_export_quittance").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterunequittanceclient/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.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; + } +} + +function imprimer_livraison_bon_differe(idgenerartionbon) +{ + donnees = "idgenerartionbon="+idgenerartionbon; + + $('#btn_accuse_reception').click(); + + var div_accuse_reception = $('#div_accuse_reception'); + div_accuse_reception.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlivraisonbonsdiffere/", + type: 'POST', + data: donnees, + success: function(data) + { + div_accuse_reception.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function imprimer_livraison_bon_menu() +{ + idGenerationbon = $("#idGenerationbon").val(); + imprimer_livraison_bon_differe(idGenerationbon); +} + +function anteceentsmedicaux() +{ + estMedecin=$("#estMedecin").val(); + + if (estMedecin!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Anteceentsmedicaux/"); +} + +function diagnosticsbeneficiaire() +{ + estMedecin=$("#estMedecin").val(); + + if (estMedecin!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Diagnosticsconsbeneficiaire/"); +} + +function notesbeneficiaire() +{ + estMedecin=$("#estMedecin").val(); + + if (estMedecin!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Notesbeneficiaire/"); +} + +function afficher_diagnostics_beneficiaire() +{ + $("#div_dianostics").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdiagnosticsbeneficiaire/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_dianostics").html(donnees_retour); + } + }); +} + +function afficher_notes_beneficiaire() +{ + $("#div_notes").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnotesbeneficiaire/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_notes").html(donnees_retour); + } + }); +} + +function etat_sin_paiementprestationcumul_graph() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+codeEtat+"graph/"; + + var div_export = $('#div_detail_requete'); + div_export.html('
' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + // alert("error =>"+errorData); + }, + success: function(data) { + donnees_retour = data; + // alert("success =>"+data); + }, + complete: function() { + $('#div_detail_requete').html(""); + $('#div_export_a').html(donnees_retour); + } + }); +} + +// 27/11/2019 + +function etat_prod_par_mois_eclate() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + +function etat_prod_par_mois_eclate_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 effacer_caracteristiques_un_acte() +{ + $('#div_fiche_acte').html(""); +} + +function enregistrer_modif_caracteristiques_un_acte() +{ + idActe = $("#idActe").val(); + codeActe = $("#codeActe").val(); + + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + // codeFamilleActe = $("#codeFamilleActe").val(); + codeFamilleActe = $("#codeFamilleActeMaj").val(); + codeGarantie = $("#codeGarantie").val(); + codeTarifActe = $("#codeTarifActe").val(); + codeTypePrestation = $("#codeTypePrestation").val(); + + ententePrealable = $("#ententePrealable").val(); + exclu = $("#exclu").val(); + actif = $("#actif").val(); + alerte = $("#alerte").val(); + delaiCarenceActe = $("#delaiCarenceActe").val(); + + if(libelle<=" ") + { + v_msg="Veuillez saisir le libellé en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez saisir le libellé en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + if(codeFamilleActe<=" ") + { + v_msg="Veuillez sélectionner la famille!"; + v_msgEng="Please select the family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(codeGarantie<=" ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a benefit!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").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; + } + + if(codeTypePrestation<=" ") + { + v_msg="Veuillez sélectionner un type!"; + v_msgEng="Please select a type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestation").focus(); + return; + } + + donnees = 'idActe='+idActe; + donnees += '&codeActe='+codeActe; + + donnees += '&libelle='+libelle; + donnees += '&libelleEng='+libelleEng; + donnees += '&codeFamilleActe='+codeFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&codeTarifActe='+codeTarifActe; + donnees += '&codeTypePrestation='+codeTypePrestation; + + donnees += '&ententePrealable='+ententePrealable; + donnees += '&exclu='+exclu; + donnees += '&actif='+actif; + donnees += '&alerte='+alerte; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + + 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()+"Ajaxacracteristiquesacte/enregistrermodifcaracteristiquesacte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + $('#div_fiche_acte').html(""); + }, + complete: function() + { + afficher_caracteristiques_acte(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_tarifs_actes() +{ + window.location.assign($("#racineWeb" ).val()+"Tarifsactes/"); +} + +function retour_tarifs_optiques() +{ + window.location.assign($("#racineWeb" ).val()+"Tarifsoptiques/"); +} + +function creer_tarif_actes() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + codeTypeTarifActe = $("#codeTypeTarifActe").val(); + + /* + codePrestataire = $("#codePrestataire").val(); + idPolice = $("#idPolice").val(); + + codeGroupePrestataire = $("#codeGroupePrestataire").val(); + + idSouscripteur = $("#idSouscripteur").val(); + + idCollege = $("#idCollege").val(); + */ + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + if(codeTypeTarifActe<=" ") + { + v_msg="Veuillez indiquer le type du tarif!"; + v_msgEng="Please indicate the type of tariff!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeTarifActe").focus(); + return; + } + + + donnees = 'libelle='+libelle+'&libelleEng='+libelleEng+'&codeTypeTarifActe='+codeTypeTarifActe; + //donnees += '&codePrestataire='+codePrestataire+'&idPolice='+idPolice+'&codeGroupePrestataire='+codeGroupePrestataire; + //donnees += '&idSouscripteur='+idSouscripteur+'&codeTarifActe='+codeTarifActe; + + v_msg="Confirmez-vous ce nouveau tarif?"; + v_msgEng="Do you confirm this new rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveautarifacte/creertarifactes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() + { + retour_tarifs_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_tarif_actes(idTarif) +{ + v_msg="Confirmez-vous la modification de ce tarif?"; + v_msgEng="Do you confirm the modification of this rate?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + window.location.assign($("#racineWeb" ).val()+"Modifiertarifacte/"+idTarif+"/"); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function enregistrer_modif_tarif_actes() +{ + idTarif = $("#idTarif").val(); + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + codeTypeTarifActe = $("#codeTypeTarifActe").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + if(codeTypeTarifActe<=" ") + { + v_msg="Veuillez indiquer le type du tarif!"; + v_msgEng="Please indicate the type of tariff!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeTarifActe").focus(); + return; + } + + + donnees = 'idTarif='+idTarif+'&libelle='+libelle+'&libelleEng='+libelleEng; + donnees += '&codeTypeTarifActe='+codeTypeTarifActe; + + 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()+"Ajaxnouveautarifacte/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function lister_tarif_actes() +{ + window.location.assign($("#racineWeb" ).val()+"Listetarifacte/"); +} + +function importer_tarif_actes(codeTarifActe) +{ + 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(); + + + donnees = 'codeTarifActe='+codeTarifActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/initimport/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Importertarifsactes/"); + } + }); +} + +function supprimer_tarif_actes(idTarif) +{ + 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()+"Ajaxnouveautarifacte/supprimer/", + type : 'post', + data: "idTarif="+idTarif, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_tarif_optiques() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'libelle='+libelle+'&libelleEng='+libelleEng; + + v_msg="Confirmez-vous ce nouveau tarif?"; + v_msgEng="Do you confirm this new rate?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveautarifoptique/creertarifoptiques/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_tarifs_optiques(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_tarif_optiques(idTarif) +{ + window.location.assign($("#racineWeb" ).val()+"Modifiertarifoptique/"+idTarif+"/"); +} + +function importer_tarif_optiques(idTarif) +{ + v_msg="En cours!"; + v_msgEng="In progress!"; + alert_ebene(v_msg, v_msgEng); + + // return; + + // window.location.assign($("#racineWeb" ).val()+"Importertarifoptique/"+idTarif+"/"); +} + +function supprimer_tarif_optiques(idTarif) +{ + 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()+"Ajaxnouveautarifoptique/supprimer/", + type : 'post', + data: "idTarif="+idTarif, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_optiques(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function lister_tarif_optiques() +{ + window.location.assign($("#racineWeb" ).val()+"Listetarifoptique/"); +} + +function enregistrer_modif_tarif_optiques() +{ + idTarif = $("#idTarif").val(); + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'idTarif='+idTarif+'&libelle='+libelle+'&libelleEng='+libelleEng; + + // alert(donnees); + // return; + + 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()+"Ajaxnouveautarifoptique/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + lister_tarif_optiques(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_familles_actes(idFamilleacte) +{ + window.location.assign($("#racineWeb" ).val()+"Modifierfamilleacte/"+idFamilleacte+"/"); +} + +function supprimer_familles_actes(idFamilleacte) +{ + 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()+"Ajaxlistefamilleactetarif/supprimer/", + type : 'post', + data: "idFamilleacte="+idFamilleacte, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_famille_actes_tarif() + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_famille_actes_tarif() +{ + 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; + + var div_attente = $('#div_liste_famille_acte'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefamilleactetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + dataTableSpeciale(); + }, + complete: function() { + } + }); +} + +function lister_famille_actes() +{ + window.location.assign($("#racineWeb" ).val()+"Listefamilleacte/"); +} + +function creer_famille_actes() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + codeGarantie = $("#codeGarantie").val(); + codeTypePrestation = $("#codeTypePrestation").val(); + + codeTarifActe = $("#codeTarifActe").val(); + hospitalisation = $("#hospitalisation").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'libelle='+libelle+'&libelleEng='+libelleEng; + donnees += '&codeGarantie='+codeGarantie+'&codeTypePrestation='+codeTypePrestation; + donnees += '&codeTarifActe='+codeTarifActe+'&hospitalisation='+hospitalisation; + + // alert(donnees); + // return; + + v_msg="Confirmez-vous ce nouvelle famille?"; + v_msgEng="Do you confirm this new family?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistefamilleactetarif/creerfamillectes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + lister_famille_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_factures_feuille() +{ + $("#div_detail_factures").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturesfeuille/", + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_factures").html(donnees_retour); + } + }); +} + +function consulter_un_dossier() +{ + window.location.assign($("#racineWeb" ).val()+"Dossiercons/"); +} + +function afficher_factures_consultation(numeroBonConsultation) +{ + if (numeroBonConsultation<="0") + { + v_msg="Revoir le numéro!"; + v_msgEng="Review the number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBonConsultation").focus(); + + return; + } + + donnees = "numeroBonConsultation="+numeroBonConsultation; + + $("#div_detail_factures").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdossiercons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_factures").html(donnees_retour); + } + }); +} + +function ctrlkeypressconsultation(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#numeroBonConsultation").blur(); + } +} + +function enregistrer_modif_famille_actes() +{ + idFamilleacte = $("#idFamilleacte").val(); + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + codeGarantie = $("#codeGarantie").val(); + codeTypePrestation = $("#codeTypePrestation").val(); + + codeTarifActe = $("#codeTarifActe").val(); + hospitalisation = $("#hospitalisation").val(); + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le nom en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez indiquer le nom en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'idFamilleacte='+idFamilleacte+'&libelle='+libelle+'&libelleEng='+libelleEng; + donnees += '&codeGarantie='+codeGarantie+'&codeTypePrestation='+codeTypePrestation; + donnees += '&codeTarifActe='+codeTarifActe+'&hospitalisation='+hospitalisation; + + 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()+"Ajaxlistefamilleactetarif/enregistrermodiffamilleactes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + lister_famille_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function exporter_tarif_medicament() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "codeTarifMedicament="+codeTarifMedicament; + + // alert(donnees); + // return; + + var div_export = $('#div_export_tarif'); + div_export.html('
' + '
'); + + $("#btn_exporter_tarif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarifmedicament/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function rechercher_actes_famille_param() +{ + var div_detail = $('#div_detail_actes'); + + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + libelleActe=$("#libelleActe").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 sélectionne une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe+'&libelleActe='+libelleActe; + + div_detail.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactefamilleparam/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_detail.html(data); + dataTableSpeciale(); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + } + }); +} + +function ajaxfiltrefamilleactetarif() +{ + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrefamilletarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + $("#listefamille").html(data); + } + }); +} + +function rechercher_actes_famille_param_tous() +{ + var div_detail = $('#div_detail_actes'); + + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + libelleActe=$("#libelleActe").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(libelleActe<=' ') + { + v_msg="Veuillez saisir une désignation!"; + v_msgEng="Please enter a designation!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&libelleActe='+libelleActe; + + div_detail.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactefamilleparam/tous/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_detail.html(data); + dataTableSpeciale(); + + }, + error : function(resultat, statut, erreur) + { + }, + complete: function() + { + } + }); +} + +function enregistrer_nouvel_acte() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + codeFamilleActe = $("#codeFamilleActe").val(); + codeGarantie = $("#codeGarantie").val(); + + //alert(codeGarantie); + + codeTarifActe = "ST"; + codeTypePrestation = $("#codeTypePrestation").val(); + + ententePrealable = $("#ententePrealable").val(); + + + + exclu = $("#exclu").val(); + actif = $("#actif").val(); + alerte = $("#alerte").val(); + delaiCarenceActe = "0"; + + lettreCle = $("#lettreCle").val(); + coefficient = $("#coefficient").val(); + + miseEnObservation = $("#miseEnObservation").val(); + + + if(libelle<=" ") + { + v_msg="Veuillez saisir le libellé en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez saisir le libellé en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + if(codeFamilleActe<=" ") + { + v_msg="Veuillez sélectionner la famille!"; + v_msgEng="Please select the family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(codeGarantie<=" ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a benefit!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").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; + } + + if(codeTypePrestation<=" ") + { + v_msg="Veuillez sélectionner un type!"; + v_msgEng="Please select a type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestation").focus(); + return; + } + + acteChambre = $("#acteChambre").val(); + prixModifiableEnHospit = $("#prixModifiableEnHospit").val(); + + donnees = 'libelle='+libelle; + donnees += '&libelleEng='+libelleEng; + donnees += '&codeFamilleActe='+codeFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&codeTarifActe='+codeTarifActe; + donnees += '&codeTypePrestation='+codeTypePrestation; + + donnees += '&ententePrealable='+ententePrealable; + donnees += '&exclu='+exclu; + donnees += '&actif='+actif; + donnees += '&alerte='+alerte; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + donnees += '&lettreCle='+lettreCle; + donnees += '&coefficient='+coefficient; + donnees += '&miseEnObservation='+miseEnObservation; + + donnees += '&acteChambre='+acteChambre; + donnees += '&prixModifiableEnHospit='+prixModifiableEnHospit; + + //alert(donnees); + //return; + + v_msg="Confirmez-vous cette opération?"; + 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()+"Ajaxnouvelacte/enregistrernouvelacte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_liste_actes() +{ + window.location.assign($("#racineWeb" ).val()+"Listeactes/"); +} + + +function modifier_un_acte(idActe) +{ + window.location.assign($("#racineWeb" ).val()+"Modifieracte/"+idActe+"/"); +} + +function enregistrer_modif_un_acte() +{ + idActe = $("#idActe").val(); + codeActe = $("#codeActe").val(); + + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + codeFamilleActe = $("#codeFamilleActe").val(); + codeGarantie = $("#codeGarantie").val(); + codeTarifActe = "ST"; + codeTypePrestation = $("#codeTypePrestation").val(); + + ententePrealable = $("#ententePrealable").val(); + exclu = $("#exclu").val(); + actif = $("#actif").val(); + alerte = $("#alerte").val(); + delaiCarenceActe = "0"; + lettreCle = $("#lettreCle").val(); + coefficient = $("#coefficient").val(); + miseEnObservation = $("#miseEnObservation").val(); + + + if(libelle<=" ") + { + v_msg="Veuillez saisir le libellé en Français!"; + v_msgEng="Please enter the name in French!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez saisir le libellé en Anglais!"; + v_msgEng="Please enter the name in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + if(codeFamilleActe<=" ") + { + v_msg="Veuillez sélectionner la famille!"; + v_msgEng="Please select the family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + if(codeGarantie<=" ") + { + v_msg="Veuillez sélectionner une garantie!"; + v_msgEng="Please select a benefit!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeGarantie").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; + } + + if(codeTypePrestation<=" ") + { + v_msg="Veuillez sélectionner un type!"; + v_msgEng="Please select a type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypePrestation").focus(); + return; + } + + acteChambre = $("#acteChambre").val(); + prixModifiableEnHospit = $("#prixModifiableEnHospit").val(); + + donnees = 'idActe='+idActe; + donnees += '&codeActe='+codeActe; + + donnees += '&libelle='+libelle; + donnees += '&libelleEng='+libelleEng; + donnees += '&codeFamilleActe='+codeFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&codeTarifActe='+codeTarifActe; + donnees += '&codeTypePrestation='+codeTypePrestation; + + donnees += '&ententePrealable='+ententePrealable; + donnees += '&exclu='+exclu; + donnees += '&actif='+actif; + donnees += '&alerte='+alerte; + donnees += '&delaiCarenceActe='+delaiCarenceActe; + + donnees += '&lettreCle='+lettreCle; + donnees += '&coefficient='+coefficient; + donnees += '&miseEnObservation='+miseEnObservation; + + donnees += '&acteChambre='+acteChambre; + donnees += '&prixModifiableEnHospit='+prixModifiableEnHospit; + + 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()+"Ajaxnouvelacte/enregistrermodifacte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ctrlkeypress_rechercher_actes_famille_param(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + rechercher_actes_famille_param(); + } +} + +function ajax_composante_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(); + 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; + donnees += '&reinitialiser='+reinitialiser; + + //alert(donnees); + //return; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/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 ajouter_tous_actes_fam_au_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="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()+"Ajaxcomposantetarif/ajoutertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif("0"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_acte_au_tarif(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()+"Ajaxcomposantetarif/ajouterunacteautarif/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif("0"); + } + }); +} + +function retirer_un_acte_du_tarif(idDetailtarifacte) +{ + 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/retirerunactedutarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif('0'); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_actes_fam_du_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="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()+"Ajaxcomposantetarif/retirertousactsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif("0"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function maj_composante_tarif_acte(idActe, 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 = 'idActe='+idActe+"&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()+"Ajaxcomposantetarif/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_acte(idActe, 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 = 'idActe='+idActe+"&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()+"Ajaxcomposantetarif/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 ajaxfiltrefamilleactecomposantetarif() +{ + $("#div_compsante_tarif").html(""); + + donnees = "codeTarifActe="+$("#codeTarifActe").val(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrefamillecomposantetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#listefamille").html(data); + } + }); +} + +function test_online() +{ + if(navigator.onLine) + { + $("#test_connexion").css('background-color', 'green'); + v_msg="Connexion OK!"; + v_msgEng="Connection OK"; + alert_ebene(v_msg, v_msgEng); + + } + else + { + $("#test_connexion").css('background-color', 'red'); + v_msg="Problème de Connexion!"; + v_msgEng="Connection Problem!"; + alert_ebene(v_msg, v_msgEng); + } + return; +} + +function raffraichier_messagerie() +{ + deconnexion='0'; + if(navigator.onLine) + { + //$("#test_connexion").css('background-color', 'green'); + c_html = ""; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerie/", + success: function(data) { + c_html = data; + }, + error: function(errorData) { + }, + complete: function() { + $("#nbMessagesNonLus").html(c_html); + msgNonLus=$("#msgNonLus").val(); + $("#span_notification").text(msgNonLus); + // Ajout du 27/10/2024 => déconnecter si session expirée + deconnexion=$("#deconnexion").val(); + + // alert("deconnexion => "+deconnexion); + + if(deconnexion=='1') + { + window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + } + } + }); + } + else + { + $("#test_connexion").css('background-color', 'red'); + return; + } +} + + +function marquer_dernier_message_comme_lu(idMessagerie, controle) +{ + donnees = 'idMessagerie='+idMessagerie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerieliste/marquercommelu/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + // controle.parentElement.removeChild(controle); + $("#btn_close_pop_dernier_messagerie").click(); + } + }); +} + +function pop_dernier_messagerie() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerieliste/derniermessage/", + error: function(errorData) { + }, + success: function(data) { + $("#div_dernier_messagerie").html(data); + }, + complete: function() { + $("#btn_pop_dernier_messagerie").click(); + } + }); +} + + +function ajax_composante_tarif_cons() +{ + 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()+"Ajaxcomposantetarif/affichercomposantetarifcons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function archiver_tarif_actes(idTarif) +{ + + 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()+"Ajaxnouveautarifacte/supprimer/", + type : 'post', + data: "idTarif="+idTarif, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + lister_tarif_actes(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function exporter_composante_tarif_actes() +{ + codeTarifActe=$("#codeTarifActe").val(); + + if(codeTarifActe<=' ' || codeTarifActe=='ST') + { + 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; + + var div_export = $('#div_export_tarif'); + div_export.html('
' + '
'); + + $("#btn_exporter_tarif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarif/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function ajax_init_destinataires_sms() +{ + codeTypeDestinataire=$("#codeTypeDestinataire").val(); + if(codeTypeDestinataire<=' ') + { + v_msg="Veuillez sélectionner un type de destinataire!"; + v_msgEng="Please select a recipient type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDestinataire").focus(); + return; + } + + donnees = 'codeTypeDestinataire='+codeTypeDestinataire; + + if(codeTypeDestinataire=='LB') // Libre + { + ajax_init_destinataires_sms_libre(); + return; + } + else + if(codeTypeDestinataire=='AD') // adhérents + { + ajax_init_destinataires_sms_adherent(); + return; + } + else + { + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/init/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#div_destinataire").html(data); + + appliquerDataTable(); + }, + complete: function() + { + } + }); + } +} + +function ajax_init_destinataires_sms_libre() +{ + // $("#div_adherent_destinataire").html(''); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/libre/", + type : 'post', + error: function(errorData) { + }, + success: function(data) + { + // $("#div_destinataire_final").html(data); + $("#div_destinataire").html(data); + }, + complete: function() + { + $("#noDestination").focus(); + } + }); +} + +function ajax_init_destinataires_sms_adherent() +{ + $("#div_destinataire_final").html(''); + // $("#div_adherent_destinataire").html(''); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherent/", + error: function(errorData) { + }, + success: function(data) + { + // $("#div_adherent_destinataire").html(data); + $("#div_destinataire").html(data); + }, + complete: function() + { + } + }); +} + +function ajax_afficher_destinataires_sms() +{ + codeTypeDestinataire=$("#codeTypeDestinataire").val(); + if(codeTypeDestinataire<=' ') + { + v_msg="Veuillez sélectionner un type de destinataire!"; + v_msgEng="Please select a recipient type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDestinataire").focus(); + return; + } + + donnees = 'codeTypeDestinataire='+codeTypeDestinataire; + + + // $("#div_adherent_destinataire").html(''); + + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + $("#div_destinataire_final").html(data); + + appliquerDataTable(); + + }, + complete: function() { + } + }); +} + +function mettre_sms_commun_attente() +{ + nbDestinataires = $("#nbDestinataires").val(); + if (nbDestinataires=="0") + { + v_msg="Aucun destinataire!"; + v_msgEng="No recipient!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + textMessage = $("#textMessageCommun").val(); + textMessage = textMessage.trim(); + + if (textMessage<=" ") + { + v_msg="Veuillez saisir le message!"; + v_msgEng="Please enter the message!"; + alert_ebene(v_msg, v_msgEng); + + $("#textMessageCommun").focus(); + return; + } + + donnees = "textMessage="+textMessage; + + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/mettresmscommeunattente/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // div_wait.html(data); + }, + complete: function() { + v_msg="Messages mis dans la queue des envois!"; + v_msgEng="Messages in the queue!"; + alert_ebene(v_msg, v_msgEng); + ajax_afficher_destinataires_sms(); + } + }); +} + +function annuler_envoi_sms() +{ + 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é + gerer_messagerie(); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_tous_destinataires_sms() +{ + codeTypeDestinataire=$("#codeTypeDestinataire").val(); + if(codeTypeDestinataire<=' ') + { + v_msg="Veuillez sélectionner un type de destinataire!"; + v_msgEng="Please select a recipient type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDestinataire").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/ajouterdestinatairesmstous/", + // type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + ajax_afficher_destinataires_sms(); + } + }); +} + +function retirer_tous_destinataires_sms() +{ + codeTypeDestinataire=$("#codeTypeDestinataire").val(); + if(codeTypeDestinataire<=' ') + { + v_msg="Veuillez sélectionner un type de destinataire!"; + v_msgEng="Please select a recipient type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDestinataire").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/retirerdestinatairesmstous/", + // type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + ajax_afficher_destinataires_sms(); + } + }); +} + +function ajouter_un_destinataire_sms(idDestinataire) +{ + donnees = 'idDestinataire='+idDestinataire; + + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/ajouterundestinatairesms/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + ajax_afficher_destinataires_sms(); + } + }); +} + +function retirer_un_destinataire_sms(idDestinataire) +{ + donnees = 'idDestinataire='+idDestinataire; + + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/retirerundestinatairesms/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + ajax_afficher_destinataires_sms(); + } + }); +} + +function mettre_sms_commun_attente_libre() +{ + noDestination = $("#noDestination").val(); + if(noDestination.length<5) + { + v_msg="Aucun destinataire!"; + v_msgEng="No recipient!"; + alert_ebene(v_msg, v_msgEng); + + $("#noDestination").focus(); + return; + } + + textMessage = $("#textMessageCommun").val(); + textMessage = textMessage.trim(); + + if (textMessage<=" ") + { + v_msg="Veuillez saisir le message!"; + v_msgEng="Please enter the message!"; + alert_ebene(v_msg, v_msgEng); + + $("#textMessageCommun").focus(); + return; + } + + donnees = "noDestination="+noDestination+"&textMessage="+textMessage; + + // alert(donnees); + // return; + + $("#div_destinataire_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/mettresmscommeunattentelibre/", + type: 'POST', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // div_wait.html(data); + }, + complete: function() { + v_msg="Messages mis dans la queue des envois!"; + v_msgEng="Messages in the queue!"; + alert_ebene(v_msg, v_msgEng); + + ajax_init_destinataires_sms_libre(); + } + }); +} + +function consulter_envois_sms() +{ + donnees = ""; + donnees_retour = ""; + + date1 = $("#date1").val(); + date2 = $("#date2").val(); + + donnees += 'date1=' + date1; + donnees += '&date2=' + date2; + + $("#div_sms").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulter/", + 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 ajax_init_destinataires_sms_adherent_suite() +{ + codeTypeDestinataireAdherent=$("#codeTypeDestinataireAdherent").val(); + if(codeTypeDestinataireAdherent<=' ') + { + v_msg="Veuillez sélectionner un type de recherche!"; + v_msgEng="Please select a search type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeDestinataireAdherent").focus(); + return; + } + + donnees = 'codeTypeDestinataireAdherent='+codeTypeDestinataireAdherent; + + $("#div_destinataire_adherent_final").html(''); + $("#div_destinataire_adherent_client_liste").html(''); + $("#div_destinataire_adherent_client").html(''); + + if(codeTypeDestinataireAdherent=='CL') // Client + { + ajax_init_destinataires_sms_adherent_suite_client(); + return; + } + else + if(codeTypeDestinataireAdherent=='CLOC') // Client et Localité + { + ajax_init_destinataires_sms_adherent_suite_client_localite(); + return; + } + else + if(codeTypeDestinataireAdherent=='LOC') // Localité + { + ajax_init_destinataires_sms_adherent_suite_localite(); + return; + } +} + +function sms_recherche_adherent_client() +{ + nomClientAdherent=$("#nomClientAdherent").val(); + if(nomClientAdherent<=' ') + { + v_msg="Veuillez entrer un nom!"; + v_msgEng="Please enter a name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomClientAdherent").focus(); + return; + } + + donnees = 'nomClientAdherent='+nomClientAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherentclienliste/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + $('#div_destinataire_adherent_client_liste').html(data); + }, + complete: function() + { + } + }); +} + +function ajax_init_destinataires_sms_adherent_suite_client() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherentclient/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_destinataire_adherent_client").html(data); + }, + complete: function() + { + $("#nomClientAdherent").focus(); + } + }); +} + +function ajax_afficher_destinataires_sms_adherent() +{ + $("#div_destinataire_adherent_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + $("#div_destinataire_final").html(data); + }, + complete: function() { + } + }); +} + +function ajax_init_destinataires_sms_adherent_client() +{ + numeroClientAdherent=$("#numeroClientAdherent").val(); + if(numeroClientAdherent<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer type!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroClientAdherent").focus(); + return; + } + + donnees = 'numeroClientAdherent='+numeroClientAdherent; + + $("#div_destinataire_adherent_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/initenvoismsadherentclient/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + ajax_afficher_destinataires_sms_adherent(); + }, + complete: function() + { + } + }); +} + +function ajax_init_destinataires_sms_adherent_suite_localite() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherentlocalite/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_destinataire_adherent_client").html(data); + }, + complete: function() + { + $("#codeVille").focus(); + } + }); +} + +function ajax_init_destinataires_sms_adherent_localite() +{ + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees = 'codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + // alert(donnees); + // return; + + $("#div_destinataire_adherent_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/initenvoismsadherentlocalite/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + ajax_afficher_destinataires_sms_adherent(); + }, + complete: function() + { + } + }); +} + +function ajax_init_destinataires_sms_adherent_suite_client_localite() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherentclientlocalite/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_destinataire_adherent_client").html(data); + }, + complete: function() + { + $("#nomClientAdherent").focus(); + } + }); +} + +function sms_recherche_adherent_client_localite() +{ + nomClientAdherent=$("#nomClientAdherent").val(); + if(nomClientAdherent<=' ') + { + v_msg="Veuillez entrer un nom!"; + v_msgEng="Please enter a name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nomClientAdherent").focus(); + return; + } + + donnees = 'nomClientAdherent='+nomClientAdherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/adherentclientlocaliteliste/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + $('#div_destinataire_adherent_client_liste').html(data); + }, + complete: function() + { + } + }); +} + +function ajax_init_destinataires_sms_adherent_client_localite() +{ + numeroClientAdherent=$("#numeroClientAdherent").val(); + if(numeroClientAdherent<=' ') + { + v_msg="Veuillez sélectionner un client!"; + v_msgEng="Please select a customer type!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroClientAdherent").focus(); + return; + } + + donnees = 'numeroClientAdherent='+numeroClientAdherent; + + codePays = $("#codePays").val(); + codeVille = $("#codeVille").val(); + codeLocalite = $("#codeLocalite").val(); + + donnees += '&codePays=' + codePays; + donnees += '&codeVille=' + codeVille; + donnees += '&codeLocalite=' + codeLocalite; + + // alert(donnees); + // return; + + $("#div_destinataire_adherent_final").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdestinatairesms/initenvoismsadherentclientlocalite/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + ajax_afficher_destinataires_sms_adherent(); + }, + complete: function() + { + } + }); +} + +function re_init_envoi_sms() +{ + window.location.assign($("#racineWeb" ).val()+"Envoisms/"); +} + +function afficher_adherents_localite() +{ + donnees_retour = ""; + donnees = ""; + + codeLocalite = $("#codeLocalite").val(); + + if(codeLocalite<=' ') + { + v_msg="Veuillez revoir la sélection!"; + v_msgEng="Please review the selection!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeVille").focus(); + return; + } + + donnees = 'codeLocalite=' + codeLocalite; + + $("#div_adherent").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlocaliseradherent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_adherent").html(donnees_retour); + } + }); +} + +function ajaxListerLocaliteAdherent() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlocalite/filtreadherentlocalite/", + type : 'post', + data: "codePays="+$("#codePays").val()+"&codeVille="+$("#codeVille").val(), + error: function(errorData) { + }, + success: function(data) { + $("#listelocalite").html(data); + } + }); +} + +function ajouter_tous_adherents_localte() +{ + codeLocalite=$("#codeLocalite").val(); + if(codeLocalite<=' ') + { + v_msg="Veuillez sélectionner une localité!"; + v_msgEng="Please select a location!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLocalite").focus(); + return; + } + + donnees = 'codeLocalite=' + codeLocalite; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlocaliseradherent/ajouteradherentlocalitetous/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + afficher_adherents_localite(); + } + }); +} + +function ajouter_un_adherent_localte(idAherent) +{ + donnees = 'codeLocalite=' + codeLocalite; + donnees += '&idAherent='+idAherent; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlocaliseradherent/ajouterunadherentlocalite/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + afficher_adherents_localite(); + } + }); +} + +function exporter_adherents_localite() +{ + var div_export = $('#div_exporter'); + div_export.html('
' + '
'); + + $("#btn_exporter").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterlocaliseradherent/", + // type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + + +function ajax_init_composante_tarif_medicamant_cons() +{ + $('#div_compsante_tarif').html(""); + $("#libelleActe").focus(); +} + +function ajax_composante_tarif_medicaments_cons() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + libelleMedicament=$("#libelleMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + + /* + if(libelleMedicament<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleMedicament").focus(); + return; + } + */ + + donnees = 'codeTarifMedicament='+codeTarifMedicament+'&libelleMedicament='+libelleMedicament; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/affichercomposantetarifcons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + + }, + complete: function() { + } + }); +} + +function rechercher_medicaments_param() +{ + libelleMedicament=$("#libelleMedicament").val(); + + if(libelleMedicament<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleMedicament").focus(); + return; + } + + donnees = 'libelleMedicament='+libelleMedicament; + + // alert(donnees); + // return; + + var div_attente = $('#div_detail_medicaments'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/listemedicaments/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + dataTableSpeciale(); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_composante_tarif_medicaments_cons(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + ajax_composante_tarif_medicaments_cons(); + } +} + +function ctrlkeypress_rechercher_medicaments_param(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + rechercher_medicaments_param(); + } +} + +function modifier_un_medicament(idMedicament) +{ + window.location.assign($("#racineWeb" ).val()+"Modifiermedicament/"+idMedicament+"/"); +} + +function retour_liste_medicaments() +{ + window.location.assign($("#racineWeb" ).val()+"Listemedicaments/"); +} + +function enregistrer_modif_un_medicament() +{ + idMedicament = $("#idMedicament").val(); + codeMedicament = $("#codeMedicament").val(); + + libelle = $("#libelle").val(); + codeForme = $("#codeForme").val(); + + ententePrealable = $("#ententePrealable").val(); + exclu = $("#exclu").val(); + actif = $("#actif").val(); + instructions = $("#instructions").val(); + + if(libelle<=" ") + { + v_msg="Veuillez saisir la désignation!"; + v_msgEng="Please enter the designation!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(codeForme<=" ") + { + v_msg="Veuillez saisir la forme!"; + v_msgEng="Please enter the form!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeForme").focus(); + return; + } + + donnees = 'idMedicament='+idMedicament; + donnees += '&codeMedicament='+codeMedicament; + + donnees += '&libelle='+libelle; + donnees += '&codeForme='+codeForme; + + donnees += '&ententePrealable='+ententePrealable; + donnees += '&exclu='+exclu; + donnees += '&actif='+actif; + donnees += '&instructions='+instructions; + + + 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()+"Ajaxcomposantetarifmedicament/enregistrermodifmedicament/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function exporter_liste_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; + + // alert(donnees); + // return; + + var div_export = $('#div_export_acte'); + div_export.html('
' + '
'); + + $("#btn_exporter").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarif/listeacte/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function exporter_liste_medicaments() +{ + var div_export = $('#div_export_medicament'); + div_export.html('
' + '
'); + + $("#btn_exporter").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarifmedicament/listemedicament/", + // type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function enregistrer_nouvel_medicament() +{ + libelle = $("#libelle").val(); + unite = $("#unite").val(); + + ententePrealable = $("#ententePrealable").val(); + exclu = $("#exclu").val(); + actif = $("#actif").val(); + codeForme = $("#codeForme").val(); + + if(libelle<=" ") + { + v_msg="Veuillez saisir la désignation!"; + v_msgEng="Please enter the designation!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + + donnees = 'libelle='+libelle; + donnees += '&unite='+unite; + + donnees += '&ententePrealable='+ententePrealable; + donnees += '&exclu='+exclu; + donnees += '&actif='+actif; + donnees += '&codeForme='+codeForme; + + + v_msg="Confirmez-vous cette opération?"; + 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()+"Ajaxcomposantetarifmedicament/enregistrernouveaumedicament/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ctrlkeypress_composante_tarif_medicaments(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + ajax_composante_tarif_medicaments(); + } +} + +function ajax_composante_tarif_medicaments() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + libelleMedicament=$("#libelleMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + + /* + if(libelleMedicament<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleMedicament").focus(); + return; + } + */ + + donnees = 'codeTarifMedicament='+codeTarifMedicament+'&libelleMedicament='+libelleMedicament; + + // alert(donnees); + // return; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/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_medicaments_libelle_au_tarif() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + libelleMedicament=$("#libelleMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + + if(libelleMedicament<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleMedicament").focus(); + return; + } + + donnees = 'codeTarifMedicament='+codeTarifMedicament+'&libelleMedicament='+libelleMedicament; + + // alert(donnees); + // return; + + 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()+"Ajaxcomposantetarifmedicament/ajoutertousmedicamentsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_medicaments_libelle_au_tarif() +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + libelleMedicament=$("#libelleMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + + /* + if(libelleMedicament<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleMedicament").focus(); + return; + } + */ + + donnees = 'codeTarifMedicament='+codeTarifMedicament+'&libelleMedicament='+libelleMedicament; + + // alert(donnees); + // return; + + 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()+"Ajaxcomposantetarifmedicament/retirertousmedicamentsautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_medicaments(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_medicament_au_tarif(idMedicament) +{ + codeTarifMedicament=$("#codeTarifMedicament").val(); + + if(codeTarifMedicament<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifMedicament").focus(); + return; + } + + donnees = 'idMedicament='+idMedicament+'&codeTarifMedicament='+codeTarifMedicament; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/ajouterunamedicamentautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_medicaments(); + } + }); +} + +function retirer_un_medicament_du_tarif(idDetailtarifMedicament) +{ + donnees = 'idDetailtarifMedicament='+idDetailtarifMedicament; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/retirerunamedicamentutarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_medicaments(); + } + }); +} + +function maj_composante_tarif_medicament(idDetailtarifMedicament, prix) +{ + donnees = 'idDetailtarifMedicament='+idDetailtarifMedicament+"&prix="+prix; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/majprix/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function(data) + { + } + }); +} + +function exporter_tarif_verre() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "codeTarifOptique="+codeTarifOptique; + + alert(donnees); + return; + + var div_export = $('#div_export_tarif'); + div_export.html('
' + '
'); + + $("#btn_exporter_tarif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarifmedicament/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function consulterfactureverres() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturecons/verres/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulterfactureverres_pop() +{ + idFacture = $("#idFacture").val(); + + $("#div_facture_detail").html('
' + '
'); + + donnees = 'idFacture='+idFacture; + + if(isNaN(idFacture)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfactureconspop/verres/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_facture_detail").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function exporter_tarif_verre() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + donnees = "codeTarifOptique="+codeTarifOptique; + + // alert(donnees); + // return; + + var div_export = $('#div_export_tarif'); + div_export.html('
' + '
'); + + $("#btn_exporter_tarif").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarifverres/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + // $('#div_test_gabarit').html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function ctrlkeypress_rechercher_verres_param(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + rechercher_verres_param(); + } +} + +function rechercher_verres_param() +{ + libelleVerre=$("#libelleVerre").val(); + + + if(libelleVerre<=' ') + { + v_msg="Veuillez indiquer la désigantion!"; + v_msgEng="Please enter the designation!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleVerre").focus(); + return; + } + + + donnees = 'libelleVerre='+libelleVerre; + + // alert(donnees); + // return; + + var div_attente = $('#div_detail_verres'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/listeverres/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function modifier_un_verre(idVerre) +{ + window.location.assign($("#racineWeb" ).val()+"Modifierverre/"+idVerre+"/"); +} + +function retour_liste_verres() +{ + window.location.assign($("#racineWeb" ).val()+"Listeverres/"); +} + +function enregistrer_modif_un_verre() +{ + idVerre = $("#idVerre").val(); + codeOptique = $("#codeOptique").val(); + + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + + actif = $("#actif").val(); + + if(libelle<=" ") + { + v_msg="Veuillez saisir la désignation en français!"; + v_msgEng="Please enter the designation in french!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez saisir la désignation en Anglais!"; + v_msgEng="Please enter the designation in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + donnees = 'idVerre='+idVerre; + donnees += '&codeOptique='+codeOptique; + + donnees += '&libelle='+libelle; + donnees += '&libelleEng='+libelleEng; + + donnees += '&actif='+actif; + + // alert(donnees); + // return; + + 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()+"Ajaxcomposantetarifoptique/enregistrermodifverre/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_verres(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function exporter_liste_verres() +{ + var div_export = $('#div_export_verres'); + div_export.html('
' + '
'); + + $("#btn_exporter").click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexportertarifverres/listeverres/", + // type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function enregistrer_nouveau_verre() +{ + libelle = $("#libelle").val(); + libelleEng = $("#libelleEng").val(); + actif = $("#actif").val(); + + if(libelle<=" ") + { + v_msg="Veuillez saisir la désignation!"; + v_msgEng="Please enter the designation!!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelle").focus(); + return; + } + + if(libelleEng<=" ") + { + v_msg="Veuillez saisir la désignation en Anglais!"; + v_msgEng="Please enter the designation in English!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleEng").focus(); + return; + } + + + donnees = 'libelle='+libelle; + donnees += '&libelleEng='+libelleEng; + + donnees += '&actif='+actif; + + // alert(donnees); + // return; + + v_msg="Confirmez-vous cette opération?"; + 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()+"Ajaxcomposantetarifoptique/enregistrernouveauverre/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + retour_liste_verres(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajax_init_composante_tarif_verre_cons() +{ + $('#div_compsante_tarif').html(""); + $("#libelleVerre").focus(); +} + +function ctrlkeypress_composante_tarif_verre_cons(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + ajax_composante_tarif_verre_cons(); + } +} + +function ajax_composante_tarif_verre_cons() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + libelleVerre=$("#libelleVerre").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + /* + if(libelleVerre<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleVerre").focus(); + return; + } + */ + + donnees = 'codeTarifOptique='+codeTarifOptique+'&libelleVerre='+libelleVerre; + + // alert(donnees); + // return; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/affichercomposantetarifcons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + +function ctrlkeypress_composante_tarif_verres(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + ajax_composante_tarif_verres(); + } +} + +function ajax_composante_tarif_verres() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + libelleVerre=$("#libelleVerre").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + /* + if(libelleVerre<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleVerre").focus(); + return; + } + */ + + donnees = 'codeTarifOptique='+codeTarifOptique+'&libelleVerre='+libelleVerre; + + // alert(donnees); + // return; + + var div_attente = $('#div_compsante_tarif'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/affichercomposantetarif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + + +function afficher_dernieres_factures_optique(idBeneficiaire) +{ + idFacture = $("#idFacture").val(); + + $("#div_dernieres_factures_optique").html('
' + '
'); + + donnees = 'idBeneficiaire='+idBeneficiaire; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdernieresfacturesoptique/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_dernieres_factures_optique").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ajouter_tous_verres_libelle_au_tarif() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + libelleVerre=$("#libelleVerre").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + if(libelleVerre<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleVerre").focus(); + return; + } + + donnees = 'codeTarifOptique='+codeTarifOptique+'&libelleVerre='+libelleVerre; + + // alert(donnees); + // return; + + 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()+"Ajaxcomposantetarifoptique/ajoutertousverressautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_verres(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function retirer_tous_verres_libelle_du_tarif() +{ + codeTarifOptique=$("#codeTarifOptique").val(); + libelleVerre=$("#libelleVerre").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + /* + if(libelleVerre<=' ') + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#libelleVerre").focus(); + return; + } + */ + + donnees = 'codeTarifOptique='+codeTarifOptique+'&libelleVerre='+libelleVerre; + + // alert(donnees); + // return; + + 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()+"Ajaxcomposantetarifoptique/retirertousverressautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_verres(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_verre_au_tarif(idVerre) +{ + codeTarifOptique=$("#codeTarifOptique").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + donnees = 'idVerre='+idVerre+'&codeTarifOptique='+codeTarifOptique; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/ajouterunverreautarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_verres(); + } + }); +} + +function retirer_un_verre_au_tarif(idDetailtarifOptique) +{ + codeTarifOptique=$("#codeTarifOptique").val(); + + if(codeTarifOptique<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifOptique").focus(); + return; + } + + donnees = 'idDetailtarifOptique='+idDetailtarifOptique+'&codeTarifOptique='+codeTarifOptique; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/retirerunverredutarif/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif_verres(); + } + }); +} + +function maj_composante_tarif_verres(idDetailtarifOptique, prix) +{ + donnees = 'idDetailtarifOptique='+idDetailtarifOptique+"&prix="+prix; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarifoptique/majprix/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_test_gabarit').html(data); + }, + complete: function(data) + { + } + }); +} + +function exporterbons() +{ + codePrestataire=$("#codePrestataire").val(); + + codeTypeBon=$("#codeTypeBon").val(); + codeEtatBon=$("#codeEtatBon").val(); + + noDepart=$("#noDepart").val(); + noFin=$("#noFin").val(); + + if (noDepart=="") + { + noDepart="0"; + } + + if (noFin=="") + { + noFin="0"; + } + + noDepart = parseInt(noDepart); + noFin = parseInt(noFin); + + if (codePrestataire<=" ") + { + v_msg="Veuillez sélectionner un prestataire!"; + v_msgEng="Please select a provider!"; + alert_ebene(v_msg, v_msgEng); + + $("#codePrestataire").focus(); + return; + } + + if (codeTypeBon<=" ") + { + v_msg="Veuillez sélectionner un type de bon!"; + v_msgEng="Please select a form type!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTypeBon").focus(); + return; + } + + if (noFin' + ''); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxexporterbons/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function consulter_remplacer_medicament() +{ + $("#div_liste_medicaments_remplaces").html('
' + '
'); + + $('#btn_medicaments_remplaces').click(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailprescription/consulterremplacement/", + type: 'POST', + success: function(data) { + $("#div_liste_medicaments_remplaces").html(data); + }, + error: function(data) { + }, + complete: function() + { + // $('#btn_medicaments_remplaces').click(); + } + }); +} + +function etat_prod_par_mois_eclate_client() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + 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()+"Ajax"+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()); + } + }); +} + + +function etat_prod_par_mois_eclate_client_export() +{ + debutPeriode = $("#debutPeriode").val(); + finPeriode = $("#finPeriode").val(); + + $('#div_export_a').html(""); + + donnees_retour = ""; + donnees = 'debutPeriode='+debutPeriode+"&finPeriode="+finPeriode; + + $('#div_export_a').html(""); + + 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()+"Ajax"+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 exporter_modele_destinataire_sms() +{ + $('#div_form_upload').hide(); + + var div_export = $('#div_exporter_destinataires_sms'); + + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterdestinatairesms/exportermodele/", + type: 'POST', + // data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function charger_fichier_modele_destinataire_sms() +{ + $('#div_exporter_destinataires_sms').html(""); + + $('#div_form_upload').show(); + + // return; +} + +function importer_destinataire_sms() +{ + 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_destinataires_sms'); + + div_export.html('
' + '
'); + + cheminFichier=$("#cheminFichier").val(); + + donnees = 'cheminFichier='+cheminFichier; + + $("#div_erreur_excel").html(""); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterdestinatairesms/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) + { + alert("Actualisation..."); + reinitiliser_envois_sms_hors_systeme(); + } + }); +} + +function ajax_init_destinataires_sms_hos_systeme() +{ + etape3=$("#etape3").val(); + + if (etape3 != "1") + { + v_msg="Etape 3 incomplète!"; + v_msgEng="Incomplete step 3!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#div_envois_sms").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximporterdestinatairesms/init/", + error: function(errorData) { + }, + success: function(data) + { + $("#div_envois_sms").html(data); + }, + complete: function() + { + } + }); +} + + +function reinitiliser_envois_sms_hors_systeme() +{ + window.location.assign($("#racineWeb" ).val()+"Importdestinatairesms/"); +} + +function histo_enrollement_empreinte() +{ + $("#div_detail_suppr_empreinte").html(""); + + debut=$("#debut").val(); + fin=$("#fin").val(); + + donnees = 'debut='+debut+'&fin='+fin; + donnees_retour = ""; + + $("#div_detail_suppr_empreinte").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhistsupprempreinteexport/historiqueenrollement/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_detail_suppr_empreinte").html(donnees_retour); + } + }); +} + +function imprimer_limites_adherent_entete_contrat() +{ + idEntetecontrat=$("#idEntetecontrat").val(); + + if (idEntetecontrat<="0") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#idEntetecontrat").focus(); + + div_attente.html(''); + + return; + } + + donnees = 'idEntetecontrat='+idEntetecontrat; + + var div_export = $('#div_export_a'); + div_export.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerlimite/", + type: 'POST', + data: donnees, + success: function(data) + { + div_export.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); +} + +function afficher_garantiebeneficiaire_entete_contrat() +{ + var div_attente = $('#div_gar_exo'); + + idEntetecontrat=$("#idEntetecontrat").val(); + + if (idEntetecontrat<="0") + { + v_msg="Veuillez sélectionner une période!"; + v_msgEng="Please select a period!"; + alert_ebene(v_msg, v_msgEng); + + $("#idEntetecontrat").focus(); + + div_attente.html(''); + + return; + } + + donnees = 'idEntetecontrat='+idEntetecontrat; + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxplafondbeneficiaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + }, + complete: function() { + } + }); +} + +function ajaxchanger_type_bon() +{ + $("#msgErreur").html(""); +} + +function changer_type_bon() +{ + $("#nbligne_info").val("0"); + afficherbon_vide(); +} + +function afficherbon_vide() +{ + $("#div_bonpecs").html(""); + + codeLangue = $("#codeLangue").val(); + if(codeLangue=="en_US") + { + $("#nbligne").val("Number of lines displayed : 0"); + } + else + { + $("#nbligne").val("Nombre de bons affichés : 0"); + } + + /* + codeTypeBon=$("#codeTypeBon").val(); + + if (codeTypeBon<=" ") + { + v_msg="Veuillez sélectionner un type de bon!"; + v_msgEng="Please select a form type!"; + alert_ebene(v_msg, v_msgEng); + $("#codeTypeBon").focus(); + return; + } + */ + + $("#div_bonpecs").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherbons/vide/", + error: function(errorData) + { + }, + success: function(data) + { + $("#div_bonpecs").html(data); + }, + complete: function() + { + } + }); +} + +function date_inclus_mois_decompte() +{ + datejour = $("#datejour_C").val(); + dateFacture = $("#dateFacture").val(); + dateFactureReelle = dateFacture; + + libelledebutMoisDecompte = $("#debutMoisDecompte").val(); + debutMoisDecompte = $("#debutMoisDecompte").datepicker("getDate"); + var tddebut = new Date(debutMoisDecompte); + dddebut = Math.round(Date.parse(tddebut)/(1000*3600*24)); + + CalculerFinMoisDecompte(); + + libellefinMoisDecompte = $("#finMoisDecompte").val(); + finMoisDecompte = $("#finMoisDecompte").datepicker("getDate"); + var tfin = new Date(finMoisDecompte); + ddfin = Math.round(Date.parse(tfin)/(1000*3600*24)); + + var td1 = $("#dateFacture").datepicker("getDate"); + var tdj = new Date(datejour); + + dt1=Math.round(Date.parse(td1)/(1000*3600*24)); + dtj=Math.round(Date.parse(tdj)/(1000*3600*24)); + + if ( (dt1ddfin) ) + { + v_msg="Attention! date hors du mois! => "+libelledebutMoisDecompte+" - "+libellefinMoisDecompte; + v_msgEng="Warning! date out of the month!"; + alert_ebene(v_msg, v_msgEng); + + return false; + } + + if (dt1>dtj) + { + v_msg="Attention! Revoir la date!"; + v_msgEng="Warning! Review the date!"; + alert_ebene(v_msg, v_msgEng); + + return false; + } + return true; +} + +function CalculerFinMoisDecompte() +{ + var typdate = $("#debutMoisDecompte").datepicker("getDate"); + typdate.addMonths(1); + $("#finMoisDecompte").datepicker( "setDate", typdate ); +} + +function supprimer_lien_parent_client(idClient) +{ + v_msg="Confirmez-vous la suppression de cette liaison?"; + v_msgEng="Do you confirm the deletion of this link?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxclientliaison/supprimerliaisonclient/", + type : 'post', + data: "idClient="+idClient, + error: function(errorData) { + }, + success: function(data) + { + v_msg="Suppression terminée avec succès terminé!"; + v_msgEng="Deletion completed successfully completed!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + afficher_client_liaison(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function afficher_client_liaison() +{ + window.location.assign($("#racineWeb" ).val()+"Liaisonclients/"); +} + +function client_lier_a_un_parent(idClientP) +{ + idClient = $("#idClient").val(); + + // alert("idClient => "+idClient+" ; idClientP => "+idClientP); + // return; + + if (idClient<=" " || idClientP<=" ") + { + v_msg="Veuillez sélectionner le parent!"; + v_msgEng="Please select the parent!"; + alert_ebene(v_msg, v_msgEng); + $("#nomsearch").focus(); + return; + } + + + v_msg="Confirmez-vous cette liaison?"; + v_msgEng="Do you confirm this link?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idClient="+idClient+"&idClientP="+idClientP; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxclientliaison/clientlieraunparent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + v_msg="Liaison effectuée avec succès!"; + v_msgEng="Link successfully completed!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + afficher_client_liaison(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function client_ajouter_un_enfant(idClientE) +{ + idClient = $("#idClient").val(); + + if (idClient<=" " || idClientE<=" ") + { + v_msg="Veuillez sélectionner le parent!"; + v_msgEng="Please select the parent!"; + alert_ebene(v_msg, v_msgEng); + $("#nomsearch_e").focus(); + return; + } + + v_msg="Confirmez-vous cette liaison?"; + v_msgEng="Do you confirm this link?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "idClient="+idClientE+"&idClientP="+idClient; + + // alert(donnees) + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxclientliaison/clientlieraunparent/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + v_msg="Liaison effectuée avec succès!"; + v_msgEng="Link successfully completed!"; + alert_ebene(v_msg, v_msgEng); + }, + complete: function() + { + afficher_client_liaison(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + +function ctrlkeypress_parent_client(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_parent_client(); + } +} + +function afficher_pop_recherche_parent_client() +{ + idClient = $("#idClient").val(); + numeroclientsearch = $("#numeroclientsearch").val(); + nomsearch = $("#nomsearch").val(); + + numeroclientsearch = convertir_en_entier(numeroclientsearch); + + if(numeroclientsearch+nomsearch<="0") + { + v_msg="Critères de recherche manquant!"; + v_msgEng="Missing search criteria!"; + alert_ebene(v_msg, v_msgEng); + $("#nomsearch").focus(); + return; + } + + donnees = "numeroclientsearch="+numeroclientsearch+"&nomsearch="+nomsearch+"&idClient="+idClient; + + // alert(donnees); + // return; + + $("#div_liste_clients_parents").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteclientsparents/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_clients_parents").html(data); + } + }); +} + +function afficher_pop_recherche_enfants_client() +{ + idClient = $("#idClient").val(); + numeroclientsearch = $("#numeroclientsearch_e").val(); + nomsearch = $("#nomsearch_e").val(); + + numeroclientsearch = convertir_en_entier(numeroclientsearch); + + if(numeroclientsearch+nomsearch<="0") + { + v_msg="Critères de recherche manquant!"; + v_msgEng="Missing search criteria!"; + alert_ebene(v_msg, v_msgEng); + $("#nomsearch_e").focus(); + return; + } + + donnees = "numeroclientsearch="+numeroclientsearch+"&nomsearch="+nomsearch+"&idClient="+idClient; + + // alert(donnees); + // return; + + $("#div_liste_clients_enfants").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteclientsenfants/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_clients_enfants").html(data); + } + }); +} + +function ctrlkeypress_enfant_client(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_enfants_client(); + } +} + +function afficherbon_vide_sans_wait() +{ + $("#div_bonpecs").html(""); + + codeLangue = $("#codeLangue").val(); + if(codeLangue=="en_US") + { + $("#nbligne").val("Number of lines displayed : 0"); + } + else + { + $("#nbligne").val("Nombre de bons affichés : 0"); + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherbons/vide/", + error: function(errorData) + { + }, + success: function(data) + { + $("#div_bonpecs").html(data); + }, + complete: function() + { + } + }); +} + +function listerderogations_vide() +{ + $("#div_derogations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxderogations/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_derogations").html(data); + }, + complete: function() { + } + }); +} + +function listerderogationbeneficiaire_vide() +{ + $("#div_derogations").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxderogationsbenficiaire/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_derogations").html(data); + }, + complete: function() { + } + }); +} + +function listeententeprealables_vide() +{ + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealables/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function listerententeprealablebeneficiaire_vide() +{ + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesbenficiaire/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function listeententeprealablespha_vide() +{ + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablespha/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function listeententeprealablesopt_vide() +{ + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesopt/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function listeententeprealablesmont_vide() +{ + $("#div_ententeprealable").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxententeprealablesmont/vide/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + $("#div_ententeprealable").html(data); + }, + complete: function() { + } + }); +} + +function maj_plafond_adherent_additionnelle(idCollegeTemp, plafond, controle) +{ + if(controle_numerique(controle)) + { + donnees = 'idCollegeTemp='+idCollegeTemp+"&plafond="+plafond; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majplafondadherentadd/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_plafond_global").html(data); + }, + error: function(data) { + }, + complete: function() { + controle.focus(); + } + }); + } +} + +function maj_prime_adherent_additionnelle(idCollegeTemp, prime, controle) +{ + if(controle_numerique(controle)) + { + donnees = 'idCollegeTemp='+idCollegeTemp+"&prime="+prime; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majprimeadherentadd/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_plafond_global").html(data); + }, + error: function(data) { + }, + complete: function() { + recapituler_limite_college(); + controle.focus(); + } + }); + } +} + +function maj_plafond_beneficiaire_additionnelle(idCollegeTemp, plafond, controle) +{ + if(controle_numerique(controle)) + { + donnees = 'idCollegeTemp='+idCollegeTemp+"&plafond="+plafond; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majplafondbeneficiaireadd/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_plafond_global").html(data); + }, + error: function(data) { + }, + complete: function() { + controle.focus(); + } + }); + } +} + +function maj_prime_beneficiaire_additionnelle(idCollegeTemp, prime, controle) +{ + if(controle_numerique(controle)) + { + donnees = 'idCollegeTemp='+idCollegeTemp+"&prime="+prime; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majprimebeneficiaireadd/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_plafond_global").html(data); + }, + error: function(data) { + }, + complete: function() { + recapituler_limite_college(); + controle.focus(); + } + }); + } +} + +// Gestion confiée Type de Garant 06/08/2020 + +// Styliser les bordures des champs où les données sont requises + +$(function(){ + //hideBar(); + appliquerDataTable(); + dataTableSpeciale(); + dataTableMini(); + dataTab(); + datafiltre(); + filtreTab(); + + // Initialiser Select2 + $('.js-example-basic-single').select2(); + + // Initialiser Bootstrap Select avec vérification + if (typeof $.fn.selectpicker !== 'undefined') { + $('.selectpicker').selectpicker(); + } else { + console.warn("Bootstrap Select n'est pas disponible. Assurez-vous que bootstrap-select.min.js est chargé."); + // Fallback: transformer les select en select2 + $('.selectpicker').each(function() { + if (!$(this).hasClass('select2-hidden-accessible')) { + $(this).select2({ + theme: 'bootstrap-5' + }); + } + }); + } + + // Rafraîchir les notifications toutes les 2 secondes + setInterval(raffraichier_gabarit, 2000); + + $("#div_selection").hide(); + $("#div_selection_acte").hide(); + $("#div_selection_prestataire").hide(); + + if($('#nomForm').val()=="modifiercollege" || $('#nomForm').val()=="modifiercolleged"){ + codeProduit = $('#codeProduit').val(); + codeLienParente = "A"; + codeBaseTarification = $('#codeBaseTarification').val(); + + if($('#nomForm').val()=="modifiercollege"){ + change_categorie_college_temp(); + }else{ + change_categorie_college_temp_d(); + } + + + }else if($('#nomForm').val()=="creercollege" || $('#nomForm').val()=="creercolleged"){ + + codeProduit = $('#codeProduit').val(); + codeLienParente = "A"; + codeBaseTarification = $('#codeBaseTarification').val(); + + if(codeBaseTarification!='AUC'){ + + if($('#nomForm').val()=="creercollege"){ + change_categorie_college_temp(); + }else{ + change_categorie_college_temp_d(); + } + } + + }else if($('#nomForm').val()=="frmconsultercollege"){ + $("#btn_recap").click(); + + }else if($('#nomForm').val()=="frmDetailBareme"){ + afficherDetailBareme(); + }else if($('#nomForm').val() == "frmDetailBaremeCollege" || $('#nomForm').val() == "frmConsulterDetailBaremeCollege"){ + afficherDetailBaremeCollege(); + }else if($('#nomForm').val()=="frmDetailBaremeCollegetemp"){ + afficherDetailBaremeCollegeTemp(); + }else if($('#nomForm').val()=="frmcarteassure"){ + }else if($('#nomForm').val()=="frmconsultercollege"){ + recapitulerconsultercollege(); + }else if($('#nomForm').val()=="frmPrestatairesDerogation"){ + afficher_prestataire_tm(); + }else if($('#nomForm').val()=="frmaffectionTM"){ + afficher_affection_tm(); + }else if($('#nomForm').val()=="frmremboursementgarantie"){ + afficher_remboursement_garantie(); + }else if($('#nomForm').val()=="frmproduit"){ + filtretabproduit(); + }else if($('#nomForm').val() == "adherentprestataire" || $('#nomForm').val() == "tMadherent" + || $('#nomForm').val()== "tMadherentacte" || $('#nomForm').val()== "tMadherentacteprestataire" + || $('#nomForm').val()== "tMadherentgarantieprestataire" || $('#nomForm').val()== "tMadherentprestataire"){ + + + $("#searchInput").keyup(function(){ + var numero = $(this).val(); + + if(numero.length >="2") + { + chargernumero(numero); + }else{ + $("#div_selection").hide(); + $("#div_selection_acte").hide(); + return false; + } + }); + }else if($('#nomForm').val()=="beneficiaireprestataire" || $('#nomForm').val()=="tMadherentgarantie" || $('#nomForm').val()=="tMbeneficiaire" + || $('#nomForm').val()=="tMbeneficiaireActe" || $('#nomForm').val()=="tMbeneficiaireActePrestataire" || $('#nomForm').val()=="tMbeneficiaireGarantie" + || $('#nomForm').val()=="tMbeneficiaireGarantiePrestataire" || $('#nomForm').val()=="tMbeneficiairePrestataire" || $('#nomForm').val()=="tarifappliquebeneficiaire" + || $('#nomForm').val()=="remboursementClassic"){ + + + $("#searchInput").keyup(function(){ + var numero = $(this).val(); + + if(numero.length >="2") + { + chargernumero(numero); + + }else{ + $("#div_selection").hide(); + return false; + } + }); + }else if($('#nomForm').val()=="frmcreerprestataire"){ + //$("#ligne_pharmacie").css('display','none'); + $("#ligne_pharmacie").hide(); + $("#appliquerTarifNuit").attr('disabled', 'disabled'); + $("#centreReference").attr('disabled', 'disabled'); + //console.log("Je suis en cours"); + }else if($('#nomForm').val()=="frmmodifierprestataire"){ + var codeTypePrestataire = $('#codeTypePrestataire').val(); + var categoriePresataire = $('#categoriePresataire').val(); + + if(codeTypePrestataire=="PHA"){ + $("#ligne_pharmacie").show(); + $("#appliquerTarifNuit").attr('disabled', 'disabled'); + }else{ + $("#ligne_pharmacie").hide(); + $("#appliquerTarifNuit").removeAttr('disabled'); + } + + if(categoriePresataire=="C"){ + $("#centreReference").removeAttr('disabled'); + }else{ + $("#centreReference").attr('disabled', 'disabled'); + } + + }else if($('#nomForm').val()=="modifierproduit"){ + + codeEnteteTrancheAge = $("#codeEnteteTrancheAge").val(); + + if(codeEnteteTrancheAge!=undefined || codeEnteteTrancheAge>" ") + { + trancheage(); + }else{ + modecalculeprime(); + } + + }else if($('#nomForm').val()=="frmtrancheaccessoire" + || $('#nomForm').val()=="frmtauxAjustement" + || $('#nomForm').val()=="frmacteconsultation"){ + afficheBoutons(0); + }else if($('#nomForm').val()=="parametrefacturationgarant"){ + filtre_assiette_fond() + filtre_assiette_honoraire(); + }else if($('#nomForm').val()=="frmautreparametre"){ + document.getElementById('Generaux').style.display="block"; + document.getElementById('Production').style.display="none"; + document.getElementById('Medical').style.display="none"; + document.getElementById('Prestation').style.display="none"; + }else if($('#nomForm').val()=="listebareme"){ + codeGcAssureur = $("#codeGcAssureur").val(); + codeProduit = $("#codeProduit").val(); + + if(codeGcAssureur > " "){ + filtreproduitbareme(); + } + + if(codeGcAssureur > " " & codeProduit > " "){ + afficher_bareme_produit(); + } + + }else if($('#nomForm').val()=="modifierseuilalerte"){ + codeGcAssureur = $("#codeGcAssureur").val(); + codeProduit = $("#codeProduit").val(); + + if(codeGcAssureur > " " & codeProduit > " "){ + afficher_garantie_produit(); + } + + }else if($('#nomForm').val()=="Paramfacproduit"){ + codeProduit = $("#codeProduit").val(); + + if(codeProduit > ""){ + parametre_produit(); + } + } +}); + + + +function stylechampsRequis(){ + var requis = $('input,select,textarea').filter('[required]:visible'); + + requis.each(function(){ + $(this).focus(function(){ + $(this).css('borderColor','red'); + }); + $(this).blur(function(){ + $(this).css('borderColor','#cccccc'); + }); + }); + +} + +function afficheDonneesTable(fichier){ + donnees = ''; + + $.ajax({ + url: $("#racineWeb").val()+fichier+"/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + $('#div_lister_table').html(data); + dataTableSpeciale(); + }, + complete: function() { + + } + }); + +} + +function addgctypegarant(){ + $('#div_edit_typegarant').empty(); + donnees = ''; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxouvrirtypegarant/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_add_typegarant').html(data); + $('#div_add_typegarant').modal("show"); + $('#div_add_typegarant').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeTypeGarant').focus(); + }); + }, + complete: function() { + + } + }); +} + + +function editgctypegarant(id){ + + $('#div_add_typegarant').empty(); + + donnees ='id='+id; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifiertypegarant/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_edit_typegarant').html(data); + $('#div_edit_typegarant').modal("show"); + $('#div_edit_typegarant').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeTypeGarant').focus(); + }); + + }, + complete: function() { + + } + }); +} + + +function enregistrerTypeGarant(){ + var codeTypeGarant = $('#codeTypeGarant').val(), + libelle = $('#libelle').val(), + id = $('#id').val(); + + + fichier_lister = 'Ajaxlistergctypegarant'; + + if(id == undefined){ + link = 'Ajaxouvrirtypegarant'; + }else{ + //fichier_lister = 'Ajaxlistercolleges'; + link = 'Ajaxmodifiertypegarant'; + } + + + if(libelle <=' '){ + v_msg="Le libellé est obligatoire !"; + v_msgEng="The label is required !"; + + alert_ebene(v_msg,v_msgEng); + + $('#libelle').css('borderColor','red'); + return; + } + donnees = $('#formModal').serialize(); + + $.ajax({ + url: $("#racineWeb").val()+link+"/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + /*if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + return; + } + */ + + if(id==undefined){ + afficheDonneesTable(fichier_lister); + $("#div_add_typegarant .close").click(); + }else{ + afficheDonneesTable(fichier_lister); + $("#div_edit_typegarant .close").click(); + } + //dataTableSpeciale(); + + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Gctypegarant/"); + } + }); + +} + +// Supprime une ligne du tableau +function supprimeLigneTypeGarant($idData){ + + var fichier_lister = 'Ajaxlistergctypegarant'; + + + 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 = 'id='+$idData; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + afficheDonneesTable(fichier_lister); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +function add_typetarif(){ + $('#div_edit_typetarif').empty(); + donnees = ''; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxouvrirtypetarif/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_add_typetarif').html(data); + $('#div_add_typetarif').modal("show"); + $('#div_add_typetarif').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeTypeTarifActe').focus(); + }); + }, + complete: function() { + + } + }); +} + +function add_lettrecle(){ + $('#div_edit_lettrecle').empty(); + donnees = ''; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlettrecle/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_add_lettrecle').html(data); + $('#div_add_lettrecle').modal("show"); + $('#div_add_lettrecle').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#lettreCle').focus(); + }); + }, + complete: function() { + + } + }); +} + +function enregistrelettrecle(){ + var lettreCle = $('#lettreCle').val(), + description = $('#description').val(), + descriptionEng = $('#descriptionEng').val(), + id = $('#formModal .sr-only').val(); + + fichier_lister = 'Ajaxlisterlettrecle'; + + if(id == undefined){ + link = 'Ajaxlettrecle'; + }else{ + link = 'Ajaxmodifierlettrecle'; + } + + if(lettreCle ==''){ + v_msg="La lettre clé est obligatoire!"; + v_msgEng="The key letter is mandatory!"; + + alert_ebene(v_msg,v_msgEng); + + $('#lettreCle').css('borderColor','red'); + return; + } + + + donnees = $('#formModal').serialize(); + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+link+"/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + return; + } + + if(id==undefined){ + afficheDonneesTable(fichier_lister); + $("#div_add_lettrecle .close").click(); + + }else{ + afficheDonneesTable(fichier_lister); + $("#div_edit_lettrecle .close").click(); + } + //dataTableSpeciale(); + }, + complete: function() { + + } + }); + +} + +function editlettrecle(id){ + + $('#div_add_lettrecle').empty(); + + donnees ='id='+id; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierlettrecle/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_edit_lettrecle').html(data); + $('#div_edit_lettrecle').modal("show"); + $('#div_edit_lettrecle').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#lettreCle').focus(); + }); + + }, + complete: function() { + + } + }); +} + +function edittypetarif(id){ + + $('#div_add_typetarif').empty(); + + donnees ='id='+id; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifiertypetarifacte/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_edit_typetarif').html(data); + $('#div_edit_typetarif').modal("show"); + $('#div_edit_typetarif').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeTypeTarifActe').focus(); + }); + + }, + complete: function() { + + } + }); +} + +function enregistrerTypeTarif(){ + var codeTypeGarant = $('#codeTypeTarif').val(), + libelle = $('#libelle').val(), + libelleEng = $('#libelleEng').val(), + description = $('#description').val(), + descriptionEng = $('#descriptionEng').val(), + id = $('#formModal .sr-only').val(); + + fichier_lister = 'Ajaxlistertypetarifacte'; + + if(id == undefined){ + link = 'Ajaxouvrirtypetarif'; + }else{ + link = 'Ajaxmodifiertypetarifacte'; + } + + if(codeTypeGarant ==''){ + v_msg="Le code est obligatoire !"; + v_msgEng="The code is required !"; + + alert_ebene(v_msg,v_msgEng); + + $('#codeTypeGarant').css('borderColor','red'); + return; + } + + if(libelle ==''){ + v_msg="Le libellé est obligatoire !"; + v_msgEng="The label is required !"; + + alert_ebene(v_msg,v_msgEng); + + $('#libelle').css('borderColor','red'); + return; + } + + donnees = $('#formModal').serialize(); + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+link+"/enregistrer/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + return; + } + + if(id==undefined){ + afficheDonneesTable(fichier_lister); + $("#div_add_typetarif .close").click(); + + }else{ + afficheDonneesTable(fichier_lister); + $("#div_edit_typetarif .close").click(); + } + //dataTableSpeciale(); + }, + complete: function() { + + } + }); + +} + + + +function supprimeLignetypetarif($idData){ + var fichier_lister = 'Ajaxlistertypetarifacte'; + + + 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 = 'id='+$idData; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + afficheDonneesTable(fichier_lister); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// 10-08-2020 + +function ctrlkeypress_liste_garants(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_liste_garants(); + } +} + +function afficher_liste_garants() +{ + donnees = ""; + donnees_retour = ""; + + typeGarant = $("#typeGarant").val(); + libelle = $("#libelle").val(); + codeGcAssureur = $("#codeGcAssureur").val(); + + if(typeGarant==''){ + typeGarant=0; + } + + donnees += 'typeGarant=' + typeGarant; + donnees += '&libelle=' + libelle; + donnees += '&codeGcAssureur=' + codeGcAssureur; + + //alert(donnees); + //return; + + $("#div_gcs").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistegarantsparametrage/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + }, + complete: function() { + $("#div_gcs").html(donnees_retour); + dataTableSpeciale(); + $("#nbligne").val("Nbre Lignes : "+$("#nbligne_info").val()); + } + }); +} + +function desactive_gc_assureur(idGarant){ + + v_msg = 'Confirmez-vous la désactivation de ce garant?'; + v_msgEng="Do you confirm the deactivation of this guarantor?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'idGarant='+idGarant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/desactivergcassureur/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + afficher_liste_garants(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function reactive_gc_assureur(idData){ + + v_msg = 'Confirmez-vous la réactivation de ce garant?'; + v_msgEng="Do you confirm the reactivation of this guarantor?"; + + fichier = 'Ajaxlistegarantsdesactives'; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'id='+idData; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/reactivergcassureur/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + afficheDonneesTable(fichier); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +// 13/08/2020 + +const onglets = document.querySelectorAll('.onglets'); +const contenu = document.querySelectorAll('.contenu'); +let index = 0; + +onglets.forEach(onglet =>{ + onglet.addEventListener('click', () =>{ + if(onglet.classList.contains('active')){ + return; + }else{ + onglet.classList.add('active'); + } + + index = onglet.getAttribute('data-anim'); + for(i=0; i' + ''); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairesreseau/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_prestataires_reseau').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + + } + }); +} + + +function ajouter_tous_prestataires_reseau() +{ + codeReseau=$("#codeReseau").val(); + + if (codeReseau<=" ") + { + v_msg="Veuillez sélectionner un réseau de soins!"; + v_msgEng="Please select a care network!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeReseau='+codeReseau; + + v_msg="Attention, cela va ajouter tous les prestataires disponibles à ce réseau de soins! Confirmez-vous?"; + v_msgEng="Be careful, this will add all the providers available to this healthcare network! Do you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_prestataires_reseau").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairesreseau/ajoutertousprestatairesreseausoins/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_prestataires_reseau').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_un_prestataire_reseau(codePrestataire) +{ + codeReseau=$("#codeReseau").val(); + + if (codeReseau<=" ") + { + v_msg="Veuillez sélectionner un réseau de soins!"; + v_msgEng="Please select a care network!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + donnees = 'codeReseau='+codeReseau+'&codePrestataire='+codePrestataire; + + $("#div_prestataires_reseau").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairesreseau/ajouterunprestataireaureseau/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_prestataires_reseau').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); +} + +function retirer_tous_prestataires_reseau() +{ + codeReseau=$("#codeReseau").val(); + + if (codeReseau<=" ") + { + v_msg="Veuillez sélectionner un réseau de soins!"; + v_msgEng="Please select a care network!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeReseau='+codeReseau; + + v_msg="Attention, cela va vider ce réseau de soins de tous ses prestataires! Confirmez-vous?"; + v_msgEng="Be careful, this will empty this healthcare network of all its providers! Do you confirm?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $("#div_prestataires_reseau").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairesreseau/retirertousprestatairesreseausoins/", + type: 'POST', + data: donnees, + success: function(data) + { + $('#div_prestataires_reseau').html(data); + appliquerDataTable(); + }, + error: function(data) + { + }, + complete: function() + { + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_un_prestataire_reseau(codePrestataire) +{ + + codeReseau=$("#codeReseau").val(); + + + if (codeReseau<=" ") + { + v_msg="Veuillez sélectionner un réseau de soins!"; + v_msgEng="Please select a care network!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeReseau='+codeReseau+'&codePrestataire='+codePrestataire; + + + $("#div_prestataires_reseau").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprestatairesreseau/retirerunprestatairereseausoins/", + type: 'POST', + data: donnees, + success: function(data) { + $('#div_prestataires_reseau').html(data); + appliquerDataTable(); + }, + error: function(data) { + }, + complete: function() + { + } + }); +} + + +function dupliquer_reseau(id){ + + v_msg='Confirmez-vous la duplication de ce réseau de soins?'; + v_msgEng="Do you confirm the duplication of this healthcare network?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'id='+id; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdupliquerreseausoins/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_dupliquer_reseau').html(data); + $('#div_dupliquer_reseau').modal("show"); + $('#div_dupliquer_reseau').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#libelle').focus(); + }); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function duplicationreseausoins(){ + var codeold = $('#codeold').val(), + codeReseau = "", + libelle = $('#libelle').val(); + + if(libelle <= " "){ + v_msg="Veuillez renseigner le nom du réseau de soins!"; + v_msgEng="Please enter the name of the healthcare network!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeold='+codeold+'&codeReseau='+codeReseau+'&libelle='+libelle; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdupliquerreseausoins/dupliquer/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + $("#div_dupliquer_reseau .close").click(); + retour_liste_reseaus(); + }, + complete: function() { + + } + }); + + +} + +// 19/08/2020 + +function changeTypePrestataire(){ + var categoriePresataire = $('#categoriePresataire').val(); + + if(categoriePresataire=="C"){ + $("#centreReference").removeAttr('disabled'); + }else{ + $("#centreReference").attr('disabled', 'disabled'); + } + + donnees ='categoriePresataire='+categoriePresataire; + + + $.ajax({ + url: "Ajaxcategorietypeprestataire/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + //alert("Success : "+data); + $('#div_type_prestataire').empty(); + $('#div_type_prestataire').html(data); + }, + complete: function(){ + } + }); + +} + +// 24/08/2020 + +function ajouter_praticien(){ + $('#div_modifier_praticien').empty(); + donnees = ""; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxajouterpraticien/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_ajouter_praticien').html(data); + $('#div_ajouter_praticien').modal("show"); + $('#div_ajouter_praticien').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#nom').focus(); + }); + }, + complete: function() { + + } + }); + +} + +function creer_praticien() +{ + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codeSpecialite = $("#codeSpecialite").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + telephone = $("#telephone").val(); + codeMetier = $("#codeMetier").val(); + adresse = $("#adresse").val(); + email = $("#email").val(); + sexe = $("#sexe").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez indiquer le prénoms!"; + v_msgEng="Please give the first names"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + if(codeMetier<=" ") + { + v_msg="Veuillez sélectionner la corporation!"; + v_msgEng="Please select the corporation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + + if(codeSpecialite<=" ") + { + v_msg="Veuillez sélectionner la spécialité!"; + v_msgEng="Please select the specialty"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + + if(sexe<=" ") + { + v_msg="Veuillez indiquer le sexe!"; + v_msgEng="Please indicate sex"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email; + donnees += '&codeSpecialite='+codeSpecialite+'&noOrdreMedecin='+noOrdreMedecin+'&sexe='+sexe; + donnees += '&codeMetier='+codeMetier+'&adresse='+adresse; + + // alert(donnees); + //return; + + v_msg="Confirmez-vous ce nouveau praticien?"; + v_msgEng="Do yo confirm this new practitioner?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmedecinparam/creermedecin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_unicite_medecin').html(data); + }, + complete: function() + { + unicitemedecin = $("#unicitemedecin").val(); + if(unicitemedecin==1) + { + v_msg="Praticien crée avec succès!"; + v_msgEng="Practitioner created succssfully!"; + alert_ebene(v_msg, v_msgEng); + + $("#div_ajouter_praticien .close").click(); + afficher_medecins_prestataire(); + } + else + { + v_msg="No Ordre " + noOrdreMedecin +" déjà utilisé!"; + v_msgEng="Doctor Order No " + noOrdreMedecin +" already in use!"; + alert_ebene(v_msg, v_msgEng); + + $("#noOrdreMedecin").focus(); + } + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function modifier_praticien(id){ + $('#div_ajouter_praticien').empty(); + + donnees ='id='+id; + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierpraticien/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_modifier_praticien').html(data); + $('.selectpicker').selectpicker(); + $('#div_modifier_praticien').modal("show"); + $('#div_modifier_praticien').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#nom').focus(); + }); + + }, + complete: function() { + + } + }); +} + + +function enregistrer_modifier_praticien() +{ + idMedecin = $("#idMedecin").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + codeSpecialite = $("#codeSpecialite").val(); + noOrdreMedecin = $("#noOrdreMedecin").val(); + telephone = $("#telephone").val(); + + codeMetier = $("#codeMetier").val(); + adresse = $("#adresse").val(); + + email = $("#email").val(); + sexe = $("#sexe").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(prenoms<=" ") + { + v_msg="Veuillez indiquer le prénoms!"; + v_msgEng="Please give the first names"; + alert_ebene(v_msg, v_msgEng); + + $("#prenoms").focus(); + return; + } + + if(codeMetier<=" ") + { + v_msg="Veuillez sélectionner la corporation!"; + v_msgEng="Please select the corporation!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeMetier").focus(); + return; + } + + if(codeSpecialite<=" ") + { + v_msg="Veuillez sélectionner la spécialité!"; + v_msgEng="Please select the specialty"; + alert_ebene(v_msg, v_msgEng); + + $("#codeSpecialite").focus(); + return; + } + + if(sexe<=" ") + { + v_msg="Veuillez indiquer le sexe!"; + v_msgEng="Please indicate sex"; + alert_ebene(v_msg, v_msgEng); + + $("#sexe").focus(); + return; + } + + donnees = 'idMedecin='+idMedecin+'&nom='+nom; + donnees += '&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email; + donnees += '&codeSpecialite='+codeSpecialite+'&noOrdreMedecin='+noOrdreMedecin+'&sexe='+sexe; + donnees += '&codeMetier='+codeMetier+'&adresse='+adresse; + + //alert(donnees); + //return; + + 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()+"Ajaxmedecinparam/enregistrermodifmedecin/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_modifier_praticien .close").click(); + afficher_medecins_prestataire(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function prestatairereseausoins_id(idPrestataire) +{ + window.location.assign($("#racineWeb" ).val()+"Modifierprestatairereseausoins/"+idPrestataire+"/"); +} + +function medecinsprestataire() +{ + categoriePresataire = $("#categoriePresataire").val(); + + if (categoriePresataire!="C") + { + v_msg="Accès refusé! Ce prestataire n'est pas un centre de soins!"; + v_msgEng="Access denied! This provider is not a health center!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb").val()+"Medecinsprestataire/"); +} + + +/****************************************************************** + * AUTRE TABLE DE REFERENCES +*******************************************************************/ + +// Récupère les fichiers contenu dans la table autrestablesreference +function chargerFichiersTable(){ + + + var $id = $('#listetables').val(); + + if ($id !=''){ + donnees = 'id='+$id; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxaccesfichiersautrestables/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + fermeFormulaire(); + $('#div_fichiers_table').html(data); + afficheDonneesTableChoisie($('#fichier_lister').val()); + }, + complete: function() { + + } + }); + }else{ + $('#div_fichiers_table').empty(); + $('#div_entete_table').empty(); + $('#div_lister_table').empty(); + + } +} + +// Affiche les données de la table selectionnée dans un tableau +function afficheDonneesTableChoisie(fichier){ + + var codeLangue = $("#codeLangue").val(); + + + if(fichier=="Ajaxtblisterjoursferiers"){ + codePays = $('#codePays').val(); + annee = $('#annee').val(); + + if(codePays==undefined){ + codePays ="CI" + } + + if(annee==undefined){ + var ladate=new Date(); + annee =ladate.getFullYear(); + } + + donnees = 'codePays='+codePays+'&annee='+annee; + }else{ + donnees = ''; + } + + if(fichier !=''){ + $.ajax({ + url: $("#racineWeb").val()+fichier+"/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + $('#div_lister_table').html(data); + // + + + if(fichier=="Ajaxtblisterjoursferiers"){ + $('#codePays').val(codePays); + $('#annee').val(annee); + } + if(fichier=="Ajaxtblistertableauajustementgarant"){ + appliquerDataTable(); + }else{ + + if(codeLangue=="en_US") + { + $('#tableLister').DataTable({ + "lengthMenu": [ 20, 50, 100], + "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)", + "aoColumnDefs": [ + { "bSearchable": false, "aTargets": [ 0 ] } + ] + } + }); + } + else + { + $('#tableLister').DataTable({ + "lengthMenu": [ 20, 50, 100], + "language": { + "lengthMenu":"Affiche _MENU_ par page", + "zeroRecords": "Désolé - Aucune donnée trouvée", + "info": "_PAGE_ sur _PAGES_ pages", + "infoEmpty": "Pas d'enregistrement valable", + "search": "Recherche:", + "paginate": { + "next": "►", + "previous": "◄", + "first": "|◄", + "last": "►|" + }, + "infoFiltered": "(filtré de _MAX_ total enregistrements)", + "aoColumnDefs": [ + { "bSearchable": false, "aTargets": [ 0 ] } + ] + } + }); + } + + } + + }, + complete: function() { + + } + }); + } +} + +// Gère l'affichage des boutons en entête des formulaires +function afficheBoutons($idData){ + + + var div = $('#div_maj_table').children().length; + var codeLangue = $("#codeLangue").val(); + + + if($idData == 0){ + donnees = ''; + }else{ + donnees = 'id='+$idData; + + + if(codeLangue=="en_US") + { + $('#btn-action').text('Save'); + } + else + { + $('#btn-action').text('Enregistrer'); + } + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxentete/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + + $('#div_entete_table').html(data); + + if(($('#btn-action').text() == 'Ajouter' || $('#btn-action').text() == 'Add') && div == 0){ + $('#btn-fermer').hide(); + }else{ + $('#btn-fermer').show(); + if(codeLangue=="en_US") + { + $('#btn-action').text('Save'); + } + else + { + $('#btn-action').text('Enregistrer'); + } + } + }, + complete: function(){ + + } + }); + +} + +// Ferme le formulaire affiché +function fermeFormulaire(){ + $('#div_maj_table').empty(); + + afficheBoutons(0); + +} + +// Affiche le formulaire d'ajout de données +function formAjoutTableRef(){ + + var codeLangue = $("#codeLangue").val(); + var fichier_ajouter = $('#fichier_ajouter').val(), + btn = $('#btn-action').text(); + + //alert(fichier_ajouter); + //return; + if(fichier_ajouter != '' && fichier_ajouter != undefined){ + if(btn == 'Ajouter' || btn == 'Add'){ + donnees = ''; + $('#btn-fermer').show(); + + if(codeLangue=="en_US") + { + $('#btn-action').text('Save'); + } + else + { + $('#btn-action').text('Enregistrer'); + } + + $.ajax({ + url: fichier_ajouter+"/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + $('#div_maj_table').html(data); + stylechampsRequis(); + $(".datepicker").datepicker(); + $('.selectpicker').selectpicker(); + if(typeof $('#div_maj_table input:first').attr('type') == 'string'){ + $('#div_maj_table input:first').focus(); + }else{ + $('#div_maj_table select:first').focus(); + } + }, + complete: function(){ + } + }); + }else{ + update_table(); + } + }else{ + var nomForm = $('#nomForm').val(); + + if(nomForm == 'frmbaremegarant'){ + fichier_ajouter = 'Ajaxajouterbaremeaccessoiregarant'; + }else if(nomForm == 'frmtrancheaccessoire'){ + fichier_ajouter = 'Ajaxtbajouterbaremeaccessoireavenant'; + }else if(nomForm == 'frmtauxAjustement'){ + fichier_ajouter = 'Ajaxtbajoutertableauajustement'; + }else if(nomForm == 'frmtauxAjustementgarant'){ + fichier_ajouter = 'Ajaxtbajoutertableauajustementgarant'; + }else if(nomForm == 'frmacteconsultation'){ + fichier_ajouter = 'Ajaxtbajouteracteconsultation'; + } + + + if(btn == 'Ajouter' || btn == 'Add'){ + donnees = ''; + if(nomForm == 'frmtauxAjustementgarant'){ + donnees = 'codeGcAssureur='+$("#codeGcAssureur").val(); + } + + $('#btn-fermer').show(); + + if(codeLangue=="en_US") + { + $('#btn-action').text('Save'); + } + else + { + $('#btn-action').text('Enregistrer'); + } + + $.ajax({ + url: fichier_ajouter+"/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maj_table').html(data); + $(".datepicker").datepicker(); + $(".selectpicker").selectpicker(); + stylechampsRequis(); + if(typeof $('#div_maj_table input:first').attr('type') == 'string'){ + $('#div_maj_table input:first').focus(); + }else{ + $('#div_maj_table select:first').focus(); + } + + }, + complete: function(){ + } + }); + }else{ + update_table(); + } + + } + +} + +// Filtrer la liste des villes par pays +function filtreVilleParPays(){ + var codePays = $('#codePays').val(); + + donnees ='codePays='+codePays; + $.ajax({ + url: "Ajaxfiltrevilleparpays/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + //alert("Success : "+data); + $('#div_ville').empty(); + $('#div_ville').html(data); + //filtreLocaliteParVille(); + }, + complete: function(){ + } + }); + +} + +// Filtrer la liste des localités par pays et par ville +function filtreLocaliteParVille(){ + var codePays = $('#codePays').val(), + codeVille = $('#codeVille').val(); + + if(codePays == ''){ + return; + }else{ + donnees ='codePays='+codePays+'&codeVille='+codeVille; + } + + $.ajax({ + url: "Ajaxfiltrelocaliteparville/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + //alert("Success : "+data); + $('#div_localite').empty(); + $('#div_localite').html(data); + }, + complete: function(){ + } + }); + +} + +// Affiche le formulaire de modification de données +function formModifTableRef($idData){ + + var codeLangue = $("#codeLangue").val(); + var fichier_modifier = $('#fichier_modifier').val(), + btn = $('#btn-action').text(); + + if(fichier_modifier==undefined){ + var nomForm = $('#nomForm').val(); + + if(nomForm == 'frmbaremegarant'){ + + fichier_modifier = 'Ajaxmodifierbaremeaccessoiregarant'; + }else if(nomForm == 'frmtrancheaccessoire'){ + fichier_modifier = 'Ajaxtbmodifierbaremeaccessoireavenant'; + }else if(nomForm == 'frmtauxAjustement'){ + fichier_modifier = 'Ajaxtbmodifiertableauajustement'; + }else if(nomForm == 'frmtauxAjustementgarant'){ + fichier_modifier = 'Ajaxtbmodifiertableauajustementgarant'; + }else if(nomForm == 'frmacteconsultation'){ + fichier_modifier = 'Ajaxtbmodifieracteconsultation'; + } + } + + if(btn == 'Ajouter' || btn == 'Add'){ + donnees = ''; + $('#btn-fermer').show(); + + if(codeLangue=="en_US") + { + $('#btn-action').text('Save'); + } + else + { + $('#btn-action').text('Enregistrer'); + } + + } + + donnees = 'id='+$idData; + + $.ajax({ + url: fichier_modifier+"/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_maj_table').html(data); + $(".datepicker").datepicker(); + $(".selectpicker").selectpicker(); + stylechampsRequis(); + if(typeof $('#div_maj_table input:first').attr('type') == 'string'){ + $('#div_maj_table input').eq(1).focus(); + }else{ + $('#div_maj_table select:first').focus(); + } + + }, + complete: function() { + + } + }); +} + +// Supprime une ligne du tableau +function supprimeLigneListe($idData, superUser){ + + var fichier_lister = $('#fichier_lister').val(); + + if (superUser != "1"){ + v_msg="Non autorisé!"; + v_msgEng="Unauthorized!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + var v_msg = 'Confirmez-vous la suppression de cette ligne?'; + var v_msgEng="Are you sure you want to delete this line?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'id='+$idData; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + afficheDonneesTableChoisie(fichier_lister); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + + +function supprimerprestataireenplus($idData){ + + var fichier_lister = "Ajaxajouterprestatairesenplus"; + + var v_msg = 'Confirmez-vous la suppression de cette ligne?'; + var v_msgEng="Are you sure you want to delete this line?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'id='+$idData; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + //afficheDonneesTableChoisie(fichier_lister); + codePrestataire =""; + ajouter_prestatairesenplus(codePrestataire); + //dataTableSpecialeMini(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + + +} + +function supprimerprestataireenmoins($idData){ + + var fichier_lister = "Ajaxajouterprestatairesenmoins"; + + var v_msg = 'Confirmez-vous la suppression de cette ligne?'; + var v_msgEng="Are you sure you want to delete this line?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = 'id='+$idData; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + //afficheDonneesTableChoisie(fichier_lister); + codePrestataire =""; + ajouter_prestatairesenmoins(codePrestataire); + //dataTableSpecialeMini(); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + + +// Enregistrement des données dans les différentes tables (Ajout ou modification) +function update_table(){ + + var fichier_ajouter = $('#fichier_ajouter').val(), + fichier_lister = $('#fichier_lister').val(), + fichier_modifier= $('#fichier_modifier').val(), + id = $('#formData .sr-only').val(), + visible = false, + valide = true; + requis = $('input,select,textarea').filter('[required]:visible'); + + if(fichier_ajouter == undefined && fichier_modifier==undefined && fichier_lister==undefined){ + var nomForm = $('#nomForm').val(); + + if(nomForm == 'frmbaremegarant'){ + fichier_ajouter = 'Ajaxajouterbaremeaccessoiregarant'; + fichier_modifier = 'Ajaxmodifierbaremeaccessoiregarant'; + }else if(nomForm == 'frmtrancheaccessoire'){ + fichier_ajouter = 'Ajaxtbajouterbaremeaccessoireavenant'; + fichier_modifier = 'Ajaxtbmodifierbaremeaccessoireavenant'; + fichier_lister = 'Ajaxtblisterbaremeaccessoireavenant'; + }else if(nomForm == 'frmtauxAjustement'){ + fichier_ajouter = 'Ajaxtbajoutertableauajustement'; + fichier_modifier = 'Ajaxtbmodifiertableauajustement'; + fichier_lister = 'Ajaxtblistertableauajustement'; + }else if(nomForm == 'frmtauxAjustementgarant'){ + fichier_ajouter = 'Ajaxtbajoutertableauajustementgarant'; + fichier_modifier = 'Ajaxtbmodifiertableauajustementgarant'; + fichier_lister = 'Ajaxtblistertableauajustementgarant'; + }else if(nomForm == 'frmacteconsultation'){ + fichier_ajouter = 'Ajaxtbajouteracteconsultation'; + fichier_modifier = 'Ajaxtbmodifieracteconsultation'; + } + } + + if(id == undefined){ + link = $("#racineWeb").val()+fichier_ajouter+"/ajouter/" + }else{ + link = $("#racineWeb").val()+fichier_modifier+"/modifier/" + } + + requis.each(function(){ + if($(this).val() == ''){ + v_msg="Veuillez saisir les champs en rouge !"; + v_msgEng="Please enter the fields in red !"; + alert_ebene(v_msg,v_msgEng); + $(this).css('borderColor','red'); + valide = false; + return false; + }else{ + valide = true; + } + }); + + if(valide){ + donnees = $('#formData').serialize(); + + if(nomForm == 'assures'){ + var dateNaissance = $("#dateNaissance").val(); + var dateEntree = $("#dateEntree").val(); + var dateAdhesion = $("#dateAdhesion").val(); + var dateRetrait = $("#dateRetrait").val(); + + donnees+="&dateNaissance="+dateNaissance+"&dateEntree="+dateEntree; + donnees+="&dateAdhesion="+dateAdhesion+"&dateRetrait="+dateRetrait; + }else if(nomForm == 'ayantdroits'){ + var adDateNaissance = $("#adDateNaissance").val(); + donnees+="&adDateNaissance="+adDateNaissance; + }else if(nomForm == 'frmbaremegarant'){ + var codeGcAssureur = $("#codeGcAssureur").val(); + donnees+="&codeGcAssureur="+codeGcAssureur; + }else if(nomForm == 'frmtauxAjustementgarant'){ + var codeGcAssureur = $("#codeGcAssureur").val(); + donnees+="&codeGcAssureur="+codeGcAssureur; + } + + //alert(donnees); + + //return; + + $.ajax({ + url: link, + type : 'post', + data: donnees, + error: function(errorData) { + + }, + success: function(data) { + // alert(data); + + if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + visible = true; + } + if(nomForm == 'frmbaremegarant'){ + afficher_bareme_accessoire_garant(); + fermeFormulaire(); + return; + }else if(nomForm == "frmtrancheaccessoire"){ + window.location.assign($("#racineWeb" ).val()+"Tranchesaccessoires/"); + }else if(nomForm == "frmtauxAjustement"){ + window.location.assign($("#racineWeb" ).val()+"Tableauajustementprimes/"); + }else if(nomForm == 'frmtauxAjustementgarant'){ + afficher_tauxajustement_garant(); + fermeFormulaire(); + return; + }else if(nomForm == "frmacteconsultation"){ + window.location.assign($("#racineWeb" ).val()+"Actesconsultations/"); + } + + afficheDonneesTableChoisie(fichier_lister); + if(!visible){ + fermeFormulaire(); + }else{ + $('#div_maj_table input:first').css('borderColor','red'); + } + }, + complete: function() { + + } + }); + + } +} + +function cocherDecocherTout(fichier_lister){ + var total = $('#total').val(); + + //alert(total); + //retun; + + if(parseInt(total,10)==0){ + msg = "Désolé - Aucune donnée trouvée!"; + msgeng = "Sorry - No data found!"; + + alert_ebene(msg,msgeng); + return; + } + + donnees = ""; + donnees_retour = ""; + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/selectionnetout/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + + afficheDonneesTableChoisie(fichier_lister); + + }, + complete: function() { + + } + }); + +} + +function cocherDecocherUn(fichier_lister,id){ + var nbcoche = $('#nbcoche').val(); + + + donnees = "id="+id; + donnees_retour = ""; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/selectionneun/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + + if(fichier_lister=="Ajaxlisteprestataireparlot" || fichier_lister=="Ajaxlisteprestatairegroupe"){ + + donnees_retour = data; + + + if(parseInt(donnees_retour,10) > 0){ + codeLangue = $("#codeLangue").val(); + if(codeLangue=="en_US") + { + p_msg = "Uncheck all"; + } + else + { + p_msg = "Décocher tous" ; + + } + $('#btn-coche').text(p_msg); + }else{ + + if(codeLangue=="en_US") + { + p_msg = "Check all"; + } + else + { + p_msg = "Cocher tous" ; + + } + $('#btn-coche').text(p_msg); + } + + $("#nbcoche").val('Lignes Cochées : '+parseInt(donnees_retour,10)); + + return; + }else{ + afficheDonneesTableChoisie(fichier_lister); + } + }, + complete: function() { + + } + }); + +} + +function filtreTableReference(numeroTable){ + + donnees = "numeroTable="+numeroTable; + + $("#div_lister_table").html(""); + $('#div_fichiers_table').html(""); + $('#div_entete_table').html(""); + + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltretablesreference/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + $("#div_listetables").html(data); + $("#listetables").selectpicker(); + + }, + complete: function() { + + } + }); + +} + +function supprimer_choix(){ + + var fichier_lister = $('#fichier_lister').val(); + var selectionne = $('#selectionne').val(); + var listetables = $('#listetables').val(); + + if (listetables ==''){ + v_msg = "Veuillez d'abord selectionner une table dans la liste déroulante!"; + v_msgEng="Please select a table first from the drop-down list!"; + alert_ebene(v_msg,v_msgEng); + $('#listetables').focus(); + return; + } + + if(selectionne =='false'){ + v_msg = "Suppression de masse impossible! Aucune case n'est cochée."; + v_msgEng="Mass suppression not possible! No box is checked."; + alert_ebene(v_msg,v_msgEng); + return; + } + + v_msg = 'Confirmez-vous la suppression des toutes les données sélectionnées?'; + v_msgEng="Are you sure you want to delete all selected data?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimerChoix/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + afficheDonneesTableChoisie(fichier_lister); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function tout_supprimer(){ + var fichier_lister = $('#fichier_lister').val(); + var selectionne = $('#selectionne').val(); + var listetables = $('#listetables').val(); + + if (listetables ==''){ + v_msg = "Suppression de masse impossible! Aucune case n'est cochée."; + v_msgEng="Mass suppression not possible! No box is checked."; + alert_ebene(v_msg,v_msgEng); + $('#listetables').focus(); + return; + } + + if(selectionne =='false'){ + v_msg = "Suppression impossible! Aucune case n'est cochée."; + v_msgEng="Removal impossible! No box is checked."; + alert_ebene(v_msg,v_msgEng); + return; + } + + v_msg = 'Confirmez-vous la suppression de toutes les données de la table?'; + v_msgEng="Are you sure, you want to delete all data from the table?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+fichier_lister+"/supprimerTout/", + type : 'post', + data: donnees, + error: function(errorData) { + // alert("Erreur : "+errorData); + }, + success: function(data) { + // alert("Success : "+data); + afficheDonneesTableChoisie(fichier_lister); + }, + complete: function() { + + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function supprimer_garant(){ + var idGc = $('#idGc').val(); + + v_msg = 'Confirmez-vous la suppression du garant?'; + v_msgEng="Do you confirm the removal of the guarantor?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = "id="+idGc; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/supprimer/", + type : 'post', + data: donnees, + error: function(errorData) { + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + + }, + complete: function() { + window.location.assign($("#racineWeb" ).val()+"Gcassureur/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +/* + +*/ + +// Applique la librairie DataBase sur les tableaux +function appliquerDataTable(){ + // alert('applying datatable') + + const oTable = $('.tabliste'); + + var codeLangue = $("#codeLangue").val(); + + + var nomForm = $('#nomForm').val(); + + var tab = $('#dataliste'); + + // 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 + } + + // 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 + } + + if(nomForm == 'listebareme' || nomForm == 'collegepolice' || nomForm == 'reseausoins'){ + try{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [0, "desc"], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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 + { + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [0, "desc"], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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; + } + }else if(nomForm == 'compositiontarifactes' || nomForm == 'sourceDonnees' || nomForm == 'requetepersonnalisee'){ + try{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "ordering": false, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "ordering": false, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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)" + } + }); + } + + // oTable.columns.adjust().draw(); + } + catch(err){ + return false; + } + }else if(nomForm == 'frmtrancheaccessoire'){ + try{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [[ 1, "desc" ],[6, "asc"],[2, "asc"]], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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{ + + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [[ 1, "desc" ],[6, "asc"],[2, "asc"]], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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)" + } + }); + } + + //"order": [[ 4, "asc" ],[0, "desc"]], oTable.columns.adjust().draw(); + } + catch(err){ + return false; + } + }else if(nomForm == 'Fichechangementcollege' || nomForm == 'frmficherenouvellement'){ + try{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "pagingType": "full_numbers", + "autoWidth": false, + "ordering": 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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "pagingType": "full_numbers", + "autoWidth": false, + "ordering": 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)" + } + }); + } + + //oTable.columns.adjust().draw(); + } + catch(err){ + console.log('error: ',err) + return false; + + } + }else if(nomForm == 'fichedevis'){ + try{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [1, "desc"], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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 + { + oTable.DataTable({ + destroy: true, + responsive: true, + "order": [0, "desc"], + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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; + } + + }else{ + try{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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)" + } + }); + } + + //oTable.columns.adjust().draw(); + } + catch(err){ + console.log('error: ',err) + return false; + + } + } + + if(nomForm == 'compositiontarifactes'){ + try{ + if(codeLangue=="en_US") + { + tab.DataTable({ + destroy: true, + responsive: true, + "ordering": false, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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({ + destroy: true, + responsive: true, + "ordering": false, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "75vh", + "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)" + } + }); + } + + //tab.columns.adjust().draw(); + } + catch(err){ + return false; + } + } + +} + + +function dataTableSpeciale() { + const $table = $('.tabspeciale'); + const codeLangue = $("#codeLangue").val() || "fr_FR"; + + // Détruire l'instance existante si elle existe + if ($.fn.DataTable.isDataTable($table)) { + $table.DataTable().clear().destroy(); + $table.empty(); // Optionnel : vider le contenu si nécessaire + } + + // Définition des traductions + const langOptions = { + en_US: { + 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)" + }, + fr_FR: { + 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)" + } + }; + + // Définition des lengthMenu selon la langue + const lengthMenuOptions = (codeLangue === "en_US") ? [50, 100, 150] : [20, 50, 100]; + + try { + $table.DataTable({ + destroy: true, + responsive: true, + lengthMenu: lengthMenuOptions, + scrollX: true, + scrollY: "75vh", + pagingType: "full_numbers", + autoWidth: false, + searching: false, // équivalent moderne de bFilter:false + ordering: false, + lengthChange: false, // équivalent moderne de bLengthChange:false + orderMulti: true, + language: langOptions[codeLangue] || langOptions.fr_FR + }); + + // Ajuster les colonnes après init + $table.DataTable().columns.adjust().draw(); + + } catch (err) { + console.error("Erreur DataTable:", err); + return false; + } +} + +function dataTableSpecialeMini(){ + const oTable = $('.tabspecialemini'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "34vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": false, + "bLengthChange": false, + "orderMulti": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 50, 100, 150], + "scrollX": true, + "scrollY": "34vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": false, + "bLengthChange": false, + "orderMulti": 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)" + } + }); + } + + //$('.tabspecialemini').columns.adjust().draw(); + + } + catch(err){ + return false; + } +} + + + +function dataTableMini(){ + + const oTable = $('.tabmini'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [10], + "scrollX": true, + "scrollY": "20vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": false, + "bLengthChange": false, + "orderMulti": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [10], + "scrollX": true, + "scrollY": "20vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": false, + "bLengthChange": false, + "orderMulti": 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)" + } + }); + } + + //$('.tabmini').columns.adjust().draw(); + } + catch(err){ + return false; + } +} + + +function dataTab(){ + + const oTable = $('.datatab'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": 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; + + } +} + +function datafiltre(){ + + const oTable = $('.datafiltre'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": 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; + + } +} + + +function filtreTab(){ + + const oTable = $('.filtreTab'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": 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; + + } +} + +function datatab_plus(){ + + const oTable = $('.datatabplus'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 20, 50, 100], + "scrollX": true, + "scrollY": "50vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 20, 50, 100], + "scrollX": true, + "scrollY": "50vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": 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; + + } +} + + +function dataTableServeur(){ + + const oTable = $('.datatab'); + var codeLangue = $("#codeLangue").val(); + + // 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{ + + if(codeLangue=="en_US") + { + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": true, + "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{ + oTable.DataTable({ + destroy: true, + responsive: true, + "lengthMenu": [ 10, 50, 100], + "scrollX": true, + "scrollY": "23vh", + "pagingType": "full_numbers", + "autoWidth": false, + "bFilter": 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; + + } +} + +function rattacher_prestataires_reseau(){ + var nbcoche = $('#nbcoche').val(); + var nomReseau = $('#nomReseau').val(); + var msg_fr = "Aucun prestataire n'est sélectionné pour être rattaché au reséau de soins : "+nomReseau+"!"; + var msg_en = "No provider is selected to be attached to the care network: "+nomReseau+"'"; + + if(nbcoche == '0' || nbcoche =='' || nbcoche ==undefined){ + alert_ebene(msg_fr,msg_en); + return; + }else{ + msg_fr = "Confirmez-vous le rattachement des "+ nbcoche +" prestataires sélectionnés au reséau de soins :"+nomReseau+"?"; + msg_en = "Do you confirm the attachment of the "+ nbcoche +" selected providers to the care network"+nomReseau+"?"; + + confirm_ebene(msg_fr, msg_en) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + donnees = ""; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteprestataireparlot/rattacher/", + type : 'post', + data: donnees, + error: function(errorData) { + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + }, + complete: function() { + afficher_lite_prestataire_lot(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + } + +} + +function modifier_college_type(idTable) +{ + window.location.assign($("#racineWeb" ).val()+"Modifiercollegetype/"+idTable+"/"); +} + +function supprimer_college_type(idTable) +{ + 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()+"Ajaxnouveaucollegetype/supprimer/", + type : 'post', + data: "idTable="+idTable, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_colleges_types(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function enregistrer_modif_college_type() +{ + idTable = $("#idTable").val(); + + + codeLangue = $("#codeLangue").val(); + + if(codeLangue=="en_US") + { + libelle = $('#libelleEng').val(); + } + else + { + libelle = $('#libelle').val(); + } + + + if(libelle<=" ") + { + v_msg="Veuillez indiquer le libellé!"; + v_msgEng="Please enter the label!!"; + alert_ebene(v_msg, v_msgEng); + + if(codeLangue=="en_US") + { + $('#libelleEng').css('borderColor','red'); + $('#libelleEng').focus(); + }else{ + $('#libelle').css('borderColor','red'); + $('#libelle').focus(); + } + + return; + } + + donnees = 'idTable='+idTable+'&libelle='+libelle; + + 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()+"Ajaxnouveaucollegetype/enregistrermodif/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + retour_colleges_types(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retour_colleges_types() +{ + window.location.assign($("#racineWeb" ).val()+"Collegetype/"); +} + + +function nouveaucollegetype(){ + donnees = ''; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveaucollegetype/", + type : 'post', + data: donnees, + error: function(errorData){ + alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_nouveaucollegetype').html(data); + $('#div_nouveaucollegetype').modal("show"); + $('#div_nouveaucollegetype').on('shown.bs.modal', function(){ + stylechampsRequis(); + $('#codeCollegeType').focus(); + }); + }, + complete: function() { + + } + }); +} + +function ajoutercollegetype(){ + + + libelleEng = $('#libelleEng').val(); + + + libelle = $('#libelle').val(); + + + if(libelle <=" " || libelleEng <=" "){ + v_msg="Le libellé est obligatoire !"; + v_msgEng="The label is required !"; + + alert_ebene(v_msg,v_msgEng); + + if(codeLangue=="en_US") + { + $('#libelleEng').css('borderColor','red'); + $('#libelleEng').focus(); + }else{ + $('#libelle').css('borderColor','red'); + $('#libelle').focus(); + } + + return; + } + + donnees = $('#formModal').serialize(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxnouveaucollegetype/ajouter", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $("#div_nouveaucollegetype .close").click(); + + }, + complete: function() { + retour_colleges_types(); + } + }); + +} + +function afficher_primes_categorie_lien_parente(){ + + var codeProduit = $('#codeProduit').val(); + var codeGcAssureur = $('#codeGcAssureur').val(); + + if(codeProduit ==''){ + v_msg="La produit est obligatoire !"; + v_msgEng="The category is required !"; + + alert_ebene(v_msg,v_msgEng); + + $('#codeProduit').css('borderColor','red'); + $('#codeProduit').focus(); + return; + } + + if(codeGcAssureur ==''){ + v_msg="Le garant est obligatoire !"; + v_msgEng="The guarantor is mandatory !"; + + alert_ebene(v_msg,v_msgEng); + + $('#codeGcAssureur').css('borderColor','red'); + $('#codeGcAssureur').focus(); + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimeproduitlienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_prime_produit_lien_parente').html(data); + }, + complete: function() { + + } + }); + +} + +function modifierPrimeproduit(id){ + + donnees = 'id='+id; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierprimeproduitlienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_maj_table').html(data); + $('#prime').focus(); + }, + complete: function() { + + } + }); + +} + +function enregistrerModificationPrimeProduit(){ + donnees = $('#formData').serialize(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmodifierprimeproduitlienparente/modifier", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + + }, + complete: function() { + //retour_liste_primeproduitlienparente(); + afficher_primes_categorie_lien_parente(); + $('#div_maj_table').empty(); + } + }); +} + +function retour_liste_primeproduitlienparente() +{ + $('#div_maj_table').empty(); +} + + +function afficher_garantiesproductionlienparente() +{ + var codeProduit = $('#codeProduit').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'codeProduit='+codeProduit; + donnees += '&codeLienParente='+codeLienParente; + + + if(codeProduit !='' && codeLienParente!='') + { + $("#div_garanties_categorie_lien_parente").html(''); + + $("#div_garanties_categorie_lien_parente").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescategorielienparente/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + $('#div_garanties_categorie_lien_parente').html(data); + dataTableSpeciale(); + //alert(parseInt($('#ligne2').val())); + if(parseInt($('#ligne1').val()) <= 0) + { + $("#btn_ajout_tous").prop("disabled",true); + }else{ + $("#btn_ajout_tous").prop('disabled', false); + } + + if(parseInt($('#ligne2').val())<= 0) + { + $("#btn_retire_tous").prop("disabled",true); + }else{ + $("#btn_retire_tous").prop('disabled', false); + } + }, + complete: function() { + + } + }); + } + +} + +function ajouter_toutes_garantiesproductionlienparente() +{ + var codeProduit = $("#codeProduit").val(); + var codeLienParente = $('#codeLienParente').val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner une produit assurée!"; + v_msgEng="Please select an insured category!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if (codeLienParente<=" ") + { + v_msg="Veuillez sélectionner un status!"; + v_msgEng="Please select a status!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').val(); + return; + } + + donnees = 'codeProduit='+codeProduit; + donnees += '&codeLienParente='+codeLienParente; + + + v_msg="Attention, cela va rendre toutes les garanties accessibles à cette produit assurée et ce status! Le confirmez vous?"; + v_msgEng="Attention, this will make all the guarantees accessible to this insured category and this status! Do you confirm it?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescategorielienparente/ajoutertoutes/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantiesproductionlienparente(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function ajouter_une_garantieproductionlienparente(codeGarantie) +{ + codeProduit =$("#codeProduit").val(); + codeLienParente = $('#codeLienParente').val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner une produit assurée!"; + v_msgEng="Please select an insured category!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if (codeLienParente<=" ") + { + v_msg="Veuillez sélectionner un status!"; + v_msgEng="Please select a status!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').val(); + return; + } + + donnees = 'codeProduit='+codeProduit; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescategorielienparente/ajouterune/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantiesproductionlienparente(); + } + }); +} + +function retirer_toutes_garantiesproductionlienparente() +{ + var codeProduit = $("#codeProduit").val(); + var codeLienParente = $('#codeLienParente').val(); + + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if (codeLienParente<=" ") + { + v_msg="Veuillez sélectionner un status!"; + v_msgEng="Please select a status!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').val(); + return; + } + + donnees = 'codeProduit='+codeProduit; + donnees += '&codeLienParente='+codeLienParente; + + v_msg="Attention, cela va vider cette produit assurée et ce status de toutes ses garanties! Le confirmez-vous?"; + v_msgEng="Attention, this will empty this insured category and this status of all its guarantees! Do you confirm it?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescategorielienparente/retirertoutes/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantiesproductionlienparente(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_une_garantieproductionlienparente(codeGarantie) +{ + codeProduit = $("#codeProduit").val(); + codeLienParente = $('#codeLienParente').val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner une produit assurée!"; + v_msgEng="Please select a insured category!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeProduit").focus(); + return; + } + + if (codeLienParente<=" ") + { + v_msg="Veuillez sélectionner un status!"; + v_msgEng="Please select a status!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').val(); + return; + } + + donnees = 'codeProduit='+codeProduit; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&codeGarantie='+codeGarantie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescategorielienparente/retirerune/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_garantiesproductionlienparente(); + } + }); +} + +function afficher_actes_garantiestatus(idGarbase, codeGarantie, codeLienParente){ + var popstatut = $('#popstatut').val(); + + /* + if(popstatut==0){ + v_msg="Vous devez définir d'abord un effectif pour ce statut, avant de parametrer ses garanties !"; + v_msgEng="You must first define a workforce for this status, before setting up its guarantees!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + enregistrer_college_temp(); + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&idGarbase='+idGarbase; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actesgarantiestatus').html(data); + $('#div_actesgarantiestatus').modal("show"); + $('#div_actesgarantiestatus').on('shown.bs.modal', function(){ + stylechampsRequis(); + //$('#codeTypeGarant').focus(); + }); + }, + complete: function() { + + } + }); +} + +function majgarantielienparente(idGarantie){ + donnees = 'idGarantie='+idGarantie; + //alert(donnees); + //return; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majgarantielienparente", + type : 'post', + data: donnees, + error: function(errorData){ + + }, + success: function(data) { + //alert('Mise à jour OK!!! '); + }, + complete: function() { + + } + }); +} + + +function familleactegarantieexamen(idGarbase, codeGarantie,codeLienParente){ + + donnees = 'codeGarantie='+codeGarantie; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&idGarbase='+idGarbase; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/familleactegarantieexamen/", + type : 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + }, + success: function(data) { + //alert("Success : "+data); + $('#div_actesgarantiestatus').html(data); + $('#div_actesgarantiestatus').modal("show"); + $('#div_actesgarantiestatus').on('shown.bs.modal', function(){ + //stylechampsRequis(); + //$('#codeTypeGarant').focus(); + }); + }, + complete: function() { + + } + }); +} + + +function enregistrer_college_lien_parente_temp() +{ + /* + nomForm = $('#nomForm').val(); + + if(nomForm == "frmconsultercollege"){ + return; + } + */ + + 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(); + + if($('#codeProduit').val()<=" ") + { + v_msg="Veuillez sélectionner une produit d'assuré!"; + v_msgEng="Please select an insured category!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeProduit').focus(); + return false; + } + + if($('#codeCollegeType').val()<=" ") + { + v_msg="Veuillez sélectionner un collège type!"; + v_msgEng="Please select a typical college!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeCollegeType').focus(); + return false; + } + + if (codeTypeRemboursement!='RDE'){ + if($('#codeReseau').val()<=" ") + { + v_msg="Veuillez choisir un réseau de soins pour ce collège!"; + v_msgEng="Please choose a care network for this college!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeReseau').focus(); + return false; + } + } + + if($('#codeTypeRemboursement').val()<=" ") + { + v_msg="Veuillez choisir un type de remboursement pour ce collège!"; + v_msgEng="Please choose a reimbursement type for this college!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeTypeRemboursement').focus(); + return false; + } + + if($('#codeTerritoire').val()<=" ") + { + v_msg="Veuillez sélectionner l'étendue du territoire de couverture de ce collège!"; + v_msgEng="Please select the extent of this college's coverage area!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeTerritoire').focus(); + return false; + } + + if($('#codeLienParente').val()<=" ") + { + v_msg="Veuillez sélectionner un status de bénéficiaire dans la liste!"; + v_msgEng="Please select a beneficiary status from the list!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeLienParente').focus(); + return false; + } + + + if($('#libelleCollege').val()<=" ") + { + v_msg="Veuillez nommer le collège!"; + v_msgEng="Please name the college!"; + alert_ebene(v_msg, v_msgEng); + + $('#libelleCollege').focus(); + return false; + } + + + /* + if($('#ticketModerateurCollege').val()<=" ") + { + v_msg="Veuillez saisir le taux du ticket modérateur du collège!"; + v_msgEng="Please enter the college co-payment rate!"; + alert_ebene(v_msg, v_msgEng); + + $('#ticketModerateurCollege').focus(); + return; + } + */ + + if($('#delaiCarenceCollege').val()<=" ") + { + v_msg="Veuillez saisir le délai de carence en jour du collège!"; + v_msgEng="Please enter the waiting period in college days!"; + alert_ebene(v_msg, v_msgEng); + + $('#delaiCarenceCollege').focus(); + return false; + } + + + /* Ne pas rendre le plafondAdherent obligatoire + if(plafondAdherent<=" " || plafondAdherent=="0") + { + v_msg="Veuillez indiquer le montant du plafond famille!"; + v_msgEng="Please indicate the amount of the family ceiling!"; + alert_ebene(v_msg, v_msgEng); + + $('#plafondAdherent').focus(); + return false; + } + */ + + if($('#codeTypeTarifActe').val()<=" ") + { + v_msg="Veuillez selectionner le type de tarif des actes du collège!"; + v_msgEng="Please select the type of rate for the college acts!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeTypeTarifActe').focus(); + return false; + } + + /* + if($('#codeTarifActe').val()<=" ") + { + v_msg="Veuillez selectionner le tarif des actes du collège!"; + v_msgEng="Please select the rate for college acts!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeTarifActe').focus(); + return false; + } + */ + if($('#idBaremePriseEnCharge').val()<=" ") + { + v_msg="Veuillez selectionner un bareme pour le collège!"; + v_msgEng="Please select a scale for the college!"; + alert_ebene(v_msg, v_msgEng); + + $('#idBaremePriseEnCharge').focus(); + return false; + } + + if($('#codeBaseTarification').val()<=" ") + { + v_msg="Veuillez selectionner une base de tarification pour le collège!"; + v_msgEng="Please select a pricing base for the college!"; + alert_ebene(v_msg, v_msgEng); + + $('#codeBaseTarification').focus(); + return false; + } + + + 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 = $('#frmcreercollege').serialize(); + + //$("#div_garanties").html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgarantiescollege/enregistrercollegelienparentetemp/", + type: 'POST', + data: donnees, + success: function(data) + { + v_msg="Enregistrement bien effectué!"; + v_msgEng="Registration well done!"; + //affiche_particularite_statut(); + alert_ebene(v_msg, v_msgEng); + }, + complete: function(data) + { + } + }); +} + +function ajax_maj_prime_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/majprimecollege/"; + }else{ + v_url = "Ajaxprimescategoried/majprimecollege/"; + } + + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + if(data.length > 5){ + var str = data.split('/'); + alert_ebene(str[0],str[1]); + + } + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + if(modeDevis == "0"){ + enregistrer_college_temp(); + recapitulercollege(); + }else{ + enregistrer_college_temp_d(); + recapitulercollege_d(); + } + } + }); + } +} + + +function ajax_maj_population_college_temp(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/majpopulationcollege/"; + }else{ + v_url = "Ajaxprimescategoried/majpopulationcollege/"; + } + + $.ajax({ + url: $("#racineWeb").val()+v_url, + type: 'POST', + data: donnees, + success: function(data) { + + + if(modeDevis == "0"){ + affiche_garanties_par_statut(); + }else{ + affiche_garanties_par_statut_d(); + } + }, + error: function(data) { + }, + complete: function() { + + + if(modeDevis == "0"){ + enregistrer_college_temp(); + recapitulercollege(); + }else{ + enregistrer_college_temp_d(); + recapitulercollege_d(); + } + + } + }); + } +} + +function ajax_maj_forfait_college_temp(idPrime, forfait, controle) +{ + controle.value=forfait; + + donnees = 'idPrime='+idPrime+"&forfait="+forfait; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprimescategorie/majforfaitcollege/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + enregistrer_college_temp(); + } + }); + +} + +function ajax_maj_plafond_college_temp(idPrime, plafond, controle, modeDevis) +{ + plafond=plafond.replace(/ /g,""); + plafond=parseInt(plafond.replace(",","."),10); + controle.value=plafond; + + if(controle_numerique(controle)) + { + donnees = 'idPrime='+idPrime+"&plafond="+plafond; + + if(modeDevis == "0"){ + v_url = "Ajaxprimescategorie/majplafondcollege/"; + }else{ + v_url = "Ajaxprimescategoried/majplafondcollege/"; + } + + $.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_agelimite_collegelienparente_temp(idCollege, ageLimiteStatus, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + ageLimiteStatus=ageLimiteStatus.replace(",","."); + controle.value=ageLimiteStatus; + + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&ageLimiteStatus="+ageLimiteStatus+'&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majagelimitestatus/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_agelimiteEleve_collegelienparente_temp(idCollege, ageLimiteStatusEleve, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + ageLimiteStatusEleve=ageLimiteStatusEleve.replace(",","."); + controle.value=ageLimiteStatusEleve; + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&ageLimiteStatusEleve="+ageLimiteStatusEleve+'&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majagelimitestatuseleve/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_ticketModerateur_collegelienparente_temp(idCollege, ticketModerateurStatus, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + ticketModerateurStatus=ticketModerateurStatus.replace(",","."); + controle.value=ticketModerateurStatus; + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&ticketModerateurStatus="+ticketModerateurStatus+'&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majticketmoderateurstatus/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_ticketModerateurEleve_collegelienparente_temp(idCollege, ticketModerateurStatusEleve, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + ticketModerateurStatusEleve=ticketModerateurStatusEleve.replace(",","."); + controle.value=ticketModerateurStatusEleve; + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&ticketModerateurStatusEleve="+ticketModerateurStatusEleve+'&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majticketmoderateurstatuseleve/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + + +function ajax_maj_surprime_collegelienparente_temp(idCollege, surprimeOption, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + surprimeOption=surprimeOption.replace(/ /g,""); + surprimeOption=parseInt(surprimeOption.replace(",","."),10); + controle.value=surprimeOption; + + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&surprimeOption="+surprimeOption+'&codeLienParente='+codeLienParente; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majsurprimeOptionstatus/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_surprimeEleve_collegelienparente_temp(idCollege, surprimeOption, controle) +{ + var codeLienParente = $('#codeLienParente').val(); + + surprimeOption=surprimeOption.replace(/ /g,""); + surprimeOption=parseInt(surprimeOption.replace(",","."),10); + controle.value=surprimeOption; + + if(controle_numerique(controle)) + { + donnees = 'idCollege='+idCollege+"&surprimeOption="+surprimeOption+'&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxparticularitestatuscollege/majsurprimeOptionstatuseleve/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + + + + +function ajax_maj_forfait_familleacte_produit_lienparente(idFamilleacte, forfait, controle) +{ + var idGarantie = $('#idGarantie').val(); + + controle.value=forfait; + + donnees = 'idFamilleacte='+idFamilleacte+"&forfait="+forfait+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majforfaitfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + +function ajax_maj_plafond_familleacte_produit_lienparente(idFamilleacte, plafond, controle) +{ + var idGarantie = $('#idGarantie').val(); + + plafond=plafond.replace(/ /g,""); + plafond=parseInt(plafond.replace(",","."),10); + controle.value=plafond; + + if(controle_numerique(controle)) + { + + donnees = 'idFamilleacte='+idFamilleacte+"&plafond="+plafond+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majplafondfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + + +function ajax_maj_nbretransaction_familleacte_produit_lienparente(idFamilleacte, nbreTransaction, controle) +{ + var idGarantie = $('#idGarantie').val(); + + nbreTransaction=nbreTransaction.replace(",","."); + controle.value=nbreTransaction; + + //alert(nbreTransaction); + if(controle_numerique(controle)) + { + donnees = 'idFamilleacte='+idFamilleacte+"&nbreTransaction="+nbreTransaction+"&idGarantie="+idGarantie; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majnbretransactionfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + + +function ajax_maj_periodicite_familleacte_produit_lienparente(idFamilleacte, codePeriodicite, controle) +{ + var idGarantie = $('#idGarantie').val(); + + controle.value=codePeriodicite; + + donnees = 'idFamilleacte='+idFamilleacte+"&codePeriodicite="+codePeriodicite+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majperiodicitefamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + +function ajax_maj_observation_familleacte_produit_lienparente(idFamilleacte, codeObservation, controle) +{ + var idGarantie = $('#idGarantie').val(); + + controle.value=codeObservation; + + donnees = 'idFamilleacte='+idFamilleacte+"&codeObservation="+codeObservation+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majobservationfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + +function ajax_maj_delaicarence_familleacte_produit_lienparente(idFamilleacte, delaiCarenceFamilleActe, controle) +{ + var idGarantie = $('#idGarantie').val(); + + delaiCarenceFamilleActe=delaiCarenceFamilleActe.replace(",","."); + controle.value=delaiCarenceFamilleActe; + + if(controle_numerique(controle)) + { + + donnees = 'idFamilleacte='+idFamilleacte+"&delaiCarenceFamilleActe="+delaiCarenceFamilleActe+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majdelaicarencefamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } + +} + +function ajax_maj_ticketmoderateur_familleacte_produit_lienparente(idFamilleacte, ticketModerateur, controle) +{ + var idGarantie = $('#idGarantie').val(); + + ticketModerateur=ticketModerateur.replace(",","."); + controle.value=ticketModerateur; + + if(controle_numerique(controle)) + { + + donnees = 'idFamilleacte='+idFamilleacte+"&ticketModerateur="+ticketModerateur+"&idGarantie="+idGarantie; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majticketmoderateurfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } + +} + +//03/11/2020 + +function activeRachatTm(){ + var rachatTm = $('#rachatTm').val(); + + if(rachatTm == '1'){ + $('#rachatTm').val('1'); + $('#rachatTm').removeAttr('disabled'); + $('#tauxRachatTm').removeAttr('disabled'); + $('#tauxPrimeRachatTm').removeAttr('disabled'); + } else{ + $('#rachatTm').val('0'); + $('#tauxRachatTm').val('0'); + $('#tauxPrimeRachatTm').val('0'); + $('#rachatTm').attr('disabled', 'disabled'); + $('#tauxRachatTm').attr('disabled', 'disabled'); + $('#tauxPrimeRachatTm').attr('disabled', 'disabled'); + } +} + +function activeBudget(){ + var budgetDefini = $('#budgetDefini').val(); + + if(budgetDefini == '1'){ + $('#budgetDefini').val('1'); + $('#montantBudget').removeAttr('disabled'); + } else{ + $('#budgetDefini').val('0'); + $('#montantBudget').val('0'); + + $('#montantBudget').attr('disabled', 'disabled'); + } +} + + +function ajax_maj_forfait_status(idActe, forfait, controle) +{ + controle.value=forfait; + + donnees = 'idActe='+idActe+"&forfait="+forfait; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majforfaitacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + +function ajax_maj_plafond_status(idActe, plafond, controle) +{ + plafond=plafond.replace(/ /g,""); + plafond=parseInt(plafond.replace(",","."),10); + controle.value=plafond; + + if(controle_numerique(controle)) + { + + donnees = 'idActe='+idActe+"&plafond="+plafond; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majplafondacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + + +function ajax_maj_nbreTransaction_status(idActe, nbreTransaction, controle) +{ + nbreTransaction=nbreTransaction.replace(",","."); + controle.value=nbreTransaction; + + if(controle_numerique(controle)) + { + donnees = 'idActe='+idActe+"&nbreTransaction="+nbreTransaction; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majnbretransactionacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_codeperiodicite_status(idActe, codePeriodicite, controle) +{ + controle.value=codePeriodicite; + + donnees = 'idActe='+idActe+"&codePeriodicite="+codePeriodicite; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majperiodiciteacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + + +function ajax_maj_codeobservation_status(idActe, codeObservation, controle) +{ + controle.value=codeObservation; + + donnees = 'idActe='+idActe+"&codeObservation="+codeObservation; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majobservationacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + +} + + +function ajax_maj_delaicarenceacte_status(idActe, delaiCarenceActe, controle) +{ + delaiCarenceActe=delaiCarenceActe.replace(",","."); + controle.value=delaiCarenceFamilleActe; + + if(controle_numerique(controle)) + { + + donnees = 'idActe='+idActe+"&delaiCarenceActe="+delaiCarenceActe; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majdelaicarenceacte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + //enregistrer_college_lien_parente_temp(); + } + }); + } +} + +function ajax_maj_ticketmoderateur_acte_status(idActe, ticketModerateur, controle) +{ + ticketModerateur=ticketModerateur.replace(",","."); + controle.value=ticketModerateur; + + if(controle_numerique(controle)) + { + + donnees = 'idActe='+idActe+"&ticketModerateur="+ticketModerateur; + + // alert(donnees); + // return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majticketmoderateuracte/", + type: 'POST', + data: donnees, + success: function(data) { + //$("#div_garanties").html(data); + }, + error: function(data) { + }, + complete: function() { + //controle.focus(); + + } + }); + } + +} + + +///////////////////////////////05-11-2020////////////////////////////////////// +/* +function affichertoutfamilleacte(idCollegeTemp,codeLienParente,codeGarantie){ + + donnees = "idCollegeTemp="+idCollegeTemp+"&codeLienParente="+codeLienParente+"&codeGarantie="+codeGarantie; + + $("#div_corpsfamilleacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_corpsfamilleacte").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function affichertoutacte(idCollegeTemp,codeLienParente,codeGarantie){ + + donnees = "idCollegeTemp="+idCollegeTemp+"&codeLienParente="+codeLienParente+"&codeGarantie="+codeGarantie; + + alert(donnees); + return; + + $("#div_corpsacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsacte/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_corpsacte").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} +*/ +function affichertoutfamilleacte(){ + + donnees = ""; + + $("#div_corpsfamilleacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_corpsfamilleacte").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +function affichertoutacte(){ + + donnees = ""; + + //alert(donnees); + //return; + + $("#div_corpsacte").html('
' + '
'); + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcorpsacte/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_corpsacte").html(data); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + +//////////////// toutfamilleacte ////////////////////////////////////////// +function majtoutforfaitfamilleacte(){ + var forfaitFamilleActe = $('#forfaitFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + var codeProduit = $('#codeProduit').val(); + + donnees = 'forfaitFamilleActe='+forfaitFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + donnees += '&codeProduit='+codeProduit; + + alert(donnees); + return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutforfaitfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + //alert(data); + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + /* + + */ +function majtoutplafondfamilleacte(){ + var plafondFamilleActe = $('#plafondFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + plafondFamilleActe=plafondFamilleActe.replace(/ /g,""); + plafondFamilleActe=parseInt(plafondFamilleActe.replace(",","."),10); + + donnees = "plafondFamilleActe="+plafondFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebareme/majtoutplafondfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutnbretransactionfamilleacte(){ + var nbreTransactionFamilleActe = $('#nbreTransactionFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'nbreTransactionFamilleActe='+nbreTransactionFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebareme/majtoutnbretransactionfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + + +function majtoutperiodicitefamilleacte(){ + var codePeriodiciteFamilleActe = $('#codePeriodiciteFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = "codePeriodiciteFamilleActe="+codePeriodiciteFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebareme/majtoutperiodicitefamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + + +function majtoutdelaicarencefamilleacte(){ + var delaiCarenceFamilleActe = $('#delaiCarenceFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'delaiCarenceFamilleActe='+delaiCarenceFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebareme/majtoutdelaicarencefamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutticketmoderateurfamilleacte(){ + var ticketModerateurFamilleActe = $('#ticketModerateurFamilleActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = "ticketModerateurFamilleActe="+ticketModerateurFamilleActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiebareme/majtoutticketmoderateurfamilleacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutfamilleacte(); + }, + error: function(data) { + }, + complete: function() { + + } + }); +} + + +//////////////// toutacte ////////////////////////////////////////// +function majtoutforfaitacte(){ + var forfaitActe = $('#forfaitActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'forfaitActe='+forfaitActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutforfaitacte/", + type: 'POST', + data: donnees, + success: function(data) { + //alert(data); + //affichertoutacte(idCollegeTemp,codeLienParente,codeGarantie); + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutplafondacte(){ + var plafondActe = $('#plafondActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + plafondActe=plafondActe.replace(/ /g,""); + plafondActe=parseInt(plafondActe.replace(",","."),10); + + + donnees = "plafondActe="+plafondActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutplafondacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutnbretransactionacte(){ + var nbreTransactionActe = $('#nbreTransactionActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'nbreTransactionActe='+nbreTransactionActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutnbretransactionacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + + +function majtoutcodeperiodiciteacte(){ + var codePeriodiciteActe = $('#codePeriodiciteActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = "codePeriodiciteActe="+codePeriodiciteActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutcodeperiodiciteacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutobservationacte(){ + var codeObservationActe = $('#codeObservationActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = "codeObservationActe="+codeObservationActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutobservationacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutactebareme(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutdelaicarenceacte(){ + var delaiCarenceActe = $('#delaiCarenceActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + donnees = 'delaiCarenceActe='+delaiCarenceActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutdelaicarenceacte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + +function majtoutticketmoderateuracte(){ + var ticketModerateurActe = $('#ticketModerateurActe').val(); + var codeGarantie = $('#codeGarantie').val(); + var idCollegeTemp = $('#idCollegeTemp').val(); + var codeLienParente = $('#codeLienParente').val(); + + + donnees = "ticketModerateurActe="+ticketModerateurActe; + donnees += '&codeGarantie='+codeGarantie; + donnees += '&idCollegeTemp='+idCollegeTemp; + donnees += '&codeLienParente='+codeLienParente; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesgarantiestatus/majtoutticketmoderateuracte/", + type: 'POST', + data: donnees, + success: function(data) { + affichertoutacte(); + }, + error: function(data) { + }, + complete: function() { + + + } + }); +} + + +// 06-11-2020 +function filtreReseauProduit(){ + var codeProduit = $('#codeProduit').val(); + + donnees ='codeProduit='+codeProduit; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrereseauproduit/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_codeReseau').html(data); + $('.selectpicker').selectpicker(); + }, + complete: function(){ + } + }); + +} + + +function filtreBaremeProduit(){ + var codeProduit = $('#codeProduit').val(); + var codeGcAssureur = $('#codeGcAssureur').val(); + + donnees ='codeProduit='+codeProduit; + donnees +='&codeGcAssureur='+codeGcAssureur; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltrebaremeproduit/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_bareme').html(data); + $('.selectpicker').selectpicker(); + }, + complete: function(){ + } + }); + +} + +function afficher_actesexclus_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + var div_attente = $('#div_actesproduit'); + + div_attente.html('
' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesexclusparproduit/afficheractesproduit/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + div_attente.html(data); + appliquerDataTable(); + }, + complete: function() { + } + }); +} + + +function ajouter_tous_actesexclus_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + 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()+"Ajaxactesexclusparproduit/ajoutertousactesexclusproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_actesexclus_produit(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function retirer_tous_actesexclus_produit() +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit; + + 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()+"Ajaxactesexclusparproduit/retirertousactesexclusproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_actesexclus_produit(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); +} + + +function ajouter_un_acteexclu_produit(codeActe) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&codeActe='+codeActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesexclusparproduit/ajouterunacteexcluproduit/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_actesexclus_produit(); + } + }); +} + +function retirer_un_acteexclu_produit(idActe) +{ + codeProduit=$("#codeProduit").val(); + + if (codeProduit<=" ") + { + v_msg="Veuillez sélectionner un produit!"; + v_msgEng="Please select a category!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'codeProduit='+codeProduit+'&idActe='+idActe; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxactesexclusparproduit/retirerunacteexcluproduit/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_actesexclus_produit(); + } + }); +} + +// 10/11/2020 + +function accesReseauSoin(){ + var codeTypeRemboursement = $('#codeTypeRemboursement').val(); + + if(codeTypeRemboursement == 'RDE'){ + $('#codeReseau').val(""); + $('#codeReseau').attr('disabled', 'disabled'); + }else{ + $('#codeReseau').removeAttr('disabled'); + } +} + +function filtreTarifActeParType(){ + var codeTypeTarifActe = $('#codeTypeTarifActe').val(); + + donnees ='codeTypeTarifActe='+codeTypeTarifActe; + + //alert(donnees); + //return; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfiltretarifactepartype/", + type: 'post', + data: donnees, + error: function(errorData){ + //alert("Erreur : "+errorData); + + }, + success: function(data) { + $('#div_tarifActe').html(data); + }, + complete: function(){ + } + }); + +} + +// 10-11-2020 + +function formatMonetaire(controle){ + controle.value = formatCurrency(controle.value); + return; +} + +function verifierPlafondBeneficiaire(controle){ + var plafondAdherent = $('#plafondAdherent').val(); + var plafondBeneficiaire = $('#plafondBeneficiaire').val(); + + plafondAdherent = plafondAdherent.replace(/ /g,""); + plafondAdherent = parseInt(plafondAdherent.replace(",","."),10); + + plafondBeneficiaire = plafondBeneficiaire.replace(/ /g,""); + plafondBeneficiaire = parseInt(plafondBeneficiaire.replace(",","."),10); + + if(plafondAdherent > 0){ + if(plafondBeneficiaire > plafondAdherent){ + v_msg="Le montant du plafond individu est supérieure au plafond famille!"; + v_msgEng="The amount of the individual cap is greater than the family cap!"; + alert_ebene(v_msg, v_msgEng); + + controle.focus(); + return false; + } + } +} + + +function verifierPrimeMinimale(controle){ + var primeMin = $('#primeMin').val(); + var primeMax = $('#primeMax').val(); + + primeMin = primeMin.replace(/ /g,""); + primeMin = parseInt(primeMin.replace(",","."),10); + + primeMax = primeMax.replace(/ /g,""); + primeMax = parseInt(primeMax.replace(",","."),10); + + if(primeMax > 0){ + if(primeMin > primeMax){ + v_msg="La prime minimale est supérieure à la prime maximale!"; + v_msgEng="The minimum premium is higher than the maximum premium!"; + alert_ebene(v_msg, v_msgEng); + + controle.focus(); + return false; + } + } +} + +function verifierPrimeIndivdu(controle){ + var primeIndividu = $('#primeIndividu').val(); + var primeFamille = $('#primeFamille').val(); + + primeIndividu = primeIndividu.replace(/ /g,""); + primeIndividu = parseInt(primeIndividu.replace(",","."),10); + + primeFamille = primeFamille.replace(/ /g,""); + primeFamille = parseInt(primeFamille.replace(",","."),10); + + + + + //primeFamille = parseInt($('#primeFamille').val().replace(/ /g,""),10); + + //primeIndividu = parseInt($('#primeIndividu').val().replace(/ /g,""),10); + + + if(primeFamille > 0){ + if(primeIndividu > primeFamille){ + v_msg="La prime individu est supérieure à la prime famille!"; + v_msgEng="The individual premium is greater than the family premium!"; + alert_ebene(v_msg, v_msgEng); + + controle.focus(); + return false; + } + } +} + +function controle_numerique(controle) +{ + controle.value=controle.value.replace(/ /g,""); + controle.value=parseInt(controle.value.replace(",","."),10); + + if(controle.value=="") + { + controle.value=0; + } + + + if(isNaN(controle.value)) + { + controle.value=0; + controle.focus(); + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + // controle.value=""; + return false; + } + return true; +} + + +var formatCurrency = function(num){ + var str = num.toString().replace("", ""), parts = false, output = [], i = 1, formatted = null; + if(str.indexOf(".") > 0) { + parts = str.split("."); + str = parts[0]; + } + str = str.split("").reverse(); + for(var j = 0, len = str.length; j < len; j++) { + if(str[j] != " ") { + output.push(str[j]); + if(i%3 == 0 && j < (len - 1)) { + output.push(" "); + } + i++; + } + } + formatted = output.reverse().join(""); + return(formatted + ((parts) ? "." + parts[1].substr(0, 2) : "")); +}; + +function recapitulercollege(){ \ No newline at end of file