273 lines
9.9 KiB
PHP
273 lines
9.9 KiB
PHP
<?php
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Facture.php';
|
|
|
|
|
|
class ControleurAjaximprimerfacturepartielle extends Controleurrequete
|
|
{
|
|
private $prestationacte;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->prestationacte = new Prestationactes();
|
|
$this->facture = new Facture();
|
|
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$idPrestationactes = $this->requete->getParametre("idPrestationactes");
|
|
$codeTypePrestation = $this->requete->getParametreFormulaire("codeTypePrestation");
|
|
|
|
$factures = $this->prestationacte->getFacturepartielle($idPrestationactes);
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($factures , true) . ";\n>");
|
|
//die();
|
|
$feuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
|
|
$codeActe = $factures['codeActe'];
|
|
$codeGarantie = $factures['codeGarantie'];
|
|
$datePrestation = $factures['datePrestation'];
|
|
|
|
$tm = intval($this->prestationacte->getTmActe($codeActe, $datePrestation, $codeGarantie));
|
|
|
|
$motifsententes = $this->facture->getmotifententeprealabletypeprestation($feuilleMaladie, $codeTypePrestation, $codeActe);
|
|
|
|
$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;
|
|
|
|
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
|
|
{
|
|
$libelleActe = $factures['libelleActeEng'];
|
|
|
|
}else{
|
|
|
|
$libelleActe = $factures['libelleActe'];
|
|
|
|
}
|
|
|
|
if($factures['codeTypePrestation']=="CSM"){
|
|
$libelleActe = $factures['libelleConsommable'];
|
|
$codeGarantie= "AUX";
|
|
}
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
|
|
// Logo
|
|
$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);
|
|
// Décalage à droite
|
|
$pdf->Cell(30);
|
|
|
|
$pdf->SetFont('Arial','B', 18);
|
|
$pdf->Cell(140,$ht,convertirc("RECU No : ".$factures['numeroFacture']),'TLBR',1,'C',false);
|
|
|
|
$pdf->Ln(10);
|
|
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(55,$ht,convertirc(_('Garant / Souscripteur')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(55,$ht,convertirc(": ".$_SESSION['p_nomClient_C']),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(55,$ht,convertirc(_('Adhérent')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(55,$ht,convertirc(": ".$_SESSION['p_numeroAdherent_C']." / ".$_SESSION['p_adherent_C']),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(55,$ht,convertirc(_('Patient')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(55,$ht,convertirc(": ".$_SESSION['p_numeroBeneficiaire_C']." / ".$_SESSION['p_beneficiaire_C']),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(55,$ht,convertirc(_('Genre')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(25,$ht,convertirc(": ".$_SESSION['p_sexe_C']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(30,$ht,convertirc(_('Né(e) le')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(15,$ht,convertirc(": ".dateLang($_SESSION['p_dateNaissance_C'])),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(55,$ht,convertirc(_('Numéro de Bon')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(25,$ht,convertirc(": ".$_SESSION['p_numeroBonConsultation_C']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(30,$ht,convertirc(_('Prise en charge')),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(55,$ht,convertirc(": ".taux_couverture($tm)),0,1,'L',false);
|
|
|
|
|
|
|
|
$pdf->Ln(2);
|
|
|
|
///////////////////////////////////////////////////////
|
|
$pdf->SetFont('Arial','B', 10);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(15,$ht,convertirc(_("Date")),'TLR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(17,$ht,convertirc(_('Garantie')),'LTR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(64,$ht,convertirc(_("Acte")),'LTR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$ht,convertirc(_("Plafond")),'LTR',0,'C',true);
|
|
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$ht,convertirc(_("P U")),'LTR',0,'C',true);
|
|
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(10,$ht,convertirc(_("Nbre")),'LTR',0,'C',true);
|
|
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$ht,convertirc(_("Total")),'LTR',0,'C',true);
|
|
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(30,$ht,convertirc(_("Net à Payer")),1,1,'C',true);
|
|
|
|
$pdf->Cell(15,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(17,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(64,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$hl,convertirc(""),'LBR',0,'C',true);
|
|
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(10,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(18,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(15,$hl,convertirc(_("TM")),1,0,'C',true);
|
|
$pdf->Cell(15,$hl,convertirc(_("Dépas")),1,1,'C',true);
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////
|
|
|
|
if ($factures['depassement'] > "0")
|
|
{
|
|
$aPayer = $factures['montantTm'] + $factures['depassement'];
|
|
}else{
|
|
$aPayer = $factures['montantTm'];
|
|
}
|
|
|
|
if ($factures['plafondActe'] > "0" && $factures['plafondActe'] !="9999999999"){
|
|
$plafondActe = $factures['plafondActe'];
|
|
}else{
|
|
$plafondActe = "0";
|
|
}
|
|
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($factures , true) . ";\n>");
|
|
$pdf->SetFont('Arial','', 8);
|
|
$pdf->Cell(15,50,convertirc(dateLang($factures['datePrestation'],$_SESSION['p_lang'])),'LBR',0,'C',false);
|
|
$pdf->Cell(17,50,convertirc($factures['codeGarantie']),'BR',0,'C',false);
|
|
|
|
$pdf->Cell(64,50,convertirc(substr($libelleActe,0,50)),'BR',0,'L',false);
|
|
$pdf->Cell(18,50,convertirc(format_N($plafondActe)),'BR',0,'C',false);
|
|
|
|
$pdf->Cell(18,50,convertirc(format_N($factures['valeurActe'])),'BR',0,'C',false);
|
|
|
|
$pdf->Cell(10,50,convertirc($factures['quantite']),'BR',0,'C',false);
|
|
|
|
$pdf->Cell(18,50,convertirc(format_N($factures['fraisReel'])),'BR',0,'C',false);
|
|
$pdf->Cell(15,50,convertirc(format_N($factures['montantTm'])),1,0,'C',false);
|
|
$pdf->Cell(15,50,convertirc(format_N($factures['depassement'])),1,1,'C',false);
|
|
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(142,10,convertirc(_("Total")),1,0,'C',false);
|
|
$pdf->Cell(18,10,convertirc(format_N($factures['fraisReel'])),1,0,'C',false);
|
|
$pdf->Cell(30,10,convertirc(format_N($aPayer)),1,1,'C',false);
|
|
|
|
if(count($motifsententes) > "0"){
|
|
$ht= 6;
|
|
$pdf->Ln(5);
|
|
$pdf->SetFillColor(223, 232, 247);
|
|
$pdf->Cell(190,$ht,convertirc(_("Instructions particulières")),1,1,'C',true);
|
|
$pdf->Cell(70,$ht,convertirc(_("Acte")),1,0,'C',true);
|
|
$pdf->Cell(60,$ht,convertirc(_("Instructions Assureur")),1,0,'C',true);
|
|
$pdf->Cell(60,$ht,convertirc(_("Réponse Assureur")),1,1,'C',true);
|
|
$pdf->SetFont('Arial','', 7);
|
|
|
|
foreach($motifsententes as $motifsentente){
|
|
$pdf->Cell(70,$ht,convertirc(substr($motifsentente['libelleActe'],0,40)),1,0,'L',false);
|
|
$pdf->Cell(60,$ht,convertirc(substr($motifsentente['motifReel'],0,40)),1,0,'L',false);
|
|
$pdf->Cell(60,$ht,convertirc(substr($motifsentente['reponsentEnteprealable'],0,60)),1,1,'C',false);
|
|
}
|
|
}
|
|
|
|
$pdf->Ln(5);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(42,6,convertirc(_('Part Assuré').' : '),0,0,'L',false);
|
|
$pdf->SetFont('Arial','BU', 12);
|
|
$pdf->Cell(25,6,convertirc(format_N($aPayer)." ".$_SESSION['p_devise_C']),0,1,'L',false);
|
|
|
|
$pdf->Ln(2);
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(42,6,convertirc(_('Net à Rembourser').' : '),0,0,'L',false);
|
|
$pdf->SetFont('Arial','BU', 12);
|
|
$pdf->Cell(25,6,convertirc(format_N($factures['fraisReel']-$aPayer)." ".$_SESSION['p_devise_C']),0,1,'L',false);
|
|
|
|
$pdf->Ln(8);
|
|
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(0,6,convertirc(_('Montant de la prise en charge').' : '),0,1,'C',false);
|
|
|
|
$pdf->Ln(3);
|
|
$pdf->SetFont('Arial','I',12);
|
|
|
|
|
|
$pdf->Cell(0,15, convetirEnLettre($factures['fraisReel']-$aPayer, $_SESSION['p_lang'])." ".$_SESSION['p_devise_C'],'TLBR',1,'C',false);
|
|
|
|
$ica ='';
|
|
$ica ='CE0353';
|
|
if($ica!=$_SESSION['p_codePrestataire_C']){
|
|
$pdf->Ln(20);
|
|
$pdf->SetFont('','BU');
|
|
$pdf->Cell(0,6,convertirc($_SESSION['p_prestataire_C']),0,0,'R',false);
|
|
|
|
} else{
|
|
$pdf->Ln(30);
|
|
$pdf->SetFont('', 'BU', 10);
|
|
$pdf->Cell(42, 6, convertirc(_('Médecin conseil')), 0, 0, 'L', false);
|
|
$pdf->Cell(100, 6, convertirc(_('Signature et Téléphone')), 0, 0, 'C', false);
|
|
|
|
$pdf->Cell(60, 6, convertirc('Signature et cachet'), 0, 0, 'C', false);
|
|
$pdf->Ln(7);
|
|
$pdf->Cell(40, 6, convertirc(''), 0, 0, 'L', false);
|
|
$pdf->Cell(100, 6, convertirc(_('Du Patient')), 0, 0, 'C', false);
|
|
$pdf->Ln(2);
|
|
$pdf->Cell(0,6,convertirc($_SESSION['p_prestataire_C']),0,0,'R',false);
|
|
}
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($_SESSION , true) . ";\n>");
|
|
|
|
$fichier="Temp/TMP_facture_partielle"."_".uniqid().".pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_export_a" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
|
|
exit();
|
|
}
|
|
} |