148 lines
6.1 KiB
PHP
148 lines
6.1 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
require_once 'Modele/Detailprescription.php';
|
|
require_once 'Modele/Prescription_temp.php';
|
|
require_once 'Modele/Detailtarifacte.php';
|
|
require_once 'Modele/Garantiesbaremepriseencharge.php';
|
|
|
|
class ControleurPharmacie extends Controleur {
|
|
private $menuvue;
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $acte;
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue('Pharmacie');
|
|
|
|
$this->prescription = new Prescription_temp();
|
|
$this->detailprescription = new Detailprescription();
|
|
$this->acte = new Detailtarifacte();
|
|
$this->garantie = new Garantiesbaremepriseencharge();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
$datePrestation = $_SESSION['datePrestation'];
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
$codeActe = "PH";
|
|
|
|
$codeGarantie = "PHA";
|
|
|
|
$this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrestation);
|
|
|
|
|
|
|
|
$tMacte = $this->acte->ticketModerateurDefinitif($codeGarantie, $codeActe, $datePrestation);
|
|
|
|
$tmDerogation = $this->acte->getTmDerogation($codeGarantie);
|
|
$tmAffection = $this->acte->getTmAffection();
|
|
|
|
|
|
if($tmAffection == "1000"){
|
|
if($tmDerogation == "1000"){
|
|
$tauxCouverture = (100-$tMacte)."%";
|
|
$tm = $tMacte;
|
|
}else{
|
|
$tauxCouverture = (100-$tmDerogation)."%";
|
|
$tm = $tmDerogation;
|
|
}
|
|
}else{
|
|
$tauxCouverture = (100-$tmAffection)."%";
|
|
$tm = $tmAffection;
|
|
}
|
|
|
|
$_SESSION['p_tm_C'] = $tm;
|
|
|
|
$this->prescription->initpharmacie_cso();
|
|
|
|
$this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrestation);
|
|
|
|
|
|
$dateFinDelaiCarenceActe = $_SESSION['p_bareme']['bareme_finDelaiCarence'];//$this->acte->getDateFinDelaiCarenceActe();
|
|
|
|
|
|
$baremesolde = $this->garantie->getbaremesoldeacte($idBeneficiaire,$codeActe,$codeGarantie,$datePrestation);
|
|
|
|
$soldeConsommation = $baremesolde['soldeConsommation'];
|
|
$soldeNbreTransaction = $baremesolde['soldeNbreTransaction'];
|
|
|
|
|
|
if($soldeConsommation < 0)
|
|
{
|
|
$soldeConsommation = 0;
|
|
}
|
|
|
|
if($soldeNbreTransaction < 0)
|
|
{
|
|
$soldeNbreTransaction = 0;
|
|
}
|
|
|
|
|
|
$gar_codePeriodicite = $_SESSION['p_bareme']['gar_codePeriodiciteBeneficiaire'];
|
|
$gar_periodicite = $this->garantie->getlibelleperiodicite($gar_codePeriodicite);
|
|
$gar_periodiciteEng = $this->garantie->getlibelleperiodicite($gar_codePeriodicite);
|
|
|
|
|
|
$gar_codePeriodicitePlafond = $_SESSION['p_bareme']['gar_codePeriodicitePlafondBeneficiaire'];
|
|
$gar_periodicitePlafond = $this->garantie->getlibelleperiodicite($gar_codePeriodicitePlafond);
|
|
$gar_periodicitePlafondEng = $this->garantie->getlibelleperiodicite($gar_codePeriodicitePlafond);
|
|
|
|
|
|
$act_codePeriodicite = $_SESSION['p_bareme']['act_codePeriodiciteBeneficiaire'];
|
|
$act_periodicite = $this->garantie->getlibelleperiodicite($act_codePeriodicite);
|
|
$act_periodiciteEng = $this->garantie->getlibelleperiodicite($act_codePeriodicite);
|
|
|
|
$act_codePeriodicitePlafond = $_SESSION['p_bareme']['act_codePeriodicitePlafondBeneficiaire'];
|
|
$act_periodicitePlafond = $this->garantie->getlibelleperiodicite($act_codePeriodicitePlafond);
|
|
$act_periodicitePlafondEng = $this->garantie->getlibelleperiodicite($act_codePeriodicitePlafond);
|
|
|
|
$gar_nbreTransaction = $_SESSION['p_bareme']['gar_nbreTransactionBeneficiaire'];
|
|
$gar_forfaitPlafond = $_SESSION['p_bareme']['gar_forfaitPlafondBeneficiaire'];
|
|
|
|
$act_forfaitPlafond = $_SESSION['p_bareme']['act_forfaitPlafondBeneficiaire'];
|
|
$act_nbreTransaction = $_SESSION['p_bareme']['act_nbreTransactionBeneficiaire'];
|
|
|
|
$statut = $this->garantie->getstatutacte($idBeneficiaire,$codeActe,$codeGarantie);
|
|
|
|
$tmDerogation = $this->acte->getTmDerogation($codeGarantie);
|
|
|
|
$dateFinDelaiCarenceActe = $_SESSION['p_bareme']['bareme_finDelaiCarence'];//$this->acte->getDateFinDelaiCarenceActe();
|
|
|
|
$statut = $this->garantie->getstatutacte($idBeneficiaire,$codeActe,$codeGarantie);
|
|
|
|
$prescription = $this->prescription->getprescription();
|
|
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($prescription, true) . ";\n>"); die();
|
|
|
|
$marges = $this->detailprescription->getMarges();
|
|
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailprescription($numeroPrescription);
|
|
|
|
$detailnonlivres = $this->prescription->getdetailnonlivre();
|
|
|
|
$detaillivres = $this->prescription->getdetaillivrecso();
|
|
|
|
$factures = $this->prescription->getfactures_ordonnance($numeroBonOrdonnance);
|
|
$factures_toal = $this->prescription->getfactures_total_ordonnance($numeroBonOrdonnance);
|
|
|
|
$this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
|
|
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'tauxCouverture' => $tauxCouverture,
|
|
'dateFinDelaiCarenceActe' => $dateFinDelaiCarenceActe, 'marges' => $marges, 'statut' => $statut,
|
|
'factures' => $factures, 'factures_toal' => $factures_toal, 'gar_codePeriodicite' => $gar_codePeriodicite,'gar_periodicite' => $gar_periodicite,
|
|
'gar_periodiciteEng' => $gar_periodiciteEng,'gar_codePeriodicitePlafond' => $gar_codePeriodicitePlafond,
|
|
'gar_periodicitePlafond' => $gar_periodicitePlafond,'gar_periodicitePlafondEng' => $gar_periodicitePlafondEng,
|
|
'act_codePeriodicite' => $act_codePeriodicite,'act_periodicite' => $act_periodicite,
|
|
'act_periodiciteEng' => $act_periodiciteEng,'act_codePeriodicitePlafond' => $act_codePeriodicitePlafond,
|
|
'act_periodicitePlafond' => $act_periodicitePlafond,'act_periodicitePlafondEng' => $act_periodicitePlafondEng,
|
|
'gar_nbreTransaction' => $gar_nbreTransaction,'gar_forfaitPlafond' => $gar_forfaitPlafond,
|
|
'act_forfaitPlafond' => $act_forfaitPlafond,'act_nbreTransaction' => $act_nbreTransaction,));
|
|
}
|
|
|
|
|
|
} |