production/Vue/Ajaxdetailfactureclassique/index.php
2025-12-01 16:12:12 +00:00

309 lines
16 KiB
PHP
Executable File

<?php
$idDossierClassique = $facture['idDossierClassique'];
$hospitalisation = $facture['hospitalisation'];
$controlerPlafondAdherent = ($_SESSION['controlerPlafondAdherent']>0);
$controlerPlafondBeneficiaire = ($_SESSION['controlerPlafondBeneficiaire']>0);
$codePrestataire = $facture['codePrestataire'];
$ndFacture = $dossier['ndFacture'];
$prestataireConsultation = $dossier['prestataireConsultation'];
?>
<!-- <div id="div_facture"> -->
<div id="div_entete_facture">
<input class="sr-only" type="text" id="prixActe" name="prixActe" value="<?= $this->nettoyer($facture['fraisRetenu']) ?>" >
<input class="sr-only" type="text" id="cout" name="cout" value="<?= $this->nettoyer($facture['fraisReel']) ?>" >
<input class="sr-only" type="text" id="montantTm" name="montantTm" value="<?= $this->nettoyer($facture['montantTm']) ?>" >
<input class="sr-only" type="text" id="montantArembourser" name="montantArembourser" value="<?= $this->nettoyer($facture['montantArembourser']) ?>" >
<div id="div_prestataire">
<INPUT class="sr-only" TYPE="text" id="prestataire" NAME="prestataire" value="<?= $_SESSION['prestataire_F'] ?>" >
<input class="sr-only" type="text" id="codePrestataire" name="codePrestataire" value="<?= $_SESSION['codePrestataire_F'] ?>" >
</div>
<legend><?= _("Entête") ?></legend>
<table class="table table-responsive table-condensed" style='font-size:8pt;'>
<tbody>
<tr>
<td width="6%" > <?= _("Réclamé") ?> </td>
<td><INPUT style='font-size:8pt; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['fraisReel'])) ?>" readonly ></td>
<td width="6%" align="center" > <?= _("Rejeté") ?> </td>
<td><INPUT style='font-size:8pt; color:red; text-align:center;' id="v_rejet" name="v_rejet" class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['montantRejete'])) ?>" readonly ></td>
<td width="6%" align="center" > <?= _("Exclu") ?> </td>
<td><INPUT style='font-size:8pt; color:red; text-align:center;' id="v_exclu" name="v_exclu" class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['fraisExclu'])) ?>" readonly ></td>
<td width="6%" align="center" > <?= _("Base Remb") ?> </td>
<td> <INPUT style='font-size:8pt; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['baseRemboursement'])) ?>" readonly ></td>
<td width="6%" align="center" > <?= _("Montant T M") ?> </td>
<td><INPUT style='font-size:8pt; color:red; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['montantTm'])) ?>" readonly ></td>
<td width="6%" align="center"> <?= _("A Rembourser") ?> </td>
<td><INPUT style='font-size:8pt; color:blue; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($facture['baseRemboursement']-$facture['montantTm']) ?>" readonly ></td>
<td width="6%" align="center" > <?= _("Dépassement") ?> </td>
<td><INPUT style='font-size:8pt; color:red; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['depassementLimite'])) ?>" readonly ></td>
</tr>
<tr>
<td> <?= _("No Facture") ?> </td>
<td><INPUT class="form-control" style='font-size:8pt; text-align:center;' TYPE="text" id="numeroFacture" NAME="numeroFacture" onChange="javascript:ajaxtmfacturerbcl();" value="<?= $this->nettoyer($facture['numeroFacture']) ?>" autofocus required AUTOCOMPLETE="OFF" AUTOCOMPLETE="OFF"></td>
<td align="center" > <?= _("Prestataire") ?> </td>
<td colspan="5">
<?php if ($_SESSION['prestataire_C']>" "): ?>
<button id="button_popRecherchePrestataire" NAME="button_popRecherchePrestataire" type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popRecherchePrestataire" style='font-size:10pt;' style='font-size:10pt;' ><span id="nomPrestataire" name="nomPrestataire"> <?= $_SESSION['prestataire_C'] ?> </span></button>
<?php else : ?>
<button id="button_popRecherchePrestataire" NAME="button_popRecherchePrestataire" type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popRecherchePrestataire" style='font-size:10pt;' ><span id="nomPrestataire" name="nomPrestataire"> <?= $prestataireConsultation ?> </span></button>
<?php endif; ?>
</td>
<td align="center" > <?= _("Date Facture") ?> </td>
<td >
<INPUT style='font-size:8pt; text-align:center;' class="form-control datepicker" TYPE="text" id="dateFacture" NAME="dateFacture" value="<?= dateLang($this->nettoyer($facture['dateFacture'])) ?>" required AUTOCOMPLETE="OFF" onChange="enregistrerfacture_classique_date();" >
</td>
<td width="6%" align="center"> <?= _("Retenu") ?> </td>
<td><INPUT style='font-size:8pt; color:blue; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($facture['fraisRetenu'])) ?>" readonly ></td>
<td align="center"> <?= _("Hospitalisé ?") ?> </td>
<?php if($hospitalisation=='1'): ?>
<td><INPUT class="form-control" style='font-size:8pt; text-align:center;' TYPE="text" value="Oui" readonly ></td>
<?php else: ?>
<td><INPUT class="form-control" style='font-size:8pt; text-align:center;' TYPE="text" value="Non" readonly ></td>
<?php endif; ?>
<tr>
<tr>
<td> <?= _("T M") ?> </td>
<td>
<div id="div_tm">
<INPUT id="tmFacture" name="tmFacture" style='font-size:8pt; text-align:center; color:red;' class="form-control" type="number" value="<?= $this->nettoyer($facture['tm']) ?>"
onChange="ajax_maj_tm_facture(this.value, this);" readonly>
</div>
</td>
<td align="center" > Observations </td>
<td colspan="5"><INPUT style='font-size:8pt;' id="observations" name="observations" class="form-control" TYPE="text" value="<?= $this->nettoyer($facture['observations']) ?>" onChange="enregistrerfacture_classique_date();" AUTOCOMPLETE="OFF"></td>
<td> </td>
<td colspan="3"> <input id="btn_enreg" name="btn_enreg" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer Entête...") ?>" onClick="javascript:valider_facture_classique_temp();" style='font-size:10pt;' > </td>
<td align="center"> <?= _("Nbre Facture") ?> </td>
<td><INPUT style='font-size:8pt; color:blue; text-align:center;' class="form-control" TYPE="text" value="<?= format_N($ndFacture) ?>" readonly ></td>
<tr>
</tbody>
</table>
</div>
<div id="content">
<?php include 'flexcode/include/global.php'; ?>
</div>
<div id ="div_wait">
</div>
<table class="table table-bordered table-condensed table-responsive" style="font-size:8pt;">
<tbody>
<tr>
<td width="8%"> <?= _("Plafond Famille") ?> </td>
<td><INPUT style='text-align:center; background-color:#7d4e27 !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($police['plafond']) ?>" readonly ></td>
<td align="center"> <?= _("Conso. Famille") ?> </td>
<td><INPUT style='text-align:center; background-color:rgba(255, 0, 127) !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($police['consommation']) ?>" readonly ></td>
<td align="center"> <?= _("Solde Famille") ?> </td>
<td> <INPUT style='text-align:center; background-color:green !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($police['soldeConsommation']) ?>" readonly ></td>
<td align="center" width="8%"> <?= _("Plafond Bénéficiaire") ?> </td>
<td><INPUT style='text-align:center; background-color:#7d4e27 !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($college['plafond']) ?>" readonly ></td>
<td align="center"> <?= _("Conso. Bénéficiaire") ?> </td>
<td><INPUT style='text-align:center; background-color:rgba(255, 0, 127) !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($college['consommation']) ?>" readonly ></td>
<td align="center"> <?= _("Solde Bénéficiaire") ?> </td>
<td><INPUT style='text-align:center; background-color:green !important;color:white; font-size:8pt;' class="form-control" TYPE="text" value="<?= format_N($college['soldeConsommation']) ?>" readonly ></td>
</tr>
</tbody>
</table>
<legend><?= _("Détail") ?></legend>
<table class="table table-striped table-bordered table-condensed table-responsive" style="font-size:8pt;">
<tbody>
<tr>
<td width="8%" class="required" style="font-size:12pt;"> <?= _("Acte") ?> </td>
<td colspan="5">
<input id="searchInputActe" name="searchInputActe" AUTOCOMPLETE="OFF" style="font-size:12pt; height:30px;" class="form-control" type="text" required AUTOCOMPLETE="OFF"
onkeyup="javascript:affichelisteactes(this.value, 'acte');" placeholder="<?= _("Rechercher puis sélectionner un acte à ajouter à la facture...") ?>">
<INPUT class="sr-only" TYPE="text" id="codeActe" NAME="codeActe" value="">
<div id="div_selection_acte" style="width:92%">
</div>
</td>
</tr>
</tbody>
</table>
<div id="div_prestations">
<table class="table table-striped table-bordered table-condensed table-responsive" style="font-size:8pt;">
<thead>
<tr>
<th rowspan="2"style='text-align:center'> <?= _("Suppr") ?> </th>
<th rowspan="2" style="text-align:center"> <?= _("Garantie") ?> </th>
<th rowspan="2" style="text-align:center"> <?= _("Actes") ?> </th>
<th rowspan="2" colspan="2" style="text-align:center"> <?= _("Réclamé") ?> </th>
<th colspan="3" style="text-align:center"> <?= _("Rejeté") ?> </th>
<th colspan="3" style="text-align:center"> <?= _("Exlusion") ?> </th>
<th colspan="2" style="text-align:center"> <?= _("Ticket Modérateur") ?> </th>
<th rowspan="2" style="text-align:center"> <?= _("A Remb") ?> </th>
<th rowspan="2" style="text-align:center"> <?= _("Dépassement") ?> </th>
<th rowspan="2" style="text-align:center"> <?= _("Motif") ?> </th>
</tr>
<tr>
<th style="text-align:center"> <?= _("Montant") ?> </th>
<th style="text-align:center"> <?= _("Motif") ?> </th>
<th style="text-align:center"> <?= _("Obs") ?> </th>
<th style="text-align:center"> <?= _("Montant") ?> </th>
<th style="text-align:center"> <?= _("Motif") ?> </th>
<th style="text-align:center"> <?= _("Obs") ?> </th>
<th style="text-align:center"> <?= _("Taux") ?> </th>
<th style="text-align:center"> <?= _("Montant") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($prestations as $prestation):
$idPrestation = $this->nettoyer($prestation['id']);
$codeGarantie = $this->nettoyer($prestation['codeGarantie']);
$libelleActe = mb_strtoupper($this->echapper($prestation['libelleActe'], 'UTF-8'));
$valeurActe = $this->nettoyer($prestation['valeurActe']);
$montantRejete = $this->nettoyer($prestation['montantRejete']);
$fraisExclu = $this->nettoyer($prestation['fraisExclu']);
$codeMotifRejet = $this->nettoyer($prestation['codeMotifRejet']);
$codeMotifExclusion = $this->nettoyer($prestation['codeMotifExclusion']);
$libellemotifRejet = $this->nettoyer($prestation['libellemotifRejet']);
$libellemotifRejet = $this->echapper($libellemotifRejet);
$libelleMotifExclusion = $this->nettoyer($prestation['libelleMotifExclusion']);
$libelleMotifExclusion = $this->echapper($libelleMotifExclusion);
$depassement = $this->nettoyer($prestation['depassement']);
$codeMotifDepassement = $this->nettoyer($prestation['codeMotifDepassement']);
$motif = $this->nettoyer($prestation['motif']);
$motifEng = $this->nettoyer($prestation['motifEng']);
?>
<tr valign="top">
<td>
<button type="button" class="form-control btn btn-danger" onClick="javascript:supprimer_prestation_classique('<?= $idPrestation ?>');">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
</td>
<td align='center'> <?= $codeGarantie ?> </td>
<td align='center' width="15%" > <?= $this->dechapper($libelleActe) ?> </td>
<td align='center' width="7%" >
<INPUT style='text-align:center; font-size:8pt;' class="form-control" TYPE="number" value="<?= $this->nettoyer($prestation['valeurActe']) ?>"
onChange="ajax_maj_prix_acte_classique('<?=$idPrestation?>', this.value, this);">
</td>
<td align='center' width="8%" > <?= format_N($this->nettoyer($prestation['fraisReel'])) ?> </td>
<td align='center' width="7%" >
<INPUT style='text-align:center; font-size:8pt;' class="form-control" TYPE="number" value="<?= $this->nettoyer($prestation['montantRejete']) ?>"
onChange="ajax_maj_montant_rejete('<?=$idPrestation?>', this.value, this);">
</td>
<td width="13%" align="center">
<?php if($montantRejete>'0'): ?>
<select class="form-select" id="codeMotifRejetPop" NAME="codeMotifRejetPop" required AUTOCOMPLETE="OFF" style='font-size:10pt;' onChange='javascript:enregistrer_motif_rejet_classique(<?= $idPrestation ?>,this.value);'>
<?php liste_options($motifrejets, $codeMotifRejet); ?>
</SELECT>
<?php endif; ?>
</td>
<td width="3%" align="center">
<?php if($montantRejete>'0'): ?>
<input style='text-align:center; font-size:8pt; background-color: yellow;' type="button" value="Obs" class="form-control"
onClick='javascript:init_maj_detail_rejet_rbcl(<?= $idPrestation ?>);'>
<?php endif; ?>
</td>
<td align='center' width="7%" >
<INPUT style='text-align:center; font-size:8pt;' class="form-control" TYPE="number" value="<?= $this->nettoyer($prestation['fraisExclu']) ?>"
onChange="ajax_maj_montant_exclu('<?=$idPrestation?>', this.value, this);">
</td>
<td width="13%" align="center">
<?php if($fraisExclu!='0'): ?>
<select class="form-select" id="codeMotifExclusionPop" NAME="codeMotifExclusionPop" required AUTOCOMPLETE="OFF" style='font-size:10pt;' onChange='javascript:enregistrer_motif_exclusion_classique(<?= $idPrestation ?>,this.value);'>
<?php liste_options($motifecxlusions, $codeMotifExclusion); ?>
</SELECT>
<?php endif; ?>
</td>
<td width="3%" align="center">
<?php if($fraisExclu>'0'): ?>
<input style='text-align:center; font-size:8pt; background-color: red; color : white' type="button" value="Obs" class="form-control"
onClick='javascript:init_maj_detail_exclusion_rbcl(<?= $idPrestation ?>);'>
<?php endif; ?>
</td>
<td align='center' width="4%" >
<INPUT style='text-align:center; font-size:8pt;' class="form-control" TYPE="text" value="<?= $this->nettoyer($prestation['tm']) ?>"
onChange="ajax_maj_tm_acte_rbcl('<?=$idPrestation?>', this.value, this);">
</td>
<td align='center' style='color:red;' width="5%" > <?= format_N($this->nettoyer($prestation['montantTm'])) ?> </td>
<td align='center' width="8%" > <?= format_N($this->nettoyer($prestation['montantArembourser'])) ?> </td>
<td align='center' width="8%" > <?= format_N($this->nettoyer($depassement)) ?> </td>
<?php if($codeMotifDepassement!=''): ?>
<td align='center'>
<button type="button" class="btn btn-info" title="<?= _("Voir le motif du dépassement...") ?>" onClick="javascript:alert_ebene('<?= $motif ?>', '<?= $motifEng ?>');">
<?= $codeMotifDepassement ?>
</button>
</td>
<?php else: ?>
<td > </td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div id="div_fraisDepassement">
<input class="sr-only" type="text" id="depassementLimite" name="depassementLimite" value="<?= $this->nettoyer($facture['depassementLimite']) ?>" >
</div>
<div id="loadingDiv" style="display: none">
<div class="ajax-mask"><div class="loading"><img src="Bootstrap/images/loading-spinner-grey.gif"/> <?= _("Veuillez patienter...") ?> </span></div></div>
</div>
<!-- </div> -->