18 |
* |
* |
19 |
* $Id$ |
* $Id$ |
20 |
* $Source$ |
* $Source$ |
|
* |
|
21 |
*/ |
*/ |
22 |
|
|
23 |
/** |
/** |
48 |
$this->db = $db; |
$this->db = $db; |
49 |
$this->name = "crabe"; |
$this->name = "crabe"; |
50 |
$this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)"; |
$this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)"; |
51 |
|
$this->format="A4"; |
52 |
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO |
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO |
53 |
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
54 |
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER |
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER |
148 |
$nexY = $pdf->GetY(); |
$nexY = $pdf->GetY(); |
149 |
$nblignes = sizeof($fac->lignes); |
$nblignes = sizeof($fac->lignes); |
150 |
|
|
151 |
|
$posxdesc=11; |
152 |
|
$posxtva=121; |
153 |
|
$posxup=133; |
154 |
|
$posxqty=151; |
155 |
|
$posxdiscount=163; |
156 |
|
$postotttc=173; |
157 |
|
|
158 |
// Boucle sur les lignes |
// Boucle sur les lignes |
159 |
for ($i = 0 ; $i < $nblignes ; $i++) |
for ($i = 0 ; $i < $nblignes ; $i++) |
160 |
{ |
{ |
167 |
if ($libelleproduitservice) $libelleproduitservice.="\n"; |
if ($libelleproduitservice) $libelleproduitservice.="\n"; |
168 |
$libelleproduitservice.=$fac->lignes[$i]->desc; |
$libelleproduitservice.=$fac->lignes[$i]->desc; |
169 |
} |
} |
170 |
$pdf->SetXY (11, $curY ); |
$pdf->SetXY ($posxdesc, $curY ); |
171 |
|
|
172 |
if ($conf->global->FACTURE_CODEPRODUITSERVICE && $fac->lignes[$i]->produit_id) |
if ($conf->global->FACTURE_CODEPRODUITSERVICE && $fac->lignes[$i]->produit_id) |
173 |
{ |
{ |
188 |
$nexY = $pdf->GetY(); |
$nexY = $pdf->GetY(); |
189 |
|
|
190 |
// TVA |
// TVA |
191 |
$pdf->SetXY (121, $curY); |
$pdf->SetXY ($posxtva, $curY); |
192 |
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C'); |
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C'); |
193 |
|
|
194 |
// Prix unitaire HT avant remise |
// Prix unitaire HT avant remise |
195 |
$pdf->SetXY (133, $curY); |
$pdf->SetXY ($posxup, $curY); |
196 |
$pdf->MultiCell(17, 5, price($fac->lignes[$i]->subprice), 0, 'R', 0); |
$pdf->MultiCell(17, 5, price($fac->lignes[$i]->subprice), 0, 'R', 0); |
197 |
|
|
198 |
// Quantité |
// Quantité |
199 |
$pdf->SetXY (151, $curY); |
$pdf->SetXY ($posxqty, $curY); |
200 |
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'R'); |
$pdf->MultiCell(10, 5, $fac->lignes[$i]->qty, 0, 'R'); |
201 |
|
|
202 |
// Remise sur ligne |
// Remise sur ligne |
203 |
$pdf->SetXY (163, $curY); |
$pdf->SetXY ($posxdiscount, $curY); |
204 |
if ($fac->lignes[$i]->remise_percent) { |
if ($fac->lignes[$i]->remise_percent) { |
205 |
$pdf->MultiCell(14, 5, $fac->lignes[$i]->remise_percent."%", 0, 'R'); |
$pdf->MultiCell(14, 5, $fac->lignes[$i]->remise_percent."%", 0, 'R'); |
206 |
} |
} |
207 |
|
|
208 |
// Total HT |
// Total TTC |
209 |
$pdf->SetXY (173, $curY); |
$pdf->SetXY ($postotttc, $curY); |
210 |
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty); |
$total = price($fac->lignes[$i]->price * $fac->lignes[$i]->qty); |
211 |
$pdf->MultiCell(26, 5, $total, 0, 'R', 0); |
$pdf->MultiCell(26, 5, $total, 0, 'R', 0); |
212 |
|
|