2022-02-22 10:47:54 +01:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Garradin\Plugin\RecusFiscaux;
|
|
|
|
|
|
|
|
|
|
// génération du formulaire
|
|
|
|
|
|
|
|
|
|
class RecusHTML
|
|
|
|
|
{
|
|
|
|
|
private $nomAsso;
|
|
|
|
|
private $adresseAsso;
|
|
|
|
|
private $objetAsso;
|
2022-02-25 15:51:48 +01:00
|
|
|
|
private $nomResponsable;
|
|
|
|
|
private $fonctionResponsable;
|
2022-03-17 15:55:54 +01:00
|
|
|
|
private $villeAsso;
|
2022-02-25 15:51:48 +01:00
|
|
|
|
private $articlesCGI;
|
2022-02-22 10:47:54 +01:00
|
|
|
|
private $signature;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* initialize global data
|
|
|
|
|
*/
|
|
|
|
|
function __construct($nomAsso,
|
|
|
|
|
$adresseAsso,
|
|
|
|
|
$objetAsso,
|
2022-02-25 15:51:48 +01:00
|
|
|
|
$nomResponsable,
|
|
|
|
|
$fonctionResponsable,
|
2022-03-17 16:00:35 +01:00
|
|
|
|
$villeAsso,
|
2022-02-25 15:51:48 +01:00
|
|
|
|
$articlesCGI,
|
2022-02-22 10:47:54 +01:00
|
|
|
|
$signature)
|
|
|
|
|
{
|
|
|
|
|
$this->nomAsso = $nomAsso;
|
|
|
|
|
$this->adresseAsso = $adresseAsso;
|
|
|
|
|
$this->objetAsso = $objetAsso;
|
2022-02-25 15:51:48 +01:00
|
|
|
|
$this->nomResponsable = $nomResponsable;
|
|
|
|
|
$this->fonctionResponsable = $fonctionResponsable;
|
2022-03-17 16:00:35 +01:00
|
|
|
|
$this->villeAsso = $villeAsso;
|
2022-02-22 10:47:54 +01:00
|
|
|
|
$this->signature = $signature;
|
2022-02-25 15:51:48 +01:00
|
|
|
|
$this->articlesCGI = $articlesCGI;
|
2022-02-22 10:47:54 +01:00
|
|
|
|
$this->html = $this->entete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function get()
|
|
|
|
|
{
|
|
|
|
|
return $this->html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// imprimer le reçu
|
|
|
|
|
function imprimer_recu($annee_recu,
|
|
|
|
|
$numero,
|
|
|
|
|
$nom,
|
|
|
|
|
$lesMontants,
|
|
|
|
|
$adresse,
|
|
|
|
|
$code_postal,
|
|
|
|
|
$ville)
|
|
|
|
|
{
|
|
|
|
|
ob_start();
|
|
|
|
|
echo <<<FDD
|
|
|
|
|
<div id="numRecu">
|
|
|
|
|
<p class="important">Reçu numéro {$annee_recu}/{$numero}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-03-23 09:44:41 +01:00
|
|
|
|
|
2022-02-22 10:47:54 +01:00
|
|
|
|
<div class="cartouche" id="beneficiaire">
|
|
|
|
|
<h3 class="rubrique">Bénéficiaire des versements</h3>
|
2022-03-23 09:44:41 +01:00
|
|
|
|
<p class="important">Association « {$this->nomAsso} »<br />
|
|
|
|
|
{$this->adresseAsso}<br />
|
|
|
|
|
<span class="titre">Objet : </span><span class="libelle">{$this->objetAsso}</span></p>
|
2022-02-22 10:47:54 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="cartouche" id="donateur">
|
|
|
|
|
<h3 class="rubrique">Donateur</h3>
|
2022-03-23 09:44:41 +01:00
|
|
|
|
<p>{$nom}<br />
|
|
|
|
|
{$adresse}<br />
|
|
|
|
|
{$code_postal} {$ville}</p>
|
2022-02-22 10:47:54 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="cartouche" id="versements">
|
|
|
|
|
<p>Le bénéficiaire reconnaît avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt :</p>
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
|
|
FDD;
|
|
|
|
|
|
|
|
|
|
foreach ($lesMontants as $taux => $montant)
|
|
|
|
|
{
|
2022-02-25 15:51:48 +01:00
|
|
|
|
$this->imprimer_montant($montant,
|
2022-02-22 10:47:54 +01:00
|
|
|
|
Utils::getLigneReduction($taux));
|
|
|
|
|
}
|
|
|
|
|
echo "</ul>\n";
|
|
|
|
|
$this->imprimer_description("Date des versements :",
|
|
|
|
|
"année {$annee_recu}");
|
|
|
|
|
$this->imprimer_description("Nature du don : ",
|
|
|
|
|
"Numéraire");
|
|
|
|
|
$this->imprimer_description("Mode de versement : ",
|
|
|
|
|
"chèque et/ou virement");
|
2022-02-25 15:51:48 +01:00
|
|
|
|
|
|
|
|
|
// articles du CGI
|
|
|
|
|
$nbArticles = count($this->articlesCGI);
|
|
|
|
|
if ($nbArticles == 1)
|
|
|
|
|
{
|
2022-03-03 12:09:52 +01:00
|
|
|
|
echo "<p>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 ";
|
|
|
|
|
printf("%s du code général des impôts</p>\n", $this->articlesCGI[0]);
|
2022-02-25 15:51:48 +01:00
|
|
|
|
}
|
|
|
|
|
else if ($nbArticles > 1)
|
|
|
|
|
{
|
|
|
|
|
echo "<p>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 aux articles ";
|
|
|
|
|
for ($i = 0; $i < $nbArticles; ++$i) {
|
|
|
|
|
printf("%s", $this->articlesCGI[$i]);
|
|
|
|
|
if ($i < $nbArticles - 2) {
|
|
|
|
|
echo ", ";
|
|
|
|
|
}
|
|
|
|
|
else if ($i == $nbArticles - 2) {
|
|
|
|
|
echo " et ";
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-03 12:09:52 +01:00
|
|
|
|
echo " du code général des impôts</p>\n";
|
2022-02-25 15:51:48 +01:00
|
|
|
|
}
|
2022-02-22 10:47:54 +01:00
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
|
|
|
|
// cartouche final
|
|
|
|
|
$date = date("j/m/Y");
|
|
|
|
|
echo <<<FDD
|
|
|
|
|
<div class="cartouche" id="final">
|
2022-03-23 09:44:41 +01:00
|
|
|
|
<p>{$this->villeAsso} le {$date}<br />
|
|
|
|
|
<img id="signature" src="$this->signature" />
|
|
|
|
|
</p>
|
|
|
|
|
<div>
|
|
|
|
|
<span id="nom">$this->nomResponsable</span><br />
|
|
|
|
|
<span id="fonction">$this->fonctionResponsable</span>
|
|
|
|
|
</div>
|
2022-02-22 10:47:54 +01:00
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
FDD;
|
|
|
|
|
$this->html .= ob_get_clean();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// imprimer un libellé précédé de son titre en gras
|
|
|
|
|
function imprimer_description($titre, $libelle)
|
|
|
|
|
{
|
|
|
|
|
echo <<<FDD
|
|
|
|
|
<p><span class="titre">{$titre}</span><span class="libelle"> {$libelle}</span></p>
|
|
|
|
|
|
|
|
|
|
FDD;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 15:51:48 +01:00
|
|
|
|
// imprimer le montant du versement et un libellé
|
|
|
|
|
function imprimer_montant($montant, $libelle = "")
|
2022-02-22 10:47:54 +01:00
|
|
|
|
{
|
|
|
|
|
$valeur = number_format($montant, 2, ',', '');
|
2022-03-17 16:05:45 +01:00
|
|
|
|
echo "<li>la somme de <b>***{$valeur}*** euros</b>";
|
2022-02-22 10:47:54 +01:00
|
|
|
|
if ($libelle != "") {
|
2022-02-25 15:51:48 +01:00
|
|
|
|
echo " ({$libelle})";
|
2022-02-22 10:47:54 +01:00
|
|
|
|
}
|
|
|
|
|
echo "</li>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-22 11:26:45 +01:00
|
|
|
|
protected function entete()
|
|
|
|
|
{
|
|
|
|
|
ob_start();
|
|
|
|
|
echo <<<FDD
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8" />
|
2022-03-04 13:54:53 +01:00
|
|
|
|
<style>
|
|
|
|
|
@page
|
|
|
|
|
{
|
|
|
|
|
size: A4 portrait;
|
|
|
|
|
margin: 1cm;
|
|
|
|
|
}
|
|
|
|
|
body
|
|
|
|
|
{
|
|
|
|
|
font-family: Serif;
|
|
|
|
|
font-size: 11pt;
|
|
|
|
|
background-color: white;
|
2022-03-23 09:44:41 +01:00
|
|
|
|
width : 19cm;
|
2022-03-04 13:54:53 +01:00
|
|
|
|
}
|
|
|
|
|
#logoCerfa
|
|
|
|
|
{
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
width: 100px;
|
|
|
|
|
background-color: rgb(0, 0, 128);
|
|
|
|
|
border-radius : 50%;
|
|
|
|
|
text-align : center;
|
|
|
|
|
margin : 2mm;
|
|
|
|
|
}
|
|
|
|
|
.centre
|
|
|
|
|
{
|
|
|
|
|
display : inline-block;
|
|
|
|
|
vertical-align : middle;
|
|
|
|
|
line-height: 20px; /* moitié de la hauteur du logo */
|
|
|
|
|
color : white;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size : 14pt;
|
|
|
|
|
}
|
|
|
|
|
#numCerfa
|
|
|
|
|
{
|
|
|
|
|
width: 100px; /* largeur du logo */
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
#titre
|
|
|
|
|
{
|
|
|
|
|
margin : 0 4cm 0 4cm;
|
|
|
|
|
text-align : center;
|
|
|
|
|
font-size : 14pt;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
#articles
|
|
|
|
|
{
|
|
|
|
|
margin : 0 4cm 0 4cm; /* idem titre */
|
|
|
|
|
text-align : center;
|
|
|
|
|
}
|
|
|
|
|
#numRecu
|
|
|
|
|
{
|
|
|
|
|
text-align : right;
|
|
|
|
|
}
|
2022-03-23 09:44:41 +01:00
|
|
|
|
#versements
|
2022-03-04 13:54:53 +01:00
|
|
|
|
{
|
2022-03-23 09:44:41 +01:00
|
|
|
|
border-top: 1px solid rgb(0, 0, 128);
|
|
|
|
|
border-bottom: 1px solid rgb(0, 0, 128);
|
2022-03-04 13:54:53 +01:00
|
|
|
|
}
|
|
|
|
|
.rubrique
|
|
|
|
|
{
|
|
|
|
|
background-color : rgb(200, 200, 250);
|
|
|
|
|
padding : 2mm;
|
|
|
|
|
}
|
|
|
|
|
.titre, .important
|
|
|
|
|
{
|
|
|
|
|
font-weight:bold;
|
|
|
|
|
}
|
2022-03-23 09:44:41 +01:00
|
|
|
|
.libelle
|
|
|
|
|
{
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
}
|
2022-03-04 13:54:53 +01:00
|
|
|
|
#signature
|
|
|
|
|
{
|
|
|
|
|
display: block;
|
|
|
|
|
max-width : 7cm;
|
2022-03-23 09:44:41 +01:00
|
|
|
|
max-height : 4cm;
|
2022-03-04 13:54:53 +01:00
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding-bottom : 2mm;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2022-02-22 11:26:45 +01:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="cartouche" id="entete">
|
|
|
|
|
<div id="logoCerfa">
|
|
|
|
|
<span class="centre">Cerfa</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="numCerfa">
|
|
|
|
|
<span>N° 11580*4</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p id="titre">Reçu au titre des dons à certains organismes d'intérêt général</p>
|
2022-02-25 15:51:48 +01:00
|
|
|
|
<p id="articles">Articles 200, 238 bis et 978 du code général des impôts</p>
|
2022-02-22 11:26:45 +01:00
|
|
|
|
|
|
|
|
|
FDD;
|
|
|
|
|
return ob_get_clean();
|
|
|
|
|
}
|
2022-02-22 10:47:54 +01:00
|
|
|
|
}
|