diff --git a/Js/fonctions.js b/Js/fonctions.js index 86f7e26..129eb5a 100644 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -5728,4 +5728,6559 @@ function prescription_medicament() { actVisible=$("#actVisible").val(); modeSaisieFacture=$("#modeSaisieFacture").val(); - saisirFactureDecompte=$("#saisirFactureDecompte").val(); \ No newline at end of file + saisirFactureDecompte=$("#saisirFactureDecompte").val(); + modeSaisieFeuille=$("#modeSaisieFeuille").val(); + + alert("saisirFactureDecompte="+saisirFactureDecompte+" ; modeSaisieFeuille="+modeSaisieFeuille); + if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (modeSaisieFacture="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Prescription/"); +} + +function livraison_pharmacie() +{ + actVisible=$("#actVisible").val(); + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonOrdonnance=$("#numeroBonOrdonnance_C").val(); + + if (numeroBonOrdonnance==0) + { + v_msg="Aucune prescription!"; + v_msgEng="No prescription!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Pharmacie/"); +} + +function prescription_optique() +{ + modeSaisieFacture=$("#modeSaisieFacture").val(); + saisirFactureDecompte=$("#saisirFactureDecompte").val(); + + modeSaisieFeuille=$("#modeSaisieFeuille").val(); + + if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (modeSaisieFacture=="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Optique/"); +} + +function attribution_chambre() +{ + window.location.assign($("#racineWeb" ).val()+"Chambre/"); +} + +function feuillemaladie() +{ + window.location.assign($("#racineWeb" ).val()+"Feuillemaladie/"); +} + +function feuillemaladie_ajax() +{ + $("#div_feuillemaladie").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfeuillemaladie/", + type: 'POST', + success: function(data) { + $("#div_feuillemaladie").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite_cso(); + } + }); +} + +function recherche() +{ + window.location.assign($("#racineWeb" ).val()+"Recherche/"); +} + +function requetes() +{ + codeProfil = $("#codeProfil_C" ).val(); + + if(codeProfil=="PHA") + { + consultationpha(); + return; + } + + if(codeProfil=="OPT") + { + consultationopt(); + return; + } + + if(codeProfil=="CSO") + { + consultationcso(); + return; + } + + if(codeProfil=="LAB") + { + consultationlab(); + return; + } + + if(codeProfil=="SEA") + { + consultationsea(); + return; + } +} + +// + +function lister_factures_pha_ben() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationbenpha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + +function lister_factures_opt_ben() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationbenopt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + +function afficher_facture_cons_pha_ben(idFacture, numeroBonOrdonnance, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonOrdonnance='+numeroBonOrdonnance+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturepha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_pha_ben(); + } + }); + } +} + +function afficher_facture_cons_pha(idFacture, numeroBonOrdonnance, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonOrdonnance='+numeroBonOrdonnance+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturepha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_pha(); + } + }); + } +} + +function consulter_facture_pha_ben() +{ + window.location.assign($("#racineWeb" ).val()+"Pharmacienconsben/"); +} + +function consulter_facture_pha() +{ + window.location.assign($("#racineWeb" ).val()+"Pharmaciencons/"); +} + +function afficher_facture_cons_opt_ben(idFacture, numeroBonOptique, numeroOptique, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonOptique='+numeroBonOptique+'&numeroOptique='+numeroOptique; + donnees += '&codePrestataireLivraison='+codePrestataireLivraison; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfactureopt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_opt_ben(); + } + }); + } +} + +function consulter_facture_opt_ben() +{ + window.location.assign($("#racineWeb" ).val()+"Opticienconsben/"); +} + +function consultations() +{ + window.location.assign($("#racineWeb" ).val()+"Consultations/"); +} + + +function listerdossiercons_pha() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + donnees_sav = donnees; + + $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationphaentete/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement").html(data); + }, + complete: function() { + } + }); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationpha/", + type : 'post', + data: donnees_sav, + error: function(errorData) { + }, + success: function(data) { + $("#detail_reglement").html(data); + $("#detail_reglement").css("padding-top", "0px"); + }, + complete: function() { + } + }); +} + +function listerdossiercons_opt() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + donnees_sav = donnees; + + $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationoptentete/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement").html(data); + }, + complete: function() { + } + }); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationopt/", + type : 'post', + data: donnees_sav, + error: function(errorData) { + }, + success: function(data) { + $("#detail_reglement").html(data); + $("#detail_reglement").css("padding-top", "0px"); + }, + complete: function() { + } + }); +} + +function afficher_facture_cons_opt(idFacture, numeroBonOptique, numeroOptique, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonOptique='+numeroBonOptique+'&numeroOptique='+numeroOptique; + donnees += '&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfactureopt/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_opt(); + } + }); + } +} + +function consulter_facture_opt() +{ + window.location.assign($("#racineWeb" ).val()+"Opticiencons/"); +} + +function liste_decompte() +{ + window.location.assign($("#racineWeb" ).val()+"Listedecomptes/"); +} + +function listerdecomptes() +{ + codeExercice = $("#codeExercice").val(); + // codeMois = $("#codeMois").val(); + codeEtatDecompte = $("#codeEtatDecompte").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; + } + + donnees = 'codeExercice='+codeExercice+'&codeEtatDecompte='+codeEtatDecompte; + + $("#div_detail").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistedecomptes/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_detail").html(data); + }, + complete: function() { + } + }); +} + +function consulterdecompte(idReglement) +{ + donnees = 'idReglement='+idReglement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdecompte/initierdecompte/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + afficher_decompte(); + } + }); +} + +function afficher_decompte() +{ + // $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); + + window.location.assign($("#racineWeb" ).val()+"Decomptecons/"); +} + + +function sortirdexclusionstandards() +{ + idBeneficiaire = $("#idBeneficiaire_C").val(); + idAdherent_C = $("#idAdherent_C" ).val(); + + + if (idBeneficiaire>"0") + { + afficher_beneficiaire_id(); + } + if (idAdherent_C>"0") + { + afficher_adherent_id(); + } + else + { + recherche(); + } +} + +function exclusionstandards() +{ + window.location.assign($("#racineWeb" ).val()+"Exclusionstandards/"); +} + + +function envoimaildivers(datamail) +{ + // var url_mail = "http://testprestation.medicare.rw/Cron/Ajaxenvoimaildivers.php?"+datamail; + + lienMail = $("#lienMail_C").val(); + var url_mail = lienMail+"/Cron/Ajaxenvoimaildivers.php?"+datamail; + + $.ajax({ + url : url_mail, + type : "GET", + error : function(errorData) { + }, + success :function(data) + { + } + }); +} + +function mettremailattente(datamail) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmailattente/ajouter/", + type: 'POST', + data: datamail, + success: function(data) + { + }, + error: function(errorData) + { + }, + complete: function() + { + } + }); +} + + +function preparesms(typeSms) +{ + envoismsactif = $("#envoismsactif").val(); + if(envoismsactif=="0") + { + return; + } + + codeLangueSociete = $("#codeLangueSociete").val(); + + p_destinataires = ""; + p_message = ""; + creation_message = "1"; + + if (typeSms=="demandederogation") + { + p_destinataires = $("#smsDerogation_C").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure=="1") + { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Request for exemption : " : "Demande derogation pour : "; + p_message += libelleDerogation; + + } + + if (typeSms=="ententeprealable") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure=="1") + { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement" : "Alerte : Accord prealable"; + } + + if (typeSms=="hospitalisation") + { + p_destinataires = $("#smsMedecinConseil_C").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure=="1") + { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Hospit. form No : " : "No Bon Hospit. : "; + p_message += numeroBon; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Hospitalization notification" : "Avis Hospitalisation"; + } + + if (typeSms=="autorisation") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure=="1") + { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert : Request authorization for excluded act" : "Alerte : Demande autorisation pour acte exclu"; + } + + if (typeSms=="commandebon") + { + p_destinataires = $("#smsGestionBon_C").val(); + + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Order of claims form " : "Commande de bons de PEC"; + p_message += "\n"; + p_message += "Quantit. : "+quantite+" "; + p_message += "\n"; + p_message += "Type : "+libelleBon+"."; + } + + if (typeSms=="ententeprealablepha") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + copieSmsPrestataireAssure = $("#copieSmsPrestataireAssure").val(); + if (copieSmsPrestataireAssure=="1") + { + p_destinataires = ajouter_destinataire_sms_adherent(p_destinataires); + } + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for pharmacy" : "Alerte : Accord prealable pharmacie"; + } + + if (typeSms=="accident") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert: Circulation accident" : "Alerte : Accident de la circulation"; + } + + if (typeSms=="ententeprealableopt") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for glasses" : "Alerte : Accord prealable verres"; + } + + if (typeSms=="ententeprealablemont") + { + p_destinataires = $("#smsAccordPrealable_C").val(); + + patient = $("#beneficiaire_C").val(); + numeroBeneficiaire = $("#numeroBeneficiaire_C" ).val(); + prestataire = $("#prestataire_C").val(); + + p_message = prestataire+" "; + p_message += "\n"; + p_message += "Patient : "+patient+" ("+numeroBeneficiaire+") "; + p_message += "\n"; + p_message += (codeLangueSociete=="en_US") ? "Alert: Prior agreement for optical frames" : "Alerte : Accord prealable monture"; + } + + envoyersms(p_destinataires, p_message, creation_message); +} + + +function liste_ententeprealable() +{ + window.location.assign($("#racineWeb" ).val()+"Listeententeprealables/"); +} + +function liste_exclusions() +{ + window.location.assign($("#racineWeb" ).val()+"Listeexclusions/"); +} + +function alerter_depassement_limite() +{ + fraisExcluLivre=$("#fraisExcluLivre").val(); + fraisExcluLivre = parseInt(fraisExcluLivre); + + if (fraisExcluLivre>0) + { + v_msg="Attention ! Dépassement de limite"; + v_msgEng="Warning ! Overflow"; + alert_ebene(v_msg, v_msgEng); + return; + } +} + +function alerter_depassement_limite_cso() +{ + fraisExclu=$("#fraisExclu").val(); + fraisExclu = parseInt(fraisExclu); + + if (fraisExclu>0) + { + v_msg="Attention ! Dépassement de limite"; + v_msgEng="Warning ! Overflow"; + alert_ebene(v_msg, v_msgEng); + return; + } +} + +function maj_fraisexclu_cso() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdepassementlimitefeuillemaladie/", + error: function(errorData) { + }, + success: function(data) { + $("#div_fraisExclu").html(data); + }, + complete: function() { + alerter_depassement_limite_cso(); + } + }); +} + +function consommables() +{ + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facturerConsommable=$("#facturerConsommable").val(); + if (facturerConsommable!="1") + { + v_msg="Consommables non facturés!"; + v_msgEng="Consumables not invoiced!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + ajoutConsommable = $("#ajoutConsommable").val(); + + if (ajoutConsommable!="1") + { + v_msg="Déjà inclu dans les actes ! Souhaitez-vous continuer?"; + v_msgEng="Already included in the acts ! Would you like to continue?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + window.location.assign($("#racineWeb" ).val()+"Consommables/"); + return; + } + else + { + return; + } + } + window.location.assign($("#racineWeb" ).val()+"Consommables/"); +} + + +function afficher_recherche_consommable() +{ + nomConsommable = $("#nomConsommable").val(); + + if (nomConsommable > " ") + { + donnees = "nomConsommable="+nomConsommable; + + $("#div_listeconsommable").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteconsommables/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listeconsommable").html(data); + } + }); + } +} + +function ajouter_consommable(idConsommable, libelleConsommable) +{ + if (libelleConsommable<=" ") + { + v_msg="Veuillez sélectionner un consommable!"; + v_msgEng="Please select a consumable!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg="Ajouter : "+libelleConsommable+"?"; + v_msgEng="Add : "+libelleConsommable+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'idConsommable='+idConsommable; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteconsommables/ajouterconsommable/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + maj_fraisexclu_cso(); + }, + complete: function() { + // afficher_consommable(); + feuillemaladie(); + } + }); + } +} + +function ajax_maj_qte_consommable(idConsommable, quantite, controle) +{ + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idConsommable='+idConsommable+"&quantite="+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteconsommables/majquantite/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_consommable(); + } + }); + } +} + +function ctrlkeypressconsommable(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_recherche_consommable(); + } +} + +function afficher_consommable() +{ + $("#div_listeconsommable").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxafficherconsommables/", + error: function(errorData) { + }, + success: function(data) { + $("#div_listeconsommable").html(data); + $("#libelleconsommable").focus(); + } + }); +} + +function changer_type_bon() +{ + $("#nbligne_info").val("0"); + afficherbon_vide(); +} + +function afficher_pop_recherche_medecin() +{ + + noOrdreMedecin = $("#noOrdreMedecin").val(); + nomsearch = $("#nomsearch").val(); + + if(noOrdreMedecin+nomsearch<=" ") + return; + + donnees = "valid=1&noOrdreMedecin="+noOrdreMedecin+"&nomsearch="+nomsearch; + + $("#div_listemedecins").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemedecins/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listemedecins").html(data); + }, + complete: function() { + } + }); +} + + + +function afficher_pop_recherche_actes_possibles() +{ + libelleActeSearch = $("#libelleActeSearch").val(); + + if(libelleActeSearch<=" ") + { + return; + } + + donnees = "valid=1&libelleActeSearch="+libelleActeSearch; + + $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteactespossibles/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_actes_possibles").html(data); + } + }); +} + + +function ctrlkeypress_medecin(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_medecin(); + } +} + + +function ctrlkeypress_actes_cons(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_actes_cons(); + } +} + + +function ctrlkeypress_actes_possibles(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_actes_possibles(); + } +} + + +function selectionner_medecin(codeMedecin, nomMedecin, noOrdreMedecin) +{ + if(noOrdreMedecin+codeMedecin<=" ") + return; + + v_msg="Confirmez-vous ce Médecin : "+nomMedecin+"?"; + v_msgEng="Do you confirm this Doctor : "+nomMedecin+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + $("#codeMedecin").val(codeMedecin); + $("#nomMedecin").html(nomMedecin+" ( "+noOrdreMedecin+" )"); + + if(codeMedecin=="ZZZZ") + { + $("#medecinManquant").readable(); + $("#codeSpecialiteManuel").enable(); + + } + else + { + $("#medecinManquant").unreadable(); + $("#codeSpecialiteManuel").disable(); + } + + $("#close_pop").click(); + } +} + +function maj_prix_actemedical() +{ + prixTarif = $("#prixTarif").val(); + prixNew = $("#prixNew").val(); + + if(prixNew==0 || parseFloat(prixNew)>parseFloat(prixTarif)) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixNew").focus(); + + return; + } + + div_quantite = $("#quantite"); + quantite = div_quantite.val(); + + if(quantite=="") + { + quantite = "0"; + } + + div_quantite.val(quantite); + + quantite = parseInt(quantite); + + if(quantite==0) + { + div_quantite.focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter quantity!"; + alert_ebene(v_msg, v_msgEng); + + $("#quantite").focus(); + + return; + } + + ententePrealable = $("#ententePrealable").val(); + acteExclu = $("#acteExclu").val(); + acteChirurgie = $("#acteChirurgie").val(); + + donnees = 'prixNew='+prixNew+'&quantite='+quantite+'&prixTarif='+prixTarif; + donnees += '&ententePrealable='+ententePrealable+'&acteExclu='+acteExclu+'&acteChirurgie='+acteChirurgie; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmajprixactemed/", + type : 'post', + data : donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosacte").html(data); + }, + complete: function() { + $("#btn_close_pop_tarif").click(); + } + }); +} + +function afficher_pop_tarif() +{ + prixActe = $("#prixActe").val(); + $("#prixNew").val(prixActe); + $("#btn_pop_tarif").click(); +} + +function demanderaccordacteexclu() +{ + v_msg="Acte non couvert!"; + v_msgEng="Not covered!"; + alert_ebene(v_msg, v_msgEng); + $("#codeActe").focus(); + return; + +} + +function demanderaccordchambreexclu() +{ + + v_msg="Attention! Chambre exclue. Demander un accord?"; + v_msgEng="Warning! Non covered room. Request Agreement?"; + alert_ebene(v_msg, v_msgEng); + return; +} + +function substituer_medicament(idMedicament) +{ + v_msg="Substituer ce médicament?"; + v_msgEng="Substitute this drug?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + + donnees = 'idMedicament='+idMedicament; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxsubstitutionmedicament/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_substitution").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); + } +} + + +function annuler_substitution_medicament(idMedicament) +{ + v_msg="Annuler cette substitution?"; + v_msgEng="Cancel this substitution?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'idMedicament='+idMedicament; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpharmacien/annulersubstitutionmedicament/", + type: 'POST', + data: donnees, + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); + } +} + + +function enregistrersubstituion_medicament() +{ + idMedicament = $("#idMedicament").val(); + prixTarif = $("#prixTarif").val(); + prixSubstitut = $("#prixSubstitut").val(); + + if(prixSubstitut==0 || parseFloat(prixSubstitut)>parseFloat(prixTarif)) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette substitution ?"; + v_msgEng="Do you confirm this substitution?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'idMedicament='+idMedicament+'&prixSubstitut='+prixSubstitut; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrersubstitutionmedicament/", + type: 'POST', + data: donnees, + success: function(data) { + $("#btn_close_pop").click(); + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); + } +} + +function selectionner_acte_cons(codeFamilleActe, codeActe, familleActe, libelleActe) +{ + if(libelleActe<=" ") + return; + + $("#codeFamilleActe").val(codeFamilleActe); + ajaxactespossibles(); + + v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; + v_msgEng="Do you confirm this act : "+libelleActe+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + $("#codeActe").val(codeActe); + ajaxprixacte(); + + $("#libelleActe").val(libelleActe); + $("#close_pop_acte").click(); + } +} + +function afficher_pop_recherche_actes_cons() +{ + libelleActeSearch = $("#libelleActeSearch").val(); + + if(libelleActeSearch<=" ") + { + return; + } + + donnees = "valid=1&libelleActeSearch="+libelleActeSearch; + + $("#div_liste_actes_cons").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteactescons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_actes_cons").html(data); + } + }); +} + +function selectionner_acte_possibles(codeFamilleActe, codeActe, familleActe, libelleActe) +{ + if(libelleActe<=" ") + return; + + $("#codeFamilleActe").val(codeFamilleActe); + // ajaxactespossibles(); + ajaxactespossibles_med(); + + v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; + v_msgEng="Do you confirm this act : "+libelleActe+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + $("#codeActe").val(codeActe); + ajaxprixactemed(); + + $("#libelleActe").val(libelleActe); + $("#close_pop_acte").click(); + } +} + +function ctrlkeypress_pha(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_medicament_pha(); + } +} + +function afficher_pop_recherche_medicament_pha() +{ + nomsearch = $("#nomsearch").val(); + + if (nomsearch > " ") + { + donnees = "valid=1&nomsearch="+nomsearch; + + $("#div_listemedicament").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemedicamentspha/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listemedicament").html(data); + } + }); + } +} + + +function prescrire_medicament_pha() +{ +// Ajout à la prescription + codePrestatairePrescription = $("#codePrestatairePrescription").val(); + codeMedicament = $("#codeMedicament_pop").val(); + + + libelleMedicament = $("#libelleMedicament_pop").val(); + + if (codeMedicament<=" ") + { + v_msg="Veuillez sélectionner un médicament!"; + v_msgEng="Please select a medicine/drug!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = 'codeMedicament='+codeMedicament; + donnees += '&codePrestatairePrescription=' + codePrestatairePrescription; + + // alert(donnees); + // return; + + v_msg="Prescrire : "+libelleMedicament+"?"; + v_msgEng="Prescribe : "+libelleMedicament+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpharmacien/ajoutermedicamentprescription/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_medicament").click(); + $("#livraison").html(data); + raffraichier_detail_prescription(); + }, + complete: function() { + alerter_depassement_limite(); + } + }); + } +// Fin Ajout à l aprescription +} + +function raffraichier_detail_prescription() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailordonnance/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#ordonnance").html(data); + }, + complete: function() { + } + }); +} + +function actualiser_pharmacien() +{ + /* modif du 15/11/2018 + // window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); + actualiser_saisie_pharmacien(); + */ + + actVisible=$("#actVisible").val(); + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Pharmacien/"); +} + +function ajax_maj_qte_medicament_pha(idMedicament, quantite, controle) +{ + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idMedicament='+idMedicament+"&quantite="+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majquantitepha/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#medicaments").html(data); + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + controle.focus(); + } + }); + } +} + +function prescription_examen() +{ + actVisible=$("#actVisible").val(); + + modeSaisieFeuille=$("#modeSaisieFeuille").val(); + + if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (actVisible!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Prescriptionexamen/"); +} + +function valider_presciption_examens() +{ + bonCaduc=$("#bonCaduc").val(); + // alert("bonCaduc => "+bonCaduc); + // return; + + if (bonCaduc==1) + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbExamens=$("#nbExamens").val(); + nbExamens = parseInt(nbExamens); + + /* On peut saisir juste le No de bon + sans saisir le détail de la prescription + + if (nbExamens<1) + { + v_msg="Rien à valider!"; + v_msgEng="Nothing to save!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + numeroBonExamen=$("#numeroBonExamen").val(); + if (numeroBonExamen<=0) + { + v_msg="Pas de prescription!"; + v_msgEng="No prescription!"; + alert_ebene(v_msg, v_msgEng); + + // feuillemaladie(); + return; + } + + v_msg="Confirmez-vous cette presciption ?"; + v_msgEng="Do you confirm this prescription?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + feuillemaladie(); + /* + $.ajax({ + // url: $("#racineWeb").val()+"Ajaxenregistreroptique/videroptiquetemp/", + url: $("#racineWeb").val()+"Ajaxenregistrerexamen/viderexamentemp/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + feuillemaladie(); + }, + complete: function() { + } + }); + */ + } +} + +function ajaxinfosbonprescriptionexamen() +{ + bonCaduc=$("#bonCaduc").val(); + // alert("bonCaduc => "+bonCaduc); + // return; + + if (bonCaduc==1) + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + + codeGestionBon = $("#codeGestionBon").val(); + + if (codeGestionBon!="0") + { + v_msg="Option non disponible!"; + v_msgEng="Option not available!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + numeroBonExamen = $("#numeroBonExamen").val(); + numeroBonExamen = parseInt(numeroBonExamen); + if (numeroBonExamen>0) + { + v_msg="Déjà effectué!"; + v_msgEng="Already done!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeMedecin = $("#codeMedecin").val(); + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médecin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").val(""); + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + // $("#codeMedecin").focus(); + $("#nomMedecin").focus(); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonexamen/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function supprimer_examen(idExamen) +{ + v_msg="Confirmez-vous la suppression de cet examen?"; + v_msgEng="Do you confirm the removal of this exam?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'idExamen='+idExamen; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/supprimer/", + type: 'POST', + data: donnees, + success: function(data) { + $("#examens").html(data); + }, + error: function(data) { + }, + complete: function() { + prescription_examen(); + } + }); + } +} + +function enregistrerprescriptionexamen() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsOrd = $("#nbBonsOrd").val(); + + numeroBonSave = $("#numeroBonSave").val(); + + codeMedecin = $("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médecin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + $("#nomMedecin").focus(); + return; + } + + if (codeGestionBon=="0") + { + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of prescription?"; + } + else + { + numeroBon = "-1"; + v_msg="Confirmez-vous cette prescription?"; + v_msgEng="Do you confirm this prescription?"; + } + + /* + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of prescription?"; + */ + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin; + + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees += '&codeGestionBon='+codeGestionBon; + + $("#btn_enreg").disable(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionexamen/enregistrerprescriptionexamen/", + type : 'post', + data: donnees, + error: function(errorData) { + // $("#msgErreur").html(errorData); + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + v_msg="Prescription enregistrée avec succès"; + v_msgEng="Saved successfully!"; + alert_ebene(v_msg, v_msgEng); + + prescription_examen(); + } + }); + } +} + +function ctrlkeypress_examens_possibles(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_examens_possibles(); + } +} + +function afficher_pop_recherche_examens_possibles() +{ + libelleActeSearch = $("#libelleActeSearch").val(); + + if(libelleActeSearch<=" ") + { + return; + } + + donnees = "valid=1&libelleActeSearch="+libelleActeSearch; + + $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteexamenspossibles/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_actes_possibles").html(data); + } + }); +} + +function ajouter_examen_possible(codeActe, libelleActe, acteExclu, ententePrealable) +{ + typeSms="ententeprealable"; + + if(libelleActeSearch<=" ") + { + return; + } + + if(acteExclu==1) + { + v_msg="Acte non couvert!"; + v_msgEng="Not covered!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; + v_msgEng="Do you confirm this act : "+libelleActe+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable; + + if (ententePrealable==1) + { + numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); + donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/ajouterexamen/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + if(ententePrealable==1) + { + preparesms(typeSms); + + v_msg="Demande accord prealable envoyée!"; + v_msgEng="Request prior agreement sent!"; + alert_ebene(v_msg, v_msgEng); + } + + // prescription_examen(); + + }, + complete: function() { + if(ententePrealable==1) + { + mettremailattente(donnees_sav); + } + + prescription_examen(); + + } + }); + } +} + +function ajax_maj_qte_examen(idExamen, quantite, controle) +{ + quantite=quantite.replace(",","."); + controle.value=quantite; + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idExamen='+idExamen+"&quantite="+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailprescriptionexamen/majquantite/", + type: 'POST', + data: donnees, + success: function(data) { + $("#examens").html(data); + }, + error: function(data) { + }, + complete: function() { + controle.focus(); + } + }); + } +} + +function examensmedicaux() +{ + actVisible=$("#actVisible").val(); + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroExamen=$("#numeroExamen_C").val(); + + if (numeroExamen==0) + { + v_msg="Aucun examen prescrit!"; + v_msgEng="No prescribed exam!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Examensmedicaux/"); +} + + +function valider_examen_cso() +{ + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + nbLivre=$("#nbLivre").val(); + nbLivre = parseInt(nbLivre); + + if (nbLivre<1) + { + v_msg="Rien à enregitrer!"; + v_msgEng="Nothing to save!"; + + alert_ebene(v_msg, v_msgEng); + feuillemaladie(); + } + else + { + v_msg="Confirmez-vous ces examens?"; + v_msgEng="Do you confirm these exams?"; + } + if(confirm_ebene(v_msg, v_msgEng)) + { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailexamen/enregistrerexamen/", + type: 'POST', + success: function(data) { + maj_fraisexclu_cso(); + }, + error: function(data) { + }, + complete: function() { + feuillemaladie(); + } + }); + } +} + +function ajouterexamen_tous() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailexamen/ajouterexamentous/", + type: 'POST', + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite_cso(); + } + }); +} + +function ajouterexamen(idExamen, ententePrealable, codeActe) +{ + donnees = 'idExamen='+idExamen+'&codeActe='+codeActe+'&ententePrealable='+ententePrealable; + + typeSms="ententeprealable"; + + if (ententePrealable==9) + { + v_msg="Acte refusé!"; + v_msgEng="Act refused!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (ententePrealable==2) + { + numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); + donnees_sav = donnees+'&codeActe='+codeActe+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailexamen/ajouterexamen/", + type: 'POST', + data: donnees, + success: function(data) { + $("#livraison").html(data); + + if(ententePrealable=="2") + { + preparesms(typeSms); + + v_msg="Demande accord prealable envoyée!"; + v_msgEng="Request prior agreement sent!"; + alert_ebene(v_msg, v_msgEng); + } + }, + error: function(data) { + }, + complete: function() { + if(ententePrealable=="2") + { + mettremailattente(donnees_sav); + } + } + }); +} + +function retirerexamen_tous() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailexamen/retirerexamentous/", + type: 'POST', + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function retirerexamen(idExamen) +{ + donnees = 'idExamen='+idExamen; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailexamen/retirerexamen/", + type: 'POST', + data: donnees, + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function consulter_limite_avant_facturation_cons() +{ + /* + 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()+"Plafondavantfacturecons/"); + */ +} + +function consulter_limite_avant_facturation() +{ + /* + 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()+"Plafondavantfacture/"); + */ +} + + + +function consulter_limite_avant_facturation_cons_ben() +{ + /* + 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()+"Plafondavantfactureconsben/"); + */ +} + +function consulter_limite_avant_facturation_pha() +{ + /* + 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()+"Plafondavantfacturepha/"); + */ +} + +function consulter_limite_avant_facturation_pha_cons() +{ + /* + 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()+"Plafondavantfacturephacons/"); + */ +} + +function consulter_limite_avant_facturation_pha_cons_ben() +{ + /* + 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()+"Plafondavantfacturephaconsben/"); + */ +} + +function actualiser_opticien() +{ + window.location.assign($("#racineWeb" ).val()+"Opticien/"); +} + +function reinitialiser_opticien() +{ + window.location.assign($("#racineWeb" ).val()+"Opticien/0"); +} + + +function consulter_limite_avant_facturation_opt() +{ + /* + 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()+"Plafondavantfactureopt/"); + */ +} + +function consulter_limite_avant_facturation_opt_cons() +{ + /* + 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()+"Plafondavantfactureoptcons/"); + */ +} + +function consulter_limite_avant_facturation_opt_cons_ben() +{ + /* + 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()+"Plafondavantfactureoptconsben/"); + */ +} + +function ajouterexamen_lab_tous() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamentous/", + type: 'POST', + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); +} + +function ajouterexamen_lab(idExamen) +{ + donnees = 'idExamen='+idExamen; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamen/", + type: 'POST', + data: donnees, + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); +} + + +function retirerexamen_lab(idExamen) +{ + donnees = 'idExamen='+idExamen; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/retirerexamen/", + type: 'POST', + data: donnees, + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); +} + +function ctrlkeypress_examens_possibles_lab(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_examens_possibles_lab(); + } +} + +function afficher_pop_recherche_examens_possibles_lab() +{ + libelleActeSearch = $("#libelleActeSearch").val(); + + if(libelleActeSearch<=" ") + { + return; + } + + donnees = "valid=1&libelleActeSearch="+libelleActeSearch; + + $("#div_liste_actes_possibles").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteexamenspossibleslab/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_liste_actes_possibles").html(data); + } + }); +} + +function consulter_limite_avant_facturation_lab() +{ + /* + 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()+"Plafondavantfacturelab/"); + */ +} + +function actualiser_laboratoire() +{ + window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); +} + +function valider_examen_lab() +{ + actVisible=$("#actVisible").val(); + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroExamen=$("#numeroExamen_C").val(); + + if (numeroExamen<="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + facture = parseInt(facture); + + if (facture>0) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbLivre=$("#nbLivre").val(); + nbLivre = parseInt(nbLivre); + + if (facture==0 && nbLivre<1) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ces actes?"; + v_msgEng="Do you confirm those acts?"; + // alert_ebene(v_msg, v_msgEng); + + if(confirm_ebene(v_msg, v_msgEng)) + { + user_id_0 = $("#user_id_C").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + derogationFingerFacturation=$("#derogationFingerFacturation").val(); + if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_lab(user_id_0); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_lab(user_id_0); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id =$("#user_id_C").val(); + finger_id =$("#finger_id_C").val(); + + $("#facturation").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; + + load("flexcode/user.php?"+data); + } + } +} + +function retirerexamen_lab_tous() +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/retirerexamentous/", + type: 'POST', + success: function(data) { + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + // actualiser_pharmacien(); + } + }); +} + +function facturer_lab(user_id) +{ + facture=$("#facture").val(); + facture = parseInt(facture); + + if (facture>0) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbLivre=$("#nbLivre").val(); + nbLivre = parseInt(nbLivre); + + if (facture==0 && nbLivre<1) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + prixActe = $("#prixActe").val(); + if (prixActe==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + montantTm = $("#montantTm").val(); + cout = $("#cout").val(); + + montantTm_f = $("#montantTm_f").val(); + cout_f = $("#cout_f").val(); + + donnees = 'prixActe='+prixActe; + donnees += '&montantTm='+montantTm; + donnees += '&cout='+cout; + + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + codePrestataire = $("#codePrestataire_C").val(); + + donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=maillabo'; + + typeSms = "facturer_lab"; + + donnees_retour =""; + + user_id_0 = $("#user_id_C").val(); + user_id_substitut = "0"; + if (user_id_0!=user_id) + { + user_id_substitut = user_id; + } + + donnees_substitut = 'user_id_substitut='+user_id_substitut; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/enregistrerlaboratoire/", + type: 'POST', + data: donnees_substitut, + success: function(data) { + preparesms_adherent(typeSms); + }, + error: function(data) { + }, + complete: function() { + preparemail_adherent(typeSms); + + v_msg="Facturation effectuée avec succès!"; + v_msgEng="Billing done successfully!"; + alert_ebene(v_msg, v_msgEng); + + window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); + } + }); +} + +function prescrire_examen_lab(codeActe, libelleActe, acteExclu, ententePrealable) +{ + typeSms="ententeprealable"; + + if(libelleActeSearch<=" ") + { + return; + } + + if(acteExclu==1) + { + v_msg="Acte non couvert!"; + v_msgEng="Not covered!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + v_msg="Confirmez-vous cet acte : "+libelleActe+"?"; + v_msgEng="Do you confirm this act : "+libelleActe+"?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'codeActe='+codeActe+'&ententePrealable='+ententePrealable; + + if (ententePrealable==1) + { + numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); + donnees_sav = donnees+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; + } + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/ajouterexamenprescription/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_acte").click(); + $("#livraison").html(data); + + if(ententePrealable==1) + { + preparesms(typeSms); + + v_msg="Demande accord prealable envoyée!"; + v_msgEng="Request prior agreement sent!"; + alert_ebene(v_msg, v_msgEng); + } + }, + complete: function() { + if(ententePrealable==1) + { + mettremailattente(donnees_sav); + } + alerter_depassement_limite(); + } + }); + } +} + +function enregistrer_nv_consommables() +{ + libelleconsommable = $("#libelleconsommable").val(); + + if (libelleconsommable<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter tyhe name!"; + alert_ebene(v_msg, v_msgEng); + $("#libelleconsommable").focus(); + return; + } + + quantiteconsommable=$("#quantiteconsommable").val(); + quantiteconsommable=quantiteconsommable.replace(",","."); + $("#quantiteconsommable").val(quantiteconsommable); + + if(isNaN(quantiteconsommable)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#quantiteconsommable").val("0"); + $("#quantiteconsommable").focus(); + return; + } + + if(quantiteconsommable==0) + { + $("#quantiteconsommable").focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + prixconsommable=$("#prixconsommable").val(); + prixconsommable=prixconsommable.replace(",","."); + $("#prixconsommable").val(prixconsommable); + + if(isNaN(prixconsommable)) + { + v_msg="Valeur numérique exigée!"; + v_msgEng="Numeric value required!"; + alert_ebene(v_msg, v_msgEng); + + $("#prixconsommable").val("0"); + $("#prixconsommable").focus(); + return; + } + + if(prixconsommable==0) + { + $("#prixconsommable").focus(); + v_msg="Veuillez saisir le prix!"; + v_msgEng="Please enter the price!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + donnees = 'libelleconsommable='+libelleconsommable+'&prixconsommable='+prixconsommable+'&quantiteconsommable='+quantiteconsommable; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteconsommables/creerconsommable/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_consommable(); + } + }); +} + +function ajax_maj_prix_consommable(idConsommable, valeurActe, controle) +{ + valeurActe=valeurActe.replace(",","."); + controle.value=valeurActe; + + if(controle_numerique(controle)) + { + if(valeurActe==0) + { + controle.focus(); + v_msg="Veuillez saisir le prix!"; + v_msgEng="Please enter the price!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idConsommable='+idConsommable+"&valeurActe="+valeurActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlisteconsommables/majprix/", + type: 'POST', + data: donnees, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + error: function(data) { + }, + complete: function() { + afficher_consommable(); + } + }); + } +} + +function remplacer_feuillemaladie() +{ + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Remplacerfeuille/"); +} + +function ajaxinfosremplacerbonconsultation() +{ + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosremplacerbonconsultation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function enregistrerremplacementconsultation() +{ + numeroBonSave = $("#numeroBonSave").val(); + + motifremplacement = $("#motifremplacement").val(); + + if (motifremplacement<=" ") + { + v_msg="Veuillez saisir le otif du remplacement!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + + $("#motifremplacement").focus(); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + OldnumeroBon = $("#OldnumeroBon").val(); + + donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroBon='+numeroBon+'&OldnumeroBon='+OldnumeroBon+'&motifremplacement='+motifremplacement; + + // donnees += '&dateSurvenance='+dateSurvenance+'&observations='+observations+'&prixActe='+prixActe; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosremplacerbonconsultation/enregistrerremplacementconsultation/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + v_msg="Feuille remplacée avec succès!"; + v_msgEng="Replaced successfully!"; + alert_ebene(v_msg, v_msgEng); + + feuillemaladie(); + } + }); + } +} + +function remplacer_ordonnance() +{ + bonCaduc=$("#bonCaduc").val(); + if (bonCaduc==1) + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture!=1) + { + v_msg="Pas encore facturé, vous pouvez modifier l\'ordonnance!"; + v_msgEng="Not yet charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonOrdonnance = $("#numeroBonOrdonnance").val(); + numeroBonOrdonnance = parseInt(numeroBonOrdonnance); + + /* + if (numeroBonOrdonnance<=0) + { + v_msg="Pas de prescription!"; + v_msgEng="No prescription!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + codeGestionBon = $("#codeGestionBon").val(); + + if (codeGestionBon!="0") + { + v_msg="Option non disponible!"; + v_msgEng="Option not available!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + fiche_remplacer_ordonnance(); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id =$("#user_id_C").val(); + finger_id =$("#finger_id_C").val(); + + $("#remplacerordonnance").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&remplacerordonnance=1"; + + load("flexcode/user.php?"+data); + } +} + +function fiche_remplacer_ordonnance() +{ + window.location.assign($("#racineWeb" ).val()+"Remplacerordonnance/"); +} + +function ajaxinfosremplacerordonnance() +{ + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosremplacerordonnence/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function enregistrerremplacementordonnance() +{ + numeroBonSave = $("#numeroBonSave").val(); + + motifremplacement = $("#motifremplacement").val(); + + if (motifremplacement<=" ") + { + v_msg="Veuillez saisir le otif du remplacement!"; + v_msgEng="Please enter the reason!"; + alert_ebene(v_msg, v_msgEng); + $("#motifremplacement").focus(); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + OldnumeroBon = $("#OldnumeroBon").val(); + + donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroBon='+numeroBon+'&OldnumeroBon='+OldnumeroBon+'&motifremplacement='+motifremplacement; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosremplacerordonnence/enregistrerremplacementordonnance/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + }, + complete: function() { + v_msg="Ordonnance remplacée avec succès!"; + v_msgEng="Replaced successfully!"; + alert_ebene(v_msg, v_msgEng); + + prescription_medicament(); + } + }); + } +} + +function afficher_laboratoire_cso() +{ + window.location.assign($("#racineWeb" ).val()+"Laboratoirecso/"); +} + + +function afficher_seance_cso() +{ + window.location.assign($("#racineWeb" ).val()+"Kinecso/"); +} + +function consulter_limite_avant_facturation_lab_cso() +{ + /* + 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()+"Plafondavantfacturelabcso/"); + */ +} + +function rechercherbonexamen_lab() +{ + numeroBonExamen=$("#numeroBonExamen").val(); + + if (numeroBonExamen>" ") + { + chercher_ordonnance_lab(numeroBonExamen); + } +} + +function rechercherbonexamen_lab_cso() +{ + numeroBonExamen=$("#numeroBonExamen").val(); + + if (numeroBonExamen>" ") + { + chercher_ordonnance_lab_cso(numeroBonExamen); + } +} + +function chercher_ordonnance_lab_cso(numeroBonExamen) +{ + donnees = 'numeroBonExamen='+numeroBonExamen; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxchangerordonnancelab/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_laboratoire_cso(); + } + }); +} + +function valider_examen_lab_cso() +{ + actVisible=$("#actVisible").val(); + + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroExamen=$("#numeroExamen_C").val(); + + if (numeroExamen<="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + /* + facture=$("#facture").val(); + facture = parseInt(facture); + + if (facture>0) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + nbLivre=$("#nbLivre").val(); + nbLivre = parseInt(nbLivre); + + // alert("nbLivre => "+nbLivre); + // return; + + // if (facture==0 && nbLivre<1) + if (nbLivre<1) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ces actes?"; + v_msgEng="Do you confirm those acts?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + user_id_0 = $("#user_id_C").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + derogationFingerFacturation=$("#derogationFingerFacturation").val(); + if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_lab_cso(user_id_0); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_lab_cso(user_id_0); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id = $("#user_id_C").val(); + finger_id = $("#finger_id_C").val(); + + $("#facturation").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; + + load("flexcode/user.php?"+data); + } + } +} + +function facturer_lab_cso(user_id) +{ + facture=$("#facture").val(); + facture = parseInt(facture); + + if (facture>0) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + nbLivre=$("#nbLivre").val(); + nbLivre = parseInt(nbLivre); + + if (facture==0 && nbLivre<1) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + prixActe = $("#prixActe").val(); + if (prixActe==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + montantTm = $("#montantTm").val(); + cout = $("#cout").val(); + + montantTm_f = $("#montantTm_f").val(); + cout_f = $("#cout_f").val(); + + donnees = 'prixActe='+prixActe; + donnees += '&montantTm='+montantTm; + donnees += '&cout='+cout; + + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + codePrestataire = $("#codePrestataire_C").val(); + + donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=maillabo'; + + typeSms = "facturer_lab"; + + user_id_0 = $("#user_id_C").val(); + user_id_substitut = "0"; + if (user_id_0!=user_id) + { + user_id_substitut = user_id; + } + + donnees_substitut = 'user_id_substitut='+user_id_substitut; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetaillaboratoire/enregistrerlaboratoire/", + type: 'POST', + data: donnees_substitut, + success: function(data) { + preparesms_adherent(typeSms); + }, + error: function(data) { + }, + complete: function() { + preparemail_adherent(typeSms); + + v_msg="Facturation effectuée avec succès!"; + v_msgEng="Billing done successfully!"; + alert_ebene(v_msg, v_msgEng); + + afficher_laboratoire_cso(); + + } + }); +} + +function prescription_seance() +{ + actVisible=$("#actVisible").val(); + + modeSaisieFeuille=$("#modeSaisieFeuille").val(); + + if (modeSaisieFeuille=="1" && saisirFactureDecompte!="1") + { + v_msg="Non autorisé!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + window.location.assign($("#racineWeb" ).val()+"Prescriptionseance/"); +} + + +function seances() +{ + actVisible=$("#actVisible").val(); + + // if (actVisible!="1" && modeSaisieFacture!="1") + if (actVisible!="1") + { + v_msg="Non autorisée!"; + v_msgEng="Not allowed!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroPrescriptionKine=$("#numeroPrescriptionKine_C").val(); + + if (numeroPrescriptionKine==0) + { + v_msg="Aucune séance prescrite!"; + v_msgEng="No prescribed session!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + window.location.assign($("#racineWeb" ).val()+"Seances/"); +} + +function ajaxinfosbonprescriptionseance() +{ + bonCaduc=$("#bonCaduc").val(); + // alert("bonCaduc => "+bonCaduc); + // return; + + if (bonCaduc==1) + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + + if (codeGestionBon!="0") + { + v_msg="Option non disponible!"; + v_msgEng="Option not available!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + numeroBonKine = $("#numeroBonKine").val(); + numeroBonKine = parseInt(numeroBonKine); + if (numeroBonKine>0) + { + v_msg="Déjà effectué!"; + v_msgEng="Already done!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeMedecin = $("#codeMedecin").val(); + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médecin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").val(""); + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#nomMedecin").focus(); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonseance/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function enregistrerprescriptionseance() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsOrd = $("#nbBonsOrd").val(); + + numeroBonSave = $("#numeroBonSave").val(); + + codeMedecin = $("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médecin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + // $("#codeMedecin").focus(); + $("#nomMedecin").focus(); + return; + } + + if (codeGestionBon=="0") + { + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of prescription?"; + } + else + { + numeroBon = "-1"; + v_msg="Confirmez-vous cette prescription?"; + v_msgEng="Do you confirm this prescription?"; + } + + /* + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of prescription?"; + */ + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = 'numeroBon='+numeroBon+'&codeMedecin='+codeMedecin; + + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees += '&codeGestionBon='+codeGestionBon; + + $("#btn_enreg").disable(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/enregistrerprescriptionseance/", + type : 'post', + data: donnees, + error: function(errorData) { + // $("#msgErreur").html(errorData); + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + v_msg="Prescription enregistrée avec succès"; + v_msgEng="Saved successfully!"; + alert_ebene(v_msg, v_msgEng); + + prescription_seance(); + } + }); + } +} + +function modifierprescriptionseance() +{ + acteExclu = $("#acteExclu").val(); + ententePrealable = $("#ententePrealableSea").val(); + autorisation = "0"; + + if(acteExclu==1) + { + v_msg="Acte non couvert!"; + v_msgEng="Not covered!"; + alert_ebene(v_msg, v_msgEng); + $("#codeActe").focus(); + return; + } + + codeMedecin = $("#codeMedecin").val(); + + if (codeMedecin<=" ") + { + v_msg="Veuillez sélectionner un médecin!"; + v_msgEng="Please select a doctor!"; + alert_ebene(v_msg, v_msgEng); + // $("#codeMedecin").focus(); + $("#nomMedecin").focus(); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + $("#numeroBon").focus(); + return; + } + + codeActePrescription = $("#codeActe").val(); + + if (codeActePrescription<=" ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + // $("#codeActePrescription").focus(); + return; + } + + quantite =$("#quantite").val(); + + quantite = parseInt(quantite); + + if(quantite<1) + { + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + // $("#quantite").focus(); + return; + } + + div_prix = $("#prixActe"); + prixActe = div_prix.val(); + + /* + if(prixActe==0) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + */ + + v_msg="Confirmez-vous cette presciption ?"; + v_msgEng="Do you confirm this prescription?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + if(ententePrealable==1) + { + ententePrealable = "2"; + } + + montantTm =$("#montantTm").val(); + montantArembourser =$("#aRembourser").val(); + fraisReel =$("#totalActe").val(); + + donnees = 'codeActePrescription='+codeActePrescription +'&quantite='+quantite +'&prixActe='+prixActe; + donnees += '&montantTm='+montantTm +'&montantArembourser='+montantArembourser +'&fraisReel='+fraisReel; + donnees += '&ententePrealable='+ententePrealable; + + numeroFeuilleMaladie=$("#numeroFeuilleMaladie_C").val(); + + donnees_sav = 'codeActe='+codeActePrescription+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailententeprealable'; + donnees_sav2 = 'codeActe='+codeActePrescription+'&numeroFeuilleMaladie='+numeroFeuilleMaladie+'&typeMail=mailautorisation'; + + typeSms="ententeprealable"; + typeSms2="autorisation"; + + $("#btn_enreg_seance").disable(); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxenregistrerprescriptionseance/modifierprescriptionseance/", + type : 'post', + data: donnees, + error: function(errorData) { + $("#msgErreur").html(errorData); + }, + success: function(data) { + if(ententePrealable=="2") + { + preparesms(typeSms); + + v_msg="Demande accord prealable envoyée!"; + v_msgEng="Request prior agreement sent!"; + alert_ebene(v_msg, v_msgEng); + } + + if(autorisation=="2") + { + preparesms(typeSms2); + + v_msg="Demande autorisation envoyée!"; + v_msgEng="Request for authorization sent!"; + alert_ebene(v_msg, v_msgEng); + } + }, + complete: function() + { + if(ententePrealable=="2") + { + mettremailattente(donnees_sav); + } + + if(autorisation=="2") + { + mettremailattente(donnees_sav2); + } + + v_msg="Prescription enregistrée avec succès"; + v_msgEng="Saved successfully!"; + alert_ebene(v_msg, v_msgEng); + + prescription_seance(); + } + }); + } +} + +function ajaxprixseance() +{ + $("#prixActe_info").val("0"); + $("#montantTm_info").val("0"); + $("#aRembourser_info").val("0"); + // $("#quantite_info").val("0"); + + codeActe = $("#codeActe").val(); + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un act!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + $("#codeActe").focus(); + return; + } + + div_quantite = $("#quantite"); + quantite = div_quantite.val(); + + if(quantite=="") + { + quantite = "0"; + } + + div_quantite.val(quantite); + + quantite = parseInt(quantite); + + if(quantite==0) + { + div_quantite.focus(); + v_msg="Veuillez saisir le nombre de séances!"; + v_msgEng="Please enter the number of sessions!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + // on va griser le bouton btn_enreg_seance + $("#btn_enreg_seance").disable(); + + donnees = 'codeActe='+codeActe+'&quantite='+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprixseance/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosacte").html(data); + }, + complete: function() { + } + }); +} + +function valider_presciption_seances() +{ + bonCaduc=$("#bonCaduc").val(); + // alert("bonCaduc => "+bonCaduc); + // return; + + if (bonCaduc==1) + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonKine=$("#numeroBonKine").val(); + if (numeroBonKine<=0) + { + v_msg="Pas de prescription!"; + v_msgEng="No prescription!"; + alert_ebene(v_msg, v_msgEng); + + // feuillemaladie(); + return; + } + + codeActePrescription = $("#codeActePrescription").val(); + + if (codeActePrescription<=" ") + { + v_msg="Veuillez sélectionner un acte!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_prescrire").click(); + + return; + } + + nbSeance=$("#nbSeance").val(); + nbSeance = parseInt(nbSeance); + + if (nbSeance<1) + { + v_msg="Veuillez saisir le nombre de séances!"; + v_msgEng="Please enter the number of sessions!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_prescrire").click(); + + return; + } + + v_msg="Confirmez-vous cette presciption ?"; + v_msgEng="Do you confirm this prescription?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + feuillemaladie(); + } +} + +function valider_seance_cso() +{ + ententePrealableSea=$("#ententePrealableSea").val(); + + if (ententePrealableSea>1) + { + v_msg="Entente préalable!"; + v_msgEng="Prior agreement!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + facture=$("#facture").val(); + + if (facture==1) + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonSeance=$("#numeroBonSeance_C").val(); + + if (numeroBonSeance<="0") + { + v_msg="Veuillez sélectionner un bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_InitSession").click(); + return; + } + + div_quantite = $("#quantiteSeance"); + quantite = div_quantite.val(); + + if(quantite=="") + { + quantite = "0"; + } + + div_quantite.val(quantite); + + quantite = parseInt(quantite); + + if(quantite==0) + { + // div_quantite.focus(); + v_msg="Veuillez saisir le nombre de séances!"; + v_msgEng="Please enter the number of sessions!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + div_prix = $("#prixActe"); + prixActe = div_prix.val(); + + if(prixActe==0) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + + v_msg="Confirmez-vous ces séances?"; + v_msgEng="Do you confirm these sessions?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees = 'codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailseance/enregistrerseance/", + type: 'POST', + data: donnees, + success: function(data) + { + // $('#div_test_gabarit').html(data); + + maj_fraisexclu_cso(); + }, + error: function(data) + { + }, + complete: function() + { + feuillemaladie(); + } + }); + } +} + +function actualiser_seance() +{ + window.location.assign($("#racineWeb" ).val()+"Seances/"); +} + +// SEANCES KINE +function valider_seance_sea_cso() +{ + ententePrealableSea=$("#ententePrealableSea").val(); + + if (ententePrealableSea>1) + { + v_msg="Entente préalable!"; + v_msgEng="Prior agreement!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonSeance=$("#numeroBonSeance_C").val(); + + if (numeroBonSeance<="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeActe = $("#codeActe").val(); + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un act!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + } + + quantiteSeance=$("#quantiteSeance").val(); + + if (quantiteSeance<=0) + { + v_msg="Veuillez revoir la quantité!"; + v_msgEng="Please review the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + fraisRetenuSeance=$("#fraisRetenuSeance").val(); + + if (fraisRetenuSeance<=0) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ces séances?"; + v_msgEng="Do you confirm those sessions?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + user_id_0 = $("#user_id_C").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + derogationFingerFacturation=$("#derogationFingerFacturation").val(); + if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_sea_cso(user_id_0); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_sea_cso(user_id_0); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id =$("#user_id_C").val(); + finger_id =$("#finger_id_C").val(); + + $("#facturation").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; + + // load("flexcode/user.php?"+data); + load("flexcode/user_facturation.php?"+data); + } + } +} + +function facturer_sea_cso(user_id) +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + cout = $("#cout").val(); + + if (cout==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + prixActe = $("#prixActe").val(); + montantTm = $("#montantTm").val(); + cout = $("#cout").val(); + + montantTm_f = $("#montantTm_f").val(); + cout_f = $("#cout_f").val(); + + donnees = 'prixActe='+prixActe; + donnees += '&montantTm='+montantTm; + donnees += '&cout='+cout; + + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + codePrestataire = $("#codePrestataire_C").val(); + + donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=mailkine'; + + typeSms = "facturer_sea"; + + user_id_0 = $("#user_id_C").val(); + user_id_substitut = "0"; + if (user_id_0!=user_id) + { + user_id_substitut = user_id; + } + + donnees_substitut = 'user_id_substitut='+user_id_substitut; + + // ajout du 27/06/2019 => prise en compte de la gestion paperless + // donnees += '&codeGestionBon='+codeGestionBon; + donnees_substitut += '&codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/facturerseance/", + type: 'POST', + data: donnees_substitut, + success: function(data) + { + // $('#div_test_gabarit').html(data); + preparesms_adherent(typeSms); + }, + error: function(data) { + }, + complete: function() + { + preparemail_adherent(typeSms); + + v_msg="Facturation effectuée avec succès!"; + v_msgEng="Billing done successfully!"; + alert_ebene(v_msg, v_msgEng); + + afficher_seance_cso(); + } + }); + +} + +function rechercherbonkine_sea() +{ + numeroBonKine=$("#numeroBonKine").val(); + + if (numeroBonKine>" ") + { + chercher_ordonnance_sea(numeroBonKine); + } +} + +function chercher_ordonnance_sea(numeroBonKine) +{ + $("#numeroBonSeance_C").val("-1"); + donnees = 'numeroBonKine='+numeroBonKine; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxchangerordonnancesea/", + type: 'POST', + data: donnees, + success: function(data) { + window.location.assign($("#racineWeb" ).val()+"Kine/"); + }, + error: function(data) { + }, + complete: function() { + } + }); +} + +function ctrlkeypressordsea(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + numeroBonKine=$("#numeroBonKine").val(); + $("#numeroBonKine").blur(); + } +} + +function rechercherbonkine_sea_cso() +{ + numeroBonKine=$("#numeroBonKine").val(); + + if (numeroBonKine>" ") + { + chercher_ordonnance_sea_cso(numeroBonKine); + } +} + +function chercher_ordonnance_sea_cso(numeroBonKine) +{ + $("#numeroBonSeance_C").val("-1"); + donnees = 'numeroBonKine='+numeroBonKine; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxchangerordonnancesea/", + type: 'POST', + data: donnees, + success: function(data) { + window.location.assign($("#racineWeb" ).val()+"Kinecso/"); + }, + error: function(data) { + }, + complete: function() { + } + }); + +} + + +function ajaxinfosbonseancekine() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg_bon_kine").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonseancekine/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function enregistrerbonsseancekine() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + if (codeGestionBon=="0") + { + numeroBonSave = $("#numeroBonSave").val(); + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + } + else + { + // numeroBon = "-1"; + numeroBon = "1"; + v_msg="Confirmez-vous ce dossier?"; + v_msgEng="Do you confirm this claim?"; + } + + /* + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + */ + + if(confirm_ebene(v_msg, v_msgEng)) + { + + donnees = "numeroBon="+numeroBon; + + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees += '&codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonseancekine/attributionbontemporaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + afficher_facturation_seance(); + } + }); + } +} + + +function afficher_facturation_seance() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/", + // type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_session").click(); + $("#div_facturation_seance").html(data); + }, + complete: function(data) { + $("#numeroBonSeance_C").val($("#numeroBonSeance_info").val()); + } + }); +} + +function ajaxprixseancesea() +{ + codeActe = $("#codeActe").val(); + + if (codeActe<=" ") + { + $("#prixActe_info").val("0"); + $("#totalActe_info").val("0"); + $("#montantTm_info").val("0"); + $("#aRembourser_info").val("0"); + + v_msg="Veuillez sélectionner un act!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + } + + div_quantite = $("#quantiteSeance"); + quantite = div_quantite.val(); + + if(quantite=="") + { + quantite = "0"; + } + + div_quantite.val(quantite); + + quantite = parseInt(quantite); + + if(quantite==0) + { + div_quantite.val(1); + + quantite = 1; + /* + div_quantite.focus(); + v_msg="Veuillez saisir le nombre de séances!"; + v_msgEng="Please enter the number of sessions!"; + alert_ebene(v_msg, v_msgEng); + + return; + */ + } + + div_nbRestant = $("#nbRestant"); + nbRestant = div_nbRestant.val(); + nbRestant = parseInt(nbRestant); + + if(quantite>nbRestant) + { + // div_quantite.focus(); + v_msg="Vous ne pouvez pas dépasser "+nbRestant+" séances!"; + v_msgEng="Only "+nbRestant+" sessions are possible!"; + alert_ebene(v_msg, v_msgEng); + + // return; + quantite = 0; + } + + donnees = 'codeActe='+codeActe+'&quantite='+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxprixseancesea/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosacte").html(data); + }, + complete: function() { + } + }); +} + +// Facturation SEANCE KINE + +function valider_seance_sea() +{ + ententePrealableSea=$("#ententePrealableSea").val(); + + if (ententePrealableSea>1) + { + v_msg="Entente préalable!"; + v_msgEng="Prior agreement!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + + bonCaduc=$("#bonCaduc").val(); + + if (bonCaduc==1 && modeSaisieFacture!="1") + { + v_msg="Bon caduc!"; + v_msgEng="Obsolete!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroBonSeance=$("#numeroBonSeance_C").val(); + + if (numeroBonSeance<="0") + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + codeActe = $("#codeActe").val(); + + if (codeActe<=" ") + { + v_msg="Veuillez sélectionner un act!"; + v_msgEng="Please select an act!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeActe").focus(); + return; + } + + fraisRetenuSeance=$("#fraisRetenuSeance").val(); + + if (fraisRetenuSeance<=0) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous ces séances?"; + v_msgEng="Do you confirm those sessions?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + user_id_0 = $("#user_id_C").val(); + + modeSaisieFacture=$("#modeSaisieFacture").val(); + derogationFingerFacturation=$("#derogationFingerFacturation").val(); + if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_sea(user_id_0); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_sea(user_id_0); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id =$("#user_id_C").val(); + finger_id =$("#finger_id_C").val(); + + $("#facturation").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; + + load("flexcode/user.php?"+data); + } + } +} + +function facturer_sea(user_id) +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + cout = $("#cout").val(); + + if (cout==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + prixActe = $("#prixActe").val(); + montantTm = $("#montantTm").val(); + cout = $("#cout").val(); + + montantTm_f = $("#montantTm_f").val(); + cout_f = $("#cout_f").val(); + + donnees = 'prixActe='+prixActe; + donnees += '&montantTm='+montantTm; + donnees += '&cout='+cout; + + numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + codePrestataire = $("#codePrestataire_C").val(); + + donnees_sav = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&codePrestataire='+codePrestataire+'&typeMail=mailkine'; + + typeSms = "facturer_sea"; + + user_id_0 = $("#user_id_C").val(); + user_id_substitut = "0"; + if (user_id_0!=user_id) + { + user_id_substitut = user_id; + } + + donnees_substitut = 'user_id_substitut='+user_id_substitut; + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees_substitut += '&codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturatioseancesea/facturerseance/", + type: 'POST', + data: donnees_substitut, + success: function(data) + { + preparesms_adherent(typeSms); + }, + error: function(data) { + }, + complete: function() + { + preparemail_adherent(typeSms); + + v_msg="Facturation effectuée avec succès!"; + v_msgEng="Billing done successfully!"; + alert_ebene(v_msg, v_msgEng); + + // window.location.assign($("#racineWeb" ).val()+"Kine/"); + afficher_seance_kine(); + } + }); +} + +/* +function rechercherbonexamen_lab_cso() +{ + numeroBonExamen=$("#numeroBonExamen").val(); + + if (numeroBonExamen>" ") + { + chercher_ordonnance_lab_cso(numeroBonExamen); + } +} +*/ + +// 19/11/2017 + +function enregistrerbonsseancekinecso() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + + codeGestionBon = $("#codeGestionBon").val(); + nbBonsCons = $("#nbBonsCons").val(); + + if (codeGestionBon=="0") + { + numeroBonSave = $("#numeroBonSave").val(); + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").focus(); + return; + } + + codeEtatBon = $("#codeEtatBon").val(); + + if (codeEtatBon!="1") + { + v_msg="Veuillez saisir un No de bon disponible!"; + v_msgEng="Please enter a prescription number available!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroBon").focus(); + return; + } + + if(numeroBonSave!=numeroBon) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + } + else + { + // numeroBon = "-1"; + numeroBon = "1"; + v_msg="Confirmez-vous ce dossier?"; + v_msgEng="Do you confirm this claim?"; + } + + /* + v_msg="Confirmez-vous ce No de bon?"; + v_msgEng="Do you confirm this number of presciption?"; + */ + + if(confirm_ebene(v_msg, v_msgEng)) + { + donnees = "numeroBon="+numeroBon; + + // ajout du 27/06/2019 => prise en compte de la gestion paperless + donnees += '&codeGestionBon='+codeGestionBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonseancekinecso/attributionbontemporaire/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + // $('#div_test_gabarit').html(data); + }, + complete: function() + { + afficher_facturation_seance_cso(); + } + }); + } +} + + +function afficher_facturation_seance_cso() +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturatioseancecso/", + error: function(errorData) { + }, + success: function(data) { + $("#btn_close_pop_session").click(); + $("#div_facturation_seance").html(data); + }, + complete: function(data) { + $("#numeroBonSeance_C").val($("#numeroBonSeance_info").val()); + } + }); +} + + +function ajaxinfosbonseancekinecso() +{ + badcodeGestionBon = $("#badcodeGestionBon").val(); + + if (badcodeGestionBon=="1") + { + v_msg="Veuillez revoir le type de gestion de bons!"; + v_msgEng="Please review the type of forms management!"; + alert_ebene(v_msg, v_msgEng); + return; + } + + numeroBon = $("#numeroBon").val(); + + if(isNaN(numeroBon)) + { + v_msg="Veuillez revoir le numéro de bon!"; + v_msgEng="Please review the prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + if ($("#numeroBon").val()<="0") + { + v_msg="Veuillez saisir un No de bon!"; + v_msgEng="Please enter a prescription number!"; + alert_ebene(v_msg, v_msgEng); + + $("#btn_enreg_bon_kine").disable(); + $("#msgErreur").html(""); + $("#codeEtatBon").val(""); + + $("#numeroBon").focus(); + return; + } + + donnees = "numeroBon="+numeroBon; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxinfosbonseancekinecso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#infosbon").html(data); + }, + complete: function() { + } + }); +} + +function ajaxmajquteseancecso() +{ + div_prix = $("#prixActe"); + prixActe = div_prix.val(); + + if(prixActe==0) + { + v_msg="Veuillez revoir le tarif!"; + v_msgEng="Please review rate!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + div_quantite = $("#quantiteSeance"); + quantite = div_quantite.val(); + + if(quantite=="") + { + quantite = "0"; + } + + div_quantite.val(quantite); + + quantite = parseInt(quantite); + + if(quantite==0) + { + div_quantite.focus(); + v_msg="Veuillez saisir le nombre de séances!"; + v_msgEng="Please enter the number of sessions!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + div_nbRestant = $("#nbRestant"); + nbRestant = div_nbRestant.val(); + nbRestant = parseInt(nbRestant); + + if(quantite>nbRestant) + { + div_quantite.focus(); + v_msg="Vous ne pouvez pas dépasser "+nbRestant+" séances!"; + v_msgEng="Only "+nbRestant+" sessions are possible!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + $("#btn_enreg_seance").disable(); + + donnees = 'prixActe='+prixActe+'&quantite='+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxfacturatioseancecso/modifierseancecso/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $("#infoseance").html(data); + }, + complete: function() { + afficher_facturation_seance_cso(); + } + }); +} + + + +function consulter_limite_avant_facturation_kinecso(idFacture) +{ + /* + 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()+"Plafondavantfacturekinecso/"+idFacture+"/"); + */ +} + + +function consulter_limite_avant_facturation_kine(idFacture) +{ + /* + 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()+"Plafondavantfacturekine/"+idFacture+"/"); + */ +} + +function afficher_seance_kine() +{ + window.location.assign($("#racineWeb" ).val()+"Kine/"); +} + +// consulatation_ben + +function consultationbenlab() +{ + window.location.assign($("#racineWeb" ).val()+"Consultationbenlab/"); +} + +function consultationbensea() +{ + window.location.assign($("#racineWeb" ).val()+"Consultationbensea/"); +} + +function laboratoire() +{ + if (prestation_possible()) + { + /* mis en commentaire le 28/11/2017 + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + } + else + { + finger_id = $("#finger_id_C" ).val(); + + if (finger_id==0) + { + v_msg="Veuillez procéder à l\'enrôlement avant!"; + v_msgEng="Please enroll before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + okId=$("#okId" ).val(); + okId_face=$("#okId_face" ).val(); + + if (okId!=1 && (okId_face!=1) + { + v_msg="Veuillez procéder à l\'identification avant!"; + v_msgEng="Please check identity before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + */ + + window.location.assign($("#racineWeb" ).val()+"Laboratoire/"); + } +} + + +function seancekine() +{ + if (prestation_possible()) + { + /* mis en commentaire le 28/11/2017 + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + } + else + { + finger_id = $("#finger_id_C" ).val(); + + if (finger_id==0) + { + v_msg="Veuillez procéder à l\'enrôlement avant!"; + v_msgEng="Please enroll before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + okId=$("#okId" ).val(); + okId_face=$("#okId_face" ).val(); + if (okId!=1 && okId!=1) + { + v_msg="Veuillez procéder à l\'identification avant!"; + v_msgEng="Please check identity before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + */ + + window.location.assign($("#racineWeb" ).val()+"Kine/"); + } +} + +function afficher_facture_cons_lab(idFacture, numeroBonExamen, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonExamen='+numeroBonExamen+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturelab/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_lab(); + } + }); + } +} + +function consulter_facture_lab() +{ + window.location.assign($("#racineWeb" ).val()+"Laboratoirecons/"); +} + +function consulter_limite_avant_facturation_lab_cons() +{ + /* + 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()+"Plafondavantfacturelabcons/"); + */ +} + +function afficher_facture_cons_lab_ben(idFacture, numeroBonExamen, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonExamen='+numeroBonExamen+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturelab/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_lab_ben(); + } + }); + } +} + +function consulter_facture_lab_ben() +{ + window.location.assign($("#racineWeb" ).val()+"Laboratoireconsben/"); +} + +function consulter_limite_avant_facturation_lab_cons_ben() +{ + /* + 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()+"Plafondavantfacturelabconsben/"); + */ +} + +function listerdossiercons_lab() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + donnees_sav = donnees; + + $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationlabentete/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement").html(data); + }, + complete: function() { + } + }); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationlab/", + type : 'post', + data: donnees_sav, + error: function(errorData) { + }, + success: function(data) { + $("#detail_reglement").html(data); + $("#detail_reglement").css("padding-top", "0px"); + }, + complete: function() { + } + }); +} + +function lister_factures_lab_ben() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationbenlab/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + +function consultationsea() +{ + window.location.assign($("#racineWeb" ).val()+"Consultationsea/"); +} + +function listerdossiercons_sea() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + donnees_sav = donnees; + + $("#detail_reglement").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationseaentete/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#reglement").html(data); + }, + complete: function() { + } + }); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxconsultationsea/", + type : 'post', + data: donnees_sav, + error: function(errorData) { + }, + success: function(data) { + $("#detail_reglement").html(data); + $("#detail_reglement").css("padding-top", "0px"); + }, + complete: function() { + } + }); +} + +function consulter_facture_sea() +{ + window.location.assign($("#racineWeb" ).val()+"Kinecons/"); +} + +function consulter_limite_avant_facturation_sea_cons() +{ + /* + 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()+"Plafondavantfactureseacons/"); + */ +} + +function lister_factures_sea_ben() +{ + d1=$("#d1").val(); + d2=$("#d2").val(); + + donnees = 'd1='+d1+'&d2='+d2; + + $("#div_dossiers").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + // url: $("#racineWeb").val()+"Ajaxconsultationbenlab/", + url: $("#racineWeb").val()+"Ajaxconsultationbensea/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_dossiers").html(data); + }, + complete: function() { + } + }); +} + +function afficher_facture_cons_sea(idFacture, numeroBonKine, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonKine='+numeroBonKine+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturesea/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_sea(); + } + }); + } +} + + +function afficher_facture_cons_sea_ben(idFacture, numeroBonKine, codePrestataireLivraison) +{ + if (idFacture>"") + { + donnees = 'idFacture='+idFacture+'&numeroBonKine='+numeroBonKine+'&codePrestataireLivraison='+codePrestataireLivraison; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcontextfacturesea/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + complete: function() { + consulter_facture_sea_ben(); + } + }); + } +} + +function consulter_facture_sea_ben() +{ + window.location.assign($("#racineWeb" ).val()+"Kineconsben/"); +} + +function consulter_limite_avant_facturation_sea_cons_ben() +{ + /* + 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()+"Plafondavantfactureseaconsben/"); + */ +} + +function ctrlkeypress_numeroBon(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + $("#numeroBon").blur(); + } +} + +function verifier_feuille_maladie_dec_cons(numeroFeuilleMaladie, idFacture) +{ + $("#numeroFeuilleMaladie_C").val(numeroFeuilleMaladie); + numeroDecompte = $("#numeroDecompte").val(); + + // if (numeroFeuilleMaladie>"") + if (idFacture>"") + { + donnees = 'numeroFeuilleMaladie='+numeroFeuilleMaladie+'&numeroDecompte='+numeroDecompte+'&idFacture='+idFacture; + + codeTypePrestataire = $("#codeTypePrestataire_C").val(); + + if(codeTypePrestataire=="CSO" || codeTypePrestataire=="LAB" || codeTypePrestataire=="SEA") + { + + verifier_feuille_maladie_dec_cso_cons(donnees); + } + else + if(codeTypePrestataire=="PHA") + { + verifier_feuille_maladie_dec_pha_cons(donnees); + } + else + if(codeTypePrestataire=="OPT") + { + verifier_feuille_maladie_dec_opt_cons(donnees); + } + } +} + + +function imprimerbordereaudecompte() +{ + idReglement = $("#idReglement").val(); + + + if (idReglement>"0") + { + var div_wait = $('#div_wait'); + div_wait.html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandereglement/imprimerbordereaudecompte", + type: 'POST', + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } +} + +function verifier_feuille_maladie_dec_cso_cons(donnees) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxverifierfacturecons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_verification_facture").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); +} + +function verifier_feuille_maladie_dec_pha_cons(donnees) +{ + $.ajax({ + url: $("#racineWeb").val()+"Ajaxverifierfacturephacons/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_verification_facture").html(data); + }, + complete: function() { + $("#btn_pop").click(); + } + }); +} + +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 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 demander_decompte() +{ + window.location.assign($("#racineWeb" ).val()+"Initdemandedecompte/"); +} + +function initierdemandedecompte() +{ + 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 = 'codeExercice='+codeExercice+'&codeMois='+codeMois; + + // $("#div_dossiers").html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemandedecompte/initierdemandedecompte/", + 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 + { + afficher_demande_decompte(); + } + } + }); +} + +function afficher_demande_decompte() +{ + $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); + window.location.assign($("#racineWeb" ).val()+"Demandedecompte/"); +} + + +function imprimerbordereaudemandedecompte() +{ + idDemandeDecompte = $("#idDemandeDecompte").val(); + + if (idDemandeDecompte>"0") + { + var div_wait = $('#div_wait'); + div_wait.html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaximprimerdemandedecompte/imprimerdemandecompte", + type: 'POST', + success: function(data) + { + div_wait.html(data); + }, + error : function(resultat, statut, erreur) + { + }, + complete: function(data) + { + } + }); + } +} + +function rechargerdemandedecompte() +{ + $("#detail_demande_decompte").html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdemandedecompte/rechargerdemandedecompte/", + type : 'post', + error: function(errorData) { + }, + success: function(data) { + afficher_demande_decompte(); + }, + complete: function() { + } + }); +} + +function actualiser_decompte() +{ + $("#div_detail").html('
  ' + 'Veuillez patienter...' + '
'); + + window.location.assign($("#racineWeb" ).val()+"Decomptecons/"); +} + +function monture() +{ + $("#monture").val("1"); + + if (prestation_possible()) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + + window.location.assign($("#racineWeb" ).val()+"Monture/"); + + /* MAJ du 06/06/2019 => proposition de Pascal => les magasins d'optique n'ont pas de lecteurs d'empriente + modeSaisieFacture=$("#modeSaisieFacture").val(); + if(modeSaisieFacture=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + + window.location.assign($("#racineWeb" ).val()+"Monture/"); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + } + else + { + finger_id = $("#finger_id_C" ).val(); + + if (finger_id==0) + { + v_msg="Veuillez procéder à l\'enrôlement avant!"; + v_msgEng="Please enroll before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + okId=$("#okId" ).val(); + okId_face=$("#okId_face" ).val(); + + if (okId!=1 && okId_face!=1) + { + v_msg="Veuillez procéder à l\'identification avant!"; + v_msgEng="Please check identity before!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + } + + window.location.assign($("#racineWeb" ).val()+"Monture/"); + */ + } +} + +function actualiser_monture() +{ + window.location.assign($("#racineWeb" ).val()+"Monture/"); +} + +function valider_monture() +{ + dejaFacture=$("#dejaFacture").val(); + + // alert("dejaFacture =>" +dejaFacture); + // return; + + if (dejaFacture=="1") + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + ententePrealableMont=$("#ententePrealableMont").val(); + + nbActesMonture=$("#nbActesMonture").val(); + + if (nbActesMonture>0 && ententePrealableMont!=1) + { + /* + v_msg="Montures déjà livrées une fois!"; + v_msgEng="Frames already delivered once!"; + */ + v_msg="Veuillez demander une autorisation!"; + v_msgEng="Please ask for an authorization!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroFacture=$("#numeroFacture").val(); + + if (numeroFacture<=" ") + { + v_msg="Veuillez saisir le No de la facture!"; + v_msgEng="Please enter the Invoice No!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroFacture").focus(); + + return; + } + + prixActe = $("#prixActe").val(); + if (prixActe==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + v_msg="Confirmez-vous cette livraison?"; + v_msgEng="Do you confirm this delivery?"; + + if(confirm_ebene(v_msg, v_msgEng)) + { + user_id_0 = $("#user_id_C").val(); + + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + + facturer_monture(user_id_0); + + /* MAJ du 06/06/2019 => proposition de Pascal => les magasins d'optique n'ont pas de lecteurs d'empriente + modeSaisieFacture=$("#modeSaisieFacture").val(); + derogationFingerFacturation=$("#derogationFingerFacturation").val(); + if(modeSaisieFacture=="1" || derogationFingerFacturation=="1") + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_monture(user_id_0); + return; + } + + derogation_finger_en_cours=$("#derogation_finger_en_cours_C").val(); + if(derogation_finger_en_cours>0) + { + $("#okId" ).val("1"); + $("#okId_face" ).val("1"); + facturer_monture(user_id_0); + } + else + { + beneficiaire = $("#beneficiaire_C").val(); + user_id =$("#user_id_C").val(); + finger_id =$("#finger_id_C").val(); + + $("#facturation").val("1"); + + data = "action=index&user_id="+user_id+"&user_name="+beneficiaire+"&finger="+finger_id+"&facturation=1"; + + load("flexcode/user.php?"+data); + } + */ + } +} + +function maj_monture_temp_monture(idOptique, monture) +{ + numeroFacture=$("#numeroFacture").val(); + + donnees = 'idOptique='+idOptique+"&monture="+monture+"&numeroFacture="+numeroFacture; + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmonture/majmonture/", + type: 'POST', + data: donnees, + success: function(data) { + $("#div_monture").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + } + }); +} + +function facturer_monture(user_id) +{ + dejaFacture=$("#dejaFacture").val(); + + if (dejaFacture=="1") + { + v_msg="Déjà facturé!"; + v_msgEng="Already charged!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + numeroFacture=$("#numeroFacture").val(); + + if (numeroFacture<=" ") + { + v_msg="Veuillez saisir le No de la facture!"; + v_msgEng="Please enter the Invoice No!"; + alert_ebene(v_msg, v_msgEng); + + $("#numeroFacture").focus(); + + return; + } + + prixActe = $("#prixActe").val(); + if (prixActe==0) + { + v_msg="Rien à facturer!"; + v_msgEng="Nothing to bill!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + montantTm = $("#montantTm").val(); + cout = $("#cout").val(); + + montantTm_f = $("#montantTm_f").val(); + cout_f = $("#cout_f").val(); + + donnees = 'prixActe='+prixActe; + donnees += '&montantTm='+montantTm; + donnees += '&cout='+cout; + donnees += '&numeroFacture='+numeroFacture; + + + // numeroFeuilleMaladie = $("#numeroFeuilleMaladie_C").val(); + codePrestataire = $("#codePrestataire_C").val(); + + donnees_sav = 'codePrestataire='+codePrestataire+'&typeMail=mailoptique'; + + typeSms = "facturer_mont"; + + donnees_retour =""; + + user_id_0 = $("#user_id_C").val(); + user_id_substitut = "0"; + if (user_id_0!=user_id) + { + user_id_substitut = user_id; + } + + donnees += '&user_id_substitut='+user_id_substitut; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmonture/enregistrermonture/", + type: 'POST', + data: donnees, + success: function(data) + { + donnees_retour = data; + preparesms_adherent(typeSms); + }, + error: function(data) + { + + }, + complete: function() { + preparemail_adherent(typeSms); + + v_msg="Facturation effectuée avec succès!"; + v_msgEng="Billing done successfully!"; + alert_ebene(v_msg, v_msgEng); + + $("#div_monture").html(donnees_retour); + // window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"); + } + }); +} + + +function requetes_prestaire() +{ + window.location.assign($("#racineWeb" ).val()+"Requetes/"); +} + +function ajaxenteterequete() +{ + 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()+"Ajaxrequeteentete"+codeRequete+"/"; + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_ente_requete").html(data); + $(".datepicker" ).datepicker(); + } + }); +} + +function requetes_feuilles_maladie() +{ + $('#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(); + dateConsultation1 = $("#dateConsultation1").val(); + dateConsultation2 = $("#dateConsultation2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + codeMedecin = $("#codeMedecin").val(); + + 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(); + codeRaisonConsultation = $("#codeRaisonConsultation").val(); + hospitalisation = $("#hospitalisation").val(); + numeroChambre = $("#numeroChambre").val(); + chirurgie = $("#chirurgie").val(); + facture = $("#facture").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 += '&dateConsultation1=' + dateConsultation1; + donnees += '&dateConsultation2=' + dateConsultation2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&codeMedecin=' + codeMedecin; + + 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 += '&codeRaisonConsultation=' + codeRaisonConsultation; + donnees += '&hospitalisation=' + hospitalisation; + donnees += '&numeroChambre=' + numeroChambre; + donnees += '&chirurgie=' + chirurgie; + donnees += '&facture=' + facture; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + $("#div_detail_requete").html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + //$("#div_detail_requete").html(data); + }, + complete: function() { + $("#div_detail_requete").html(donnees_retour); + $("#nbligne").val("Result : "+$("#nbligne_info").val()); + } + }); +} + +function requetes_feuilles_maladie_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(); + dateConsultation1 = $("#dateConsultation1").val(); + dateConsultation2 = $("#dateConsultation2").val(); + numeroAdherent = $("#numeroAdherent").val(); + numeroBeneficiaire = $("#numeroBeneficiaire").val(); + + // Ligne 2 + codeMedecin = $("#codeMedecin").val(); + + 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(); + codeRaisonConsultation = $("#codeRaisonConsultation").val(); + hospitalisation = $("#hospitalisation").val(); + numeroChambre = $("#numeroChambre").val(); + chirurgie = $("#chirurgie").val(); + facture = $("#facture").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 += '&dateConsultation1=' + dateConsultation1; + donnees += '&dateConsultation2=' + dateConsultation2; + donnees += '&numeroAdherent=' + numeroAdherent; + donnees += '&numeroBeneficiaire=' + numeroBeneficiaire; + + // Ligne 2 + donnees += '&codeMedecin=' + codeMedecin; + + 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 += '&codeRaisonConsultation=' + codeRaisonConsultation; + donnees += '&hospitalisation=' + hospitalisation; + donnees += '&numeroChambre=' + numeroChambre; + donnees += '&chirurgie=' + chirurgie; + donnees += '&facture=' + facture; + + // Ligne 4 + donnees += '&adherent=' + adherent; + donnees += '&beneficiaire=' + beneficiaire; + + var div_export = $('#div_detail_requete'); + div_export.html('
  ' + 'Veuillez patienter...' + '
'); + + $.ajax({ + url: v_url, + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + donnees_retour = data; + // $('#div_detail_requete').html(""); + // $('#div_export_a').html(data); + }, + complete: function() { + $('#div_detail_requete').html(""); + $('#div_export_a').html(donnees_retour); + } + }); +} + + +function selectionner_medecin_requete(codeMedecin, nomMedecin, noOrdreMedecin) +{ + $("#codeMedecin").val(codeMedecin); + $("#nomMedecin").html(nomMedecin+" ( "+noOrdreMedecin+" )"); + $("#close_pop").click(); +} + +function afficher_pop_recherche_medecin_requete() +{ + + noOrdreMedecin = $("#noOrdreMedecin").val(); + nomsearch = $("#nomsearch").val(); + + if(noOrdreMedecin+nomsearch<=" ") + return; + + donnees = "valid=1&noOrdreMedecin="+noOrdreMedecin+"&nomsearch="+nomsearch; + + $("#div_listemedecins").html('
  ' + 'Veuillez patienter... / Please wait...' + '
'); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxlistemedecinsrequete/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_listemedecins").html(data); + } + }); +} + +function ctrlkeypress_medecin_requete(ev) +{ + var keycode = (ev.keyCode ? ev.keyCode : ev.which); + if(keycode == '13') + { + afficher_pop_recherche_medecin_requete(); + } +} + +function reinitialiser_medecin() +{ + $("#codeMedecin").val(""); + $("#nomMedecin").html("Rechercher Médecin..."); + $("#close_pop").click(); +} + +function requetes_factures() +{ + $('#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; \ No newline at end of file