This commit is contained in:
KANE LAZENI 2026-07-26 13:50:53 +00:00
parent 5441bb4da0
commit 7cea3ac755
5 changed files with 29 additions and 15 deletions

View File

@ -15,6 +15,15 @@ class ControleurAjaxfacturerfeuillemaladie extends Controleur {
public function facturer()
{
$csrf_token = trim($this->requete->getParametreFormulaire("csrf_token"));
if (!Csrf::validateToken($csrf_token)) {
$_SESSION['flash_error'] = 'Votre session a expiré. Veuillez réessayer.';
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
}
$user_id_substitut = $this->requete->getParametreFormulaire("user_id_substitut");
$this->feuillemaladie->facturer($user_id_substitut);

View File

@ -5319,6 +5319,8 @@ function facturer_cso(user_id)
}
donnees_substitut = 'user_id_substitut='+user_id_substitut;
donnees = charger_csrf_token(donnees);
$.ajax({
url: $("#racineWeb").val()+"Ajaxfacturerfeuillemaladie/facturer/",
@ -5337,15 +5339,24 @@ function facturer_cso(user_id)
feuillemaladie();
}
});
}
// Fonction de facturation de la feuille de maladie
async function facturer_feuillemaladie() {
const codeLangue = $("#codeLangue").val();
const prixActe = $("#prixActe").val();
const modeSaisieFacture = $("#modeSaisieFacture").val();
const facture = $("#facture").val();
// Déjà facturé
// if (modeSaisieFacture === "0" && facture === "1") {
if (facture === "1") {
const v_msg = "Déjà facturé!";
const v_msgEng = "Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
// Vérification si le prix est nul
if (prixActe === "0") {
const v_msg = "Rien à facturer!";
@ -5376,8 +5387,6 @@ async function facturer_feuillemaladie() {
return;
}
const modeSaisieFacture = $("#modeSaisieFacture").val();
const facture = $("#facture").val();
const contestation = $("#contestation").val();
// Dossier médical contesté
@ -5388,14 +5397,6 @@ async function facturer_feuillemaladie() {
return;
}
// Déjà facturé
if (modeSaisieFacture === "0" && facture === "1") {
const v_msg = "Déjà facturé!";
const v_msgEng = "Already charged!";
alert_ebene(v_msg, v_msgEng);
return;
}
// Bon caduc
const bonCaduc = $("#bonCaduc").val();
if (bonCaduc === "1" && modeSaisieFacture !== "1") {

View File

@ -149,7 +149,6 @@ class Feuillemaladie extends Modele {
//Biometrie
$_SESSION['p_okId'] = "-1";
$_SESSION['p_okId_face'] = "-1";
}
public function enregistrerhospitalisation($numeroBon, $codeGestionBon)

View File

@ -97,6 +97,8 @@
$otpStatus = -1;
}
$token = $_SESSION['csrf_token_submieted'];
var_dump(
array(
"otpStatus" => $otpStatus,
@ -114,6 +116,7 @@
<input class="sr-only" id="bonCaduc" name="bonCaduc" type="text" value= "<?= $bonCaduc ?>" >
<input class="sr-only" id="facture" name="facture" type="text" value= "<?= $facture ?>" >
<input class="sr-only" id="otpStatus" name="otpStatus" type="text" value= "<?= $otpStatus ?>" >
<input class="sr-only" type="text" id="prixActe" name="prixActe" value="<?= $this->nettoyer($feuillemaladie['fraisRetenu']) ?>" >
<input class="sr-only" type="text" id="prixBase" name="prixBase" value="<?= $this->nettoyer($feuillemaladie['prixBase']) ?>" >
@ -175,6 +178,8 @@
<?php if($_SESSION['p_vip_C']=="1"): ?>
<INPUT class="form-control vip" TYPE="text" id="vip" name="vip" value="<?= $_SESSION['p_strVip_C'] ?>">
<?php endif; ?>
<input type="hidden" id="csrf_token" name="csrf_token" value="<?= htmlspecialchars($token) ?>">
<INPUT class="sr-only" TYPE="text" id="autoriserBonHospitAvantDate" name="autoriserBonHospitAvantDate" value="<?= $autoriserBonHospitAvantDate ?>">
<INPUT class="sr-only" TYPE="text" id="dateDebutHospit" name="dateDebutHospit" value="<?= $this->nettoyer($feuillemaladie['dateDebutHospit']) ?>">
@ -937,7 +942,7 @@
</marquee>
<?php endif; ?>
<?php if($_SESSION['ententePrealableenattente'] == 1 ):?>
<input class="sr-only" type="text" id="ententePrealableenattente" name="ententePrealableenattente" value="<?=$_SESSION['ententePrealableenattente'] ?>" >
<input class="sr-only" type="text" id="ententePrealableenattente" name="ententePrealableenattente" value="<?=$_SESSION['ententePrealableenattente'] ?>" >
<?php endif; ?>
</tbody>
</table>

View File

@ -1,4 +1,4 @@
<INPUT class="sr-only" TYPE="text" id="nomForm" NAME="nomForm" value="ficheBeneficiaire">
facture<INPUT class="sr-only" TYPE="text" id="nomForm" NAME="nomForm" value="ficheBeneficiaire">
<INPUT class="sr-only" TYPE="text" id="todDay" NAME="todDay" value="<?= date('d/m/Y') ?>">
<?php