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

335 lines
14 KiB
PHP
Executable File

<?php $demandeTraite = $this->nettoyer($examen['demandeTraite']);?>
<div id="recap" class="tab-container">
<table class="table table-responsive table-condensed" style='font-size:12pt;' >
<tbody>
<tr>
<td align="center"> <?= _("Réclamé") ?> </td>
<td > <INPUT id="reclame" name="reclame" class="form-control" TYPE="text" value="<?= format_N($hospit_total['totalPrixManuel']) ?>" readonly style="text-align: center; font-size:12pt; font-weight:bold; background-color:#5f9ea0 !important; color:white;"> </td>
<td align="center"> <?= _("Part Assuré") ?> </td>
<td > <INPUT id="partAssure" name="partAssure" class="form-control" TYPE="text" value="<?= format_N($hospit_total['montantTm']+$hospit_total['depassement']) ?>" readonly style="text-align: center; font-size:12pt; font-weight:bold; background-color:#ba74d4 !important; color:white;"> </td>
<td align="center" > <?= _("A Rembourser") ?> </td>
<td > <INPUT id="partAssureur" name="partAssureur" class="form-control" TYPE="text" value="<?= format_N($hospit_total['montantArembourser']) ?>" readonly style="text-align: center; font-size:12pt; font-weight:bold; background-color:rgba(255, 0, 127) !important; color:white;"> </td>
</tr>
</tbody>
</table>
<INPUT class="sr-only" id="choix" name="choix" TYPE="text" value="<?= $choix ?>" >
<INPUT class="sr-only" id="accorderTout" name="accorderTout" TYPE="text" value="<?= $accorderTout ?>" >
<INPUT class="sr-only" id="refuserTout" name="refuserTout" TYPE="text" value="<?= $refuserTout ?>" >
<INPUT class="sr-only" id="siRefus" name="siRefus" TYPE="text" value="<?= $siRefus ?>" >
</div>
<div id="div_prestation" class="tab-container">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:9pt; white-space:nowrap;">
<thead>
<tr>
<th style="text-align:center"> <?= _("Acte <b style='color:red'> - [Plafond]</b>") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Prix Unitaire") ?> </th>
<!--<th style="text-align:center"> <?= _("PU Appliqué") ?> </th>-->
<th width="3%" style="text-align:center"> <?= _("Qté") ?> </th>
<th style="text-align:center"> <?= _("Prix Total") ?> </th>
<!--<th style="text-align:center"> <?= _("PT Appliqué") ?> </th>-->
<th style="text-align:center"> <?= _("TM") ?> </th>
<th style="text-align:center"> <?= _("Montant TM") ?> </th>
<th style="text-align:center"> <?= _("A Remboursé") ?> </th>
<th style="text-align:center"> <?= _("Dépass") ?> </th>
<th style="text-align:center"> <?= _("Motif") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Accorder") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Refuser") ?> </th>
<th style='text-align:center'> <?= _("Répondu le") ?> </th>
<th style='text-align:center'> <?= _("Répondu par") ?> </th>
</tr>
<tr>
<?php if ($demandeTraite=="0"): ?>
<th colspan="9"></th>
<?php if ($accorderTout=="0"): ?>
<th style='text-align:center'>
<input style="color:blue;" type="button" value="<?= _("Tout Sélectionner") ?>"
onClick="javascript:validertoutproformahospit('<?= $idProforma ?>');">
</th>
<?php else: ?>
<th style='text-align:center'>
<input style="color:blue;" type="button" value="<?= _("Tout Desélectionner") ?>"
onClick="javascript:annulervalidertoutproformahospit('<?= $idProforma ?>');">
</th>
<?php endif; ?>
<?php if ($refuserTout=="0"): ?>
<th style='text-align:center'>
<input style="color:red;" type="button" value="<?= _("Tout Sélectionner") ?>"
onClick="javascript:refusertoutproformahospit('<?=$idProforma?>');">
</th>
<?php else: ?>
<th style='text-align:center'>
<input style="color:red;" type="button" value="<?= _("Tout Desélectionner") ?>"
onClick="javascript:annulerrefusertoutproformahospit('<?=$idProforma?>');">
</th>
<?php endif; ?>
<th colspan="2"></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$entente=0;
$accepter=0;
$refuser=0;
foreach ($detailexamens as $detailexamen):
$idPrestationactes=$this->nettoyer($detailexamen['id']);
$codeTypePrestation=$this->nettoyer($detailexamen['codeTypePrestation']);
$ententePrealable=$this->nettoyer($detailexamen['ententePrealable']);
$autorisation=$this->nettoyer($detailexamen['autorisation']);
$codeTarifActe=$this->nettoyer($detailexamen['codeTarifActe']);
$valeurActeManuel = $this->nettoyer($detailexamen['valeurActeManuel']);
$libelleConsommable=$this->nettoyer($detailexamen['libelleConsommable']);
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$libelleActe = substr($this->nettoyer($detailexamen['libelleActeEng']),0,57);
}
else
{
$libelleActe = substr($this->nettoyer($detailexamen['libelleActe']),0,57);
}
$codeActe = $this->nettoyer($detailexamen['codeActe']);
if($codeActe == "CSM"){
$libelleActe = substr($libelleConsommable,0,57);
}
$valeurActe = $this->nettoyer($detailexamen['valeurActe']);
$plafondActe = $this->nettoyer($detailexamen['plafondActe']);
//var_dump($plafondActe);
$plafond = (($plafondActe == $valeurActe) && ($valeurActe > "0"))?"1":"0";
if ($plafondActe > "0" && $plafondActe !="9999999999"){
$forfaitPlafond = " - [".format_N($plafondActe)."]";
}else{
$forfaitPlafond = "";
}
$prixTarif = $this->nettoyer($detailexamen['prixTarif']);
$codeMotifDepassement = $this->nettoyer($detailexamen['codeMotifDepassement']);
$motif = $this->nettoyer($detailexamen['motif']);
$motifEng = $this->nettoyer($detailexamen['motifEng']);
$tarif = $this->nettoyer($detailexamen['tarif']);
$choixValider = $this->nettoyer($detailexamen['choixValider']);
$choixRefuser = $this->nettoyer($detailexamen['choixRefuser']);
if($choixValider=="1"){
$checkedValider = 'checked';
}else{
$checkedValider = '';
}
if($choixRefuser=="1"){
$checkedRefuser = 'checked';
}else{
$checkedRefuser = '';
}
$idProforma = $this->nettoyer($detailexamen['idProforma']);
$acteChambre = $this->nettoyer($detailexamen['acteChambre']);
?>
<?php if($choixValider=='1'): $accepter++;?>
<tr style="background-color: #00ff00;">
<INPUT class="sr-only" TYPE="text" value="<?= $this->nettoyer($detailexamen['libelleActe']) ?>">
<?php elseif($choixRefuser=='1'): $refuser++;?>
<tr style="background-color: red; color:white;">
<INPUT class="sr-only" TYPE="text" value="<?= $this->nettoyer($detailexamen['libelleActe']) ?>">
<?php else: $entente++;?>
<tr valign="top">
<?php endif; ?>
<td > <?= $libelleActe."<b style='color:red'>".$forfaitPlafond."</b>" ?> </td>
<?php if ($demandeTraite=="0"): ?>
<?php if ($prixTarif>"0"): ?>
<td align='center'>
<button type="button" class="span_link" title="<?= _("Voir le tarif appliqué") ?>" onClick='javascript:alert_ebene("<?= $tarif ?>", "<?= $tarif ?>");'>
<?= format_N($valeurActeManuel) ?>
</button>
</td>
<?php else: ?>
<td align='center' width="13%">
<INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($valeurActeManuel) ?>"
onChange="ajax_maj_prix_acte_proformahospitalisation('<?=$idPrestationactes?>', this.value, this);" onBlur="formatMonetaire(this);" onkeyup="controle_numerique(this);" onfocus="formatNumerique(this);">
</td>
<?php endif; ?>
<?php else: ?>
<td align='center'>
<button type="button" class="span_link" title="<?= _("Voir le tarif appliqué") ?>" onClick='javascript:alert_ebene("<?= $tarif ?>", "<?= $tarif ?>");'>
<?= format_N($valeurActeManuel) ?>
</button>
</td>
<?php endif; ?>
<!--<td align='center'> <?= format_N($this->nettoyer($detailexamen['valeurActe'])) ?></td>-->
<?php if ($demandeTraite=="0"): ?>
<?php if ($acteChambre=="0"): ?>
<td align='center' width="8%">
<INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailexamen['quantite']) ?>"
onChange="ajax_maj_qte_acte_proformahospitalisation('<?=$idPrestationactes?>', this.value, this);" onBlur="controle_numerique(this);">
</td>
<?php else: ?>
<td align='center' width="8%">
<INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailexamen['quantite']) ?>"
disabled>
</td>
<?php endif; ?>
<?php else: ?>
<td align='center'> <?= $this->nettoyer($detailexamen['quantite']) ?></td>
<?php endif; ?>
<td align='center'> <?= format_N($this->nettoyer($detailexamen['prixManuel'])) ?></td>
<!--<td align='center'> <?= format_N($this->nettoyer($detailexamen['fraisReel'])) ?></td>-->
<td align='center'> <?= $this->nettoyer($detailexamen['tm'])?></td>
<td align='center'> <?= format_N($this->nettoyer($detailexamen['montantTm'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($detailexamen['montantArembourser'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($detailexamen['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; ?>
<?php if ($demandeTraite=="0"): ?>
<td align="center">
<input type="checkbox" <?= $checkedValider ?> onClick="javascript:if(this.value=='1'){this.value='0'}else{this.value='1'};validerunacteproformahospit('<?=$idProforma?>', '<?=$idPrestationactes?>',this.value);" value="<?=$choixValider?>">
</td>
<td align="center">
<input type="checkbox" <?= $checkedRefuser ?> onClick="javascript:if(this.value=='1'){this.value='0'}else{this.value='1'};refuserunacteproformahospit('<?=$idProforma?>', '<?=$idPrestationactes?>',this.value);" value="<?=$choixRefuser?>">
</td>
<?php else: ?>
<td align="center">
<input type="checkbox" <?=$checkedValider?> disabled>
</td>
<td align="center">
<input type="checkbox" <?=$checkedRefuser?> disabled>
</td>
<?php endif; ?>
<td align='center'><?= dateHeureLang($this->nettoyer($detailexamen['dateHeureReponse']),$_SESSION['lang']);?></td>
<td align='center'><?= $this->nettoyer($detailexamen['responsableAccord']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="table table-responsive table-condensed" style='font-size:8pt;'>
<tbody>
<?php
$motifReel="";
$motifRefusAssure="";
$motifRefusPrestataire="";
$smsenoye=0;
foreach ($motifexamens as $motifexamen):
$codeReponseEntentePrealable = $this->nettoyer($motifexamen['codeReponseEntentePrealable']);
$motifReel = $this->nettoyer($motifexamen['motifReel']);
$motifRefusAssure = $this->nettoyer($motifexamen['motifRefusAssure']);
?>
<?php endforeach;?>
<?php if ($demandeTraite=="1"): ?>
<tr>
<td width="8%"> <?= _("Observation");?></td>
<td colspan="3">
<textarea class="form-control-sm" rows="5" disabled style="width:100%;"><?=$motifReel?></textarea>
</td>
</tr>
<?php else: ?>
<tr>
<td width="8%" > <?= _("Observation");?></td>
<td colspan="3">
<textarea class="form-control-sm" name="motifReel" id="motifReel" rows="5" AUTOCOMPLETE="OFF" style="width:100%;" onchange="javascript:maj_motifReel_proformahospit('<?= $examen['id'] ?>',this.value)"><?=$motifReel?></textarea>
</td>
</tr>
<INPUT class="sr-only" TYPE="text" id="smsenoye" name="smsenoye" value="<?= $smsenoye ?>">
<?php endif; ?>
<?php if ($demandeTraite=="1"): ?>
<tr>
<td>
<?= _("Motif Refus");?>
</td>
<td colspan="3">
<textarea class="form-control-sm" disabled rows="5" required AUTOCOMPLETE="OFF" style="width:100%;"><?=$motifRefusAssure ?></textarea>
</td>
</tr>
<?php else: ?>
<td class="required">
<?= _("Motif Refus");?>
</td>
<td colspan="3">
<textarea class="form-control-sm" name="motifRefusAssure" id="motifRefusAssure" placeholder="<?= _("Obligatoire si refus");?>" rows="5" required AUTOCOMPLETE="OFF" style="width:100%;" onchange="javascript:maj_motifRefusPrestataire_proformahospit('<?= $examen['id'] ?>',this.value)"><?=$motifRefusAssure ?></textarea>
</td>
<?php endif; ?>
<tr>
</tr>
<?php if ($demandeTraite=="0"): ?>
<tr>
<td colspan="2">
<?php if ($choix=="1"): ?>
<input id="btn_enreg" name="btn_enreg" class="form-control btn btn-primary"
type="button" value="<?= _("Valider la proforma") ?>"
onClick="javascript:validerproformahospitalisation('<?= $examen['id'] ?>');" style='font-size:10pt;'>
<?php else: ?>
<input id="btn_enreg" name="btn_enreg" class="form-control btn btn-primary" style='font-size:10pt;' disabled>
<?php endif; ?>
</td>
<td colspan="2">
<input id="btn_fermer" name="btn_fermer" class="form-control btn btn-warning"
type="button" value="<?= _("Fermer") ?>"
onClick="javascript:fermertraitementproformahospitalisation();" style='font-size:10pt;'>
</td>
</tr>
<?php else: ?>
<td colspan="4">
<input id="btn_fermer" name="btn_fermer" class="form-control btn btn-primary"
type="button" value="<?= _("Fermer") ?>"
onClick="javascript:fermertraitementproformahospitalisation();" style='font-size:10pt;'>
</td>
<?php endif; ?>
</tbody>
</table>
</div>