diff --git a/Js/fonctions.js b/Js/fonctions.js index 017092e0..edd6a546 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -48303,6 +48303,7 @@ function filtreTableReference(numeroTable){ */ function filtreTableReference(numeroTable) { + debugger; const racineWeb = $("#racineWeb").val(); const $divListe = $("#div_listetables"); const $select = $("#listetables"); @@ -48321,6 +48322,7 @@ function filtreTableReference(numeroTable) { type : 'post', data: { numeroTable: numeroTable }, success: function(data) { + debugger; // 2. On injecte le HTML $divListe.html(data); @@ -89136,3193 +89138,4 @@ function maj_authentification_otp() } }); -} - -// FONCTION OTP -function maj_authentification_otp() { - const activerOtp = $("#activerOtp").val(); - const racineWeb = $("#racineWeb").val(); - const codeLangue = $("#codeLangue").val(); - - if(activerOtp == "1"){ - v_msg="Etes-vous sur de vouloir activer la double authentification?"; - v_msgEng="Are you sure you want to enable two-factor authentication?"; - }else{ - v_msg="Etes-vous sur de vouloir désactiver la double authentification?"; - v_msgEng="Are you sure you want to disable two-factor authentication?"; - } - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - $.ajax({ - url: racineWeb + "Ajaxparametresgeneraux/majauthentification/", - type: 'POST', - data: { activerOtp: activerOtp }, - success: function() { - let msg = (codeLangue === "en_US") ? "OTP Security updated" : "Sécurité OTP mise à jour"; - toastr.success(msg); - }, - complete: function() { - window.location.assign($("#racineWeb" ).val()+"Paramreinitmotpass/"); - } - }); - } - }); -} - - - -function modifier_param_filtrage_ip() -{ - - window.location.assign($("#racineWeb" ).val()+"Filtreadresseip/"); -} - -function consulter_param_filtrage_ip() -{ - window.location.assign($("#racineWeb" ).val()+"Filtreadresseipcons/"); -} - - -function retour_param_habilitation() -{ - window.location.assign($("#racineWeb" ).val()+"Paramhabilitation/"); -} - -function enregistrer_modif_param_filtreip() -{ - idSocieteuser = $("#idSocieteuser").val(); - donnees = 'idSocieteuser='+idSocieteuser; - - - - filtrerIp = $("#filtrerIp").val(); - filtrerIpPrestataire= $("#filtrerIpPrestataire").val(); - - donnees += '&filtrerIp='+filtrerIp; - donnees += '&filtrerIpPrestataire='+filtrerIpPrestataire; - - v_msg="Confirmez-vous ces modifications?"; - v_msgEng="Do you confirm these modifications?"; - - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaxparametresgeneraux/majfiltreip/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - }, - complete: function() { - consulter_param_filtrage_ip(); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -function tester_disponibiliter_whatsapp() { - // 1. Initialisation des variables - const p_destinataires = $("#destinataires").val(); - const racineWeb = $("#racineWeb").val(); - const div_cible = $('#div_test_gabarit'); - const codeLangue = $("#codeLangue").val(); - - // On force waapi par défaut selon votre logique actuelle, - // mais prêt pour une sélection dynamique si besoin. - const fournisseurWhatsApp = 'waapi'; - - // 2. Validation du destinataire - if (!p_destinataires || p_destinataires.trim() === "") { - alert_ebene("Veuillez saisir un destinataire!", "Please enter a recipient!"); - $("#destinataires").focus(); - return; - } - - // 3. Validation et mapping du message fournisseur - let p_message = ""; - const providers = { - 'waapi': 'Fournisseur WhatsApp : waapi', - 'ultramsg': 'Fournisseur WhatsApp : ultramsg' - }; - - if (providers[fournisseurWhatsApp]) { - p_message = providers[fournisseurWhatsApp]; - } else { - alert_ebene( - fournisseurWhatsApp + " => Fournisseur de WhatsApp inconnu!", - fournisseurWhatsApp + " => Unknown WhatsApp Provider!" - ); - return; - } - - // 4. Préparation des données (Format Objet) - const donnees = { - destinataires: p_destinataires, - message: p_message, - fournisseurWhatsApp: fournisseurWhatsApp - }; - - // 5. Affichage du loader stylisé - div_cible.html(` -
-
-

- ${(codeLangue === "en_US") ? "Sending WhatsApp message..." : "Envoi du message WhatsApp..."} -

-
- `); - - // 6. Requête AJAX - $.ajax({ - url: racineWeb + "Ajaxtesterdisponiblitesms/envoyerlewhatsapp/", - type: 'POST', - data: donnees, - success: function(data) { - toastr.success((codeLangue === "en_US") ? "WhatsApp API called" : "API WhatsApp appelée"); - div_cible.html(data); - }, - error: function(xhr) { - toastr.error((codeLangue === "en_US") ? "Connection error" : "Erreur de connexion"); - div_cible.html(`
Error: ${xhr.statusText}
`); - } - }); -} - - -function parametre_produit() -{ - var codeProduit = $('#codeProduit').val(); - - if(codeProduit<=" "){ - $('#div_parametres').html(""); - } - - donnees = 'codeProduit='+codeProduit; - - $("#div_parametres").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/", - type : 'post', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - $('#div_parametres').html(data); - }, - complete: function() { - } - }); -} - -function retour_param_fact_garant() -{ - window.location.assign($("#racineWeb" ).val()+"Paramfacturegarantcons/"); -} - -function inserer_param_fact_produit() -{ - codeGcAssureur = $('#codeGcAssureur').val(); - codeProduit = $('#codeProduit').val(); - - gcTauxFraisReel = $('#gcTauxFraisReel').val(); - gcTauxRedressement = $('#gcTauxRedressement').val(); - gcTauxCommissionGerant = $('#gcTauxCommissionGerant').val(); - - - montantBudget = parseInt($("#montantBudget").val().replace(/ /g,""),10);; - montantBudgetEnfantSupl = parseInt($("#montantBudgetEnfantSupl").val().replace(/ /g,""),10); - montantBudgetConjointSupl = parseInt($("#montantBudgetConjointSupl").val().replace(/ /g,""),10); - - forfaitHonoraire = parseInt($("#forfaitHonoraire").val().replace(/ /g,""),10); - nbAdherent = parseInt($("#nbAdherent").val().replace(/ /g,""),10); - nbBeneficiaire = parseInt($("#nbBeneficiaire").val().replace(/ /g,""),10); - - donnees = 'codeGcAssureur='+codeGcAssureur; - donnees += '&codeProduit='+codeProduit; - donnees += '&gcTauxFraisReel='+gcTauxFraisReel; - - donnees += '&gcTauxRedressement='+gcTauxRedressement; - donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant; - donnees += '&montantBudget='+montantBudget; - donnees += '&montantBudgetEnfantSupl='+montantBudgetEnfantSupl; - donnees += '&montantBudgetConjointSupl='+montantBudgetConjointSupl; - donnees += '&forfaitHonoraire='+forfaitHonoraire; - donnees += '&nbAdherent='+nbAdherent; - donnees += '&nbBeneficiaire='+nbBeneficiaire; - - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/inserer/", - type : 'post', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - //alert("Success : "+data); - // - - v_msg="Paramètres insérés avec succès!"; - v_msgEng="Parameters inserted successfully!"; - alert_ebene(v_msg, v_msgEng); - - - }, - complete: function() { - retour_param_fact_garant(); - } - }); - -} - -function modifier_param_fact_produit(superUser) -{ - if (superUser != "1"){ - v_msg="Non autorisé!"; - v_msgEng="Unauthorized!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarant/"); -} - -function enregistrer_param_fact_produit() -{ - codeGcAssureur = $('#codeGcAssureur').val(); - codeProduit = $('#codeProduit').val(); - - gcTauxFraisReel = $('#gcTauxFraisReel').val(); - gcTauxRedressement = $('#gcTauxRedressement').val(); - gcTauxCommissionGerant = $('#gcTauxCommissionGerant').val(); - - montantBudget = parseInt($("#montantBudget").val().replace(/ /g,""),10);; - montantBudgetEnfantSupl = parseInt($("#montantBudgetEnfantSupl").val().replace(/ /g,""),10); - montantBudgetConjointSupl = parseInt($("#montantBudgetConjointSupl").val().replace(/ /g,""),10); - - forfaitHonoraire = parseInt($("#forfaitHonoraire").val().replace(/ /g,""),10); - nbAdherent = parseInt($("#nbAdherent").val().replace(/ /g,""),10); - nbBeneficiaire = parseInt($("#nbBeneficiaire").val().replace(/ /g,""),10); - - donnees = 'codeGcAssureur='+codeGcAssureur; - donnees += '&codeProduit='+codeProduit; - donnees += '&gcTauxFraisReel='+gcTauxFraisReel; - - donnees += '&gcTauxRedressement='+gcTauxRedressement; - donnees += '&gcTauxCommissionGerant='+gcTauxCommissionGerant; - donnees += '&montantBudget='+montantBudget; - donnees += '&montantBudgetEnfantSupl='+montantBudgetEnfantSupl; - donnees += '&montantBudgetConjointSupl='+montantBudgetConjointSupl; - donnees += '&forfaitHonoraire='+forfaitHonoraire; - donnees += '&nbAdherent='+nbAdherent; - donnees += '&nbBeneficiaire='+nbBeneficiaire; - - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxparametreproduitgarant/enregistrer/", - type : 'post', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - //alert("Success : "+data); - // - - v_msg="Paramètres enregistrés avec succès!"; - v_msgEng="Settings saved successfully!"; - alert_ebene(v_msg, v_msgEng); - - - }, - complete: function() { - retour_param_fact_garant_cons(); - } - }); - -} - -function retour_param_fact_garant_cons() -{ - window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarantcons/"); -} - - -function ouvrir_parametre_produit() -{ - if ( $("#paramFacGcProduit").val() == "0") - { - v_msg="Non autorisée!"; - v_msgEng="Not allowed!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - window.location.assign($("#racineWeb" ).val()+"Paramfactureproduitgarantcons/"); -} - -function change_password() -{ - - v_msg="Attention, vous serez déconnecté par la suite! Voulez-vous changer votre mot de passe?"; - v_msgEng="Attention, you will be logged out afterwards! Do you want to change your password?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - window.location.assign($("#racineWeb" ).val()+"Changermotpass/"); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); -} - - -function infos_entite() -{ - donnees = ""; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxinfosentite/", - type : 'post', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - //alert("Success : "+data); - // - $('#div_entite').html(data); - - delaiUsageSaas = $("#delaiUsageSaas").val(); - - //dateLimiteUsage = $("#dateLimiteUsage").val(); - - /* - v_msg="Dernière facture SAAS: "+delaiUsageSaas+"\nFin de licence: "+dateLimiteUsage; - v_msgEng="Latest SAAS invoice: "+delaiUsageSaas+"\nEnd of license: "+dateLimiteUsage; - */ - - v_msg="Fin d'abonnement: "+delaiUsageSaas; - v_msgEng="End of subscription: "+delaiUsageSaas; - - - alert_ebene(v_msg, v_msgEng); - - return; - - }, - complete: function() { - - } - }); -} - -function change_password() -{ - - v_msg="Attention, vous serez déconnecté par la suite! Voulez-vous changer votre mot de passe?"; - v_msgEng="Attention, you will be logged out afterwards! Do you want to change your password?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - window.location.assign($("#racineWeb" ).val()+"Changermotpass/"); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); -} - -function annuler_facture_classique_police(idFactureClassique, idFacture) { - - v_msg="Confirmez-vous cette annulation?"; - v_msgEng="Do you confirm this cancellation?"; - - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - donnees = 'idFactureClassique=' + idFactureClassique+'&idFacture='+idFacture; - - $("#div_annuler_facture").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxannulationfacturerdpolice/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - $("#div_annuler_facture").html(data); - $("#div_annuler_facture").modal({backdrop: 'static', keyboard: false, show: true }); - $("#div_annuler_facture").modal("show"); - }, - complete: function () { - - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -function valider_annulation_facture_classique_police() -{ - - - idFactureClassique = $("#idFactureClassique").val(); - - motif = $("#motif").val(); - - if(motif <=" ") - { - v_msg="Le motif est obligatoire!"; - v_msgEng="The pattern is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - $("#motif").focus(); - - return; - } - - donnees = "idFactureClassique="+idFactureClassique+'&motif='+motif; - - v_msg="Validez-vous cette annulation?"; - v_msgEng="Do you validate this cancellation?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaxannulationfacturerdpolice/annuler/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - - }, - complete: function() { - afficher_dossier_classique_police(); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -function tarif_applique(tarif) -{ - v_msg="Tarif appliqué : "+tarif; - v_msgEng="Price applied : "+tarif; - - alert_ebene(v_msg, v_msgEng); - - return; - -} - -function consulter_envois_whatsapp() -{ - donnees = ""; - donnees_retour = ""; - - date1 = $("#date1").val(); - date2 = $("#date2").val(); - - donnees += 'date1=' + date1; - donnees += '&date2=' + date2; - - $("#div_sms").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxdestinatairesms/consulterwhatsapp/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_sms").html(donnees_retour); - $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); - } - }); -} - -function genererQRCode(matricule) { - /* - - const container = document.getElementById('qr-code-container'); - container.innerHTML = '
Génération en cours...
'; - - donnees = "matricule="+matricule; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxgenererqrcode/", - type : 'post', - dataType: 'json', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - - - if (data.success) { - // Recharger la page - //modifier_beneficiaire(); - location.reload(); - } else { - container.innerHTML = ` -
- Erreur: ${data.error || 'Échec de génération'} - -
`; - } - - }, - complete: function() { - - } - }); - */ -} - -function regenererQRCode(matricule) { - /* - - v_msg="Voulez-vous vraiment régénérer ce QR Code ?"; - v_msgEng="Do you really want to regenerate this QR Code?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - genererQRCode(matricule); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - */ -} - -function listerremboursement() -{ - - - d1 = $("#d1").val(); - d2 = $("#d2").val(); - codeEtatDemandeRemboursement = $("#codeEtatDemandeRemboursement").val(); - - donnees = 'd1='+ d1+'&d2='+d2+'&codeEtatDemandeRemboursement='+codeEtatDemandeRemboursement; - - $("#div_dossiers").html('
' + '
'); - - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxdemanderemboursement/", - type: 'POST', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - // alert(data); - - - $('#div_dossiers').html(data); - }, - complete: function() { - - } - }); -} - -function selectionner_remboursement(idDemande) -{ - donnees = 'idDemande='+idDemande; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxdemanderemboursement/selectionnerremb/", - type: 'POST', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - // alert(data); - - }, - complete: function() { - actualiser_remboursement(); - } - }); -} - -function actualiser_remboursement() -{ - window.location.assign($("#racineWeb" ).val()+"Demanderemboursement/"); - -} - -function valider_reponse_demande_rd() -{ - idDemandeRemboursement = $("#idDemandeRemboursement").val(); - idBeneficiaire = $("#idBeneficiaire").val(); - codeEtatDemandeRemboursement = $("#codeEtatDemandeRemboursement").val(); - motifReponseDemandeRemboursement = $("#motifReponseDemandeRemboursement").val(); - - nbreFichier = $("#nbreFichier").val(); - - if(codeEtatDemandeRemboursement=="0"){ - - v_msg="Un autre état de réponse est obligatoire!"; - v_msgEng="Another response status is required!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeEtatDemandeRemboursement").focus(); - - return; - } - - if(motifReponseDemandeRemboursement<=" "){ - - v_msg="Le motif est obligatoire!"; - v_msgEng="The pattern is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - $("#motifReponseDemandeRemboursement").focus(); - - return; - } - - if(codeEtatDemandeRemboursement=="1" && nbreFichier=="0"){ - - v_msg="Au moins une facture doit être incluse à la demande !"; - v_msgEng="At least one invoice must be included with the request!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - donnees = 'idDemandeRemboursement='+idDemandeRemboursement; - donnees += '&codeEtatDemandeRemboursement='+codeEtatDemandeRemboursement; - donnees += '&motifReponseDemandeRemboursement='+motifReponseDemandeRemboursement; - - v_msg="Confirmez-vous cette réponse ?"; - v_msgEng="Do you confirm this answer?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaxdemanderemboursement/majreponse/", - type: 'POST', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - // alert(data); - - - }, - complete: function() { - - if(codeEtatDemandeRemboursement=="1"){ - ajax_context_adherent(idBeneficiaire); - }else{ - window.location.assign($("#racineWeb" ).val()+"Historiqueremboursement/"); - - } - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -function creer_dossier_demande_rd() -{ - - idBeneficiaire = $("#idBeneficiaire").val(); - - v_msg="Confirmez-vous la création du dossier de remboursement ?"; - v_msgEng="Do you confirm the creation of the reimbursement file?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - ajax_context_adherent(idBeneficiaire); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); -} - -function filtrespoliceencoursgarant(){ - - var codeGcAssureur = $('#codeGcAssureur').val(); - - donnees = 'codeGcAssureur='+codeGcAssureur; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxfiltrespoliceencoursgarant/", - type : 'post', - data: donnees, - error: function(errorData){ - //alert("Erreur : "+errorData); - }, - success: function(data) { - //alert("Success : "+data); - $('#div_policegarant').html(data); - - $("#idPolice" ).selectpicker(); - }, - complete: function() { - reinit_edition_carte(); - } - }); - -} - -function reinit_edition_carte(){ - idPolice =$("#idPolice").val(); - - $("#div_liste_carte").html('
' + '
'); - - donnees = 'idPolice='+idPolice; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/reinitedition/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - $("#div_liste_carte").html(''); - }, - complete: function() { - - } - }); - -} - -function filtrescollegepolicecarte() { - - donnees = "idPolice=" + $("#idPolice").val(); - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxfiltrescollegepolicecarte/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - $("#div_college").html(data); - $("#idCollege").selectpicker(); - }, - complete: function () { - - } - }); -} - -function select_tous_carte_a_editer(p_choix) -{ - - - donnees = 'choix='+p_choix; - - $("#div_liste_carte").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/toutchoisir/", - type: 'POST', - data: donnees, - success: function(data) { - $('#div_liste_carte').html(data); - appliquerDataTable(); - }, - error: function(data) { - }, - complete: function() { - - } - }); -} - -function select_un_assure_a_editer(p_choix, id) -{ - donnees = 'id='+id; - donnees += '&choix='+p_choix; - - //$("#div_liste_carte").html('
' + '
'); - - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/selectionunassure/", - type: 'POST', - data: donnees, - success: function(data) { - //$('#div_liste_carte').html(data); - //appliquerDataTable(); - }, - error: function(data) { - }, - complete: function() { - - } - }); -} - -function confirmer_edition_carte(){ - - idPolice =$("#idPolice").val(); - typeEdition =$("#typeEdition").val(); - - $("#div_liste_carte").html('
' + '
'); - - donnees = 'idPolice='+idPolice; - - v_msg="Confirmez-vous l'édition de carte assuré ?"; - v_msgEng="Do you confirm the insured card edition?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - if (numeroBeneficiaire_C>"") - { - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/confirmedition/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - - }, - complete: function() { - afficher_liste_carteassure_commun(); - } - }); - } - } else { - afficher_liste_carteassure_commun(); - } - }); - -} - -function actualiser_carte_assure() -{ - window.location.assign($("#racineWeb" ).val()+"Carteassures/"); -} - -function afficher_detail_emission(idEmission) -{ - if (idEmission>"0") - { - window.location.assign($("#racineWeb" ).val()+"Detailemission/"+idEmission+"/"); - } -} - - -function paiement_mobile_un_dossier() -{ - regle=$("#regle").val(); - - if (regle==1) - { - v_msg="Déjà payé!"; - v_msgEng="Already paid!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - fraisRetenu=$("#fraisRetenu").val(); - if (fraisRetenu<=0) - { - v_msg="Rien à payer!"; - v_msgEng="Nothing to pay!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - demandeReglement=$("#demandeReglement").val(); - demandeReglement = parseInt(demandeReglement); - - if (demandeReglement==0) - { - v_msg="Aucune Demande de Règlement!"; - v_msgEng="No request in progress!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - window.location.assign($("#racineWeb" ).val()+"Paiementmobile/"); -} - -function reinitialiser_changementcollege() -{ - v_msg="Confirmez-vous la réinitialisation?"; - v_msgEng="Do you confirm the reset?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - window.location.assign($("#racineWeb" ).val()+"Fichechangementcollege/"); - } - }); -} - -function lister_avenants_sans_primes() -{ - $("#div_page_complet").html('
' + '
'); - - debut=$("#debut").val(); - fin=$("#fin").val(); - - donnees = 'debut='+debut+'&fin='+fin; - - $("#avenant_a_facturer").html('
' + '
'); - $.ajax({ - url: $("#racineWeb").val()+"Ajaxfacturerpolice/listeravenantsanprime/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - $("#div_page_complet").html(data); - appliquerDataTable(); - }, - complete: function() { - } - }); -} - - -function cloturer_avenant_sans_prime(idAvenant) -{ - v_msg="Confirmez-vous cette opération?"; - v_msgEng="Do you confirm this operation?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - - $("#div_page_complet").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxfacturerpolice/clotureravenantsansprime/", - type : 'post', - data: "idAvenant="+idAvenant, - error: function(errorData) { - }, - success: function(data) { - }, - complete: function() - { - lister_avenants_sans_primes(); - } - }); - } else { - } - }); - -} - -function tester_reconnaissance_faciale() -{ - alert("tester_reconnaissance_faciale"); - return; - - p_idReglement = $("#idReglement").val(); - p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); - p_prefixdestinataire = $("#prefixdestinataire").val(); - p_destinataires = $("#destinataires").val(); - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - - if (p_idReglement<=" ") - { - v_msg="ID Règlement manquant!"; - v_msgEng="Missing Regulation ID!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (fournisseurPaiementMobile<=" ") - { - v_msg="Fournisseur de paiement mobile non défini!"; - v_msgEng="Mobile payment provide not defined!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_prefixdestinataire<=" ") - { - v_msg="Veuillez saisir un préfixe!"; - v_msgEng="Please enter a prefix!"; - alert_ebene(v_msg, v_msgEng); - - $("#prefixdestinataire").focus(); - return; - } - - if (p_destinataires<=" ") - { - v_msg="Veuillez saisir un destinataire!"; - v_msgEng="Please enter a recipient!"; - alert_ebene(v_msg, v_msgEng); - - $("#destinataires").focus(); - return; - } - - const liste_fournisseurs = ["cinetpay", "paydunya", "waveci"]; - - if (!liste_fournisseurs.includes(p_fournisseurPaiementMobile)) - { - v_msg=p_fournisseurPaiementMobile+" => Fournisseur de paiement mobile inconnu!"; - v_msgEng=fournisseurPaiementMobile+" => Unknown Mobile payment provider!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - donnees = "idReglement="+p_idReglement; - donnees += "&fournisseurPaiementMobile="+p_fournisseurPaiementMobile; - donnees += "&prefixdestinataire="+p_prefixdestinataire; - donnees += "&destinataires="+p_destinataires; - - $("#div_test_gabarit").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxtesterpaiementmobile/envoyerargent/", - type: 'POST', - data: donnees, - success: function(data) - { - // alert("success "+data); - $('#div_test_gabarit').html(data); - }, - error: function(errdata) - { - // alert("Error : "+errdata); - $('#div_test_gabarit').html(errdata); - }, - complete: function() - { - } - }); -} - -function tester_paiement_mobile() -{ - p_idReglement = $("#idReglement").val(); - p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); - p_prefixdestinataire = $("#prefixdestinataire").val(); - p_destinataires = $("#destinataires").val(); - p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - - if (p_idReglement<=" ") - { - v_msg="ID Règlement manquant!"; - v_msgEng="Missing Regulation ID!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (fournisseurPaiementMobile<=" ") - { - v_msg="Fournisseur de paiement mobile non défini!"; - v_msgEng="Mobile payment provide not defined!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_prefixdestinataire<=" ") - { - v_msg="Veuillez saisir un préfixe!"; - v_msgEng="Please enter a prefix!"; - alert_ebene(v_msg, v_msgEng); - - $("#prefixdestinataire").focus(); - return; - } - - if (p_destinataires<=" ") - { - v_msg="Veuillez saisir un destinataire!"; - v_msgEng="Please enter a recipient!"; - alert_ebene(v_msg, v_msgEng); - - $("#destinataires").focus(); - return; - } - - if (p_withdrawModePaiementMobile<=" ") - { - v_msg="Veuillez indiquer le withdraw mode!"; - v_msgEng="Please indicate the withdraw mode!"; - alert_ebene(v_msg, v_msgEng); - - $("#withdrawModePaiementMobile").focus(); - return; - } - - const liste_fournisseurs = ["cinetpay", "paydunya", "waveci"]; - - if (!liste_fournisseurs.includes(p_fournisseurPaiementMobile)) - { - v_msg=p_fournisseurPaiementMobile+" => Fournisseur de paiement mobile inconnu!"; - v_msgEng=fournisseurPaiementMobile+" => Unknown Mobile payment provider!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - donnees = "idReglement="+p_idReglement; - donnees += "&fournisseurPaiementMobile="+p_fournisseurPaiementMobile; - donnees += "&prefixdestinataire="+p_prefixdestinataire; - donnees += "&destinataires="+p_destinataires; - donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; - - $("#div_test_gabarit").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxtesterpaiementmobile/envoyerargent/", - type: 'POST', - data: donnees, - success: function(data) - { - // alert("success "+data); - $('#div_test_gabarit').html(data); - }, - error: function(errdata) - { - // alert("Error : "+errdata); - $('#div_test_gabarit').html(errdata); - }, - complete: function() - { - } - }); -} - -function paiement_par_mobile() -{ - p_idReglement = $("#idReglement").val(); - p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); - p_prefixePaiementMobile = $("#prefixePaiementMobile").val(); - p_mobilePaiement = $("#mobilePaiement").val(); - p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - plafondPaiementMobile=$("#plafondPaiementMobile").val(); - plafondPaiementMobile = parseInt(plafondPaiementMobile); - - montantMobileMoney=$("#montantMobileMoney").val(); - montantMobileMoney = parseInt(montantMobileMoney); - - if (montantMobileMoney > plafondPaiementMobile) - { - v_msg="Plafond mobile monney dépassé!"; - v_msgEng="Mobile money ceiling exceeded!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - if (p_idReglement<=" ") - { - v_msg="Veuillez indiquer un décompte à payer!"; - v_msgEng="Please indicate a statement to pay!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_prefixePaiementMobile<=" ") - { - v_msg="L'indicatif du téléphonique est obligatoire!"; - v_msgEng="The telephone code is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - if (p_fournisseurPaiementMobile<=" ") - { - v_msg="Fournisseur de paiement mobile non défini!"; - v_msgEng="Mobile payment provide not defined!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_mobilePaiement<=" ") - { - v_msg="Le numéro du téléphonique est obligatoire!"; - v_msgEng="The phone number is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - - if (p_withdrawModePaiementMobile<=" ") - { - v_msg="Veuillez indiquer un oprérateur!"; - v_msgEng="Please specify an operator!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - $("#btn_paiement").prop("disabled",true); - - donnees = "idReglement="+p_idReglement; - donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; - - // alert(donnees); - // return; - - v_msg="Confirmez-vous le paiement mobile?"; - v_msgEng="Do you confirm mobile payment?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - - $("#div_wait").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxpaiementmobile/envoyerargent/", - type: 'POST', - data: donnees, - success: function(data) - { - $('#div_wait').html(data); - - $("#btn_paiement").prop("disabled",false); - - v_msg="Paiement mobile bien effectué!"; - v_msgEng="Mobile payment successful!"; - alert_ebene(v_msg, v_msgEng); - }, - error: function(errdata) - { - // alert("Error : "+errdata); - $('#div_test_gabarit').html(errdata); - }, - complete: function() - { - afficher_dossier_classique(); - } - }); - } else { - afficher_dossier_classique(); - } - }); -} - -function paiement_mobile_un_dossier_police() -{ - regle=$("#regle").val(); - - if (regle==1) - { - v_msg="Déjà payé!"; - v_msgEng="Already paid!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - fraisRetenu=$("#fraisRetenu").val(); - if (fraisRetenu<=0) - { - v_msg="Rien à payer!"; - v_msgEng="Nothing to pay!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - demandeReglement=$("#demandeReglement").val(); - demandeReglement = parseInt(demandeReglement); - - if (demandeReglement==0) - { - v_msg="Aucune Demande de Règlement!"; - v_msgEng="No request in progress!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - window.location.assign($("#racineWeb" ).val()+"Paiementmobilepolice/"); -} - - -function paiement_par_mobile_police() -{ - p_idReglement = $("#idReglement").val(); - p_fournisseurPaiementMobile = $("#fournisseurPaiementMobile").val(); - p_prefixePaiementMobile = $("#prefixePaiementMobile").val(); - p_mobilePaiement = $("#mobilePaiement").val(); - p_withdrawModePaiementMobile = $("#withdrawModePaiementMobile").val(); - - paiementMobileActif=$("#paiementMobileActif").val(); - paiementMobileActif = parseInt(paiementMobileActif); - - if (paiementMobileActif!=1) - { - v_msg="Module paiement mobile non activé!"; - v_msgEng="Mobile payment module not activated"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - plafondPaiementMobile=$("#plafondPaiementMobile").val(); - plafondPaiementMobile = parseInt(plafondPaiementMobile); - - montantMobileMoney=$("#montantMobileMoney").val(); - montantMobileMoney = parseInt(montantMobileMoney); - - if (montantMobileMoney > plafondPaiementMobile) - { - v_msg="Plafond mobile monney dépassé!"; - v_msgEng="Mobile money ceiling exceeded!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - if (p_idReglement<=" ") - { - v_msg="Veuillez indiquer un décompte à payer!"; - v_msgEng="Please indicate a statement to pay!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_prefixePaiementMobile<=" ") - { - v_msg="L'indicatif du téléphonique est obligatoire!"; - v_msgEng="The telephone code is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - if (p_fournisseurPaiementMobile<=" ") - { - v_msg="Fournisseur de paiement mobile non défini!"; - v_msgEng="Mobile payment provide not defined!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - if (p_mobilePaiement<=" ") - { - v_msg="Le numéro du téléphonique est obligatoire!"; - v_msgEng="The phone number is mandatory!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - if (p_withdrawModePaiementMobile<=" ") - { - v_msg="Veuillez indiquer un oprérateur!"; - v_msgEng="Please specify an operator!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - $("#btn_paiement").prop("disabled",true); - - donnees = "idReglement="+p_idReglement; - donnees += "&withdrawModePaiementMobile="+p_withdrawModePaiementMobile; - - // alert(donnees); - // return; - - v_msg="Confirmez-vous le paiement mobile?"; - v_msgEng="Do you confirm mobile payment?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - - $("#div_wait").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxpaiementmobile/envoyerargent/", - type: 'POST', - data: donnees, - success: function(data) - { - $('#div_wait').html(data); - - $("#btn_paiement").prop("disabled",false); - - // $('#div_test_gabarit').html(data); - - v_msg="Paiement mobile bien effectué!"; - v_msgEng="Mobile payment successful!"; - alert_ebene(v_msg, v_msgEng); - }, - error: function(errdata) - { - $('#div_test_gabarit').html(errdata); - }, - complete: function() - { - afficher_dossier_classique_police(); - } - }); - } else { - afficher_dossier_classique_police(); - } - }); -} - - -function exporter_modele_tarif_acte() -{ - $('#div_form_upload').hide(); - - - var div_export = $('#div_exporter_tarif'); - - - div_export.html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaximportertarifacte/exportermodele/", - type: 'POST', - //data: donnees, - success: function(data) - { - div_export.html(data); - }, - error : function(resultat, statut, erreur) - { - }, - complete: function() - { - } - }); -} - - -function init_import_tarif_actes() -{ - adminSin=$("#adminSin").val(); - - if (adminSin!="1") - { - v_msg="Non autorisée!"; - v_msgEng="Not allowed!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - codeTarifActe=$("#codeTarifActe").val(); - - if(codeTarifActe<=' ') - { - v_msg="Veuillez sélectionner un tarif!"; - v_msgEng="Please select a rate!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeTarifActe").focus(); - return; - } - - donnees = 'codeTarifActe='+codeTarifActe; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxcomposantetarif/initimport/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) - { - //alert(data); - }, - complete: function() { - window.location.assign($("#racineWeb" ).val()+"Importertarifsactes/"); - } - }); -} - - -function charger_fichier_modele_tarifacte() -{ - $('#div_exporter_tarif').html(""); - - $('#div_form_upload').show(); - - // return; -} - -function importer_modele_tarif_acte() -{ - etape2=$("#etape2").val(); - - if (etape2 != "1") - { - v_msg="Etape 2 incomplète!"; - v_msgEng="Incomplete step 2!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - codeTarifActe=$("#codeTarifActe").val(); - cheminFichier=$("#cheminFichier").val(); - - donnees = 'codeTarifActe='+codeTarifActe+'&cheminFichier='+cheminFichier; - - - $('#div_form_upload').hide(); - - var div_export = $('#div_exporter_tarif'); - - div_export.html('
' + '
'); - - $("#div_erreur_excel").html(""); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaximportertarifacte/importermodele/", - type: 'POST', - data: donnees, - success: function(data) - { - div_export.html(''); - $("#div_erreur_excel").html(data); - - v_msg="Opération terminée avec succès!"; - v_msgEng="Operation completed successfully!"; - alert_ebene(v_msg, v_msgEng); - }, - error : function(resultat, statut, erreur) - { - }, - complete: function(data) - { - - div_export.html(''); - - succes_impot_execl=$("#succes_impot_execl").val(); - - if (succes_impot_execl == "1") - { - maj_etape_3_import_actes(); - } - - } - }); -} - -function maj_etape_3_import_actes() -{ - codeTarifActe=$("#codeTarifActe").val(); - - donnees = 'codeTarifActe='+codeTarifActe; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaximportertarifacte/majetape/", - type: 'POST', - data: donnees, - success: function(data) - { - }, - error : function(resultat, statut, erreur) - { - }, - complete: function(data) - { - window.location.assign($("#racineWeb" ).val()+"Listeimporttarifacte/"); - } - }); -} - -function traiter_actes_importes() -{ - etape2=$("#etape2").val(); - - if (etape2 != "1") - { - v_msg="Etape 2 incomplète!"; - v_msgEng="Incomplete step 2!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - etape3=$("#etape3").val(); - - if (etape3 != "1") - { - v_msg="Etape 3 incomplète!"; - v_msgEng="Incomplete step 3!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - window.location.assign($("#racineWeb" ).val()+"Listeimporttarifacte/"); -} - -function ajax_composante_tarif_acte_importe() -{ - adminSin=$("#adminSin").val(); - - if (adminSin!="1") - { - v_msg="Non autorisée!"; - v_msgEng="Not allowed!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - codeTarifActe=$("#codeTarifActe").val(); - codeFamilleActe=$("#codeFamilleActe").val(); - - if(codeFamilleActe<=' ') - { - v_msg="Veuillez saisir une famille!"; - v_msgEng="Please select a family!"; - alert_ebene(v_msg, v_msgEng); - $("#codeFamilleActe").focus(); - return; - } - - donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; - - var div_attente = $('#div_compsante_tarif'); - - div_attente.html('
' + '
'); - - - $.ajax({ - url: $("#racineWeb").val()+"Ajaximportertarifacte/affichercomposantetarif/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) - { - // $('#div_test_gabarit').html(data); - div_attente.html(data); - $(".datepicker").datepicker(); - appliquerDataTable(); - }, - complete: function() { - } - }); -} - -function valider_import_tarif_actes() -{ - codeTarifActe=$("#codeTarifActe").val(); - - if(codeTarifActe<=' ') - { - v_msg="Veuillez sélectionner un tarif!"; - v_msgEng="Please select a rate!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeTarifActe").focus(); - return; - } - - donnees = 'codeTarifActe='+codeTarifActe; - - v_msg="Validez-vous cette importation de tarif?"; - v_msgEng="Do you validate this tariff import?"; - - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaximportertarifacte/validerimporttarifacte/", - type: 'POST', - data: donnees, - success: function(data) - { - $('#div_test_gabarit').html(data); - }, - error: function(data) { - $('#div_test_gabarit').html(data); - }, - complete: function() { - window.location.assign($("#racineWeb" ).val()+"Compositiontarifactes/"); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); -} - -function importer_tarif_medicaments_code() -{ - adminSin=$("#adminSin").val(); - - if (adminSin!="1") - { - v_msg="Non autorisée!"; - v_msgEng="Not allowed!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - codeTarifMedicament=$("#codeTarifMedicament").val(); - - donnees = 'codeTarifMedicament='+codeTarifMedicament; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxcomposantetarifmedicament/initimportcode/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) - { - - }, - complete: function() { - window.location.assign($("#racineWeb" ).val()+"Importertarifmedicament/"); - } - }); -} - -function afficher_liste_carteassure_police() -{ - donnees = ""; - donnees_retour = ""; - - idPolice =$("#idPolice").val(); - if(idPolice<=' ') - { - v_msg="Veuillez saisir une police!"; - v_msgEng="Please select a police!"; - alert_ebene(v_msg, v_msgEng); - - $("#idPolice").focus(); - return; - } - - idCollege=$("#idCollege").val(); - - $("#div_export_a").html(""); - - $("#div_liste_carte").html('
' + '
'); - - donnees = 'idPolice='+idPolice+'&idCollege='+idCollege; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_liste_carte").html(donnees_retour); - appliquerDataTable(); - $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); - } - }); -} - -function tester_edition_carteassure() -{ - idPolice =$("#idPolice").val(); - donnees = 'idPolice='+idPolice; - - $('#div_export_a').html(""); - $('#div_liste_carte').html(""); - - $("#div_liste_carte").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/afficherliste/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_liste_carte").html(donnees_retour); - $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); - - nbChoix = $("#nbChoix").val(); - if (nbChoix<="0") - { - v_msg="Liste vide!"; - v_msgEng="Empty list!"; - alert_ebene(v_msg, v_msgEng); - appliquerDataTable(); - return false; - } - else - { - editer_carteassure(); - } - } - }); -} - -function editer_carteassure() -{ - nbChoix = $("#nbChoix").val(); - if (nbChoix<="0") - { - v_msg="Liste vide!"; - v_msgEng="Empty list!"; - alert_ebene(v_msg, v_msgEng); - return false; - } - - idPolice =$("#idPolice").val(); - idCollege=$("#idCollege").val(); - - $('#div_export_a').html(""); - $('#div_liste_carte').html(""); - - donnees = 'idPolice='+idPolice+'&idCollege='+idCollege; - - v_url = $("#racineWeb").val()+"Ajaxeditioncarteassure/"; - - $("#div_export_a").html('
' + '
'); - - $.ajax({ - url: v_url, - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - $("#div_export_a").html(data); - } - }); -} - -function controler_piece_beneficiaire() -{ - v_codeNaturePiece = $("#codeNaturePiece").val(); - - if(v_codeNaturePiece<=' ') - { - v_msg="Veuillez sélection la nature de la pièce!"; - v_msgEng="Please select the type of document!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeNaturePiece").focus(); - return; - } - - $('#numeroPiece').removeAttr('minlength'); - - if(v_codeNaturePiece=="CNI") - { - $('#div_controle_piece').html(""); - - v_numeroPiece = $("#numeroPiece").val(); - - $('#numeroPiece').attr('minlength', 9); - - donnees = "numeroPiece="+v_numeroPiece; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxcontrolepiece/", - type: 'POST', - data: donnees, - success: function(data) { - $('#div_controle_piece').html(data); - - var resultatPiece = $("#resultatPiece").val(); - - if(resultatPiece!="0") - { - $("#numeroPiece").focus(); - return; - } - }, - error: function(data) { - }, - complete: function() - { - } - }); - } -} - -function enregistrer_encaissement_quittance() -{ - anc_solde = $("#anc_solde").val(); - montant = $("#montant").val(); - montant_ecart = (montant-anc_solde); - montant_ecart = Math.abs(montant_ecart); - - montant = $("#montant").val(); - montant = montant.replace(" ", ""); - montant = parseInt(montant); - montant = Math.abs(montant); - - codeModePaiement = $("#codeModePaiement").val(); - codeMoyenPaiement = $("#codeMoyenPaiement").val(); - referencePaiement = $("#referencePaiement").val(); - libelleOperation = $("#libelleOperation").val(); - codeTypePaiement = $("#codeTypePaiement").val(); - banquePayeur = $("#banquePayeur").val(); - - if(codeModePaiement<=" ") - { - v_msg="Veuillez indiquer le mode de paiement!"; - v_msgEng="Please enter the method of payment"; - alert_ebene(v_msg, v_msgEng); - - $("#codeModePaiement").focus(); - return; - } - - if(codeMoyenPaiement<=" ") - { - v_msg="Veuillez indiquer le moyen de paiement!"; - v_msgEng="Please enter the method of payment!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeMoyenPaiement").focus(); - return; - } - - if(referencePaiement<=" ") - { - v_msg="Veuillez indiquer la référence du paiement!"; - v_msgEng="Please enter the payment reference!"; - alert_ebene(v_msg, v_msgEng); - - $("#referencePaiement").focus(); - return; - } - - if(codeTypePaiement=="B" || codeTypePaiement=="M") - { - if (nomTireur<=" ") - { - v_msg="Veuillez saisir le tireur!"; - v_msgEng="Please enter the issuer of the check! "; - alert_ebene(v_msg, v_msgEng); - - $("#nomTireur").focus(); - return; - } - - if(banquePayeur<=" ") - { - v_msg="Veuillez indiquer l\'établissement payeur!"; - v_msgEng="Please indicate the paying institution!"; - alert_ebene(v_msg, v_msgEng); - - $("#banquePayeur").focus(); - return; - } - } - - if(montant_ecart>"100") - { - v_msg="Veuillez vérifier votre écart!"; - v_msgEng="Please check your gap!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - // if(montant=="100") - if(montant<="100") - { - v_msg="Veuillez saisir un montant!"; - v_msgEng="Please enter an amount"; - alert_ebene(v_msg, v_msgEng); - - $("#montant").focus(); - return; - } - - if(libelleOperation<=" ") - { - v_msg="Veuillez saisir le libellé de l\'opération!"; - v_msgEng="Please enter the text of the transaction!"; - alert_ebene(v_msg, v_msgEng); - - $("#libelleOperation").focus(); - return; - } - - $("#formente_encaissement").submit(); -} - -function suite_encaissement_client() -{ - montant = $("#montant").val(); - montant = montant.replace(" ", ""); - montant = parseInt(montant); - montant = Math.abs(montant); - - codeModePaiement = $("#codeModePaiement").val(); - codeMoyenPaiement = $("#codeMoyenPaiement").val(); - referencePaiement = $("#referencePaiement").val(); - libelleOperation = $("#libelleOperation").val(); - codeTypePaiement = $("#codeTypePaiement").val(); - nomTireur = $("#nomTireur").val(); - banquePayeur = $("#banquePayeur").val(); - - if(codeModePaiement<=" ") - { - v_msg="Veuillez indiquer le mode de paiement!"; - v_msgEng="Please enter the method of payment"; - alert_ebene(v_msg, v_msgEng); - - $("#codeModePaiement").focus(); - return; - } - - if(codeMoyenPaiement<=" ") - { - v_msg="Veuillez indiquer le moyen de paiement!"; - v_msgEng="Please enter the method of payment!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeMoyenPaiement").focus(); - return; - } - - if(referencePaiement<=" ") - { - v_msg="Veuillez indiquer la référence du paiement!"; - v_msgEng="Please enter the payment reference!"; - alert_ebene(v_msg, v_msgEng); - - $("#referencePaiement").focus(); - return; - } - - if(codeTypePaiement=="B" || codeTypePaiement=="M") - { - if (nomTireur<=" ") - { - v_msg="Veuillez saisir le tireur!"; - v_msgEng="Please enter the issuer of the check! "; - alert_ebene(v_msg, v_msgEng); - - $("#nomTireur").focus(); - return; - } - - if(banquePayeur<=" ") - { - v_msg="Veuillez indiquer l\'établissement payeur!"; - v_msgEng="Please indicate the paying institution!"; - alert_ebene(v_msg, v_msgEng); - - $("#banquePayeur").focus(); - return; - } - } - - if(montant<="0") - { - v_msg="Veuillez saisir un montant!"; - v_msgEng="Please enter an amount"; - alert_ebene(v_msg, v_msgEng); - - $("#montant").focus(); - return; - } - - - if(libelleOperation<=" ") - { - v_msg="Veuillez saisir le libellé de l\'opération!"; - v_msgEng="Please enter the text of the transaction!"; - alert_ebene(v_msg, v_msgEng); - - $("#libelleOperation").focus(); - return; - } - - $("#btn_suivant").click(); -} - - -function suite_encaissement_bordreau() -{ - montant = $("#montant").val(); - montant = montant.replace(" ", ""); - montant = parseInt(montant); - montant = Math.abs(montant); - - codeModePaiement = $("#codeModePaiement").val(); - codeMoyenPaiement = $("#codeMoyenPaiement").val(); - referencePaiement = $("#referencePaiement").val(); - libelleOperation = $("#libelleOperation").val(); - codeTypePaiement = $("#codeTypePaiement").val(); - nomTireur = $("#nomTireur").val(); - banquePayeur = $("#banquePayeur").val(); - - if(codeModePaiement<=" ") - { - v_msg="Veuillez indiquer le mode de paiement!"; - v_msgEng="Please enter the method of payment"; - alert_ebene(v_msg, v_msgEng); - - $("#codeModePaiement").focus(); - return; - } - - if(codeMoyenPaiement<=" ") - { - v_msg="Veuillez indiquer le moyen de paiement!"; - v_msgEng="Please enter the method of payment!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeMoyenPaiement").focus(); - return; - } - - if(referencePaiement<=" ") - { - v_msg="Veuillez indiquer la référence du paiement!"; - v_msgEng="Please enter the payment reference!"; - alert_ebene(v_msg, v_msgEng); - - $("#referencePaiement").focus(); - return; - } - - if(codeTypePaiement=="B" || codeTypePaiement=="M") - { - if (nomTireur<=" ") - { - v_msg="Veuillez saisir le tireur!"; - v_msgEng="Please enter the issuer of the check! "; - alert_ebene(v_msg, v_msgEng); - - $("#nomTireur").focus(); - return; - } - - if(banquePayeur<=" ") - { - v_msg="Veuillez indiquer l\'établissement payeur!"; - v_msgEng="Please indicate the paying institution!"; - alert_ebene(v_msg, v_msgEng); - - $("#banquePayeur").focus(); - return; - } - } - - if(montant<="0") - { - v_msg="Veuillez saisir un montant!"; - v_msgEng="Please enter an amount"; - alert_ebene(v_msg, v_msgEng); - - $("#montant").focus(); - return; - } - - - if(libelleOperation<=" ") - { - v_msg="Veuillez saisir le libellé de l\'opération!"; - v_msgEng="Please enter the text of the transaction!"; - alert_ebene(v_msg, v_msgEng); - - $("#libelleOperation").focus(); - return; - } - - $("#btn_suivant").click(); -} - -function suite_encaissement_depot() -{ - montant = $("#montant").val(); - montant = montant.replace(" ", ""); - montant = parseInt(montant); - montant = Math.abs(montant); - - codeModePaiement = $("#codeModePaiement").val(); - codeMoyenPaiement = $("#codeMoyenPaiement").val(); - referencePaiement = $("#referencePaiement").val(); - libelleOperation = $("#libelleOperation").val(); - codeTypePaiement = $("#codeTypePaiement").val(); - nomTireur = $("#nomTireur").val(); - banquePayeur = $("#banquePayeur").val(); - - if(codeModePaiement<=" ") - { - v_msg="Veuillez indiquer le mode de paiement!"; - v_msgEng="Please enter the method of payment"; - alert_ebene(v_msg, v_msgEng); - - $("#codeModePaiement").focus(); - return; - } - - if(codeMoyenPaiement<=" ") - { - v_msg="Veuillez indiquer le moyen de paiement!"; - v_msgEng="Please enter the method of payment!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeMoyenPaiement").focus(); - return; - } - - if(referencePaiement<=" ") - { - v_msg="Veuillez indiquer la référence du paiement!"; - v_msgEng="Please enter the payment reference!"; - alert_ebene(v_msg, v_msgEng); - - $("#referencePaiement").focus(); - return; - } - - if(codeTypePaiement=="B" || codeTypePaiement=="M") - { - if (nomTireur<=" ") - { - v_msg="Veuillez saisir le tireur!"; - v_msgEng="Please enter the issuer of the check! "; - alert_ebene(v_msg, v_msgEng); - - $("#nomTireur").focus(); - return; - } - - if(banquePayeur<=" ") - { - v_msg="Veuillez indiquer l\'établissement payeur!"; - v_msgEng="Please indicate the paying institution!"; - alert_ebene(v_msg, v_msgEng); - - $("#banquePayeur").focus(); - return; - } - } - - if(montant<="0") - { - v_msg="Veuillez saisir un montant!"; - v_msgEng="Please enter an amount"; - alert_ebene(v_msg, v_msgEng); - - $("#montant").focus(); - return; - } - - - if(libelleOperation<=" ") - { - v_msg="Veuillez saisir le libellé de l\'opération!"; - v_msgEng="Please enter the text of the transaction!"; - alert_ebene(v_msg, v_msgEng); - - $("#libelleOperation").focus(); - return; - } - - $("#btn_depot").click(); -} - -function liste_renouvellement_medicament() -{ - demandeTraite = $("#demandeTraite").val(); - debut = $("#debut").val(); - fin = $("#fin").val(); - - donnees = 'demandeTraite='+demandeTraite; - donnees += '&debut='+debut+'&fin='+fin; - - $("#div_ententeprealable").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxententeprealablespha/renouvellementmedicament/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - $("#div_ententeprealable").html(data); - }, - complete: function() { - - } - }); -} - -function afficher_detail_ren_medicament(idPrescription) { - - - donnees = "idPrescription=" + idPrescription; - - - $("#div_patienter").html('
' + '
'); - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - //$('#div_test_gabarit').html(data); - //alert(data); - - $("#div_medicaments_prescrits").html(data); - $("#div_medicaments_prescrits").modal({ backdrop: 'static', keyboard: false, show: true }); - $("#div_medicaments_prescrits").modal("show"); - $("#div_patienter").empty(); - - //alert("afficherMasquerMedicaments"); - // afficherMasquerMedicaments(); - - }, - complete: function () { - - } - }); - -} - -function ajax_maj_qte_prescrit_medicament(idMedicament, quantite, controle) { - - donnee_a_affciher = ""; - - quantite = quantite.replace(",", "."); - controle.value = quantite; - - if (controle_numerique(controle)) { - if (quantite == 0) { - controle.focus(); - v_msg = "Veuillez saisir la quantit\u00e9!"; - v_msgEng = "Please enter the quantity!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - donnees = 'idMedicament=' + idMedicament + "&quantite=" + quantite; - - //alert(donnees); - //return; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/majquantiteaccorde/", - type: 'POST', - data: donnees, - success: function (data) { - - }, - error: function (data) { - }, - complete: function () { - affiche_liste_phar_renouvellement_provisoire(); - } - }); - } -} - -function affiche_liste_phar_renouvellement_provisoire() -{ - $("#tab_liste").html('
' + '
'); - - donnees = ""; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traitementprovisoire/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - $("#tab_liste").html(data); - }, - complete: function () { - - } - }); - -} - -function ajax_maj_duree_triatement_renouvelleemnt_medicament(idMedicament, dureeTraitement, controle) { - - donnee_a_affciher = ""; - - dureeTraitement = dureeTraitement.replace(",", "."); - controle.value = dureeTraitement; - - if (controle_numerique(controle)) { - if (dureeTraitement == 0) { - controle.focus(); - v_msg = "Veuillez saisir la durée!"; - v_msgEng = "Please enter the duration!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - donnees = 'idMedicament=' + idMedicament + "&dureeTraitement=" + dureeTraitement; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/majdureetraitement/", - - type: 'POST', - data: donnees, - success: function (data) { - - }, - error: function (data) { - }, - complete: function () { - affiche_liste_phar_renouvellement_provisoire(); - } - }); - } -} - -function traitement_tous_ren_medic(codeReponseProvisoire) -{ - donnees = "codeReponseProvisoire=" + codeReponseProvisoire; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traitertousprovisoire/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - // $('#div_test_gabarit').html(data); - affiche_liste_phar_renouvellement_provisoire(); - }, - complete: function () { - - } - }); - -} - -function traiter_un_provisoire_ren_medic(idMedicament, codeReponseProvisoire) -{ - donnees = "idMedicament=" + idMedicament + "&codeReponseProvisoire=" + codeReponseProvisoire; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/traiterunprovisoire/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - affiche_liste_phar_renouvellement_provisoire(); - }, - complete: function () { - - } - }); - -} - -function valider_renouvellement_medicament() { - - observations = $("#observations").val(); - motifRefusAssure = $("#motifRefusAssure").val(); - - nombreRefus = $("#nombreRefus").val(); - nombreEnAttente = $("#nombreEnAttente").val(); - - if(nombreEnAttente>"0"){ - v_msg = "Veuillez traiter toutes les lignes!"; - v_msgEng = "Please process all lines!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - - if (nombreRefus >"0" && motifRefusAssure <= " ") { - v_msg = "Veuillez saisir le motif pour les refus!"; - v_msgEng = "Please enter the reason for rejections!"; - alert_ebene(v_msg, v_msgEng); - - $("#motifRefusAssure").focus(); - - return; - } - - v_msg = "Confirmez-vous cette validation?"; - v_msgEng = "Do you confirm this validation?"; - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - donnees = 'observations=' + observations + '&motifRefusAssure=' + motifRefusAssure; - - $.ajax({ - url: $("#racineWeb").val() + "Ajaxlistemedicamentsrenouvellement/valider/", - type: 'post', - data: donnees, - error: function (errorData) { - }, - success: function (data) { - $('#div_resultat_validation').html(data); - valider = $("#valider").val(); - - if(valider=="1"){ - v_msg = "Validation réussie!"; - v_msgEng = "Validation succeed!"; - alert_ebene(v_msg, v_msgEng); - - $("#btn-fermer-entente").click(); - }else{ - v_msg = "Echèc de la validation!"; - v_msgEng = "Validation failed!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - }, - complete: function () { - liste_renouvellement_medicament(); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -function afficherMasquerAntecedents() -{ - masquerAntecedents = $("#masquerAntecedents").val(); - - const element = document.getElementById("chevron-antecedents"); - - if(masquerAntecedents=="1"){ - $('#div_antecedents').hide(); - $("#masquerAntecedents").val("0"); - //$("#span_antecedents").text("Voir"); - - element.classList.remove("bi-chevron-up"); - element.classList.add("bi-chevron-down"); - - }else{ - $('#div_antecedents').show(); - $("#masquerAntecedents").val("1"); - //$("#span_antecedents").text("Masquer"); - - element.classList.remove("bi-chevron-down"); - element.classList.add("bi-chevron-up"); - - afficher_diagnostics_beneficiaire_entente(); - } - -} - - -function afficher_diagnostics_beneficiaire_entente() -{ - idBeneficiaire = $("#idBeneficiaire").val(); - - donnees = "idBeneficiaire=" + idBeneficiaire; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxdiagnosticsbeneficiaireentente/", - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_dianostics").html(donnees_retour); - } - }); -} - -function afficher_liste_carteassure_adherent() -{ - donnees = ""; - donnees_retour = ""; - - idAdherent =$("#idAdherent").val(); - if(idAdherent<=' ') - { - v_msg="Veuillez sélectionner une famille!"; - v_msgEng="Please select a family!"; - alert_ebene(v_msg, v_msgEng); - - return; - } - - $("#div_export_a").html(""); - - $("#div_liste_carte").html('
' + '
'); - - donnees = 'idAdherent='+idAdherent; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxlistecarteassure/indexadherent/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_liste_carte").html(donnees_retour); - appliquerDataTable(); - $("#nbligne").val("Lignes : "+$("#nbligne_info").val()); - } - }); -} - - -function afficher_liste_carteassure_commun() -{ - typeEdition =$("#typeEdition").val(); - - switch(typeEdition) { - case "garant": - afficher_liste_carteassure(); - break; - case "police": - afficher_liste_carteassure_police(); - break; - case "adherent": - afficher_liste_carteassure_adherent(); - break; - default: - afficher_liste_carteassure(); - } -} - -function imprimer_carte_assure() -{ - prestationPossible = $("#prestationPossible").val(); - - if (prestationPossible!="1") - { - v_msg="Pas encore couvert!"; - v_msgEng="Not covered yet!"; - alert_ebene(v_msg, v_msgEng); - return; - } - - window.location.assign($("#racineWeb" ).val()+"Carteassuresadherent/"); -} - -function afficherMasquerSituation() -{ - masquerSituation = $("#masquerSituation").val(); - - const element = document.getElementById("chevron-situation"); - - if(masquerSituation=="1"){ - $('#div_situation').hide(); - $("#masquerSituation").val("0"); - - - element.classList.remove("bi-chevron-up"); - element.classList.add("bi-chevron-down"); - - }else{ - $('#div_situation').show(); - $("#masquerSituation").val("1"); - - - element.classList.remove("bi-chevron-down"); - element.classList.add("bi-chevron-up"); - - afficher_situation_beneficiaire(); - } - -} - -function afficherMasquerMedicaments() -{ - masquerMedicament = $("#masquerMedicament").val(); - - const element = document.getElementById("chevron-medicament"); - - if(masquerMedicament=="1"){ - $('#div_medicament').hide(); - $("#masquerMedicament").val("0"); - - element.classList.remove("bi-chevron-up"); - element.classList.add("bi-chevron-down"); - - }else{ - $('#div_medicament').show(); - $("#masquerMedicament").val("1"); - - element.classList.remove("bi-chevron-down"); - element.classList.add("bi-chevron-up"); - - afficher_ordonnance_beneficiaire(); - } -} - -function afficher_situation_beneficiaire() -{ - donnees_retour = ''; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxsituationbeneficiaire/", - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_situation").html(donnees_retour); - } - }); -} - -function afficher_ordonnance_beneficiaire() -{ - numeroFeuilleMaladie = $("#numeroFeuilleMaladie").val(); - - donnees = "numeroFeuilleMaladie="+numeroFeuilleMaladie; - - donnees_retour = ''; - - $.ajax({ - url: $("#racineWeb").val()+"Ajaxordonnancebeneficiaire/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) { - donnees_retour = data; - }, - complete: function() { - $("#div_medicament").html(donnees_retour); - } - }); -} - -// Fonction globale pour tes notifications AJAX (Wahoo Effect) -function notification(type, message) { - const Toast = Swal.mixin({ - toast: true, - position: 'top-end', - showConfirmButton: false, - timer: 3000, - timerProgressBar: true, - didOpen: (toast) => { - toast.addEventListener('mouseenter', Swal.stopTimer) - toast.addEventListener('mouseleave', Swal.resumeTimer) - } - }); - - Toast.fire({ - icon: type, // 'success', 'error', 'warning', 'info' - title: message - }); -} - -function gerer_garant_defaut() -{ - codeGcAssureurDefaut=$("#codeGcAssureurDefaut").val(); - codeGcAssureur=$("#codeGcAssureur").val(); - - if(codeGcAssureurDefaut>" ") - { - $('#codeGcAssureur').val(codeGcAssureurDefaut).trigger('change'); - selectionTauxGarant(); - } -} - -function toggleSidebar() { - document.body.classList.toggle('sidebar-collapsed'); -} - -function init_revoquer_htagcarte(idHtagcarte) { - $("#idHtagcarte").val(idHtagcarte); - $("#div_revoquer_carte").modal({backdrop: 'static', keyboard: false, show: true }); - $("#div_revoquer_carte").modal("show"); -} - -function enregistrer_modif_parametres_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 enregistrer_modif_parametres_med() -{ - - idSocieteuser = $("#idSocieteuser").val(); - - envoismsactif = $("#s_envoismsactif").val(); - - smsAssure = $("#s_smsAssure").val(); - smsmParFacture = $("#s_smsmParFacture").val(); - - emailParFacture = $("#s_emailParFacture").val(); - copieSmsAssure = $("#s_copieSmsAssure").val(); - - seuilAlerteActif = $("#s_seuilAlerteActif").val(); - - montantTotalExamen = $("#s_montantTotalExamen").val(); - montantTotalMedicament = $("#s_montantTotalMedicament").val(); - - accorderMedecinSouscripteur = $("#s_accorderMedecinSouscripteur").val(); - delaisReponseMedecinSouscripteur = $("#s_delaisReponseMedecinSouscripteur").val(); - - tousActesSoumisOuinon = $("#s_tousActesSoumisOuinon").val(); - - envoismswhatsappactif = $("#s_envoismswhatsappactif").val(); - appliquerTarifBas = $("#s_appliquerTarifBas").val(); - nombreActeEntentePrealable = $("#s_nombreActeEntentePrealable").val(); - - donnees = 'idSocieteuser='+idSocieteuser; - donnees += '&envoismsactif='+envoismsactif; - donnees += '&smsAssure='+smsAssure+'&smsmParFacture='+smsmParFacture; - donnees += '&emailParFacture='+emailParFacture+'&copieSmsAssure='+copieSmsAssure; - donnees += '&seuilAlerteActif='+seuilAlerteActif; - donnees += '&montantTotalExamen='+montantTotalExamen; - donnees += '&montantTotalMedicament='+montantTotalMedicament; - - donnees += '&accorderMedecinSouscripteur='+accorderMedecinSouscripteur; - donnees += '&delaisReponseMedecinSouscripteur='+delaisReponseMedecinSouscripteur; - - donnees += '&tousActesSoumisOuinon='+tousActesSoumisOuinon; - - donnees += '&envoismswhatsappactif='+envoismswhatsappactif; - donnees += '&appliquerTarifBas='+appliquerTarifBas; - donnees += '&nombreActeEntentePrealable='+nombreActeEntentePrealable; - - v_msg="Confirmez-vous ces modifications ?"; - v_msgEng="Do you confirm these modifications?"; - - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaxparametresgeneraux/enregistrermodifmed/", - type : 'post', - data: donnees, - error: function(errorData) { - }, - success: function(data) - { - v_msg="Mise à jour effectuée avec succès!"; - v_msgEng="Update done successfully!"; - alert_ebene(v_msg, v_msgEng); - }, - complete: function() - { - afficher_autres_parametresgeneraux(); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - -/** - * Initialise DataTables avec options d'export et de tri - * @param {string} selector - Sélecteur CSS de la table - * @param {string} pageTitle - Titre pour les exports PDF/Excel - * @param {boolean|array} defaultOrder - Exemple: [1, 'desc'] ou false pour garder l'ordre serveur - */ -function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Données', defaultOrder = false) { - if ($(selector).length === 0) return; - - var hasGlobalSearch = $('#globalSearch').length > 0; - - if ($.fn.DataTable.isDataTable(selector)) { - $(selector).DataTable().destroy(); - } - - var domStructure = hasGlobalSearch - ? '<"d-flex align-items-center justify-content-start p-3 border-bottom"B>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>' - : '<"d-flex align-items-center justify-content-between p-3 border-bottom"Bf>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>'; - - // Détermination de l'option "order" : - // Si defaultOrder est explicitement false, on passe un tableau vide pour désactiver le tri auto - var orderConfig = (defaultOrder === false) ? [] : defaultOrder; - - var table = $(selector).DataTable({ - "dom": domStructure, - "order": orderConfig, // <--- AJOUT ICI - "buttons": [ - { - extend: 'excelHtml5', - text: 'Excel', - className: 'btn btn-success btn-sm fw-bold border-0 shadow-sm px-3' - }, - { - extend: 'pdfHtml5', - text: 'PDF', - className: 'btn btn-danger btn-sm fw-bold border-0 shadow-sm px-3 ms-2', - title: pageTitle, - orientation: 'landscape', - pageSize: 'A4' - } - ], - "language": { - "url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json", - "search": "Rechercher : ", - "searchPlaceholder": "Filtrer..." - }, - "pageLength": 10, - "autoWidth": false, - "drawCallback": function() { - if (!hasGlobalSearch) { - $('.dataTables_filter input').addClass('form-control form-control-sm d-inline-block ms-2 rounded-pill border-2 shadow-none').css('width', '200px'); - } - $('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1'); - } - }); - - if (hasGlobalSearch) { - $('#globalSearch').off('keyup').on('keyup', function() { - table.search(this.value).draw(); - }); - } - - return table; -} - - -function loadMessageSection(section) { - let url = ""; - let target = "#content-" + section; - let donnees = ""; - - // Détermination de l'ID du tableau et du titre pour l'export - let tableId = (section === 'Motifs') ? '#tableMotifs' : '#tableTextes'; - let pageTitle = (section === 'Motifs') ? 'Liste des Motifs de Dépassement' : 'Liste des Textes de Facturation'; - - if (section === 'Motifs') url = $("#racineWeb").val() + "Ajaxmotifdepassement/"; - if (section === 'Facturation') url = $("#racineWeb").val() + "Ajaxtextefacturationgarant/"; - - // Si déjà chargé, on ajuste simplement les colonnes pour le rendu visuel - if ($(target).find('table').length > 0) { - if ($.fn.DataTable.isDataTable(tableId)) { - $(tableId).DataTable().columns.adjust(); - } - return; - } - - $.ajax({ - url: url, - type: 'post', - data: donnees, - success: function(data) { - // 1. Injection du contenu HTML - $(target).html(data); - - // 2. Initialisation forcée avec un léger délai pour laisser le DOM respirer - setTimeout(function() { - initSmartTable(tableId, pageTitle, false); - }, 150); - }, - error: function() { - $(target).html('
Erreur de chargement
'); - } - }); } \ No newline at end of file