Subversion Repositories Applications.annuaire

Rev

Rev 589 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
296 aurelien 1
<?php
2
// Création de l'objet pdf
3
 
4
class Recu extends AppControleur {
5
 
6
	public function Recu() {
7
 
8
		require_once('bibliotheque/tcpdf/config/lang/fra.php');
9
		require 'bibliotheque/tcpdf/tcpdf.php';
10
		require 'bibliotheque/Words/Words.php';
11
		// Constante nécessaire à fpdf.php
12
		parent::__construct();
13
	}
14
 
15
	public function fabriquerRecuPdf($utilisateur, $cotisation) {
16
 
17
		$num_recu = $cotisation['recu_envoye'];
18
 
19
		$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
20
 
21
		//$pdf->Open();
22
		$pdf->SetTitle('Recu pour don à Tela Botanica');
23
 
24
		$pdf->SetFont('helvetica','',14);
25
 
26
		$pdf->AddPage();
27
 
28
		$pdf->Line(10, 10, 200, 10) ;
29
 
30
		// Contenu du document
31
 
32
		$pdf->SetFont('helvetica', '', 8) ;
33
 
34
		$pdf->Cell(150, 10, "", 0, 0) ;
35
 
36
		$pdf->MultiCell(40, 10, "Numéro d'ordre : $num_recu", 1, "C") ;
37
 
38
		$pdf->SetY($pdf->GetY() - 10) ;
39
 
40
		$pdf->SetFont('helvetica','B',14);
41
		$pdf->Cell(0,10,'Reçu dons aux oeuvres', 0, 1, "C");
42
		$pdf->SetFont('helvetica', '', 10) ;
43
		$pdf->Cell(0, 0, 'Articles 200, 238 bis et 885-0 du code général des impôts (CGI)', 0, 1, "C") ;
44
 
329 aurelien 45
		$pdf->Cell(0, 10, 'REÇU A CONSERVER ET A JOINDRE A VOTRE DECLARATION DE REVENUS '.$cotisation['annee_cotisation'], 0, 1, "L") ;
296 aurelien 46
 
47
		// On met le logo de Tela
427 aurelien 48
		$pdf->Image(dirname(__FILE__)."/logo_tela.png", 12, 40, "29", "", "PNG", "http://www.tela-botanica.org/") ;
296 aurelien 49
 
50
		// On écrit Les titres du cadre
51
		$pdf->SetFontSize(12) ;
52
		$pdf->Cell(100, 10, 'Bénéficiaire du don', 0, 0, "C") ;
53
		$pdf->Cell(100, 10, 'Donateur', 0, 1, "C") ;
54
 
55
		$pdf->Cell(38, 5, '', 0, 0) ;
56
		$pdf->Cell(62, 5, 'Association Tela Botanica', 0, 0, "L") ;
57
 
58
		$pdf->SetFont('helvetica', 'B', 10) ;
59
 
60
		$pdf->Cell(100, 5, $utilisateur['nom']['amv_valeur'].' '.$utilisateur['prenom']['amv_valeur'], 0, 1, "L") ;
61
 
62
		$pdf->SetFont('helvetica', '', 10) ;
596 mathias 63
 
296 aurelien 64
		$pdf->Cell(38, 5, '', 0, 0) ;
596 mathias 65
		$pdf->Cell(62, 5, '4, rue de Belfort', 0, 0, "L") ;
296 aurelien 66
		$pdf->Cell(100, 5, $utilisateur['adresse']['amv_valeur'], 0, 1, "L") ;
67
 
68
		$pdf->Cell(38, 5, '', 0, 0) ;
69
		$pdf->Cell(62, 5, '34090 Montpellier', 0, 0, "L") ;
70
		$pdf->Cell(100, 8, $utilisateur['adresse_comp']['amv_valeur'], 0, 1, "L") ;
71
 
72
 
73
		$pdf->Cell(100, 5, 'Objet :', 0,1, "L") ;
74
		$pdf->SetFontSize(8) ;
75
		$pdf->MultiCell(100, 4, 'Contribuer au rapprochement de tous les botanistes de langue française. Favoriser l\'échange d\'information'.
76
		                        ' et animer des projets botaniques grâce aux nouvelles technologies de la communication.', 0, 1, "") ;
77
		$pdf->MultiCell(100,4, 'Organisme d\'intérêt général à caractère scientifique concourant à la diffusion de la langue et des connaissances scientifiques françaises.', 0,1, "") ;
78
 
79
		$pdf->SetFontSize(10) ;
80
 
81
		$pdf->Text(111, 58 + 8, $utilisateur['code_postal']['amv_valeur'].' '.$utilisateur['ville']['amv_valeur']) ;
82
		$pdf->SetFontSize(8) ;
83
 
84
		// On remonte le curseur de 52
85
		$pdf->SetY($pdf->GetY() - 30) ;
86
 
87
		// Le cadre central
88
		$pdf->Cell(100, 60, '', 1) ;
89
		$pdf->Cell(90, 60, '', 1) ;
90
		$pdf->Ln() ;
91
 
92
		$pdf->SetFontSize(10) ;
93
		$pdf->Cell(0,10, 'L\'Association reconnaît avoir reçu en numéraire, à titre de don, la somme de :', 0, 1, "L") ;
94
 
95
		$wordsConverter = new Numbers_Words() ;
96
		$montantLettres = $wordsConverter->toWords($cotisation['montant_cotisation'],'fr') ;
97
 
98
		$pdf->SetFont('helvetica', 'B', 11) ;
99
		$pdf->Cell(0,10,  "*** ".$cotisation['montant_cotisation']." euros ***", 0, 1, "C") ;
100
		$pdf->Ln() ;
101
		$pdf->Cell(0,10,  "*** (".$montantLettres." euros) ***", 0, 1, "C") ;
102
 
103
		$pdf->SetFont('helvetica', '', 10) ;
104
 
105
		$pdf->Ln() ;
106
		$pdf->Cell(100,10, "Date du paiement : ".$cotisation['date_cotisation'], 0, 0, "L") ;
329 aurelien 107
		$pdf->Cell(100, 10, 'Montpellier, le '.$cotisation['date_envoi_recu'], 0, 1, "L") ;
296 aurelien 108
 
531 mathias 109
		// La signature de Daniel Mathieu
523 aurelien 110
		$pdf->Image(dirname(__FILE__).'/signature_Daniel.png', 110, $pdf->GetY(),28.22, "") ;
296 aurelien 111
 
112
		$pdf->Ln() ;
113
		$pdf->Cell(0, 10, "Mode de versement : ".$cotisation['mode_cotisation'], 0, 1, "L") ;
114
 
115
		$pdf->Cell(100, 10, '', 0, 0) ;
523 aurelien 116
		$pdf->Cell (100, 10, 'Daniel Mathieu, Président', 0, 1, "L") ;
296 aurelien 117
		$pdf->Ln(5) ;
118
 
119
		$pdf->SetFontSize(10) ;
120
		$pdf->Cell(0, 7, '66 % de votre don à Tela Botanica est déductible de vos impôts dans la limite de 20 % de votre revenu imposable.', 1, 1, "C") ;
121
 
122
		return $pdf;
123
	}
124
 
125
	public function afficherRecuPdf($utilisateur, $cotisation) {
126
 
127
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
128
		$pdf->Output();
129
		exit;
130
	}
131
 
132
	public function renvoyerRecuPdf($utilisateur, $cotisation) {
133
 
134
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
135
 
136
		$contenu_pdf = $pdf->Output('','S');
137
 
138
		return $contenu_pdf;
139
	}
140
}
141
?>