5407 lines
116 KiB
JavaScript
Executable File
5407 lines
116 KiB
JavaScript
Executable File
|
|
var triggerTabList = [].slice.call(document.querySelectorAll('#myTab a'));
|
|
triggerTabList.forEach(function (triggerEl) {
|
|
var tabTrigger = new bootstrap.Tab(triggerEl)
|
|
|
|
triggerEl.addEventListener('click', function (event) {
|
|
event.preventDefault()
|
|
tabTrigger.show()
|
|
})
|
|
})
|
|
|
|
function showHideElt(param) {
|
|
var GenerauxId = document.getElementById('Generaux');
|
|
var ProductionId = document.getElementById('Production');
|
|
var MedicalId = document.getElementById('Medical');
|
|
var PrestationId = document.getElementById('Prestation');
|
|
|
|
GenerauxId.style.display = "none";
|
|
ProductionId.style.display = "none";
|
|
MedicalId.style.display = "none";
|
|
PrestationId.style.display = "none";
|
|
|
|
if (param === 'Production') {
|
|
ProductionId.style.display = "block";
|
|
} else if (param === 'Generaux') {
|
|
GenerauxId.style.display = "block";
|
|
} else if (param === 'Medical') {
|
|
MedicalId.style.display = "block";
|
|
} else if (param === 'Prestation') {
|
|
PrestationId.style.display = "block";
|
|
}
|
|
}
|
|
|
|
|
|
function alert_ebene(p_msg, p_msg_eng) {
|
|
// Récupération de la langue sélectionnée
|
|
let codeLangue = $("#codeLangue").val();
|
|
|
|
// Choix du message en fonction de la langue
|
|
let message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
|
|
|
|
// Utilisation de SweetAlert pour afficher le message
|
|
Swal.fire({
|
|
title: message,
|
|
icon: 'info', // Icône de type information
|
|
confirmButtonText: codeLangue === "en_US" ? 'OK' : 'D\'accord'
|
|
});
|
|
}
|
|
|
|
|
|
function confirm_ebene(p_msg, p_msg_eng) {
|
|
// Récupération de la langue sélectionnée
|
|
let codeLangue = $("#codeLangue").val();
|
|
|
|
// Choix du message en fonction de la langue
|
|
let message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
|
|
|
|
// Utilisation de SweetAlert avec une promesse
|
|
return Swal.fire({
|
|
title: message,
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonText: codeLangue === "en_US" ? 'Yes' : 'Oui',
|
|
cancelButtonText: codeLangue === "en_US" ? 'No' : 'Non'
|
|
}).then((result) => {
|
|
return result.isConfirmed; // Retourne true si l'utilisateur confirme, false sinon
|
|
});
|
|
}
|
|
|
|
|
|
function prompt_ebene(p_msg, p_msg_eng, p_retour, callback) {
|
|
let codeLangue = $("#codeLangue").val();
|
|
let message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
|
|
|
|
Swal.fire({
|
|
title: message,
|
|
input: 'text',
|
|
inputValue: p_retour,
|
|
showCancelButton: true,
|
|
confirmButtonText: 'OK',
|
|
cancelButtonText: 'Annuler'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
callback(result.value); // Exécute la fonction callback avec la valeur saisie
|
|
} else {
|
|
callback(null); // Annule l'opération
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function addslashes(ch)
|
|
{
|
|
ch = ch.replace(/\\/g,"\\\\");
|
|
ch = ch.replace(/\'/g,"\\'");
|
|
ch = ch.replace(/\"/g,"\\\"");
|
|
return ch;
|
|
}
|
|
|
|
function adherents_police()
|
|
{
|
|
if ($("#idPolice_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Listeadherent/");
|
|
}
|
|
}
|
|
|
|
function college_police()
|
|
{
|
|
if ($("#idPolice_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Collegepolice/");
|
|
}
|
|
}
|
|
|
|
function facturer_police()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
/* O,n peut cquand même facturer
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
*/
|
|
|
|
if ($("#idPolice_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Facturerpolice/");
|
|
}
|
|
}
|
|
|
|
$.prototype.enable = function () {
|
|
$.each(this, function (index, el) {
|
|
$(el).removeAttr('disabled');
|
|
});
|
|
}
|
|
|
|
$.prototype.disable = function () {
|
|
$.each(this, function (index, el) {
|
|
$(el).attr('disabled', 'disabled');
|
|
});
|
|
}
|
|
|
|
$.prototype.unreadable = function () {
|
|
$.each(this, function (index, el) {
|
|
$(el).attr('READONLY', 'READONLY');
|
|
});
|
|
}
|
|
|
|
$.prototype.readable = function () {
|
|
$.each(this, function (index, el) {
|
|
$(el).removeAttr('READONLY');
|
|
});
|
|
}
|
|
|
|
Date.estAnneeBissextile = function (annee) {
|
|
return (((annee % 4 === 0) && (annee % 100 !== 0)) || (annee % 400 === 0));
|
|
};
|
|
|
|
Date.getDaysInMonth = function (annee, month) {
|
|
return [31, (Date.estAnneeBissextile(annee) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
|
};
|
|
|
|
Date.prototype.estAnneeBissextile = function () {
|
|
return Date.estAnneeBissextile(this.getFullYear());
|
|
};
|
|
|
|
Date.prototype.getDaysInMonth = function () {
|
|
return Date.getDaysInMonth(this.getFullYear(), this.getMonth());
|
|
};
|
|
|
|
Date.prototype.addMonths = function (value) {
|
|
var n = this.getDate();
|
|
this.setDate(1);
|
|
this.setMonth(this.getMonth() + value);
|
|
this.setDate(Math.min(n, this.getDaysInMonth()));
|
|
this.setDate(this.getDate()-1);
|
|
return this;
|
|
};
|
|
|
|
$( ".datepicker" ).datepicker({
|
|
inline: true,
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: "c-60:c+20"
|
|
|
|
});
|
|
|
|
/*les fonctions courantes et globales */
|
|
|
|
function get_age(dater)
|
|
{
|
|
var td2 = $("#datejourfr_C").datepicker("getDate");
|
|
return age = td2.getFullYear()-dater.getFullYear();
|
|
}
|
|
|
|
function get_age_relatif(dateNaissance, dateEffet)
|
|
{
|
|
return age = dateEffet.getFullYear()-dateNaissance.getFullYear();
|
|
}
|
|
|
|
function controle_age(dater, codeLienParente)
|
|
{
|
|
|
|
ageMax = parseInt($("#ageMax").val());
|
|
|
|
age = get_age(dater);
|
|
$("#agepersonne").val("Âge : "+age);
|
|
|
|
if (age>ageMax)
|
|
{
|
|
v_msg="Âge "+age+" supérieur à " +ageMax+ " ans!";
|
|
v_msgEng="Age "+age+" over " +ageMax+ "!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
function controle_age_relatif(dateNaissance, dateEffet, codeLienParente)
|
|
{
|
|
ageMax = parseInt($("#ageMax").val());
|
|
|
|
age = get_age_relatif(dateNaissance, dateEffet);
|
|
|
|
|
|
|
|
$("#agepersonne").val("Âge : "+age);
|
|
|
|
if (age>ageMax)
|
|
{
|
|
v_msg="Âge "+age+" supérieur à " +ageMax+ " ans!";
|
|
v_msgEng="Age "+age+" over " +ageMax+ "!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#dateNaissance").val("");
|
|
$("#agepersonne").val("0");
|
|
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/* Début JS client */
|
|
function selectionner_client(id,no)
|
|
{
|
|
$("#idClient_C").val(id);
|
|
$("#numeroClient_C").val(no);
|
|
$("#nomClient_C").val("");
|
|
}
|
|
|
|
function selectionner_client_d(id,no)
|
|
{
|
|
$("#idClient_d_C").val(id);
|
|
$("#numeroClient_d_C").val(no);
|
|
$("#nomClient_d_C").val("");
|
|
}
|
|
|
|
function afficher_client_id()
|
|
{
|
|
idClient=$("#idClient_C").val();
|
|
|
|
if (idClient>"")
|
|
{
|
|
ajax_context_client_afficher(idClient);
|
|
}
|
|
}
|
|
|
|
function afficher_client_d_id()
|
|
{
|
|
idClient=$("#idClient_d_C" ).val();
|
|
|
|
if (idClient>"")
|
|
{
|
|
ajax_context_client_d_afficher(idClient);
|
|
}
|
|
}
|
|
|
|
|
|
/* Fin JS client */
|
|
|
|
/* Début JS police */
|
|
function selectionner_police(id,no)
|
|
{
|
|
$("#idPolice_C" ).val(id);
|
|
$("#numeroPolice_C" ).val(no);
|
|
}
|
|
|
|
function selectionner_police_d(id,no)
|
|
{
|
|
$("#idPolice_d_C" ).val(id);
|
|
$("#numeroPolice_d_C" ).val(no);
|
|
}
|
|
|
|
function afficher_police_id()
|
|
{
|
|
idPolice=$("#idPolice_C" ).val();
|
|
|
|
if (idPolice>"")
|
|
{
|
|
ajax_context_police_afficher(idPolice);
|
|
}/*else{
|
|
window.location.assign($("#racineWeb" ).val()+"Remboursementclassique/");
|
|
}*/
|
|
}
|
|
|
|
function afficher_garant(codeGcAssureur)
|
|
{
|
|
//alert(codeGcAssureur);
|
|
//return;
|
|
if (codeGcAssureur>"")
|
|
{
|
|
ajax_context_garant_afficher(codeGcAssureur);
|
|
}
|
|
}
|
|
|
|
function afficher_police_d_id()
|
|
{
|
|
idPolice=$("#idPolice_d_C" ).val();
|
|
|
|
if (idPolice>"")
|
|
{
|
|
ajax_context_police_d_afficher(idPolice);
|
|
|
|
//window.location.assign($("#racineWeb" ).val()+"Fichedevis/");
|
|
}
|
|
}
|
|
|
|
function afficher_police_d_id_init()
|
|
{
|
|
idPolice=$("#idPolice_d_C" ).val();
|
|
|
|
if (idPolice>"")
|
|
{
|
|
ajax_context_police_d_afficher(idPolice);
|
|
}
|
|
}
|
|
|
|
function detail_quittance(idQuittance)
|
|
{
|
|
if (idQuittance>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Beneficiairequittance/"+idQuittance+"/");
|
|
}
|
|
}
|
|
|
|
|
|
/* Fin JS client */
|
|
|
|
/* Début JS adherent */
|
|
function selectionner_adherent(id,no)
|
|
{
|
|
$("#idAdherent_C" ).val(id);
|
|
$("#numeroAdherent_C" ).val(no);
|
|
}
|
|
|
|
function afficher_adherent()
|
|
{
|
|
if ($("#numeroAdherent_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheadherent/"+$("#numeroAdherent_C" ).val()+"/");
|
|
}
|
|
}
|
|
|
|
function afficher_adherent_id()
|
|
{
|
|
nomForm = $('#nomForm').val();
|
|
|
|
if(nomForm != "ficheBeneficiaire"){
|
|
idAdherent = $("#idAdherent_C" ).val();
|
|
}else{
|
|
idAdherent = $("#idAdherent" ).val();
|
|
}
|
|
|
|
if (idAdherent>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheadherent/"+idAdherent+"/");
|
|
}
|
|
}
|
|
/* Fin JS adherent */
|
|
|
|
/* Début JS bénéficiare */
|
|
function selectionner_beneficiaire(id,no)
|
|
{
|
|
$("#idBeneficiaire_C" ).val(id);
|
|
$("#numeroBeneficiaire_C" ).val(no);
|
|
}
|
|
|
|
function afficher_beneficiaire()
|
|
{
|
|
if ($("#numeroBeneficiaire_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+$("#numeroBeneficiaire_C" ).val()+"/");
|
|
}
|
|
}
|
|
|
|
function afficher_beneficiaire_id()
|
|
{
|
|
if ($("#idBeneficiaire_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// pour la reedition des cartes
|
|
|
|
function Reeditioncarte()
|
|
{
|
|
|
|
idBeneficiaire_C = $("#idBeneficiaire_C" ).val()
|
|
donnees = "idBeneficiaire_C="+idBeneficiaire_C;
|
|
|
|
$("#div_patienter").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
//alert(window.location.assign($("#racineWeb" ).val()));
|
|
if ($("#idBeneficiaire_C" ).val()>"")
|
|
{
|
|
//window.location.assign($("#racineWeb" ).val()+"Reeditioncarte/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Reeditioncarte/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
/*$("#div_examens_prescrits").html(data);
|
|
appliquerDataTable();
|
|
$("#div_examens_prescrits").modal("show");*/
|
|
$("#div_patienter").empty();
|
|
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Reeditioncarte/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function permutation_numero_beneficiaire()
|
|
{
|
|
|
|
|
|
numeroBeneficiaire_C = $("#numeroBeneficiaire_C" ).val()
|
|
|
|
donnees = "numeroBeneficiaire_C="+numeroBeneficiaire_C;
|
|
|
|
//donnees = "numeroBeneficiaire="+numeroBeneficiaire;
|
|
|
|
$("#div_patienter").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
|
|
v_msg="Etes-vous sur de vouloir générer un nouveau numéro?";
|
|
v_msgEng="Are you sure you want to generate a new number?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
if (numeroBeneficiaire_C>"")
|
|
{
|
|
//window.location.assign($("#racineWeb" ).val()+"Reeditioncarte/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Reeditioncarte/permutation/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
/*$("#div_examens_prescrits").html(data);
|
|
appliquerDataTable();
|
|
$("#div_examens_prescrits").modal("show");*/
|
|
$("#div_patienter").empty();
|
|
|
|
},
|
|
complete: function() {
|
|
afficher_beneficiaire_id();
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
afficher_beneficiaire_id();
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function modifier_prime_beneficiaire(idBeneficiaire)
|
|
{
|
|
// alert("Attention!");
|
|
// return;
|
|
|
|
if (idBeneficiaire>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierprimebeneficiaire/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
}
|
|
}
|
|
|
|
function afficher_adherent_assure()
|
|
{
|
|
if ($("#idAdherent_C" ).val()<=" ")
|
|
{
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb" ).val()+"ficheadherentassure/");
|
|
}
|
|
|
|
|
|
function afficher_echeance_assure()
|
|
{
|
|
if ($("#idAdherent_C" ).val()<=" ")
|
|
{
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb" ).val()+"Echeanceassure/");
|
|
}
|
|
|
|
function afficher_echeance_adherent()
|
|
{
|
|
if ($("#idAdherent_C" ).val()<=" ")
|
|
{
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb" ).val()+"Echeanceadherent/");
|
|
}
|
|
|
|
function afficher_assure()
|
|
{
|
|
if ($("#idAdherent_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"ficheadherentassure/"+$("#idAdherent_C" ).val()+"/");
|
|
}
|
|
}
|
|
|
|
function afficher_beneficiaire_assure()
|
|
{
|
|
if ($("#idBeneficiaire_C" ).val()<=" ")
|
|
{
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb" ).val()+"fichebeneficiaireassure/"+$("#idBeneficiaire_C" ).val()+"/");
|
|
}
|
|
|
|
function changer_photo_beneficiaire_id()
|
|
{
|
|
}
|
|
|
|
function fermerFenetre()
|
|
{
|
|
v_msg="Etes-vous sur de vouloir quitter?";
|
|
v_msgEng="Are you sure you want to exit?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
ajax_deconnexion();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function supprimer_ligne_Tb(id,libelle)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de la ligne : "+libelle+"?";
|
|
v_msgEng="Do you confirm the deletion of the line : "+libelle+"?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Tbliste"+$("#nomtable").val()+"/supprimer/"+id+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function modifier_ligne_Tb()
|
|
{
|
|
if ($("#idLigne" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une ligne!";
|
|
v_msgEng="Please select a line!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb").val()+"Tbmodifier"+$("#nomtable").val()+"/"+$("#idLigne" ).val()+"/");
|
|
}
|
|
|
|
function selectionner_ligne_Tb(id)
|
|
{
|
|
$("#idLigne" ).val(id);
|
|
}
|
|
|
|
/* */
|
|
|
|
function selectionner_Tb(lientable)
|
|
{
|
|
$("#lientable" ).val(lientable);
|
|
}
|
|
|
|
function modifier_Tb()
|
|
{
|
|
if ($("#lientable" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une table!";
|
|
v_msgEng="Please select a table!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
} else
|
|
window.location.assign($("#racineWeb" ).val()+$("#lientable" ).val());
|
|
}
|
|
|
|
function afficher_Tb()
|
|
{
|
|
if ($("#lientable" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une table!";
|
|
v_msgEng="Please select a table!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
} else
|
|
window.location.assign($("#racineWeb" ).val()+$("#lientable" ).val());
|
|
}
|
|
|
|
function ajaxListerVille()
|
|
{
|
|
donnees = "codePays="+$("#codePays").val();
|
|
|
|
//alert(donnees);
|
|
//return;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxville/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listeville").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxListerLocalite()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxlocalite/",
|
|
type : 'post',
|
|
data: "codePays="+$("#codePays").val()+"&codeVille="+$("#codeVille").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listelocalite").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxListerTitre(typeClient)
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxtitretypeclient/",
|
|
type : 'post',
|
|
data: "typeClient="+$("#typeClient").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#codeTitre").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function controletytpeclient()
|
|
{
|
|
var typeClient = $("#typeClient").val();
|
|
|
|
//alert(typeClient);
|
|
//return;
|
|
if (typeClient=="E")
|
|
{
|
|
ajaxListerTitre(typeClient);
|
|
$("#nomMandataire").removeAttr('readonly','readonly');
|
|
$("#telephonePortablemandataire").removeAttr('readonly','readonly');
|
|
$("#telephoneFixemandataire").removeAttr('readonly','readonly');
|
|
$("#emailMandataire").removeAttr('readonly','readonly');
|
|
$("#prenoms").attr('readonly','readonly');
|
|
} else
|
|
{
|
|
ajaxListerTitre(typeClient);
|
|
$("#prenoms").removeAttr('readonly','readonly');
|
|
$("#nomMandataire").attr('readonly','readonly');
|
|
$("#telephonePortablemandataire").attr('readonly','readonly');
|
|
$("#telephoneFixemandataire").attr('readonly','readonly');
|
|
$("#emailMandataire").attr('readonly','readonly');
|
|
}
|
|
}
|
|
|
|
function enregistrer_client()
|
|
{
|
|
$("#formficheclient").submit();
|
|
}
|
|
|
|
function modifier_client()
|
|
{
|
|
if ($("#idClient_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierclient/");
|
|
}
|
|
}
|
|
|
|
function modifier_client_d()
|
|
{
|
|
if ($("#idClient_d_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierprospect/");
|
|
}
|
|
}
|
|
|
|
function modifier_police()
|
|
{
|
|
idPolice = $("#idPolice_C").val();
|
|
if (idPolice>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierpolice/");
|
|
}
|
|
}
|
|
|
|
function modifier_devis()
|
|
{
|
|
idPolice = $("#idPolice_d_C").val();
|
|
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (idPolice>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierdevis/");
|
|
}
|
|
}
|
|
|
|
|
|
function transformer_devis()
|
|
{
|
|
idDevis = $("#idPolice_d_C").val();
|
|
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
primeTtc_total = $("#primeTtc_total").val();
|
|
nbTotalCollege = $("#nbTotalCollege").val();
|
|
|
|
// if (primeTtc_total=="0")
|
|
if (nbTotalCollege=="0")
|
|
{
|
|
v_msg="Rien à transformer!";
|
|
v_msgEng="Nothing to transform!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous la transformation en contrat?";
|
|
v_msgEng="Do you confirm the transformation into a contract?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
numeroOptionTarif = $("#numeroOptionTarif").val();
|
|
donnees = 'idDevis='+idDevis+"&numeroOptionTarif="+numeroOptionTarif;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxtransformerdevis/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function() {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Fichepolice/");
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function supprimer_client()
|
|
{
|
|
v_msg="Confirmez-vous la suppression de ce client?";
|
|
v_msgEng="Do you confirm the deletion of this customer?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheclient/supprimer/"+$("#idClient_C").val()+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function supprimer_prospect()
|
|
{
|
|
v_msg="Confirmez-vous la suppression de ce prospect?";
|
|
v_msgEng="Do you confirm the deletion of this prospect?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheprospect/supprimer/"+$("#idClient_d_C").val()+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function CalculerEcheance()
|
|
{
|
|
$("#dateEcheance").disable();
|
|
|
|
codePeriodicite=$("#codePeriodicite").val();
|
|
|
|
var typdate = $("#dateEffet").datepicker("getDate");
|
|
|
|
switch (codePeriodicite) {
|
|
case "A":
|
|
typdate.addMonths(12);
|
|
break;
|
|
case "S":
|
|
typdate.addMonths(6);
|
|
break;
|
|
case "T":
|
|
typdate.addMonths(3);
|
|
break;
|
|
case "M":
|
|
typdate.addMonths(1);
|
|
break;
|
|
case "L":
|
|
$("#dateEcheance").enable();
|
|
typdate = $("#dateEcheance").datepicker("getDate");
|
|
break;
|
|
default:
|
|
typdate.addMonths(12);
|
|
}
|
|
|
|
$( "#dateEcheance" ).datepicker( "setDate", typdate );
|
|
}
|
|
|
|
function CalculerFin()
|
|
{
|
|
$("#dateFin").disable();
|
|
|
|
codeFractionnement=$("#codeFractionnement").val();
|
|
|
|
var typdate = $("#dateEffet").datepicker("getDate");
|
|
var dtech = $("#dateEcheance").datepicker("getDate");
|
|
|
|
switch (codeFractionnement) {
|
|
case "A":
|
|
typdate.addMonths(12);
|
|
break;
|
|
case "S":
|
|
typdate.addMonths(6);
|
|
break;
|
|
case "T":
|
|
typdate.addMonths(3);
|
|
break;
|
|
case "M":
|
|
typdate.addMonths(1);
|
|
break;
|
|
default:
|
|
typdate.addMonths(12);
|
|
}
|
|
if (typdate>dtech)
|
|
{
|
|
typdate=dtech;
|
|
}
|
|
$( "#dateFin" ).datepicker( "setDate", typdate );
|
|
}
|
|
|
|
function ControlerEcheance()
|
|
{
|
|
codePeriodicite=$("#codePeriodicite").val();
|
|
if (codePeriodicite!="L") return true;
|
|
else {
|
|
var eff = $("#dateEffet").datepicker("getDate");
|
|
var ech = $("#dateEcheance").datepicker("getDate");
|
|
|
|
if (ech<eff) {
|
|
$("#dateEcheance").focus();
|
|
return false;
|
|
}
|
|
|
|
if (ech>eff.addMonths(12)) {
|
|
v_msg="Période supérieur à un an!";
|
|
v_msgEng="Period greater than one year!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
}
|
|
}
|
|
}
|
|
|
|
function ChangerPass()
|
|
{
|
|
if ($("#ancmdp" ).val()<=' ')
|
|
{
|
|
alert_ebene("Veuillez saisir l\'ancien mot de passe!", "Please enter the old password!");
|
|
$("#ancmdp").focus();
|
|
return false;
|
|
}
|
|
|
|
if ($("#nvmdp" ).val()<=' ')
|
|
{
|
|
v_msg="Veuillez saisir un mot de passe!";
|
|
v_msgEng="Please enter a password!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#nvmdp").focus();
|
|
return false;
|
|
}
|
|
|
|
if ($("#nvmdp").val()=='0000' || $("#nvmdp").val()=='radiant')
|
|
{
|
|
alert_ebene("Veuillez changer de mot de passe!", "Please change password!");
|
|
$("#nvmdp").focus();
|
|
return false;
|
|
}
|
|
|
|
longueur = $("#nvmdp").val().length;
|
|
|
|
if(longueur>0 && longueur<6)
|
|
{
|
|
v_msg="6 caractères minimum exigé!";
|
|
v_msgEng="6 characters minmum required!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#nvmdp").focus();
|
|
return false;
|
|
}
|
|
|
|
if ($("#cfnvmdp" ).val()!=$("#nvmdp" ).val())
|
|
{
|
|
v_msg="Veuillez confirmer votre mot de passe!";
|
|
v_msgEng="Please confirm your password!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#nvmdp").focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function modifier_profil()
|
|
{
|
|
if ($("#idLigne" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une ligne!";
|
|
v_msgEng="Please select a line!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
} else
|
|
window.location.assign($("#racineWeb").val()+"Modifierprofil/"+$("#idLigne" ).val()+"/");
|
|
}
|
|
|
|
|
|
function parametrer_profil()
|
|
{
|
|
if ($("#idLigne" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une ligne!";
|
|
v_msgEng="Please select a line!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
} else
|
|
window.location.assign($("#racineWeb").val()+"Parametrerprofil/"+$("#idLigne" ).val()+"/");
|
|
}
|
|
|
|
function supprimer_profil(id, libelle)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de la ligne : "+libelle+"?";
|
|
v_msgEng="Do you confirm the deletion of the line : "+libelle+"?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Listeprofil/supprimer/"+id+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function modifier_utilisateur()
|
|
{
|
|
if ($("#idLigne" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une ligne!";
|
|
v_msgEng="Please select a line!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
} else
|
|
window.location.assign($("#racineWeb").val()+"Modifierutilisateur/"+$("#idLigne" ).val()+"/");
|
|
}
|
|
|
|
function supprimer_utilisateur(id,libelle)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de la ligne : "+libelle+"?";
|
|
v_msgEng="Do you confirm the deletion of the line : "+libelle+"?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Listeutilisateur/supprimer/"+id+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function supprimer_police()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous la suppression de cette police?";
|
|
v_msgEng="Do you confirm the deletion of this policy?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Fichepolice/supprimer/"+$("#idPolice_C").val()+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function supprimer_devis()
|
|
{
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
nbTotalCollege = $("#nbTotalCollege").val();
|
|
|
|
if (nbTotalCollege > "0")
|
|
{
|
|
v_msg="Impossible de supprimer cette cotation!";
|
|
v_msgEng="Impossible to delete this quote!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
//
|
|
v_msg="Confirmez-vous la suppression de cette cotation?";
|
|
v_msgEng="Do you confirm the deletion of this quote?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Fichedevis/supprimer/"+$("#idPolice_d_C").val()+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function archiver_garantie_police()
|
|
{
|
|
v_msg="Confirmez-vous l\'archivage des garanties de cette police?";
|
|
v_msgEng="Do you confirm the archiving of the guarantees of this policy?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Fichepolice/archivergarantie/"+$("#idPolice_C").val()+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function archiver_colleege_police()
|
|
{
|
|
}
|
|
|
|
function ajaxListerUtilisateursProfil()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxutilisateursprofil/",
|
|
type : 'post',
|
|
data: "codeProfil="+$("#codeProfil").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listeutilisateur").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxListerUtilisateursPrestataire()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxutilisateursprestataire/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listeutilisateur").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function attribuer_profil_utilisateur(p_choix,p_id_utilisateur)
|
|
{
|
|
donnees = 'id_utilisateur='+p_id_utilisateur;
|
|
donnees += '&codeProfil='+$("#codeProfil").val();
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxutilisateursprofil/attribuerProfil/"+p_id_utilisateur+"/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function attribuer_prestataire_utilisateur(p_choix,p_id_utilisateur)
|
|
{
|
|
donnees = 'id_utilisateur='+p_id_utilisateur;
|
|
donnees += '&codePrestataire='+$("#codePrestataire").val();
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxutilisateursprestataire/attribuerPrestataire/"+p_id_utilisateur+"/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function beneficiaire_a_facturer(p_choix,p_id_beneficiaire)
|
|
{
|
|
donnees = 'idBeneficiairePrime='+p_id_beneficiaire;
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxbeneficiaireafacturer/selectionner/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
$("#actualsiser" ).val("0");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxListerMenusProfil()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmenusprofil/",
|
|
type : 'post',
|
|
data: "codeProfil="+$("#codeProfil").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listemenu").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajouter_menu_profil(p_choix,p_code_menu,p_id_menuprofil)
|
|
{
|
|
donnees = 'id_menuprofil='+p_id_menuprofil;
|
|
donnees += '&codeMenu='+p_code_menu;
|
|
donnees += '&codeProfil='+$("#codeProfil").val();
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmenusprofil/ajouterMenu/"+p_id_menuprofil+"/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxListerVuesProfil()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxvuesprofil/",
|
|
type : 'post',
|
|
data: "codeProfil="+$("#codeProfil").val()+"&vue="+$("#vue").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listemenu").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajouter_vue_profil(p_choix,p_code_menu,p_id_menuvueprofil)
|
|
{
|
|
donnees = 'id_menuvueprofil='+p_id_menuvueprofil;
|
|
donnees += '&codeMenu='+p_code_menu;
|
|
donnees += '&codeProfil='+$("#codeProfil").val();
|
|
donnees += '&vue='+$("#vue").val();
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxvuesprofil/ajouterMenu/"+p_id_menuvueprofil+"/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function lancer_facturation()
|
|
{
|
|
if ($("#actualsiser").val()=="0" && $("#primeTtc").val()>"0")
|
|
{
|
|
v_msg="Veuillez réactualiser!";
|
|
v_msgEng="Please refresh!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if ($("#primeTtc").val()<="0")
|
|
{
|
|
v_msg="Rien à facturer!";
|
|
v_msgEng="Nothing to charge!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Lancer la facturation?";
|
|
v_msgEng="Start billing?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Facturerpolice/facturer/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function afficher_image(fichier)
|
|
{
|
|
window.open(fichier);
|
|
}
|
|
|
|
function modifier_adherent()
|
|
{
|
|
|
|
|
|
if ($("#idAdherent_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifieradherent/"+$("#idAdherent_C").val()+"/");
|
|
}
|
|
}
|
|
|
|
function modifier_beneficiaire()
|
|
{
|
|
if ($("#idBeneficiaire_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifierbeneficiaire/"+$("#idBeneficiaire_C").val()+"/");
|
|
}
|
|
}
|
|
|
|
function supprimer_bon()
|
|
{
|
|
if ($("#codePrestataire").val()<" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un prestataire!";
|
|
v_msgEng="Please select a provider!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if ($("#noDepart").val()<="0")
|
|
{
|
|
v_msg="Veuillez revoir vos bornes!";
|
|
v_msgEng="Please check your limits!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if ($("#noFin").val()<$("#noDepart").val())
|
|
{
|
|
v_msg="Veuillez revoir vos bornes!";
|
|
v_msgEng="Please check your limits!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous la suppression de la plage de "+$("#noDepart").val()+" à "+$("#noFin").val()+" pour "+$("#codePrestataire").val()+"?";
|
|
v_msgEng="Do you confirm the deletion of the range from "+$("#noDepart").val()+" to "+$("#noFin").val()+" for "+$("#codePrestataire").val()+"?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$('#frmsupprimerbons').submit();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function selectionner_bon(id,no, codeEtatBon, motifAnnulation)
|
|
{
|
|
$("#idBon_C").val(id);
|
|
$("#numeroBon_C").val(no);
|
|
$("#motifAnnulation_C").val(motifAnnulation);
|
|
$("#codeEtatBon_C").val(codeEtatBon);
|
|
}
|
|
|
|
function annuler_bon()
|
|
{
|
|
var codeEtatBon = $("#codeEtatBon_C").val();
|
|
var motifAnnulation = $("#motifAnnulation_C").val();
|
|
var numeroBon = $("#numeroBon_C").val();
|
|
var idBon = $("#idBon_C").val();
|
|
|
|
if (numeroBon<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner une ligne!";
|
|
v_msgEng="Please select a line!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (codeEtatBon=="3")
|
|
{
|
|
v_msg="Anullé pour motif : "+motifAnnulation;
|
|
v_msgEng="Canceled for reason : "+motifAnnulation;
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (codeEtatBon=="4")
|
|
{
|
|
v_msg="Remplacé pour motif : "+motifAnnulation;
|
|
v_msgEng="Replaced for reason : "+motifAnnulation;
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous l\'annulation du bon No "+numeroBon+"?";
|
|
v_msgEng="Do you confirm the cancellation of the form No "+numeroBon+"?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng).then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
let v_msg = "Raison de l'annulation?";
|
|
let v_msgEng = "Reason for cancellation?";
|
|
|
|
prompt_ebene(v_msg, v_msgEng, "", function(motifAnnulation) {
|
|
if (!motifAnnulation || motifAnnulation.trim() === "") {
|
|
v_msg = "Vous devez saisir un motif!";
|
|
v_msgEng = "You have to enter a reason!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
|
|
$("#motifAnnulation_C").val(motifAnnulation);
|
|
|
|
let donnees = 'idBon=' + idBon + '&motifAnnulation=' + encodeURIComponent(motifAnnulation);
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val() + "Ajaxafficherbons/annulerBon/",
|
|
type: 'post',
|
|
data: donnees,
|
|
error: function(errorData) { },
|
|
success: function(data) { },
|
|
complete: function() {
|
|
afficherbon();
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function ajaxbondisponible()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
if ($("#codeMedecin").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un prescripteur!";
|
|
v_msgEng="Please select a prescriber!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeMedecin").focus();
|
|
return;
|
|
}
|
|
|
|
if ($("#numeroBon").val()<=" ")
|
|
{
|
|
v_msg="Veuillez saisir un No de bon!";
|
|
v_msgEng="Please enter a prescription number!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#numeroBon").focus();
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxbondisponible/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val()+"&numeroBon="+$("#numeroBon").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#msgErreur").html(data);
|
|
},
|
|
complete: function() {
|
|
imprimerbon();
|
|
}
|
|
});
|
|
}
|
|
|
|
function imprimerbon()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
if ($("#numeroBon").val()<=" ")
|
|
{
|
|
v_msg="Veuillez saisir un No de bon!";
|
|
v_msgEng="Please enter a prescription number!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
var codeEtatBon = $("input[name='codeEtatBon']").val();
|
|
|
|
if (codeEtatBon!="1")
|
|
{
|
|
return;
|
|
}
|
|
|
|
$("#frmconsultation").submit();
|
|
}
|
|
|
|
function imprimerbonVierge()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
$("#codeTypeBon").val('2');
|
|
$("#frmconsultation").submit();
|
|
$("#codeTypeBon").val('1');
|
|
}
|
|
|
|
|
|
function ajaxcommission()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcommission/",
|
|
type : 'post',
|
|
data: "codeApporteur="+$("#codeApporteur").val()+"&codeEtape="+$("#codeEtape").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infocomm").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#tauxCommission").val( $("#tauxCommission_info").val());
|
|
}
|
|
});
|
|
}
|
|
|
|
function selectionTauxGarant()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcommissiongarant/",
|
|
type : 'post',
|
|
data: "codeGcAssureur="+$("#codeGcAssureur").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_taux_garant").html(data);
|
|
|
|
var gcTauxFraisReel = $("#gcTauxFraisReel").val();
|
|
var gcTauxCommissionGerant = $("#gcTauxCommissionGerant").val();
|
|
var gcLimiteConsommation = $("#gcLimiteConsommation").val();
|
|
var gcTauxRistourne = $("#gcTauxRistourne").val();
|
|
var seuilRdGarant = $("#seuilRdGarant").val();
|
|
|
|
if(gcTauxCommissionGerant>"0"){
|
|
$("#tauxCommissionGerant").val(gcTauxCommissionGerant);
|
|
}
|
|
|
|
$("#tauxCommissionGcAssureur").val(gcTauxFraisReel);
|
|
$("#limiteConsommation").val(gcLimiteConsommation);
|
|
$("#tauxRistourne").val(gcTauxRistourne);
|
|
$("#seuilRdPolice").val(seuilRdGarant);
|
|
|
|
|
|
},
|
|
complete: function() {
|
|
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function ajaxinfosacte()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxinfosacte/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val()+"&codeActe="+$("#codeActe").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infosacte").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#montantacte").val( $("#montantacte_info").val());
|
|
$("#tauxCouverture").val( $("#tauxCouverture_info").val());
|
|
calculer_Tm();
|
|
}
|
|
});
|
|
}
|
|
|
|
function recapitulerprimeimposee()
|
|
{
|
|
primeNette = $("#primeNette").val();
|
|
fraisCarte = $("#fraisCarte").val();
|
|
|
|
donnees = "primeNette="+primeNette+"&fraisCarte="+fraisCarte;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxrecapitulerprimeimposee/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#primeimposee").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#primeHt").val( $("#primeHt_info").val());
|
|
$("#accessoire").val( $("#accessoire_info").val());
|
|
$("#accessoireGarant").val( $("#accessoireGarant_info").val());
|
|
$("#commission").val( $("#commission_info").val());
|
|
$("#commissionGestion").val( $("#commissionGestion_info").val());
|
|
$("#commissionAutre").val( $("#commissionAutre_info").val());
|
|
$("#taxe").val( $("#taxe_info").val());
|
|
$("#primeTtc").val( $("#primeTtc_info").val());
|
|
$("#primeNetteStat").val( $("#primeNetteStat_info").val());
|
|
}
|
|
});
|
|
}
|
|
|
|
function imposerprime()
|
|
{
|
|
v_msg="Confirmez-vous cette nouvelle prime?";
|
|
v_msgEng="Do you confirm this new premium?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$("#frmModifierprimebeneficiaire").submit();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function calculer_Tm()
|
|
{
|
|
$("#montantTm").val( ($("#montantacte").val() * (100-$("#tauxCouverture").val() )) / 100 );
|
|
if ($("#codeMedecin").val()>" ")
|
|
$("#numeroBon").focus();
|
|
else
|
|
$("#codeMedecin").focus();
|
|
return true;
|
|
}
|
|
|
|
function controlefocusconsultationMd()
|
|
{
|
|
if ($("#codeActe").val()>" ")
|
|
$("#numeroBon").focus();
|
|
else
|
|
$("#codeActe").focus();
|
|
return true;
|
|
}
|
|
|
|
function ajaxinfosacteexamen()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxinfosacte/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val()+"&codeActe="+$("#codeActe").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infosacte").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#tauxCouverture").val( $("#tauxCouverture_info").val());
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxbonexamendisponible()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
if ($("#numeroBon").val()<=" ")
|
|
{
|
|
v_msg="Veuillez saisir un No de bon!";
|
|
v_msgEng="Please enter a prescription number!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#numeroBon").focus();
|
|
return;
|
|
}
|
|
|
|
$("#codeTypeBon").val('1');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxbondisponible/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val()+"&numeroBon="+$("#numeroBon").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#msgErreur").html(data);
|
|
},
|
|
complete: function() {
|
|
imprimerbon();
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxbonhospitdisponible()
|
|
{
|
|
if ($("#codeActe").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un acte!";
|
|
v_msgEng="Please select an act!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeActe").focus();
|
|
return;
|
|
}
|
|
|
|
if ($("#numeroBon").val()<=" ")
|
|
{
|
|
v_msg="Veuillez saisir un No de bon!";
|
|
v_msgEng="Please enter a prescription number!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#numeroBon").focus();
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxbondisponible/",
|
|
type : 'post',
|
|
data: "codePrestataire="+$("#codePrestataire").val()+"&numeroBon="+$("#numeroBon").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#msgErreur").html(data);
|
|
},
|
|
complete: function() {
|
|
imprimerbon();
|
|
}
|
|
});
|
|
}
|
|
|
|
function repondreDemandePec(numeroDemande, codeFamille)
|
|
{
|
|
if(codeFamille=="EE")
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Repondrepecexamen/"+numeroDemande+"/");
|
|
}
|
|
else
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Repondrepechospit/"+numeroDemande+"/");
|
|
}
|
|
}
|
|
|
|
function accueil()
|
|
{
|
|
if($("#codeProfil_C" ).val()=="MEC")
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Accueilmedecin/");
|
|
}
|
|
else
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Accueil/");
|
|
}
|
|
}
|
|
|
|
function tache()
|
|
{
|
|
if($("#codeProfil_C" ).val()=="ASS")
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Tacheassure/");
|
|
}
|
|
else
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Tache/");
|
|
}
|
|
}
|
|
|
|
function actualiserdemandeexam()
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Examenententeprealable/");
|
|
}
|
|
|
|
function actualiserdemandehospit()
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Avishospitalisation/");
|
|
}
|
|
|
|
function actualiserprolongationhospit()
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Prologerhospitalisation/");
|
|
}
|
|
|
|
function Imprimerbonpecexam(numeroDemande)
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Imprimerbonpecexam/"+ numeroDemande +"/");
|
|
}
|
|
|
|
function Imprimerbonpechosp(numeroDemande)
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Imprimerbonpechosp/"+ numeroDemande +"/");
|
|
}
|
|
|
|
function Imprimerprolongationhosp(numeroDemande)
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Imprimprolonghosp/"+ numeroDemande +"/");
|
|
}
|
|
|
|
function forceDownload(fileURL, fileName)
|
|
{
|
|
}
|
|
|
|
|
|
function ged()
|
|
{
|
|
if ($("#numeroBeneficiaire_C" ).val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un assuré!";
|
|
v_msgEng="Please select an insured person!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb").val()+"Ged/");
|
|
}
|
|
|
|
function gedassure()
|
|
{
|
|
if ($("#numeroAdherent_C" ).val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un assuré!";
|
|
v_msgEng="Please select an insured person!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb").val()+"Gedassure/");
|
|
}
|
|
|
|
|
|
function tachesadherent()
|
|
{
|
|
if ($("#numeroAdherent_C" ).val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un assuré!";
|
|
v_msgEng="Please select an insured person!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb").val()+"Tacheadherent/");
|
|
}
|
|
|
|
function afficherged(cheminFichier)
|
|
{
|
|
if (cheminFichier<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un fichier!";
|
|
v_msgEng="Please select a file";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.open(cheminFichier, '_blank');
|
|
}
|
|
|
|
function archiverged()
|
|
{
|
|
if ($("#nomFichier").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un document!";
|
|
v_msgEng="Please select a document";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
if( $("#accesAssure").val()=="0" && $("#accesPrestataire").val()=="0"
|
|
&& $("#accesMedecin").val()=="0" && $("#accesGestionnaire").val()=="0")
|
|
{
|
|
v_msg="Le document doit être visible par au moins un des acteurs!";
|
|
v_msgEng="The document must be seen by at least one of the persons in charge!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
$("#frmarchiherged").submit();
|
|
}
|
|
|
|
function archiverfacture()
|
|
{
|
|
if ($("#nomFichier").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un fichier!";
|
|
v_msgEng="Please select a file";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
$("#frmarchiherged").submit();
|
|
}
|
|
|
|
function ajaxinfosdestinatairetache()
|
|
{
|
|
if ($("#codeDestinataire").val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un destinataire!";
|
|
v_msgEng="Please select a recipient!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeDestinataire").focus();
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxinfosdestinatairetache/",
|
|
type : 'post',
|
|
data: "codeDestinataire="+$("#codeDestinataire").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infosdestinatairetache").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#emailtache").val( $("#emailActeurtache_info").val());
|
|
}
|
|
});
|
|
}
|
|
|
|
function afficherPrestataireAssure(id)
|
|
{
|
|
if (id <=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un prestataire!";
|
|
v_msgEng="Please select a provider!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
window.location.assign($("#racineWeb").val()+"Prestataireassure/"+id+"/");
|
|
}
|
|
|
|
|
|
function selectionner_Rq(lienrequete)
|
|
{
|
|
$("#lienrequete" ).val(lienrequete);
|
|
}
|
|
|
|
|
|
function parametre_Rq()
|
|
{
|
|
if ($("#lienrequete" ).val()<="")
|
|
{
|
|
v_msg="Veuillez sélectionner une requête!";
|
|
v_msgEng="Please select a query (request)!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+$("#lienrequete" ).val());
|
|
}
|
|
}
|
|
|
|
function imprimer_pdf()
|
|
{
|
|
$("#sortie").val('1');
|
|
$("#frmrequete").submit();
|
|
}
|
|
|
|
function export_xls()
|
|
{
|
|
$("#sortie").val('2');
|
|
$("#frmrequete").submit();
|
|
$("#sortie").val('1');
|
|
}
|
|
|
|
function affichermanuel()
|
|
{
|
|
codeProfil = $("#codeProfil_C").val();
|
|
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_CENTRES_DE_SOINS.pdf";
|
|
|
|
switch(codeProfil)
|
|
{
|
|
case "AAA":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_AGENT_AFRIK_ASSUR.pdf";
|
|
break;
|
|
case "ADM":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_ADMINISTRATEUR_SYSTEME.pdf";
|
|
break;
|
|
case "ASS":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_ASSURE.pdf";
|
|
break;
|
|
case "CSO":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_CENTRES_DE_SOINS.pdf";
|
|
break;
|
|
case "DIR":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_DIRECTION_AFRIK_ASSUR.pdf";
|
|
break;
|
|
case "LAB":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_LABORATOIRES.pdf";
|
|
break;
|
|
case "MEC":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_MEDECINS_CONSEIL.pdf";
|
|
break;
|
|
case "PHA":
|
|
cheminFichier="MANUEL_AFRIK_ASSUR_SANTE_PHARMACIES.pdf";
|
|
break;
|
|
}
|
|
window.open('Docs/'+cheminFichier, '_blank');
|
|
}
|
|
|
|
function ajaxListerequetesProfil()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxrequetesprofil/",
|
|
type : 'post',
|
|
data: "codeProfil="+$("#codeProfil").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listerequete").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajouter_requete_profil(p_choix,p_nomRequete,p_id_requeteprofil)
|
|
{
|
|
donnees = 'id_requeteprofil='+p_id_requeteprofil;
|
|
donnees += '&nomRequete='+p_nomRequete;
|
|
donnees += '&codeProfil='+$("#codeProfil").val();
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxrequetesprofil/ajouterRequete/"+p_id_requeteprofil+"/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function supprimer_beneficiaire()
|
|
{
|
|
idBeneficiaire = $("#idBeneficiaire_C").val();
|
|
|
|
primeArchive=$("#primeArchive").val();
|
|
if (primeArchive=="1")
|
|
{
|
|
v_msg="Prime archivée!";
|
|
v_msgEng="Primium archived!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (primeArchive=="0")
|
|
{
|
|
supprimer_beneficiaire_id(idBeneficiaire);
|
|
return;
|
|
}
|
|
|
|
codeTypeAvenant=$("#codeTypeAvenant_C").val();
|
|
|
|
if (codeTypeAvenant!="REN" && codeTypeAvenant!="AFN")
|
|
{
|
|
v_msg="Veuillez procéder à un retrait!";
|
|
v_msgEng="Please make a withdrawal!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
supprimer_beneficiaire_id(idBeneficiaire);
|
|
}
|
|
|
|
function supprimer_beneficiaire_id(idBeneficiaire)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de ce bénéficiaire?";
|
|
v_msgEng="Do you confirm the removal of this beneficiary?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxbeneficiaire/supprimer/",
|
|
type : 'post',
|
|
data: "idBeneficiaire="+idBeneficiaire,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
afficher_adherent_id();
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function actualiserbeneficiaireafacturer()
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Facturerpolice/");
|
|
}
|
|
|
|
function selectionner_tout_beneficiaireafacturer(choix)
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Facturerpolice/selectionnertout/"+choix+"/");
|
|
}
|
|
|
|
function compta()
|
|
{
|
|
numeroClient = $("#numeroClient_C" ).val();
|
|
idClient = $("#idClient_C").val();
|
|
|
|
if(idClient<'0')
|
|
{
|
|
idClient = '0';
|
|
}
|
|
|
|
if(idClient>'0')
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Compta/"+idClient+"/");
|
|
}
|
|
else
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Compta/");
|
|
}
|
|
}
|
|
|
|
|
|
function selection_quittanes_enc()
|
|
{
|
|
numeroClient = $("#numeroClient_C" ).val();
|
|
idClient = $("#idClient_C").val();
|
|
window.location.assign($("#racineWeb").val()+"Encselectionquittances/"+idClient+"/");
|
|
}
|
|
|
|
function selection_quittances_cli_enc()
|
|
{
|
|
numeroClient = $("#numeroClient_C" ).val();
|
|
idClient = $("#idClient_C").val();
|
|
window.location.assign($("#racineWeb").val()+"Encselectquitclient/"+idClient+"/");
|
|
}
|
|
|
|
function compta_changer_client(numeroClient)
|
|
{
|
|
if (numeroClient>"0")
|
|
{
|
|
$("#forminfoclient").submit();
|
|
}
|
|
}
|
|
|
|
|
|
function encaissement_changer_client(numeroClient)
|
|
{
|
|
if (numeroClient>"0")
|
|
{
|
|
$("#forminfoclient").submit();
|
|
}
|
|
}
|
|
|
|
function afficher_quittances_police()
|
|
{
|
|
numeroPolice = $("#numeroPolice_C" ).val();
|
|
idPolice = $("#idPolice_C" ).val();
|
|
|
|
$("#div_quittancepolice").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
if (numeroPolice>" ")
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxquittancepolice/",
|
|
type : 'post',
|
|
data: "idPolice="+idPolice+"&numeroPolice="+numeroPolice,
|
|
error: function(errorData) {
|
|
// $("#div_ajaxgabarit").html(data);
|
|
},
|
|
success: function(data) {
|
|
// $("#div_ajaxgabarit").html(data);
|
|
$("#div_quittancepolice").html(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function afficher_quittances_impayees_client()
|
|
{
|
|
idClient = $("#idClient_C").val();
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxsituationclient/",
|
|
type : 'post',
|
|
data: "idClient="+idClient,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_quittancesclient").html(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
function afficher_encaissements_quittance(idQuittance, numeroQuittance)
|
|
{
|
|
if (idQuittance>"0")
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxencaissementquittance/",
|
|
type : 'post',
|
|
data: "idQuittance="+idQuittance+"&numeroQuittance="+numeroQuittance,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_encaissementsquittance").html(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
function afficher_encaissement(idEncaissement)
|
|
{
|
|
if (idEncaissement>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheencaissement/"+idEncaissement+"/");
|
|
}
|
|
}
|
|
|
|
|
|
function encaisser_client()
|
|
{
|
|
numeroClient = $("#numeroClient_C" ).val();
|
|
idClient = $("#idClient_C").val();
|
|
|
|
if (idClient>"0")
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Encaisserclient/"+idClient+"/");
|
|
}
|
|
else
|
|
{
|
|
v_msg="Veuillez sélectionner un client!";
|
|
v_msgEng="Please select a customer!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
compta();
|
|
}
|
|
}
|
|
|
|
function encaisser_depot_bord()
|
|
{
|
|
$("#btn_depot").click();
|
|
}
|
|
|
|
function enregistrer_college()
|
|
{
|
|
//
|
|
var primeTtcCollege = parseInt($('#primeTtcCollege').val().replace(/ /g,""));
|
|
var nomForm = $('#nomForm').val();
|
|
|
|
var plafondCollege = parseInt($('#plafondCollege').val().replace(/ /g,""));
|
|
var plafondAdherent = parseInt($('#plafondAdherent').val().replace(/ /g,""));
|
|
|
|
if($('#codeProduit').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un produit!";
|
|
v_msgEng="Please select a category!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeProduit').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#idBaremePriseEnCharge').val()=="0")
|
|
{
|
|
v_msg="Veuillez sélectionner un barème!";
|
|
v_msgEng="Please select a scale!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#idBaremePriseEnCharge').focus();
|
|
return;
|
|
}
|
|
|
|
|
|
if($('#codeCollegeType').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un collège type!";
|
|
v_msgEng="Please select a typical college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeCollegeType').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#codeReseau').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un réseau de soins!";
|
|
v_msgEng="Please select a care network!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeReseau').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#codeBaseTarification').val()=="AUC")
|
|
{
|
|
v_msg="Veuillez sélectionner une base tarifaire!";
|
|
v_msgEng="Please select a fare basis!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeBaseTarification').focus();
|
|
return;
|
|
}
|
|
|
|
/* Ne pas rendre le plafondAdherent obligatoire
|
|
if(plafondAdherent=="0" || plafondAdherent obligatoire<=" "){
|
|
|
|
v_msg="Veuillez indiquer le montant du plafond famille!";
|
|
v_msgEng="Please indicate the amount of the family ceiling!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
|
|
$("#plafondAdherent").focus();
|
|
|
|
return;
|
|
|
|
}
|
|
*/
|
|
|
|
enregistrer_college_temp();
|
|
|
|
v_msg="Confirmez-vous l'enregistrement du collège?";
|
|
v_msgEng="Do you confirm college registration?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
if($('#nomForm').val()=="creercollege"){
|
|
window.location.assign($("#racineWeb" ).val()+"Creercollege/enregistrer/");
|
|
}else{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifiercollege/enregistrer/");
|
|
}
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
function enregistrer_college_d()
|
|
{
|
|
var garantieArchive = $('#garantieArchive').val();
|
|
|
|
if(garantieArchive == "1"){
|
|
afficher_police_d_id();
|
|
}
|
|
|
|
|
|
var primeTtcCollege = parseInt($('#primeTtcCollege').val().replace(/ /g,""));
|
|
var nomForm = $('#nomForm').val();
|
|
|
|
var plafondCollege = parseInt($('#plafondCollege').val().replace(/ /g,""));
|
|
var plafondAdherent = parseInt($('#plafondAdherent').val().replace(/ /g,""));
|
|
|
|
if($('#codeProduit').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un produit!";
|
|
v_msgEng="Please select a category!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeProduit').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#idBaremePriseEnCharge').val()=="0")
|
|
{
|
|
v_msg="Veuillez sélectionner un barème!";
|
|
v_msgEng="Please select a scale!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#idBaremePriseEnCharge').focus();
|
|
return;
|
|
}
|
|
|
|
|
|
if($('#codeCollegeType').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un collège type!";
|
|
v_msgEng="Please select a typical college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeCollegeType').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#codeReseau').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un réseau de soins!";
|
|
v_msgEng="Please select a care network!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeReseau').focus();
|
|
return;
|
|
}
|
|
|
|
if($('#codeBaseTarification').val()=="AUC")
|
|
{
|
|
v_msg="Veuillez sélectionner une base tarifaire!";
|
|
v_msgEng="Please select a fare basis!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeBaseTarification').focus();
|
|
return;
|
|
}
|
|
|
|
/* Ne pas rendre le plafondAdherent obligatoire
|
|
if(plafondAdherent=="0" || plafondAdherent<=" "){
|
|
|
|
v_msg="Veuillez indiquer le montant du plafond famille!";
|
|
v_msgEng="Please indicate the amount of the family ceiling!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
|
|
$("#plafondAdherent").focus();
|
|
|
|
return;
|
|
|
|
}
|
|
*/
|
|
|
|
enregistrer_college_temp_d();
|
|
|
|
v_msg="Confirmez-vous l'enregistrement du collège?";
|
|
v_msgEng="Do you confirm college registration?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
if($('#nomForm').val()=="creercolleged"){
|
|
window.location.assign($("#racineWeb" ).val()+"Creercolleged/enregistrer/");
|
|
}else{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifiercolleged/enregistrer/");
|
|
}
|
|
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function encaisser_quittance(idQuittance)
|
|
{
|
|
if (idQuittance>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Encaisserquittance/"+idQuittance+"/");
|
|
}
|
|
}
|
|
|
|
|
|
function selectionner_quittance_impayee(numeroQuittance, idQuittance, primeTtc, encaisse, solde)
|
|
{
|
|
$("#numeroQuittanceAcpte").val(numeroQuittance);
|
|
$("#idQuittanceAcpte").val(idQuittance);
|
|
|
|
$("#primeTtcAcpte").val(primeTtc);
|
|
$("#encaisseAcpte").val(encaisse);
|
|
$("#montantAcpte").val(solde);
|
|
$("#anc_soldeAcpte").val(solde);
|
|
|
|
formatMonetaire(primeTtcAcpte);
|
|
formatMonetaire(encaisseAcpte);
|
|
formatMonetaire(montantAcpte);
|
|
formatMonetaire(anc_soldeAcpte);
|
|
|
|
$("#montantAcpte").focus();
|
|
}
|
|
|
|
function ajouter_quittance_acompte()
|
|
{
|
|
idQuittance = $("#idQuittanceAcpte" ).val();
|
|
v_montantAcpte = $("#montantAcpte" ).val();
|
|
v_primeTtcAcpte = $("#primeTtcAcpte" ).val();
|
|
|
|
v_montantAcpte = v_montantAcpte.replaceAll(' ', '');
|
|
v_primeTtcAcpte = v_primeTtcAcpte.replaceAll(' ', '');
|
|
|
|
if(idQuittance<="0")
|
|
{
|
|
v_msg="Veuillez sélectionner une quittance!";
|
|
v_msgEng="PLease select a premium issue!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
if(v_montantAcpte<="0")
|
|
{
|
|
$("#v_montantAcpte").focus();
|
|
v_msg="Veuillez saisir l\'acompte!";
|
|
v_msgEng="Please enter the deposit!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
v_anc_soldeAcpte = $("#anc_soldeAcpte" ).val();
|
|
v_anc_soldeAcpte = v_anc_soldeAcpte.replaceAll(' ', '');
|
|
|
|
if(Number(v_montantAcpte)>Number(v_anc_soldeAcpte))
|
|
{
|
|
$("#montantAcpte").focus();
|
|
v_msg="Veuillez vérifier le montant de l\'acompte!";
|
|
v_msgEng="Please check the amount of the deposit!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
|
|
donnees = 'idQuittance='+idQuittance+'&montantAcpte='+v_montantAcpte+'&primeTtcAcpte='+v_primeTtcAcpte;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxsituationclient/ajouteracomptequittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajouter_quittance_acompte_client()
|
|
{
|
|
idQuittance = $("#idQuittanceAcpte" ).val();
|
|
v_montantAcpte = $("#montantAcpte" ).val();
|
|
v_primeTtcAcpte = $("#primeTtcAcpte" ).val();
|
|
|
|
v_montantAcpte = v_montantAcpte.replaceAll(' ', '');
|
|
v_primeTtcAcpte = v_primeTtcAcpte.replaceAll(' ', '');
|
|
|
|
if(idQuittance<="0")
|
|
{
|
|
$("#montantAcpte").focus();
|
|
v_msg="Veuillez sélectionner une quittance!";
|
|
v_msgEng="PLease select a premium issue!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
if(v_montantAcpte<="0")
|
|
{
|
|
v_msg="Veuillez saisir l\'acompte!";
|
|
v_msgEng="Please enter the deposit!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
|
|
v_anc_soldeAcpte = $("#anc_soldeAcpte" ).val();
|
|
v_anc_soldeAcpte = v_anc_soldeAcpte.replaceAll(' ', '');
|
|
|
|
if(Number(v_montantAcpte)>Number(v_anc_soldeAcpte))
|
|
{
|
|
$("#montantAcpte").focus();
|
|
v_msg="Veuillez vérifier le montant de l\'acompte!";
|
|
v_msgEng="Please check the amount of the deposit!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
return;
|
|
}
|
|
|
|
donnees = 'idQuittance='+idQuittance+'&montantAcpte='+v_montantAcpte+'&primeTtcAcpte='+v_primeTtcAcpte;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximpayeclient/ajouteracomptequittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
function solder_quittance_temp(idQuittance)
|
|
{
|
|
donnees = 'idQuittance='+idQuittance;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxsituationclient/solderquittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
function solder_quittance_client_temp(idQuittance)
|
|
{
|
|
donnees = 'idQuittance='+idQuittance;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximpayeclient/solderquittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
function supprimer_detail_encaissement(idDetailencaissement)
|
|
{
|
|
donnees = 'idDetailencaissement='+idDetailencaissement;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxsituationclient/supprimerquittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function retirer_garantie_police(idGarantie)
|
|
{
|
|
donnees = 'idGarantie='+idGarantie;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiespolice/supprimergarantie/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function ajouter_une_garantie_college(codeGarantie)
|
|
{
|
|
donnees = 'codeGarantie='+codeGarantie;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/ajoutergarantie/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function supprimer_detail_encaissement_client(idDetailencaissement)
|
|
{
|
|
donnees = 'idDetailencaissement='+idDetailencaissement;
|
|
|
|
$("#div_situation_client").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximpayeclient/supprimerquittance/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_situation_client").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recap_bordereau_encaissement();
|
|
}
|
|
});
|
|
}
|
|
|
|
function encaissement_changer_client(numeroClient)
|
|
{
|
|
if (numeroClient>"0")
|
|
{
|
|
$("#forminfoclient").submit();
|
|
}
|
|
}
|
|
|
|
function encaisser_bordereau()
|
|
{
|
|
window.location.assign($("#racineWeb").val()+"Encaisserbordereau/");
|
|
}
|
|
|
|
function encaisser_bordereau_detail()
|
|
{
|
|
}
|
|
|
|
|
|
function imprimer_recu(idEncaissement)
|
|
{
|
|
donnees = 'idEncaissement='+idEncaissement;
|
|
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimerrecucaisse/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
function afficher_pop_recherche_client()
|
|
{
|
|
numeroclientsearch = $("#numeroclientsearch").val();
|
|
nomsearch = $("#nomsearch").val();
|
|
prenomsearch = $("#prenomsearch").val();
|
|
telsearch = $("#telsearch").val();
|
|
|
|
if (numeroclientsearch+nomsearch+prenomsearch+telsearch > " ")
|
|
{
|
|
donnees = "valid=1&numeroclientsearch="+numeroclientsearch+"&nomsearch="+nomsearch+"&prenomsearch="+prenomsearch+"&telsearch="+telsearch;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxlisteclients/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_listeclient").html(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function afficher_pop_recherche_client_enc()
|
|
{
|
|
numeroclientsearch = $("#numeroclientsearch").val();
|
|
nomsearch = $("#nomsearch").val();
|
|
prenomsearch = $("#prenomsearch").val();
|
|
telsearch = $("#telsearch").val();
|
|
|
|
if (numeroclientsearch+nomsearch+prenomsearch+telsearch > " ")
|
|
{
|
|
donnees = "valid=1&numeroclientsearch="+numeroclientsearch+"&nomsearch="+nomsearch+"&prenomsearch="+prenomsearch+"&telsearch="+telsearch;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxlisteclientsenc/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_listeclient").html(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function selectionner_client_pop(id,no,nom)
|
|
{
|
|
$("#nocli").val(no);
|
|
$("#nomcli").val(nom);
|
|
selectionner_client(id,no);
|
|
}
|
|
|
|
function ctrlkeypress(ev)
|
|
{
|
|
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
|
|
if(keycode == '13')
|
|
{
|
|
afficher_pop_recherche_client();
|
|
}
|
|
}
|
|
|
|
function ctrlkeypress_enc(ev)
|
|
{
|
|
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
|
|
if(keycode == '13')
|
|
{
|
|
afficher_pop_recherche_client_enc();
|
|
}
|
|
}
|
|
|
|
function ajaxListerMoyenPaiement()
|
|
{
|
|
codeModePaiement = $("#codeModePaiement").val();
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmoyenpaiement/",
|
|
type : 'post',
|
|
data: "codeModePaiement="+codeModePaiement,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#listemoyenpaiement").html(data);
|
|
$("#codeMoyenPaiement").focus();
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_no_cpt_paiement()
|
|
{
|
|
codeModePaiement = $("#codeModePaiement").val();
|
|
codeMoyenPaiement = $("#codeMoyenPaiement").val();
|
|
|
|
donnees = "codeModePaiement="+codeModePaiement+"&codeMoyenPaiement="+codeMoyenPaiement;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxnocptmoyenpaiement/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infonocpt").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#numeroCompte").val( $("#numeroCompte_info").val());
|
|
$("#referencePaiement").focus();
|
|
}
|
|
});
|
|
}
|
|
|
|
function modifier_detail_encaissement(idDetailencaissement)
|
|
{
|
|
}
|
|
|
|
function recap_bordereau_encaissement()
|
|
{
|
|
montant_ecart = $("#montant_ecart_info").val();
|
|
$("#montant_selection").val( $("#montant_selection_info").val());
|
|
$("#montant_ecart").val(montant_ecart);
|
|
}
|
|
|
|
|
|
function enregistrer_encaissement_bordereau()
|
|
{
|
|
montant_ecart = $("#montant_ecart").val();
|
|
montant_ecart = montant_ecart.replace(" ", "");
|
|
montant_ecart = parseInt(montant_ecart);
|
|
montant_ecart = Math.abs(montant_ecart);
|
|
|
|
if(montant_ecart>"100")
|
|
{
|
|
v_msg="Veuillez vérifier votre écart!";
|
|
v_msgEng="Please check your gap!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
$("#formente_encaissement").submit();
|
|
}
|
|
|
|
function enregistrer_encaissement_client()
|
|
{
|
|
montant_ecart = $("#montant_ecart").val();
|
|
montant_ecart = montant_ecart.replace(" ", "");
|
|
montant_ecart = parseInt(montant_ecart);
|
|
montant_ecart = Math.abs(montant_ecart);
|
|
|
|
if(montant_ecart>"100")
|
|
{
|
|
v_msg="Veuillez vérifier votre écart!";
|
|
v_msgEng="Please check your gap!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
montant = $("#montant").val();
|
|
montant = montant.replace(" ", "");
|
|
montant = parseInt(montant);
|
|
montant = Math.abs(montant);
|
|
|
|
codeModePaiement = $("#codeModePaiement").val();
|
|
codeMoyenPaiement = $("#codeMoyenPaiement").val();
|
|
referencePaiement = $("#referencePaiement").val();
|
|
libelleOperation = $("#libelleOperation").val();
|
|
|
|
|
|
if(montant=="100")
|
|
{
|
|
v_msg="Veuillez saisir un montant!";
|
|
v_msgEng="Please enter an amount";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#montant").focus();
|
|
return;
|
|
}
|
|
|
|
if(codeModePaiement<=" ")
|
|
{
|
|
v_msg="Veuillez indiquer le mode de paiement!";
|
|
v_msgEng="Please enter the method of payment";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeModePaiement").focus();
|
|
return;
|
|
}
|
|
|
|
if(codeMoyenPaiement<=" ")
|
|
{
|
|
v_msg="Veuillez indiquer le moyen de paiement!";
|
|
v_msgEng="Please enter the method of payment!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#codeMoyenPaiement").focus();
|
|
return;
|
|
}
|
|
|
|
if(referencePaiement<=" ")
|
|
{
|
|
v_msg="Veuillez indiquer la référence du paiement!";
|
|
v_msgEng="Please enter the payment reference!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#referencePaiement").focus();
|
|
return;
|
|
}
|
|
|
|
if(libelleOperation<=" ")
|
|
{
|
|
v_msg="Veuillez saisir le libellé de l\'opération!";
|
|
v_msgEng="Please enter the text of the transaction!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#libelleOperation").focus();
|
|
return;
|
|
}
|
|
|
|
$("#formente_encaissement").submit();
|
|
}
|
|
|
|
function ajax_context_client(idClient)
|
|
{
|
|
donnees = 'idClient='+idClient;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextclient/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_client_afficher(idClient)
|
|
{
|
|
donnees = 'idClient='+idClient;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextclient/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheclient/");
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function ajax_context_client_d_afficher(idClient)
|
|
{
|
|
donnees = 'idClient='+idClient;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextclientd/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheprospect/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_police(idPolice)
|
|
{
|
|
donnees = 'idPolice='+idPolice;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextpolice/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_police_d(idPolice)
|
|
{
|
|
donnees = 'idPolice='+idPolice;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextpoliced/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_police_afficher(idPolice)
|
|
{
|
|
donnees = 'idPolice='+idPolice;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextpolice/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Fichepolice/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_garant_afficher(codeGcAssureur)
|
|
{
|
|
donnees = 'codeGcAssureur='+codeGcAssureur;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextgarant/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data){
|
|
afficher_gc_assureur(data);
|
|
},
|
|
complete: function() {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_context_police_d_afficher(idPolice)
|
|
{
|
|
donnees = 'idPolice='+idPolice;
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontextpoliced/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Fichedevis/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_deconnexion()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdeconnexion/",
|
|
complete: function()
|
|
{
|
|
window.open('about:blank','_parent','');
|
|
close();
|
|
window.close();
|
|
}
|
|
});
|
|
|
|
/* 24/03/2019
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdeconnexion/"
|
|
});
|
|
*/
|
|
}
|
|
|
|
function selectionner_college(idCollege)
|
|
{
|
|
$("#idCollege" ).val(idCollege);
|
|
}
|
|
|
|
function supprimer_college(idCollege)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de ce collège?";
|
|
v_msgEng="Do you confirm the removal of this college?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Collegepolice/supprimerCollege/"+idCollege+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function supprimer_college_d(idCollege)
|
|
{
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous la suppression de ce collège?";
|
|
v_msgEng="Do you confirm the removal of this college?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Fichedevis/supprimerCollege/"+idCollege+"/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function modifier_college(idCollege)
|
|
{
|
|
if (idCollege>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifiercollege/"+idCollege+"/");
|
|
}
|
|
}
|
|
|
|
function modifier_college_d(idCollege)
|
|
{
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (idCollege>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifiercolleged/"+idCollege+"/");
|
|
}
|
|
}
|
|
|
|
function consulter_college(idCollege)
|
|
{
|
|
if (idCollege>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Consultercollege/"+idCollege+"/");
|
|
}
|
|
}
|
|
|
|
function retour_college()
|
|
{
|
|
idCollege=$("#idCollege").val();
|
|
|
|
if (idCollege>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Consultercollege/"+idCollege+"/");
|
|
}
|
|
}
|
|
|
|
function ajax_flexcode()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxflexcode/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#content").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxttcfammille()
|
|
{
|
|
idCollege=$("#idCollege").val();
|
|
dateEntree=$("#dateEntree").val();
|
|
|
|
donnees = 'idCollege='+idCollege;
|
|
donnees += '&dateEntree='+dateEntree;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxttcfammille/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infottc").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function supprimer_adherent()
|
|
{
|
|
idAherent=$("#idAdherent_C").val();
|
|
|
|
primeArchive=$("#primeArchive").val();
|
|
if (primeArchive=="1")
|
|
{
|
|
v_msg="Prime archivée!";
|
|
v_msgEng="Primium archived!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
codeTypeAvenant=$("#codeTypeAvenant_C").val();
|
|
|
|
if (codeTypeAvenant!="REN" && codeTypeAvenant!="AFN" && codeTypeAvenant!="CHE")
|
|
{
|
|
v_msg="Veuillez procéder à un retrait!";
|
|
v_msgEng="Please make a withdrawal!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (primeArchive=="0")
|
|
{
|
|
supprimer_adherent_id(idAherent);
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
function supprimer_adherent_id(idAherent)
|
|
{
|
|
v_msg="Confirmez-vous la suppression de cet adhérent?";
|
|
v_msgEng="Do you confirm the deletion of this member?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxadherent/supprimer/",
|
|
type : 'post',
|
|
data: "idAherent="+idAherent,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data)
|
|
{
|
|
v_msg="Suppression terminée avec succès terminé!";
|
|
v_msgEng="Deletion completed successfully completed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
},
|
|
complete: function()
|
|
{
|
|
adherents_police();
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
function supprimer_adherent_id_list(idAherent)
|
|
{
|
|
codeTypeAvenant=$("#codeTypeAvenant_C").val();
|
|
|
|
if (codeTypeAvenant!="REN" && codeTypeAvenant!="AFN" && codeTypeAvenant!="CHE")
|
|
{
|
|
v_msg="Veuillez procéder à un retrait!";
|
|
v_msgEng="Please make a withdrawal!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous la suppression de cet adhérent?";
|
|
v_msgEng="Do you confirm the deletion of this member?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"ajaxadherent/supprimer/",
|
|
type : 'post',
|
|
data: "idAherent="+idAherent,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
v_msg="Suppression terminée avec succès terminé!";
|
|
v_msgEng="Deletion completed successfully completed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
},
|
|
complete: function() {
|
|
adherents_police();
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function ajax_init_echancier()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxinitnbecheance/",
|
|
type : 'post',
|
|
data: "codeTypeEcheancier="+$("#codeTypeEcheancier").val(),
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#infonbEcheance").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#nbEcheance").val( $("#nbEcheance_info").val());
|
|
ajax_maj_echancier();
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_maj_echancier()
|
|
{
|
|
codeTypeEcheancier = $("#codeTypeEcheancier").val();
|
|
nbEcheance = $("#nbEcheance").val();
|
|
tauxInteret = $("#tauxInteret").val();
|
|
|
|
donnees = "codeTypeEcheancier="+codeTypeEcheancier+"&nbEcheance="+nbEcheance+"&tauxInteret="+tauxInteret;
|
|
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmajcheancier/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Echeancier/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function enregistrer_echeancier()
|
|
{
|
|
if ($("#nbEcheance").val()=="1")
|
|
{
|
|
v_msg="Confirmez-vous l\'émission sans échéancier?";
|
|
v_msgEng="Do you confirm the issue of primium without payment schedule?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
afficher_police_id();
|
|
return;
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
v_msg="Confirmez-vous cet échéancier?";
|
|
v_msgEng="Do you confirm this payment schedule?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmajcheancier/enregistrer/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
afficher_police_id();
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function ajax_maj_lib_echancier(idEcheancier, libelleEcheance)
|
|
{
|
|
donnees = "idEcheancier="+idEcheancier+"&libelleEcheance="+libelleEcheance;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmajcheancier/majlibelle/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Echeancier/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_maj_date_echancier(idEcheancier, datePaiement)
|
|
{
|
|
donnees = "idEcheancier="+idEcheancier+"&datePaiement="+datePaiement;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmajcheancier/majdatepaiement/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Echeancier/");
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function ajax_maj_taux_echancier(idEcheancier, tauxEcheance)
|
|
{
|
|
nbEcheance = $("#nbEcheance").val();
|
|
|
|
donnees = "idEcheancier="+idEcheancier+"&tauxEcheance="+tauxEcheance+"&nbEcheance="+nbEcheance;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxmajcheancier/majtauxecheance/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Echeancier/");
|
|
}
|
|
});
|
|
}
|
|
|
|
function retirer_garantie_college(idGarantie)
|
|
{
|
|
donnees = 'idGarantie='+idGarantie;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/supprimergarantie/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajax_maj_taux_plafond(idGarantie, tauxPlafond, controle)
|
|
{
|
|
tauxPlafond=tauxPlafond.replace(",",".");
|
|
controle.value=tauxPlafond;
|
|
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idGarantie='+idGarantie+"&tauxPlafond="+tauxPlafond;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/majtauxplafond/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
//controle.focus();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function ajax_imposer_plafond(idGarantie, plafond, controle)
|
|
{
|
|
plafond=plafond.replace(",",".");
|
|
controle.value=plafond;
|
|
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idGarantie='+idGarantie+"&plafond="+plafond;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/imposerplafond/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
//controle.focus();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function ajax_maj_lib_gar_opt(idGarantie, libellegarantie, controle)
|
|
{
|
|
if (libellegarantie<=" ")
|
|
{
|
|
return;
|
|
}
|
|
|
|
donnees = 'idGarantie='+idGarantie+"&libellegarantie="+libellegarantie;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/majlibgar/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
//controle.focus();
|
|
}
|
|
});
|
|
}
|
|
|
|
function maj_prime_gar_opt(idGarantie, primeOption, controle)
|
|
{
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idGarantie='+idGarantie+"&primeOption="+primeOption;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollege/majprimeopt/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
//controle.focus();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function archiver_garantie_college(idCollege)
|
|
{
|
|
v_msg="Validez-vous ce collège?";
|
|
v_msgEng="Do you validate this college?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcollege/archivergarntie/",
|
|
type : 'post',
|
|
data: "idCollege="+idCollege,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function()
|
|
{
|
|
college_police();
|
|
}
|
|
});
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function controle_champ_obligatoire(controle)
|
|
{
|
|
if (controle.value<=" ")
|
|
{
|
|
v_msg="Valeur exigée!";
|
|
v_msgEng="Value required!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
controle.focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function controle_champ_obligatoire_new(controle)
|
|
{
|
|
if (controle.value<=" ")
|
|
{
|
|
v_msg="Valeur exigée!";
|
|
v_msgEng="Value required!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
controle.focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function controle_champ_obligatoire_old(controle)
|
|
{
|
|
if (controle.value<=" ")
|
|
{
|
|
v_msg="Valeur exigée!";
|
|
v_msgEng="Value required!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
controle.focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
function plafond_adherent()
|
|
{
|
|
if ($("#idAdherent_C" ).val()>"")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Plafondadherent/");
|
|
}
|
|
}
|
|
|
|
function creer_adherents()
|
|
{
|
|
nbAdh = $("#nbAdh_C").val();
|
|
codeTypeContrat = $("#codeTypeContrat_C").val();
|
|
|
|
//if ((codeTypeContrat!="G") && (nbAdh>0) )
|
|
if ((codeTypeContrat=="P") && (nbAdh>0) )
|
|
{
|
|
v_msg="Ce n\'est pas une police GROUPE!";
|
|
v_msgEng="This is not a GROUP policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="SU")
|
|
{
|
|
v_msg="Attention! Police suspendue!";
|
|
v_msgEng="Warning! Suspended policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Creeradherent/");
|
|
}
|
|
|
|
function creer_colleges()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Creercollege/initcollege/");
|
|
}
|
|
|
|
|
|
function creer_colleges_d()
|
|
{
|
|
transforme = $("#transforme").val();
|
|
if (transforme=="1")
|
|
{
|
|
v_msg="Cotation déjà transformée!";
|
|
v_msgEng="Quote already transformed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Creercolleged/initcollege/");
|
|
}
|
|
|
|
function creer_beneficiaires()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="SU")
|
|
{
|
|
v_msg="Attention! Police suspendue!";
|
|
v_msgEng="Warning! Suspended policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
etatadh=$("#codeEtatAdherent_C").val();
|
|
|
|
if (etatadh != "V")
|
|
{
|
|
v_msg="Attention! cette famille n\'est pas en vigueur!";
|
|
v_msgEng="Warning! this family is not in force!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Creerbeneficiaire/");
|
|
}
|
|
|
|
function changer_etat_adherent()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="SU")
|
|
{
|
|
v_msg="Attention! Police suspendue!";
|
|
v_msgEng="Warning! Suspended policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Changeretatadherent/");
|
|
}
|
|
|
|
function creer_avenant()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Creeravenant/");
|
|
}
|
|
|
|
function liste_avenant()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Listeavenant/");
|
|
}
|
|
|
|
function prorater_prime_adherent()
|
|
{
|
|
codeModeCalculPrime = $("#codeModeCalculPrime").val();
|
|
|
|
if(codeModeCalculPrime=="TA"){
|
|
calcul_prime_adherent();
|
|
|
|
return;
|
|
}
|
|
|
|
idCollege=$("#idCollege").val();
|
|
|
|
if (idCollege<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un collège!";
|
|
v_msgEng="Please select a college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#div_prime").html("");
|
|
|
|
return;
|
|
}
|
|
|
|
dateEntree=$("#dateEntree").val();
|
|
prorata=$("#prorata").val();
|
|
|
|
|
|
|
|
donnees = 'idCollege='+idCollege;
|
|
donnees += '&dateEntree='+dateEntree;
|
|
donnees += '&prorata='+prorata;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxproraterprime/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_prime").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function prorater_prime_beneficiaire()
|
|
{
|
|
|
|
|
|
codeModeCalculPrime = $("#codeModeCalculPrime").val();
|
|
|
|
if(codeModeCalculPrime=="TA"){
|
|
calcul_prime_beneficiaire();
|
|
|
|
return;
|
|
}
|
|
|
|
idAvenant = $("#idAvenant").val();
|
|
|
|
if(idAvenant<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un avenant!";
|
|
v_msgEng="Please select an Amendment!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#idAvenant").focus();
|
|
return;
|
|
}
|
|
|
|
codeLienParente=$("#codeLienParente").val();
|
|
|
|
if (codeLienParente=="A")
|
|
{
|
|
v_msg="Veuillez revoir le lien de parenté!";
|
|
v_msgEng="Please review the relationship";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
$("#codeLienParente").focus();
|
|
return;
|
|
}
|
|
|
|
dateEntree=$("#dateEntree").val();
|
|
fraisCarte=$("#fraisCarte").val();
|
|
prorata=$("#prorata").val();
|
|
|
|
donnees = '&dateEntree='+dateEntree;
|
|
donnees += '&fraisCarte='+fraisCarte;
|
|
donnees += '&prorata='+prorata;
|
|
donnees += '&codeLienParente='+codeLienParente;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxproraterprimebeneficiaire/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_prime").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function histo_etats()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Histoetat/");
|
|
}
|
|
|
|
function afficher_emission(idEmission)
|
|
{
|
|
if (idEmission>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Emission/"+idEmission+"/");
|
|
}
|
|
}
|
|
|
|
function exporter_liste_assures()
|
|
{
|
|
$('#div_exporter_liste_assures').html('');
|
|
|
|
$("#btn_exporter_liste_assures").click();
|
|
}
|
|
|
|
|
|
function imprimer_liste_assures()
|
|
{
|
|
$('#div_export_assures').html('');
|
|
|
|
$("#btn_liste_assures").click();
|
|
}
|
|
|
|
function imprimer_limites()
|
|
{
|
|
idEntetecontrat=$("#idEntetecontrat").val();
|
|
|
|
if (idEntetecontrat<="0")
|
|
{
|
|
v_msg="Veuillez sélectionner une période!";
|
|
v_msgEng="Please select a period!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#idEntetecontrat").focus();
|
|
|
|
div_attente.html('');
|
|
|
|
return;
|
|
}
|
|
|
|
donnees = 'idEntetecontrat='+idEntetecontrat;
|
|
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimerlimite/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
function avenantimprimer_cp()
|
|
{
|
|
|
|
|
|
idAvenant=$("#idAvenant").val();
|
|
|
|
donnees = '&idAvenant='+idAvenant;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxavenantimprimercp/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
function imprimer_cp(lienEtat)
|
|
{
|
|
|
|
|
|
|
|
var td2 = $("#debutStat").datepicker("getDate");
|
|
var td3 = $("#finStat").datepicker("getDate");
|
|
|
|
dt2=Math.round(Date.parse(td2)/(1000*3600*24)); // debutStat
|
|
dt3=Math.round(Date.parse(td3)/(1000*3600*24)); // finStat
|
|
|
|
if (dt3<dt2)
|
|
{
|
|
v_msg="Revoir les bornes de la période!";
|
|
v_msgEng="Review the boundaries of the period!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
if ((dt3==dt2) && (lienEtat=="Conditionparticulieresuiteincorporationeng" || lienEtat=="Conditionparticulieresuiteretraiteng" ))
|
|
{
|
|
v_msg="Revoir les bornes de la période!";
|
|
v_msgEng="Review the boundaries of the period!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
debutStat = $("#debutStat").val();
|
|
finStat = $("#finStat").val();
|
|
|
|
|
|
|
|
idAvenant=$("#idAvenant").val();
|
|
|
|
if(idAvenant<="")
|
|
{
|
|
v_msg="Selectionner un avenant!";
|
|
v_msgEng="Select an endorsement!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$("#idAvenant").focus();
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
donnees = '&idAvenant='+idAvenant +'&lienEtat='+lienEtat+'&debutStat='+debutStat+"&finStat="+finStat;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimercp/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function imprimer_reseau_college(idCollege)
|
|
{
|
|
var div_imprime_reseau = $('#div_imprime_reseau');
|
|
|
|
donnees = 'idCollege='+idCollege;
|
|
|
|
div_imprime_reseau.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimereseaucollege/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_imprime_reseau.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function imprimer_cp_d(lienEtat)
|
|
{
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
donnees = 'lienEtat='+lienEtat;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimercpd/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
function imprimer_cp_eng()
|
|
{
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimercpeng/",
|
|
type: 'POST',
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
function imprimer_cp_eng_d()
|
|
{
|
|
var div_export = $('#div_export_a');
|
|
div_export.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaximprimercpengd/",
|
|
type: 'POST',
|
|
success: function(data)
|
|
{
|
|
div_export.html(data);
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function rachat_tm_police()
|
|
{
|
|
if($('#rachatTm').val()=="1")
|
|
{
|
|
$("#tauxRachatTm").readable();
|
|
}
|
|
else
|
|
{
|
|
$("#tauxRachatTm").val("0");
|
|
$("#tauxRachatTm").unreadable();
|
|
}
|
|
}
|
|
|
|
function taux_referencement()
|
|
{
|
|
if($('#avecReferencement').val()=="1")
|
|
{
|
|
$("#tauxAvecReferencement").val("0");
|
|
$("#tauxAvecReferencement").readable();
|
|
|
|
$("#tauxSansReferencement").val("0");
|
|
$("#tauxSansReferencement").readable();
|
|
}
|
|
else
|
|
{
|
|
$("#tauxAvecReferencement").val("0");
|
|
$("#tauxSansReferencement").val("0");
|
|
|
|
$("#tauxAvecReferencement").unreadable();
|
|
$("#tauxSansReferencement").unreadable();
|
|
|
|
}
|
|
}
|
|
|
|
function pop_tableau_prestation()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxtableauprestation/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_tableau_prestation").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#btn_pop").click();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function pop_consulter_tableau_prestation()
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxconsultertableauprestation/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_tableau_prestation").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#btn_pop").click();
|
|
}
|
|
});
|
|
}
|
|
|
|
function pop_afficher_detail_resiliation()
|
|
{
|
|
var div_tableau_assure = $('#div_tableau_assure');
|
|
|
|
div_tableau_assure.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdetailresiliation/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
div_tableau_assure.html(data);
|
|
|
|
var oTable = $('.tabliste').DataTable();
|
|
oTable.destroy();
|
|
|
|
setTimeout(function() {
|
|
appliquerDataTable();
|
|
}, 500);
|
|
},
|
|
complete: function() {
|
|
$("#btn_pop").click();
|
|
}
|
|
});
|
|
}
|
|
|
|
function maj_college()
|
|
{
|
|
if($('#codeProduit').val()<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un produit!";
|
|
v_msgEng="Please select a category!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
$('#codeProduit').focus();
|
|
return;
|
|
}
|
|
$("#btn_recap").click();
|
|
}
|
|
|
|
function ajax_maj_tm(idPrestation, tm, controle)
|
|
{
|
|
tm=tm.replace(",",".");
|
|
controle.value=tm;
|
|
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idPrestation='+idPrestation+"&tm="+tm;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxtableauprestation/majtm/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function texte_cp()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Textecp/");
|
|
}
|
|
|
|
function imprimer_contrat()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Contrat/");
|
|
}
|
|
|
|
function imprimer_devis()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Imprimerdevis/");
|
|
}
|
|
|
|
function rapport_sp_police()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Sppolice/");
|
|
}
|
|
|
|
function rapport_sp_adherent()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Spadherent/");
|
|
}
|
|
|
|
|
|
function rapport_sp_college()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Spcollege/");
|
|
}
|
|
|
|
function rapport_sp_beneficiaire()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Spbeneficiaire/");
|
|
}
|
|
|
|
function enregistrer_avenant()
|
|
{
|
|
//
|
|
codeTypeAvenant=$("#codeTypeAvenant").val();
|
|
|
|
//alert(codeTypeAvenant);
|
|
//return;
|
|
|
|
oldCodeTypeAvenant=$("#oldCodeTypeAvenant").val();
|
|
|
|
if ($("#codeTypeAvenant").val()<" ")
|
|
{
|
|
v_msg="Veuillez sélectionner le type d\'avenant!";
|
|
v_msgEng="Please select the type of amendment!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if(codeTypeAvenant!="CHE" && codeTypeAvenant!="REN")
|
|
{
|
|
|
|
var d_effet = new Date($("#dateEffetSql").val()); // 01/05/2022
|
|
var d_fin = new Date($("#dateFinSql").val()); // 31/12/2022
|
|
var d_avenant = $("#dateAvenant").datepicker("getDate"); // 20/07/2022
|
|
|
|
dt_effet = Math.round(Date.parse(d_effet)/(1000*3600*24));
|
|
dt_fin = Math.round(Date.parse(d_fin)/(1000*3600*24));
|
|
dt_avenant = Math.round(Date.parse(d_avenant)/(1000*3600*24));
|
|
|
|
/*
|
|
alert("dt_effet => "+dt_effet);
|
|
alert("dt_fin => "+dt_fin);
|
|
alert("dt_avenant => "+dt_avenant);
|
|
return;
|
|
*/
|
|
if(codeTypeAvenant!="RVP"){
|
|
if (dt_avenant>dt_fin || dt_avenant<dt_effet)
|
|
{
|
|
v_msg="Veuillez revoir la date!";
|
|
v_msgEng="Please review the date!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(codeTypeAvenant=="REN")
|
|
{
|
|
var td1 = new Date($("#DateRenouvellement").val());
|
|
var td2 = $("#dateAvenant").datepicker("getDate");
|
|
|
|
dt1=Math.round(Date.parse(td1)/(1000*3600*24));
|
|
dt2=Math.round(Date.parse(td2)/(1000*3600*24));
|
|
|
|
if (dt1>dt2)
|
|
{
|
|
v_msg="Veuillez revoir la date de renouvellement!";
|
|
v_msgEng="Please review the renewal date!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
var eff = $("#dateAvenant").datepicker("getDate");
|
|
var ech = $("#dateEcheanceRen").datepicker("getDate");
|
|
|
|
if (ech>eff.addMonths(12)) {
|
|
v_msg="Période supérieur à un an!";
|
|
v_msgEng="Period greater than one year!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
}
|
|
}
|
|
|
|
if(codeTypeAvenant=="CHE" && oldCodeTypeAvenant=="REN")
|
|
{
|
|
var td1 = new Date($("#dateEffet").val());
|
|
var td2 = $("#dateAvenant").datepicker("getDate");
|
|
|
|
dt1=Math.round(Date.parse(td1)/(1000*3600*24));
|
|
dt2=Math.round(Date.parse(td2)/(1000*3600*24));
|
|
|
|
if (dt1>dt2)
|
|
{
|
|
v_msg="Veuillez revoir la date!";
|
|
v_msgEng="Please review the date!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (
|
|
codeTypeAvenant=="RET" ||
|
|
codeTypeAvenant=="RES" ||
|
|
codeTypeAvenant=="SUS" ||
|
|
codeTypeAvenant=="ANL" ||
|
|
codeTypeAvenant=="RVP" ||
|
|
codeTypeAvenant=="ADL" ||
|
|
codeTypeAvenant=="INC" ||
|
|
codeTypeAvenant=="CHC" ||
|
|
codeTypeAvenant=="CHE" ||
|
|
codeTypeAvenant=="SUA" ||
|
|
codeTypeAvenant=="RVA" ||
|
|
codeTypeAvenant=="ING" ||
|
|
codeTypeAvenant=="INA" ||
|
|
codeTypeAvenant=="REG" ||
|
|
codeTypeAvenant=="REA")
|
|
{
|
|
motifAvenant=$("#motifAvenant").val();
|
|
|
|
if ($("#motifAvenant").val()<" ")
|
|
{
|
|
v_msg="Veuillez fournir le motif!";
|
|
v_msgEng="Please provide the reason";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
v_msg="Confirmez-vous cet avenant?";
|
|
v_msgEng="Do you confirm this amendment to the contract?";
|
|
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
var div_attente = $('#div_attente');
|
|
div_attente.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
codeTypeAvenant=$("#codeTypeAvenant").val();
|
|
|
|
donnees = "";
|
|
|
|
if (codeTypeAvenant=="ANL")
|
|
{
|
|
donnees = "controle=existequittance";
|
|
}
|
|
|
|
if(donnees>" ")
|
|
{
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxcontroleavenantpolice/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
// alert(data);
|
|
$("#div_controler_avenant").html(data);
|
|
},
|
|
complete: function() {
|
|
$("#controler_avenant").val($("#controler_avenant_info").val());
|
|
|
|
resultat_controler_avenant = $("#controler_avenant").val();
|
|
|
|
if (resultat_controler_avenant=="Q")
|
|
{
|
|
v_msg="Attention, cette police possède des quittances!";
|
|
v_msgEng="Warning, this policy has premium issues!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (resultat_controler_avenant=="C")
|
|
{
|
|
v_msg="Attention, cette police possède des sinistres!";
|
|
v_msgEng="Warning, this policy has claims!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
// return;
|
|
$("#btn_enreg").click();
|
|
}
|
|
});
|
|
div_attente.empty();
|
|
}
|
|
else
|
|
if (codeTypeAvenant=="ADL")
|
|
{
|
|
donnees = "dateAvenant="+$("#dateAvenant").val()+"&motifAvenant="+motifAvenant;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxlimiteadditionnelle/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
},
|
|
complete: function() {
|
|
$("#btn_enreg").click();
|
|
}
|
|
});
|
|
}
|
|
else
|
|
{
|
|
$("#btn_enreg").click();
|
|
}
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function enregistrer_resiliation()
|
|
{
|
|
v_msg="Confirmez-vous la résiliation de cette police?";
|
|
v_msgEng="Do you confirm the cancellation of this policy?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheresiliation/enregistrerresiliation/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function enregistrer_retrait()
|
|
{
|
|
var div_assure_a_retirer = $('#div_assure_a_retirer');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdetailretrait/recapituler/",
|
|
type: 'POST',
|
|
success: function(data) {
|
|
div_assure_a_retirer.html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
nbAliment=$("#nbAliment").val();
|
|
|
|
if (nbAliment<"1")
|
|
{
|
|
v_msg="Veuillez sélectionner les personnes à retirer!";
|
|
v_msgEng="Please select the people to remove!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous le retrait des personnes sélectionnées de cette police?";
|
|
v_msgEng="Do you confirm the withdrawal of the selected people from this policy?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Ficheretrait/enregistrerretrait/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
function controle_date_avenant()
|
|
{
|
|
|
|
|
|
$("#div_periodidite").html("");
|
|
|
|
codeTypeAvenant=$("#codeTypeAvenant").val();
|
|
|
|
idBeneficiaireFacture = $("#idBeneficiaireFacture").val();
|
|
|
|
idCollegeFacture = $("#idCollegeFacture").val();
|
|
|
|
//alert(idCollegeFacture);
|
|
|
|
|
|
if(codeTypeAvenant=="REN")
|
|
{
|
|
$("#dateAvenant").val($("#DateRenouvellement_fr").val());
|
|
$("#motifAvenant").val("");
|
|
|
|
$("#motifAvenant").unreadable();
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxrenouvellement/",
|
|
type: 'POST',
|
|
// data: donnees,
|
|
success: function(data)
|
|
{
|
|
$("#div_periodidite").html(data);
|
|
$(".datepicker" ).datepicker();
|
|
CalculerEcheanceRen();
|
|
CalculerFinRen();
|
|
},
|
|
error : function(resultat, statut, erreur)
|
|
{
|
|
},
|
|
complete: function(data)
|
|
{
|
|
}
|
|
});
|
|
$("#dateAvenant").readable();
|
|
}
|
|
else
|
|
if(codeTypeAvenant=="ADL")
|
|
{
|
|
$("#dateAvenant").val($("#datejourfr_C").val());
|
|
$("#dateAvenant").unreadable();
|
|
$("#motifAvenant").readable();
|
|
|
|
}
|
|
|
|
else
|
|
if(codeTypeAvenant=="ANL")
|
|
{
|
|
$("#dateAvenant").val($("#dateEffet").val());
|
|
$("#dateAvenant").unreadable();
|
|
$("#motifAvenant").readable();
|
|
}
|
|
else
|
|
if(codeTypeAvenant=="QTM")
|
|
{
|
|
if(idCollegeFacture=="0"){
|
|
v_msg="Aucun collège validé!";
|
|
v_msgEng="No validated college";
|
|
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
setTimeout(function() {
|
|
window.location.assign($("#racineWeb" ).val()+"Creeravenant/");
|
|
}, 2000);
|
|
|
|
|
|
return;
|
|
}
|
|
|
|
$("#dateAvenant").val($("#datejourfr_C").val());
|
|
|
|
$("#dateAvenant").readable();
|
|
$("#motifAvenant").readable();
|
|
|
|
if(idBeneficiaireFacture=="")
|
|
{
|
|
ajouteradherentfacturation();
|
|
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
$("#dateAvenant").val($("#datejourfr_C").val());
|
|
|
|
$("#dateAvenant").readable();
|
|
$("#motifAvenant").readable();
|
|
}
|
|
|
|
}
|
|
|
|
function pop_afficher_detail_renouvellement()
|
|
{
|
|
var div_patienter = $('#div_patienter');
|
|
|
|
div_patienter.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdetailrenouvellement/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
|
|
div_patienter.html('');
|
|
|
|
$('#div_detail_renouvellement').html(data);
|
|
//appliquerDataTable();
|
|
$('#div_detail_renouvellement').modal("show");
|
|
|
|
var oTable = $('.tabliste').DataTable();
|
|
oTable.destroy();
|
|
|
|
setTimeout(function() {
|
|
appliquerDataTable();
|
|
}, 500);
|
|
},
|
|
complete: function() {
|
|
$("#btn_pop").click();
|
|
}
|
|
});
|
|
}
|
|
|
|
function enregistrer_renouvellemnt()
|
|
{
|
|
v_msg="Confirmez-vous le renouvellement de cette police?";
|
|
v_msgEng="Do you confirm the renewal of this policy?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Ficherenouvellement/enregistrerrenouvellement/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function fiche_limite_additionnelle()
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Fichelimiteadditionnelle/");
|
|
}
|
|
|
|
function enregistrer_changement_etat_famille()
|
|
{
|
|
codeEtatAdherent=$("#codeEtatAdherent").val();
|
|
|
|
if (codeEtatAdherent<" ")
|
|
{
|
|
v_msg="Veuillez sélectionner le nouvel état!";
|
|
v_msgEng="Please select the new state!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
motifEtat=$("#motifEtat").val();
|
|
|
|
if (motifEtat<" ")
|
|
{
|
|
v_msg="Veuillez indiquer le motif!";
|
|
v_msgEng="Please enter the reason!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous ce changement d\'état?";
|
|
v_msgEng="Do you confirm this change of state?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$("#btn_enreg").click();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function changer_etat_beneficiaire()
|
|
{
|
|
etat=$("#codeEtatPolice_C").val();
|
|
|
|
if (etat=="RE")
|
|
{
|
|
v_msg="Attention! Police résiliée!";
|
|
v_msgEng="Warning! Terminated policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="SU")
|
|
{
|
|
v_msg="Attention! Police suspendue!";
|
|
v_msgEng="Warning! Suspended policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (etat=="AN")
|
|
{
|
|
v_msg="Attention! Police annulée!";
|
|
v_msgEng="Warning! Canceled policy!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Changeretatbeneficiaire/");
|
|
}
|
|
|
|
function enregistrer_changement_etat_beneficiaire()
|
|
{
|
|
codeEtatBeneficiaire=$("#codeEtatBeneficiaire").val();
|
|
|
|
if (codeEtatBeneficiaire<" ")
|
|
{
|
|
v_msg="Veuillez sélectionner le nouvel état!";
|
|
v_msgEng="Please select the new state!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
motifEtat=$("#motifEtat").val();
|
|
|
|
if (motifEtat<" ")
|
|
{
|
|
v_msg="Veuillez indiquer le motif!";
|
|
v_msgEng="Please enter the reason!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous ce changement d\'état?";
|
|
v_msgEng="Do you confirm this change of state?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$("#btn_enreg").click();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function pop_afficher_selection_retrait()
|
|
{
|
|
var div_selection_assure = $('#div_selection_assure');
|
|
div_selection_assure.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
|
$("#btn_pop").click();
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxselectionretrait/",
|
|
type : 'post',
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
div_selection_assure.html(data);
|
|
|
|
var oTable = $('.tabliste').DataTable();
|
|
oTable.destroy();
|
|
|
|
setTimeout(function() {
|
|
appliquerDataTable();
|
|
}, 500);
|
|
},
|
|
complete: function() {
|
|
// $("#btn_pop").click();
|
|
}
|
|
});
|
|
}
|
|
|
|
function beneficiaire_a_retirer(p_choix, p_id_beneficiaire)
|
|
{
|
|
donnees = 'idBeneficiaire='+p_id_beneficiaire;
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxselectionretrait/selectionner/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function recapituler_retrait()
|
|
{
|
|
var div_assure_a_retirer = $('#div_assure_a_retirer');
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxdetailretrait/recapituler/",
|
|
type: 'POST',
|
|
success: function(data) {
|
|
div_assure_a_retirer.html(data);
|
|
|
|
var oTable = $('.tabliste').DataTable();
|
|
oTable.destroy();
|
|
|
|
setTimeout(function() {
|
|
appliquerDataTable();
|
|
}, 500);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function changer_college()
|
|
{
|
|
codeTypeAvenant=$("#codeTypeAvenant_C").val();
|
|
|
|
// autorisé le 11/07/2018 en attendant
|
|
if (codeTypeAvenant!="REN")
|
|
{
|
|
v_msg="Opération possible uniquement lors du renouvellement!";
|
|
v_msgEng="Operation possible only during renewal!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
codeEtatFacturation=$("#codeEtatFacturation").val();
|
|
if (codeEtatFacturation=="1")
|
|
{
|
|
v_msg="Attention! Famille déjà facturée!";
|
|
v_msgEng="Warning! Family already billed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
consommation_adherent=$("#consommation_adherent").val();
|
|
if(consommation_adherent>"0")
|
|
{
|
|
v_msg="Attention! cette famille a déjà consommé!";
|
|
v_msgEng="Warning! this family has already consumed!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
window.location.assign($("#racineWeb" ).val()+"Changercollege/");
|
|
}
|
|
|
|
function changer_college_adherent()
|
|
{
|
|
idCollege=$("#idCollege").val();
|
|
|
|
if (idCollege<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un collège!";
|
|
v_msgEng="Please select a college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
donnees = 'idCollege='+idCollege;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxchangercollege/",
|
|
type : 'post',
|
|
data: donnees,
|
|
error: function(errorData) {
|
|
},
|
|
success: function(data) {
|
|
$("#div_prime").html(data);
|
|
},
|
|
complete: function() {
|
|
}
|
|
});
|
|
}
|
|
|
|
function enregistrer_changement_college()
|
|
{
|
|
idCollege=$("#idCollege").val();
|
|
idCollegeOld=$("#idCollegeOld").val();
|
|
|
|
if (idCollege==idCollegeOld)
|
|
{
|
|
v_msg="Veuillez sélectionner un autre collège!";
|
|
v_msgEng="Please select a another college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
if (idCollege<=" ")
|
|
{
|
|
v_msg="Veuillez sélectionner un collège!";
|
|
v_msgEng="Please select a college!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous cette opération?";
|
|
v_msgEng="Do you confirm this operation?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
$("#btn_enreg").click();
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function enregistrer_limite_additionnelle()
|
|
{
|
|
nbAliment=$("#nbAliment").val();
|
|
|
|
if (nbAliment<"1")
|
|
{
|
|
v_msg="Veuillez sélectionner les familles concernées!";
|
|
v_msgEng="Please select the families concerned!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
cumulPlafond=$("#cumulPlafond").val();
|
|
|
|
// alert("cumulPlafond => "+cumulPlafond);
|
|
// return;
|
|
|
|
if (cumulPlafond<="1")
|
|
{
|
|
v_msg="Veuillez saisir les limites additionnelles!";
|
|
v_msgEng="Please enter the additional limits!";
|
|
alert_ebene(v_msg, v_msgEng);
|
|
|
|
return;
|
|
}
|
|
|
|
v_msg="Confirmez-vous ces limites additionnelles?";
|
|
v_msgEng="Do you confirm these additional limits?";
|
|
|
|
confirm_ebene(v_msg, v_msgEng)
|
|
.then((isConfirmed) => {
|
|
if (isConfirmed) {
|
|
// L'utilisateur a confirmé
|
|
window.location.assign($("#racineWeb" ).val()+"Fichelimiteadditionnelle/enregistrerlimiteadditionnelle/");
|
|
} else {
|
|
// L'utilisateur a annulé
|
|
console.log("Confirmation refusée");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function selection_college(p_choix,p_id_college_temp)
|
|
{
|
|
donnees = 'idCollegeTemp='+p_id_college_temp;
|
|
donnees += '&choix='+p_choix;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxlimiteadditionnelle/selectionner/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recapituler_limite_additionnelle();
|
|
}
|
|
});
|
|
}
|
|
|
|
function modifier_college_temp(p_id_college_temp)
|
|
{
|
|
if (p_id_college_temp>"0")
|
|
{
|
|
window.location.assign($("#racineWeb" ).val()+"Modifiercollegetemp/"+p_id_college_temp+"/");
|
|
}
|
|
}
|
|
|
|
function maj_limite_additionnelle(idGarantie, plafond, controle)
|
|
{
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idGarantie='+idGarantie+"&plafond="+plafond;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majplafondadd/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
controle.focus();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function maj_prime_additionnelle(idGarantie, primeOption, controle)
|
|
{
|
|
if(controle_numerique(controle))
|
|
{
|
|
donnees = 'idGarantie='+idGarantie+"&primeOption="+primeOption;
|
|
|
|
$.ajax({
|
|
url: $("#racineWeb").val()+"Ajaxgarantiescollegeadd/majprimeadd/",
|
|
type: 'POST',
|
|
data: donnees,
|
|
success: function(data) {
|
|
$("#div_garanties").html(data);
|
|
},
|
|
error: function(data) {
|
|
},
|
|
complete: function() {
|
|
recapituler_limite_college();
|
|
controle.focus();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function enregistrer_college_temp()
|
|
{
|