AddFont($family, '', $family.$style.".ttf", true); // bold $this->AddFont($family, 'B', $family.$style."-Bold.ttf", true); $this->nomAsso = $nomAsso; $this->adresseAsso = $adresseAsso; $this->logoCerfa = $logo; $this->signature = $signature; } // Header function Header() { parent::Header(); // Logo $this->Image($this->logoCerfa, 10, 6, 30); // document title $this->SetTextColor(0, 0, 0); $this->SetFont('DejaVu','B',12); $titre = "Reçu au titre des dons à certains organismes d'intérêt général"; $this->SetXY(50, 10); // Titre $this->MultiCell(100, 6, $titre, 0, 'C'); // numéro de Cerfa $cerfa = "N° 11580*3"; $this->SetFont('DejaVu', 'B', 10); $this->SetXY(10, 25); $this->Cell(100, 0, $cerfa); // Articles $this->SetFont('DejaVu', '', 9); $this->SetXY(50, 25); $this->Cell(100, 0, 'Article 200, 238 bis et 885-0 V bis A du code général des impôts'); } // imprimer les informations du bénéficiaire function imprimer_beneficiaire($nom, $adresse) { $this->titre_rubrique("Bénéficiaire des versements"); $this->SetFont('DejaVu', 'B', 11); $this->Cell(0, 6, 'Association « ' . $nom . ' »', 'LR', 1); $this->Cell(0, 6, str_replace(array("\r\n", "\n", "\r"), " ", $adresse), 'LR', 1); $this->imprimer_description("Objet : ", "célébrer le culte protestant évangélique et pourvoir aux frais et besoins de ce culte."); $this->Cell(0, 6, "", 'LRB', 1); } // imprimer un libellé précédé de son titre en gras function imprimer_description($titre, $libelle) { $this->SetFont('DejaVu', 'B', 11); $this->Cell($this->GetStringWidth($titre), 6, $titre, 'L', 0); $this->SetFont('DejaVu', '', 11); $this->Cell(0, 6, $libelle, 'R', 1); } // imprimer le montant de la réduction et un libellé function imprimer_montant($texte, $montant, $libelle = "") { $this->SetFont('DejaVu'); $this->Cell($this->GetStringWidth($texte), 6, $texte, 'L', 0); $this->SetFont('DejaVu','B'); $valeur = number_format($montant, 2, "," , "") . " euros"; $this->Cell($this->GetStringWidth($valeur), 6, $valeur, '', 0); $this->SetFont('DejaVu'); if ($libelle != "") { $this->Cell(0, 6, " : " . $libelle, 'R', 1); } else { $this->Cell(0, 6, "", 'R', 1); } } function titre_rubrique($texte) { $this->SetFont('DejaVu','B',12); $largeur_texte = $this->GetStringWidth($texte); $this->setX(10); $this->SetFillColor(0, 255, 255); $this->Cell(0, 6, $texte, 'LTR', 1, 'C', true); $this->Cell(0, 6, "", 'LR', 1); } // imprimer le reçu function imprimer_recu($annee_recu, $numero, $nom, $lesMontants, $adresse, $code_postal, $ville) { $this->AddPage(); // Numéro de reçu $this->SetFont('DejaVu', 'B', 11); $this->MultiCell(0, 20, 'Reçu numéro ' . $annee_recu . '/' . $numero); // bénéficiaire $this->imprimer_beneficiaire($this->nomAsso, $this->adresseAsso); // donateur $this->Ln(10); $this->titre_rubrique("Donateur"); $this->SetFont('DejaVu', 'B', 11); $this->Cell(0, 6, $nom, 'LR', 1); $this->Cell(0, 6, $adresse, 'LR', 1); $this->Cell(0, 6, $code_postal . " " . $ville, 'LR', 1); $this->Cell(0, 6, "", 'LRB', 1); // Montant et autres informations $this->Ln(10); $this->SetFont('DejaVu', '', 11); $this->Cell(0, 6, "Le bénéficiaire reconnaît avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt :", 'LTR', 1); foreach ($lesMontants as $taux => $montant) { $this->imprimer_montant(" - la somme de ", $montant, Utils::getLigneReduction($taux)); } $this->Cell(0, 3, "", 'LR', 1); $this->imprimer_description('Date des versements : ', 'année ' . $annee_recu); $this->Cell(0, 3, "", 'LR', 1); $this->MultiCell(0, 6, "Le bénéficiaire certifie sur l’honneur que les dons et versements qu’il reçoit ouvrent droit à la réduction d'impôt prévue à l’article 200 du CGI", 'LR'); $this->Cell(0, 3, "", 'LR', 1); $this->imprimer_description("Forme du don : ", "Autre"); $this->Cell(0, 3, "", 'LR', 1); $this->imprimer_description("Nature du don : ", "Numéraire"); $this->Cell(0, 3, "", 'LR', 1); $this->imprimer_description("Mode de versement : ", "chèque et/ou virement"); $this->Cell(0, 0, "", 'LRB', 1); // cartouche final $this->Ln(10); $this->Cell(0, 6, "", 'LRT', 1); $this->Cell(0, 6, "Rennes le " . date("j/m/Y"), 'LR', 1, 'R'); $this->Cell(0, 36, "", 'LR', 1); $this->Cell(0, 0, "", 'LBR', 1); $this->SetXY(100, 220); $this->Image($this->signature, null, null, 50); } } // class RecusPDF