This commit is contained in:
KONE SOREL 2026-03-19 11:18:53 +00:00
parent 75d99961d6
commit 27f3ff0fe2
2 changed files with 152 additions and 127 deletions

View File

@ -63660,10 +63660,13 @@ function afficherDetailBareme()
}
function init_saisie_detailbareme()
{
$("#dateEffetBareme").val("");
$("#actif").val("");
/**
* Réinitialisation du formulaire après insertion
*/
function init_saisie_detailbareme() {
$("#dateEffetBareme").val("");
//$("#actif").val("");
// On ne vide pas le TM car l'utilisateur peut vouloir le réutiliser pour une autre date
}
function controleDateEffetBareme(){
@ -63707,32 +63710,23 @@ function controleDateEffetBareme(){
}
function actualiser_detailbareme()
{
idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val();
donnees = 'idBaremePriseEnCharge='+idBaremePriseEnCharge;
$.ajax({
url: $("#racineWeb").val()+"Ajaxinsererdetailbareme/",
type : 'post',
data: donnees,
error: function(errorData){
//alert("Erreur : "+errorData);
},
success: function(data) {
//alert("Success : "+data);
$('#div_bareme').html(data);
},
complete: function() {
}
});
/**
* Rafraîchissement de la zone d'historique des taux
*/
function actualiser_detailbareme() {
const idBareme = $("#idBaremePriseEnCharge").val();
$.ajax({
url: $("#racineWeb").val() + "Ajaxinsererdetailbareme/",
type: 'post',
data: { idBaremePriseEnCharge: idBareme },
success: function(data) {
$('#div_bareme').html(data);
}
});
}
function supprimer_detailbareme(adminProd, idDetail)
{
@ -63773,59 +63767,74 @@ function supprimer_detailbareme(adminProd, idDetail)
}
// inserer_bareme()
function inserer_bareme()
{
idBaremePriseEnCharge = $("#idBaremePriseEnCharge").val();
dateEffetBareme = $("#dateEffetBareme").val();
ticketModerateurBareme = $("#ticketModerateurBareme").val();
//actif = $("#actif").val();
if(dateEffetBareme <= " "){
v_msg="Veuillez entrer une date d'effet!";
v_msgEng="Please enter an effective date!";
alert_ebene(v_msg, v_msgEng);
/**
* Déploiement du Ticket Modérateur Global sur l'ensemble du barème
*/
function inserer_bareme() {
const idBareme = $("#idBaremePriseEnCharge").val();
const dateEffet = $("#dateEffetBareme").val();
const tm = $("#ticketModerateurBareme").val();
const lang = $("#codeLangue").val();
$("#dateEffetBareme").focus();
return;
}
if(ticketModerateurBareme <= " "){
v_msg="Veuillez entrer un ticket modérateur!";
v_msgEng="Please enter a co-payment!";
alert_ebene(v_msg, v_msgEng);
// 1. Validations de saisie
if (!dateEffet || dateEffet.trim() === "") {
alert_ebene("Veuillez entrer une date d'effet !", "Please enter an effective date!");
$("#dateEffetBareme").focus();
return;
}
$("#ticketModerateurBareme").focus();
return;
}
$("#div_bareme").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 = 'idBaremePriseEnCharge='+idBaremePriseEnCharge;
donnees += '&dateEffetBareme='+dateEffetBareme;
donnees += '&ticketModerateurBareme='+ticketModerateurBareme;
$.ajax({
url: $("#racineWeb").val()+"Ajaxinsererdetailbareme/ajouter/",
type : 'post',
data: donnees,
error: function(errorData){
//alert("Erreur : "+errorData);
},
success: function(data) {
//alert("Success : "+data);
init_saisie_detailbareme();
actualiser_detailbareme();
},
complete: function() {
afficheNombreLigneBareme('detailbareme');
$("#masquerBareme").val("0");
afficherDetailBareme();
}
});
if (!tm || tm.trim() === "") {
alert_ebene("Veuillez entrer un ticket modérateur !", "Please enter a co-payment!");
$("#ticketModerateurBareme").focus();
return;
}
// 2. Confirmation Critique (Standard Neutral Pro)
const c_msg = `Attention : Vous allez appliquer un taux de ${tm}% à TOUS les actes de ce barème avec effet au ${dateEffet}. Confirmez-vous ce déploiement global ?`;
const c_msgEng = `Warning: You are about to apply a ${tm}% rate to ALL acts in this scale effective ${dateEffet}. Do you confirm this global deployment?`;
confirm_ebene(c_msg, c_msgEng).then((isConfirmed) => {
if (isConfirmed) {
// Affichage du loader dans la zone d'historique
$("#div_bareme").html(`
<div class="d-flex justify-content-center align-items-center p-5">
<div class="text-center">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"></div>
<div class="mt-2 text-primary fw-bold text-uppercase small animate__animated animate__pulse animate__infinite">
${(lang === 'en_US') ? 'Deploying rates...' : 'Déploiement des taux...'}
</div>
</div>
</div>`);
const donnees = {
idBaremePriseEnCharge: idBareme,
dateEffetBareme: dateEffet,
ticketModerateurBareme: tm
};
$.ajax({
url: $("#racineWeb").val() + "Ajaxinsererdetailbareme/ajouter/",
type: 'post',
data: donnees,
success: function(data) {
init_saisie_detailbareme();
actualiser_detailbareme();
// On informe l'utilisateur que tout est à jour
alert_ebene("Le barème a été mis à jour avec succès !", "The scale has been successfully updated!");
},
complete: function() {
// Mise à jour du badge compteur "Lignes globales"
if (typeof afficheNombreLigneBareme === 'function') {
afficheNombreLigneBareme('detailbareme');
}
$("#masquerBareme").val("0");
// On force l'affichage de l'historique pour montrer la nouvelle ligne
$("#div_bareme").show();
$("#span_bareme").removeClass('fa-chevron-down').addClass('fa-chevron-up');
}
});
}
});
}
//15-05-2023

View File

@ -1,51 +1,67 @@
<?php
$adminProd = $_SESSION['adminProd'];
$adminProd = $_SESSION['adminProd'];
$isAnglais = est_anglophone();
?>
<INPUT class="sr-only" TYPE="text" id="maxDateEffetBareme" name="maxDateEffetBareme" value="<?= $maxDateEffetBareme; ?>">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:12pt;">
<thead >
<tr >
<th style='text-align:center; border: 2px solid #ddd;'> <?= _("Effet") ?> </th>
<th style='text-align:center; border: 2px solid #ddd;'> <?= _("Ticket Modérateur") ?> </th>
<th style='text-align:center; border: 2px solid #ddd;'> <?= _("Actif") ?> </th>
<th style='text-align:center; border: 2px solid #fff;'> <?= _("Suppr") ?> </th>
</tr>
</thead>
<tbody>
<tbody>
<?php foreach ($detailbareme as $v):
$idDetail = $v['id'];
$supprime = $v['supprime'];
if($this->nettoyer($v['actif'])=="1"){
$actif = "Oui";
}else{
$actif = "Non";
}
?>
<?php if($supprime=='1'): ?>
<tr valign="top" style="text-decoration: line-through red;">
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<td style='text-align:center; border: 2px solid #ddd;'><?= datefr($this->nettoyer($v['dateEffet'])); ?></td>
<td style='text-align:center; border: 2px solid #ddd;'><?= $this->nettoyer($v['ticketModerateur']);?></td>
<td style='text-align:center; border: 2px solid #ddd;'><?= $actif;?></td>
<?php if($supprime=='0'): ?>
<td>
<button type="button" class="form-control btn btn-danger" onClick="javascript:supprimer_detailbareme('<?= $adminProd?>',<?= $idDetail ?>);">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
</td>
<?php else: ?>
<td> </td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="hidden" id="maxDateEffetBareme" name="maxDateEffetBareme" value="<?= $maxDateEffetBareme; ?>">
<div class="table-responsive animate__animated animate__fadeIn">
<table class="table table-hover align-middle mb-0" style="font-size: 9.5pt;">
<thead class="bg-light border-bottom">
<tr>
<th class="ps-3 py-3 text-center" width="25%"><?= _("Date d'Effet") ?></th>
<th class="text-center py-3" width="25%"><?= _("Part Patient (TM)") ?></th>
<th class="text-center py-3" width="25%"><?= _("État / Actif") ?></th>
<th class="text-center py-3 pe-3" width="15%"><?= _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($detailbareme as $v):
$idDetail = $v['id'];
$supprime = (int)$v['supprime'];
$isActif = ($v['actif'] == "1");
// Style spécifique pour les lignes supprimées
$rowStyle = ($supprime === 1) ? 'style="background-color: #fff5f5; opacity: 0.6; text-decoration: line-through text-decoration-color: #dc3545;"' : '';
?>
<tr <?= $rowStyle ?>>
<td class="text-center fw-bold text-dark">
<i class="fas fa-calendar-alt me-2 text-muted small"></i><?= datefr($this->nettoyer($v['dateEffet'])); ?>
</td>
<td class="text-center">
<span class="badge bg-primary-ghost text-primary px-3 py-2 rounded-pill fw-bold fs-6">
<?= $this->nettoyer($v['ticketModerateur']); ?> %
</span>
</td>
<td class="text-center">
<?php if ($supprime === 0): ?>
<span class="badge <?= $isActif ? 'bg-success' : 'bg-light text-muted border' ?> rounded-pill px-3 py-2 fw-bold">
<i class="fas <?= $isActif ? 'fa-check-circle' : 'fa-clock' ?> me-1"></i>
<?= $isActif ? _("En vigueur") : _("Futur / Passé") ?>
</span>
<?php else: ?>
<span class="badge bg-danger-light text-danger rounded-pill px-3 py-2 fw-bold small">
<?= _("Supprimé") ?>
</span>
<?php endif; ?>
</td>
<td class="text-center pe-3">
<?php if ($supprime === 0): ?>
<button type="button" class="btn btn-sm btn-danger-light rounded-circle action-icon shadow-none"
onclick="supprimer_detailbareme('<?= $adminProd ?>', <?= $idDetail ?>);"
title="<?= _('Supprimer cette révision') ?>">
<i class="fas fa-trash-alt"></i>
</button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<style>
.bg-danger-light { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.action-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.action-icon:hover { background-color: #dc3545; color: white; transform: scale(1.1); }
</style>