prestation = new Prestationactes(); $this->prescription = new Prescription(); $this->feuillemaladie = new Feuillemaladie(); $this->garantie = new Garantiesbaremepriseencharge(); $this->acte = new Detailtarifacte(); } public function index() { $codeGarantie = "HOS"; $numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C']; $codePrestataire = $_SESSION['p_codePrestataire_C']; $datePrestation = $_SESSION['datePrestation']; $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; $this->garantie->getsourcebaremegarantienew($idBeneficiaire, $codeGarantie, $datePrestation); $nomForm = $this->requete->getParametreFormulaire("nomForm"); if($nomForm == "facturepartielle"){ $this->prestation->selectionnertoushospit($numeroFeuilleMaladie, $codePrestataire); } $feuillemaladie = $this->feuillemaladie->getfeuillemaladie($numeroFeuilleMaladie); $dateFinDerniereProlongation = $this->feuillemaladie->getDateFinDerniereProlongation(); $tMGarantie = $_SESSION['p_bareme']['bareme_ticketModerateur'];//$this->prescription->ticketModerateurGarantieBeneficiaire($codeGarantie); $tauxCouverture = $this->prescription->tauxCouverture($tMGarantie); $listeProlongations = $this->feuillemaladie->getListeProlongations($numeroFeuilleMaladie); $hospit_total = $this->prestation->gethospitalisation_total($numeroFeuilleMaladie); $prestations = $this->prestation->getactesmedicauxhospitalisationimpression($numeroFeuilleMaladie, $codePrestataire); $prestations_total = $this->prestation->getactesmedicauxhospitalisation_total($numeroFeuilleMaladie, $codePrestataire); $actVisible = $_SESSION['p_actVisible']; $dateDebutHospit = $feuillemaladie['dateDebutHospit']; $dureeHospit = $feuillemaladie['dureeHospit']; $dureeCorrigeeHospit = $feuillemaladie['dureeCorrigeeHospit']; $dateFinHospit = $feuillemaladie['dateFinHospit']; $prolongationHospit = $feuillemaladie['prolongationHospit']; $dateDebutPrologation = $feuillemaladie['dateDebutPrologation']; $dureeProlongation = $feuillemaladie['dureeProlongation']; $dureeCorrigeeProlongation = $feuillemaladie['dureeCorrigeeProlongation']; $dateFinProlongation = $feuillemaladie['dateFinProlongation']; $numeroChambreProlongation = $feuillemaladie['numeroChambreProlongation']; $motifHospitalisation = $feuillemaladie['motifHospitalisation']; $instructionHospit = $feuillemaladie['instructionHospit']; $idProlongationFeuille = $feuillemaladie['idProlongation']; $noChambre = $feuillemaladie['numeroChambre']; $optionHospitalisation = $feuillemaladie['optionHospitalisation']; $codeActeHospitalisation = ($optionHospitalisation=="option-1") ? "HHM" : "HHC"; if(isset($dateFinDerniereProlongation) || !empty($dateFinDerniereProlongation)){ $dateFinHospit = $dateFinDerniereProlongation; } //var_dump($idProlongationFeuille); if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US") { $subtypeHospit = ($optionHospitalisation=="option-1") ? "Medical" : "Surgical"; } else { $subtypeHospit = ($optionHospitalisation=="option-1") ? "Médicale" : "Chirurgicale"; } $pdf = new FPDF_Protection(); $pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES'); $userPassword = ''; $ownerPassword = null; $pdf->SetProtection(['print'], $userPassword, $ownerPassword); $pdf->AliasNbPages(); $pdf->AddPage(); $ht=8; $hl=5; $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['p_lienLogo'],94,3,18); $pdf->Ln(2); $pdf->SetFont('Arial','', 7); $pdf->Cell(0,$ht,convertirc(_('Edité le')." ".heureCouranteLang($_SESSION['p_lang'])),0,1,'R',false); $pdf->SetFont('Arial','B', 18); $pdf->Cell(0,$ht,convertirc(_("FACTURE")." No: FAC/".$feuillemaladie['numeroFeuilleMaladie']."/".$codeActeHospitalisation."/".$feuillemaladie['numeroBonHospitalisation']),'TLBR',1,'C',false); $pdf->Ln(5); $pdf->SetFont('Arial','', 10); $pdf->Cell(30,$ht,convertirc(_('Souscripteur')),0,0,'L',false); $pdf->Cell(45,$ht,convertirc(" : ".substr($_SESSION['p_nomClient_C'],0,34)),0,0,'L',false); $pdf->Cell(35); $pdf->Cell(20,$ht,convertirc(_('Bon No')),'TL',0,'L',false); $pdf->Cell(60,$ht,convertirc(" : ".$feuillemaladie['numeroBonHospitalisation']),'TR',1,'L',false); $pdf->Cell(30,$ht,convertirc(_('Adhérent')),0,0,'L',false); $pdf->Cell(45,$ht,convertirc(" : ".$_SESSION['p_numeroAdherent_C']." / ".substr($_SESSION['p_adherent_C'],0,23)),0,0,'L',false); $pdf->Cell(35); $pdf->Cell(20,$ht,convertirc(_('Type hospit.')),'L',0,'L',false); $pdf->Cell(60,$ht,convertirc(" : ".$subtypeHospit),'R',1,'L',false); //substr($libelleActe,0,30) $pdf->SetFont('Arial','BU', 10); $pdf->Cell(30,$ht,convertirc(_('Patient')),0,0,'L',false); $pdf->Cell(45,$ht,convertirc(" : ".$_SESSION['p_numeroBeneficiaire_C']." / ".substr($_SESSION['p_beneficiaire_C'],0,20)),0,0,'L',false); $pdf->SetFont('Arial','', 10); $pdf->Cell(35); $pdf->Cell(20,$ht,convertirc(_('Entré(e) le')),'L',0,'L',false); $pdf->Cell(60,$ht,convertirc(" : ".datefr($dateDebutHospit)),'R',1,'L',false); $pdf->SetFont('Arial','', 10); $pdf->Cell(30,$ht,convertirc(_('Lien de parenté')),0,0,'L',false); $pdf->Cell(35,$ht,convertirc(" : ".$_SESSION['p_lienparente_C']),0,0,'L',false); $pdf->SetFont('Arial','', 10); $pdf->Cell(10,$ht,convertirc(_('Genre')),0,0,'L',false); $pdf->Cell(10,$ht,convertirc(" : ".$_SESSION['p_sexe_C']),0,0,'L',false); $pdf->Cell(25); $pdf->Cell(20,$ht,convertirc(_('Sorti(e) le')),'L',0,'L',false); $pdf->Cell(60,$ht,convertirc(" : ".datefr($dateFinHospit)),'R',1,'L',false); $pdf->Cell(31,$ht,convertirc(_('Né(e) le')),0,0,'L',false); $pdf->Cell(45,$ht,convertirc(": ".dateLang($_SESSION['p_dateNaissance_C'])),0,0,'L',false); $pdf->Cell(34); $pdf->Cell(20,$ht,convertirc(_('Chambre')),'LB',0,'L',false); $pdf->Cell(60,$ht,convertirc(" : ".$noChambre),'BR',1,'L',false); $pdf->SetFont('Arial','BU', 10); $pdf->Cell(30,$ht,convertirc(_('Prise en charge')),0,0,'L',false); $pdf->Cell(5,$ht,convertirc(" : ".$tauxCouverture),0,0,'L',false); $pdf->Ln(10); /////////////////////////////////////////////////////// $pdf->SetFont('Arial','B', 7); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(50,$ht,convertirc(_("Libellé de l'acte")),'TLBR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(15,$ht,convertirc(_("Réclamé")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(15,$ht,convertirc(_("Appliqué")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(10,$ht,convertirc(_("Nb/Qt")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(20,$ht,convertirc(_("Tot Réclamé")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(20,$ht,convertirc(_("Tot Appliqué")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(20,$ht,convertirc(_("TM")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(20,$ht,convertirc(_("A Remb")),'TBLR',0,'C',true); $pdf->SetFillColor(223, 232, 247); $pdf->Cell(20,$ht,convertirc(_("Dépas")),'TBLR',1,'C',true); foreach ($prestations as $prestation){ $idPrestationactes = $prestation['id']; $supprimable = $prestation['supprimable']; $codeTypePrestation = $prestation['codeTypePrestation']; $ententePrealable = $prestation['ententePrealable']; $autorisation = $prestation['autorisation']; $codeTarifActe = $prestation['codeTarifActe']; $libelleConsommable = $prestation['libelleConsommable']; if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US") { $libelleActe = $prestation['libelleActeEng']; } else { $libelleActe = $prestation['libelleActe']; } $codeActe = $prestation['codeActe']; if($codeActe == "CSM"){ $libelleActe = $libelleConsommable; } if($actVisible!="1") { $libelleActe = $codeActe; } $valeurActe = $prestation['valeurActe']; $plafondActe = $prestation['plafondActe']; $valeurActeManuel = $prestation['valeurActeManuel']; if($valeurActeManuel == "0" ){ $valeurActeManuel = $prestation['prixPrestataire']; } $pdf->SetFont('Arial','', 7); $pdf->Cell(50,$hl,convertirc(substr($libelleActe,0,30)),'LBR',0,'L',false); $pdf->Cell(15,$hl,convertirc(format_N($valeurActeManuel)),'BR',0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($valeurActe)),'BR',0,'C',false); $pdf->Cell(10,$hl,convertirc($prestation['quantite']),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prestation['prixManuel'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prestation['fraisReel'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prestation['montantTm'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prestation['montantArembourser'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prestation['depassement'])),'BR',1,'C',false); } if ($prolongationHospit=="1"){ $pdf->SetFont('Arial','B', 9); $pdf->Cell(90,$ht,convertirc(_("Sous-total")),1,0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prestations_total['totalPrixManuel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prestations_total['fraisReel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prestations_total['montantTm'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prestations_total['montantArembourser'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prestations_total['depassement'])),'BR',1,'C',false); $i = 0; foreach ($listeProlongations as $v){ $idProlongation =$v['id']; $prolongations = $this->prestation->getactesmedicauxhospitalisationprolongationimpression($idProlongation); $prolongations_total = $this->prestation->getactesmedicauxhospitalisationprolongation_total($idProlongation); if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US") { $typeHospit = $v['typeHospitEng']; } else { $typeHospit = $v['typeHospit']; } $i++; $pdf->SetFont('Arial','U', 10); //$pdf->SetFillColor(200, 238, 200); $pdf->Cell(30,$ht,convertirc(_('Prorogation : '.$i)),'TLB',0,'L',false); $pdf->Cell(70,$ht,convertirc(substr($typeHospit,23,50)),'TB',0,'C',false); $pdf->Cell(30,$ht,convertirc(" du : ".datefr($v['debut'])),'TB',0,'L',false); $pdf->Cell(30,$ht,convertirc(" au : ".datefr($v['fin'])),'TB',0,'L',false); $pdf->Cell(30,$ht,convertirc(" Chambre : ".$v['numeroChambre']),'TBR',1,'L',false); foreach ($prolongations as $prolongation){ $libelleConsommablePro = $prolongation['libelleConsommable']; if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US") { $libelleActePro = substr($prolongation['libelleActeEng'],0,57); } else { $libelleActePro = substr($prolongation['libelleActe'],0,57); } $codeActePro = $prolongation['codeActe']; if($codeActePro == "CSM"){ $libelleActePro = substr($libelleConsommablePro,0,57); } if($actVisible!="1") { $libelleActePro = $codeActePro; } $valeurActePro = $prolongation['valeurActe']; $valeurActeManuelPro = $prolongation['valeurActeManuel']; if($valeurActeManuel == "0" ){ $valeurActeManuelPro = $prolongation['prixPrestataire']; } $pdf->SetFont('Arial','', 7); $pdf->Cell(50,$hl,convertirc(substr($libelleActePro,0,30)),'LBR',0,'L',false); $pdf->Cell(15,$hl,convertirc(format_N($valeurActeManuelPro)),'BR',0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($valeurActePro)),'BR',0,'C',false); $pdf->Cell(10,$hl,convertirc($prolongation['quantite']),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prolongation['prixManuel'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prolongation['fraisReel'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prolongation['montantTm'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prolongation['montantArembourser'])),'BR',0,'C',false); $pdf->Cell(20,$hl,convertirc(format_N($prolongation['depassement'])),'BR',1,'C',false); } $pdf->SetFont('Arial','B', 9); $pdf->Cell(90,$ht,convertirc(_("Sous-total")),1,0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prolongations_total['totalPrixManuel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prolongations_total['fraisReel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prolongations_total['montantTm'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prolongations_total['montantArembourser'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($prolongations_total['depassement'])),'BR',1,'C',false); } } $pdf->SetFont('Arial','B', 10); $pdf->Cell(90,$ht,convertirc(_("Total")),1,0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($hospit_total['totalPrixManuel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($hospit_total['fraisReel'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($hospit_total['montantTm'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($hospit_total['montantArembourser'])),'BR',0,'C',false); $pdf->Cell(20,$ht,convertirc(format_N($hospit_total['depassement'])),'BR',1,'C',false); $pdf->Ln(5); if($pdf->GetY()=="262"){ $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->Image($_SESSION['p_lienLogo'],94,3,18); $pdf->Ln(2); $pdf->SetFont('Arial','', 7); $pdf->Cell(0,$ht,convertirc(' Edité le '.heureCouranteLang($_SESSION['p_lang'])),0,1,'R',false); $pdf->Ln(10); } $pdf->SetFont('Arial','B', 10); //$pdf->Cell(30); $pdf->Cell(95,$ht,convertirc(""),0,0,'L',false); $pdf->Cell(50,$ht,convertirc(_("Part Assurance")),1,0,'L',false); $pdf->Cell(45,$ht,convertirc(format_N($hospit_total['montantArembourser'])),1,1,'R',false); //$pdf->Cell(30); $pdf->Cell(95,$ht,convertirc(""),0,0,'L',false); $pdf->Cell(50,$ht,convertirc(_("Part Assuré")),1,0,'L',false); $pdf->Cell(45,$ht,convertirc(format_N($hospit_total['montantTm']+$hospit_total['depassement'])),1,1,'R',false); //$pdf->Cell(30); $pdf->Cell(95,$ht,convertirc(""),0,0,'L',false); $pdf->Cell(50,$ht,convertirc(_("Net à payer")),1,0,'L',false); $pdf->Cell(45,$ht,convertirc(format_N($hospit_total['totalPrixManuel'])),1,1,'R',false); ///////////////////////////////////////////////////////////////// $aPayer = $hospit_total['totalPrixManuel']; $pdf->Ln(5); $pdf->SetFont('Arial','B', 10); $pdf->Cell(0,6,convertirc(_('Arrêté la présente facture à la somme de').' : '),0,1,'L',false); $pdf->Ln(3); $pdf->SetFont('Arial','I',11); $pdf->Cell(0,15, convetirEnLettre($aPayer, $_SESSION['p_lang'])." ".$_SESSION['p_devise_C'],'TLBR',1,'C',false); $pdf->Ln(20); $pdf->SetFont('','BU'); $pdf->Cell(0,6,convertirc($_SESSION['p_prestataire_C']),0,0,'R',false); $fichier="Temp/TMP_facture_hospitalisation"."_".uniqid().".pdf"; $pdf->Output($fichier,"F"); $t_html ='