a
This commit is contained in:
parent
47e27df820
commit
c3521810ed
187
Js/fonctions.js
187
Js/fonctions.js
|
|
@ -1374,3 +1374,190 @@ function creer_avenant()
|
||||||
|
|
||||||
window.location.assign($("#racineWeb" ).val()+"Creeravenant/");
|
window.location.assign($("#racineWeb" ).val()+"Creeravenant/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enregistrer_avenant()
|
||||||
|
{
|
||||||
|
codeTypeAvenant=$("#codeTypeAvenant").val();
|
||||||
|
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());
|
||||||
|
var d_fin = new Date($("#dateFinSql").val());
|
||||||
|
var d_avenant = $("#dateAvenant").datepicker("getDate");
|
||||||
|
|
||||||
|
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 (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=="CHE")
|
||||||
|
{
|
||||||
|
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?";
|
||||||
|
|
||||||
|
if(confirm_ebene(v_msg, v_msgEng))
|
||||||
|
{
|
||||||
|
var div_attente = $('#div_attente');
|
||||||
|
div_attente.html('<div style="padding-top:80px;"><img src="Bootstrap/images/loading.gif"/> <span style="font-size:15pt;">' + 'Chargement en cours! Veuillez patienter...' + '</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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -595,7 +595,7 @@ $activeChildId = $menuData['child'];
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
|
||||||
<!-- Application Scripts -->
|
<!-- Application Scripts -->
|
||||||
<script src="/Js/fonctions.js?ver=2026.01.02.08"></script>
|
<script src="/Js/fonctions.js?ver=2026.01.03.00"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user