49 |
$this->db = $db; |
$this->db = $db; |
50 |
$this->name = "azur"; |
$this->name = "azur"; |
51 |
$this->description = "Modèle de propositions commerciales complet (logo...)"; |
$this->description = "Modèle de propositions commerciales complet (logo...)"; |
52 |
|
$this->format="A4"; |
53 |
|
|
54 |
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO |
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO |
55 |
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
56 |
$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 |
57 |
$this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE |
$this->option_codeproduitservice = 1; // Affiche code produit-service |
58 |
$this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA |
$this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA |
59 |
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL |
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL |
60 |
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') |
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') |
73 |
dolibarr_print_error($this->db); |
dolibarr_print_error($this->db); |
74 |
} |
} |
75 |
$this->db->free($result); |
$this->db->free($result); |
|
} |
|
76 |
|
|
77 |
|
// Defini position des colonnes |
78 |
|
$this->posxdesc=11; |
79 |
|
$this->posxtva=121; |
80 |
|
$this->posxup=133; |
81 |
|
$this->posxqty=151; |
82 |
|
$this->posxdiscount=163; |
83 |
|
$this->postotalht=173; |
84 |
|
} |
85 |
|
|
86 |
/** |
/** |
87 |
\brief Renvoi dernière erreur |
\brief Renvoi dernière erreur |
145 |
$pdf->Open(); |
$pdf->Open(); |
146 |
$pdf->AddPage(); |
$pdf->AddPage(); |
147 |
|
|
148 |
$this->_pagehead($pdf, $prop); |
$pdf->SetDrawColor(128,128,128); |
149 |
|
|
150 |
$pdf->SetTitle($prop->ref); |
$pdf->SetTitle($prop->ref); |
151 |
$pdf->SetSubject($langs->trans("Bill")); |
$pdf->SetSubject($langs->trans("Bill")); |
155 |
$pdf->SetMargins(10, 10, 10); |
$pdf->SetMargins(10, 10, 10); |
156 |
$pdf->SetAutoPageBreak(1,0); |
$pdf->SetAutoPageBreak(1,0); |
157 |
|
|
158 |
|
$this->_pagehead($pdf, $prop); |
159 |
|
|
160 |
$tab_top = 96; |
$tab_top = 96; |
161 |
$tab_height = 110; |
$tab_height = 110; |
162 |
|
|
|
$pdf->SetFillColor(220,220,220); |
|
163 |
$pdf->SetFont('Arial','', 9); |
$pdf->SetFont('Arial','', 9); |
164 |
$pdf->SetXY (10, $tab_top + 10 ); |
|
165 |
|
$iniY = $tab_top + 8; |
166 |
$iniY = $pdf->GetY(); |
$curY = $tab_top + 8; |
167 |
$curY = $pdf->GetY(); |
$nexY = $tab_top + 8; |
|
$nexY = $pdf->GetY(); |
|
168 |
$nblignes = sizeof($prop->lignes); |
$nblignes = sizeof($prop->lignes); |
169 |
|
|
170 |
// Boucle sur les lignes |
// Boucle sur les lignes |
179 |
if ($libelleproduitservice) $libelleproduitservice.="\n"; |
if ($libelleproduitservice) $libelleproduitservice.="\n"; |
180 |
$libelleproduitservice.=$prop->lignes[$i]->desc; |
$libelleproduitservice.=$prop->lignes[$i]->desc; |
181 |
} |
} |
182 |
$pdf->SetXY (11, $curY ); |
$pdf->SetXY ($this->posxdesc-1, $curY); |
183 |
|
|
184 |
if ($conf->global->PROPALE_CODEPRODUITSERVICE && $prop->lignes[$i]->product_id) |
if ($prop->lignes[$i]->product_id) |
185 |
{ |
{ |
186 |
// Affiche code produit si ligne associée à un code produit |
// Affiche code produit si ligne associée à un code produit |
187 |
$prodser = new Product($this->db); |
$prodser = new Product($this->db); |
188 |
|
|
189 |
$prodser->fetch($prop->lignes[$i]->product_id); |
$prodser->fetch($prop->lignes[$i]->product_id); |
190 |
if ($prodser->ref) { |
if ($prodser->ref) { |
191 |
$libelleproduitservice=$langs->trans("ProductCode")." ".$prodser->ref." - ".$libelleproduitservice; |
$libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice; |
192 |
} |
} |
193 |
} |
} |
194 |
if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) { |
if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) { |
200 |
$nexY = $pdf->GetY(); |
$nexY = $pdf->GetY(); |
201 |
|
|
202 |
// TVA |
// TVA |
203 |
$pdf->SetXY (121, $curY); |
$pdf->SetXY ($this->posxtva, $curY); |
204 |
$pdf->MultiCell(10, 5, $prop->lignes[$i]->tva_tx, 0, 'C'); |
$pdf->MultiCell(10, 5, $prop->lignes[$i]->tva_tx, 0, 'C'); |
205 |
|
|
206 |
// Prix unitaire HT avant remise |
// Prix unitaire HT avant remise |
207 |
$pdf->SetXY (133, $curY); |
$pdf->SetXY ($this->posxup, $curY); |
208 |
$pdf->MultiCell(16, 5, price($prop->lignes[$i]->subprice), 0, 'R', 0); |
$pdf->MultiCell(16, 5, price($prop->lignes[$i]->subprice), 0, 'R', 0); |
209 |
|
|
210 |
// Quantité |
// Quantité |
211 |
$pdf->SetXY (151, $curY); |
$pdf->SetXY ($this->posxqty, $curY); |
212 |
$pdf->MultiCell(10, 5, $prop->lignes[$i]->qty, 0, 'R'); |
$pdf->MultiCell(10, 5, $prop->lignes[$i]->qty, 0, 'R'); |
213 |
|
|
214 |
// Remise sur ligne |
// Remise sur ligne |
215 |
$pdf->SetXY (163, $curY); |
$pdf->SetXY ($this->posxdiscount, $curY); |
216 |
if ($prop->lignes[$i]->remise_percent) { |
if ($prop->lignes[$i]->remise_percent) { |
217 |
$pdf->MultiCell(14, 5, $prop->lignes[$i]->remise_percent."%", 0, 'R'); |
$pdf->MultiCell(14, 5, $prop->lignes[$i]->remise_percent."%", 0, 'R'); |
218 |
} |
} |
219 |
|
|
220 |
// Total HT |
// Total HT ligne |
221 |
$pdf->SetXY (173, $curY); |
$pdf->SetXY ($this->postotalht, $curY); |
222 |
$total = price($prop->lignes[$i]->price * $prop->lignes[$i]->qty); |
$total = price($prop->lignes[$i]->price * $prop->lignes[$i]->qty); |
223 |
$pdf->MultiCell(26, 5, $total, 0, 'R', 0); |
$pdf->MultiCell(26, 5, $total, 0, 'R', 0); |
224 |
|
|
225 |
|
// Collecte des totaux par valeur de tva |
226 |
|
// dans le tableau tva["taux"]=total_tva |
227 |
|
$tvaligne=$fac->lignes[$i]->price * $fac->lignes[$i]->qty; |
228 |
|
if ($fac->remise_percent) $tvaligne-=($tvaligne*$fac->remise_percent)/100; |
229 |
|
$this->tva[ (string)$fac->lignes[$i]->tva_taux ] += $tvaligne; |
230 |
|
|
231 |
if ($nexY > 200 && $i < $nblignes - 1) |
if ($nexY > 200 && $i < $nblignes - 1) |
232 |
{ |
{ |
241 |
} |
} |
242 |
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); |
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); |
243 |
|
|
244 |
$this->_tableau_tot($pdf, $prop, ""); |
$posy=$this->_tableau_tot($pdf, $prop, ""); |
245 |
|
|
246 |
/* |
/* |
247 |
* Mode de règlement |
* Mode de règlement |
372 |
} |
} |
373 |
|
|
374 |
/* |
/* |
375 |
* \brief Affiche le total à payer |
* \brief Affiche le total à payer |
376 |
* \param pdf objet PDF |
* \param pdf Objet PDF |
377 |
* \param fac objet propale |
* \param fac Objet propale |
378 |
* \param deja_regle montant deja regle |
* \param deja_regle Montant deja regle |
379 |
|
* \return y Position pour suite |
380 |
*/ |
*/ |
381 |
function _tableau_tot(&$pdf, $prop, $deja_regle) |
function _tableau_tot(&$pdf, $prop, $deja_regle) |
382 |
{ |
{ |
398 |
|
|
399 |
// Tableau total |
// Tableau total |
400 |
$col1x=120; $col2x=174; |
$col1x=120; $col2x=174; |
401 |
|
|
402 |
|
// Total HT |
403 |
|
$pdf->SetFillColor(256,256,256); |
404 |
$pdf->SetXY ($col1x, $tab2_top + 0); |
$pdf->SetXY ($col1x, $tab2_top + 0); |
405 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalHT"), 0, 'L', 0); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalHT"), 0, 'L', 1); |
406 |
|
|
407 |
$pdf->SetXY ($col2x, $tab2_top + 0); |
$pdf->SetXY ($col2x, $tab2_top + 0); |
408 |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ht + $prop->remise), 0, 'R', 0); |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ht + $prop->remise), 0, 'R', 1); |
409 |
|
|
410 |
|
// Remise globale |
411 |
if ($prop->remise > 0) |
if ($prop->remise > 0) |
412 |
{ |
{ |
413 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl); |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl); |
414 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("GlobalDiscount"), 0, 'L', 0); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("GlobalDiscount"), 0, 'L', 1); |
415 |
|
|
416 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl); |
417 |
$pdf->MultiCell(26, $tab2_hl, "-".$prop->remise_percent."%", 0, 'R', 0); |
$pdf->MultiCell(26, $tab2_hl, "-".$prop->remise_percent."%", 0, 'R', 1); |
418 |
|
|
419 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2); |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2); |
420 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, "Total HT après remise", 0, 'L', 0); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, "Total HT après remise", 0, 'L', 1); |
421 |
|
|
422 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2); |
423 |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ht), 0, 'R', 0); |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ht), 0, 'R', 1); |
424 |
|
|
425 |
$index = 3; |
$index = 2; |
426 |
} |
} |
427 |
else |
else |
428 |
{ |
{ |
429 |
$index = 1; |
$index = 0; |
430 |
} |
} |
431 |
|
|
432 |
|
// Affichage des totaux de TVA par taux (conformément à réglementation) |
433 |
|
$atleastoneratenotnull=0; |
434 |
|
$pdf->SetFillColor(248,248,248); |
435 |
|
foreach( $this->tva as $tvakey => $tvaval ) |
436 |
|
{ |
437 |
|
if ($tvakey) // On affiche pas taux 0 |
438 |
|
{ |
439 |
|
$atleastoneratenotnull++; |
440 |
|
|
441 |
|
$index++; |
442 |
|
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
443 |
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT").' '.$tvakey.'%', 0, 'L', 1); |
444 |
|
|
445 |
|
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); |
446 |
|
$pdf->MultiCell(26, $tab2_hl, price($tvaval * (float)$tvakey / 100 ), 0, 'R', 1); |
447 |
|
} |
448 |
|
} |
449 |
|
if (! $atleastoneratenotnull) |
450 |
|
{ |
451 |
|
$index++; |
452 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
453 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT"), 0, 'L', 0); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT"), 0, 'L', 1); |
454 |
|
|
455 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); |
456 |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_tva), 0, 'R', 0); |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_tva), 0, 'R', 1); |
457 |
|
|
458 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * ($index+1)); |
$useborder=0; |
459 |
|
|
460 |
|
$index++; |
461 |
|
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
462 |
$pdf->SetTextColor(0,0,60); |
$pdf->SetTextColor(0,0,60); |
463 |
$pdf->SetFont('Arial','B', 9); |
$pdf->SetFont('Arial','B', 9); |
464 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalTTC"), 0, 'L', 1); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalTTC"), $useborder, 'L', 1); |
465 |
|
|
466 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+1)); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+1)); |
467 |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ttc), 0, 'R', 1); |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ttc), $useborder, 'R', 1); |
468 |
$pdf->SetFont('Arial','', 9); |
$pdf->SetFont('Arial','', 9); |
469 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
470 |
|
|
471 |
if ($deja_regle > 0) |
if ($deja_regle > 0) |
472 |
{ |
{ |
473 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * ($index+2)); |
$index++; |
474 |
|
|
475 |
|
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
476 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0); |
477 |
|
|
478 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+2)); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); |
479 |
$pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0); |
$pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0); |
480 |
|
|
481 |
|
$index++; |
482 |
$pdf->SetTextColor(0,0,60); |
$pdf->SetTextColor(0,0,60); |
483 |
$pdf->SetFont('Arial','B', 9); |
//$pdf->SetFont('Arial','B', 9); |
484 |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * ($index+3)); |
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); |
485 |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("RemainderToPay"), 0, 'L', 1); |
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("RemainderToPay"), $useborder, 'L', 1); |
486 |
|
|
487 |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+3)); |
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); |
488 |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ttc - $deja_regle), 0, 'R', 1); |
$pdf->MultiCell(26, $tab2_hl, price($prop->total_ttc - $deja_regle), $useborder, 'R', 1); |
489 |
$pdf->SetFont('Arial','', 9); |
$pdf->SetFont('Arial','', 9); |
490 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
491 |
} |
} |
492 |
|
|
493 |
|
$index++; |
494 |
|
return ($tab2_top + ($tab2_hl * $index)); |
495 |
} |
} |
496 |
|
|
497 |
/* |
/* |
505 |
$langs->load("bills"); |
$langs->load("bills"); |
506 |
|
|
507 |
$pdf->Rect( 10, $tab_top, 190, $tab_height); |
$pdf->Rect( 10, $tab_top, 190, $tab_height); |
508 |
$pdf->line( 10, $tab_top+8, 200, $tab_top+8 ); |
$pdf->line( 10, $tab_top+6, 200, $tab_top+6 ); |
509 |
|
|
510 |
$pdf->SetFont('Arial','',10); |
$pdf->SetFont('Arial','',10); |
511 |
|
|
512 |
$pdf->Text(12,$tab_top + 5, $langs->trans("Label")); |
$pdf->SetXY (10, $tab_top+2); |
513 |
|
$pdf->MultiCell(40,2, $langs->trans("Designation"),'','L'); |
514 |
|
|
515 |
$pdf->line(120, $tab_top, 120, $tab_top + $tab_height); |
$pdf->line(120, $tab_top, 120, $tab_top + $tab_height); |
516 |
$pdf->Text(122, $tab_top + 5, $langs->trans("VAT")); |
$pdf->SetXY (120, $tab_top+2); |
517 |
|
$pdf->MultiCell(12,2, $langs->trans("VAT"),'','C'); |
518 |
|
|
519 |
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height); |
$pdf->line(132, $tab_top, 132, $tab_top + $tab_height); |
520 |
$pdf->Text(135, $tab_top + 5,$langs->trans("PriceUHT")); |
$pdf->SetXY (132, $tab_top+2); |
521 |
|
$pdf->MultiCell(18,2, $langs->trans("PriceUHT"),'','C'); |
522 |
|
|
523 |
$pdf->line(150, $tab_top, 150, $tab_top + $tab_height); |
$pdf->line(150, $tab_top, 150, $tab_top + $tab_height); |
524 |
$pdf->Text(153, $tab_top + 5, $langs->trans("Qty")); |
$pdf->SetXY (150, $tab_top+2); |
525 |
|
$pdf->MultiCell(12,2, $langs->trans("Qty"),'','C'); |
526 |
|
|
527 |
$pdf->line(162, $tab_top, 162, $tab_top + $tab_height); |
$pdf->line(162, $tab_top, 162, $tab_top + $tab_height); |
528 |
$pdf->Text(163, $tab_top + 5,$langs->trans("Discount")); |
$pdf->SetXY (162, $tab_top+2); |
529 |
|
$pdf->MultiCell(15,2, $langs->trans("Discount"),'','C'); |
530 |
|
|
531 |
$pdf->line(177, $tab_top, 177, $tab_top + $tab_height); |
$pdf->line(177, $tab_top, 177, $tab_top + $tab_height); |
532 |
$pdf->Text(185, $tab_top + 5, $langs->trans("TotalHT")); |
$pdf->SetXY (177, $tab_top+2); |
533 |
|
$pdf->MultiCell(23,2, $langs->trans("TotalHT"),'','C'); |
534 |
|
|
535 |
} |
} |
536 |
|
|
541 |
*/ |
*/ |
542 |
function _pagehead(&$pdf, $prop) |
function _pagehead(&$pdf, $prop) |
543 |
{ |
{ |
544 |
global $conf; |
global $langs,$conf; |
545 |
global $langs; |
|
546 |
$langs->load("main"); |
$langs->load("main"); |
547 |
$langs->load("bills"); |
$langs->load("bills"); |
548 |
$langs->load("propal"); |
$langs->load("propal"); |
557 |
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) |
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) |
558 |
{ |
{ |
559 |
if (file_exists(FAC_PDF_LOGO)) { |
if (file_exists(FAC_PDF_LOGO)) { |
560 |
$pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24, 'PNG'); |
$pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24); |
561 |
} |
} |
562 |
else { |
else { |
563 |
$pdf->SetTextColor(200,0,0); |
$pdf->SetTextColor(200,0,0); |
580 |
$pdf->SetTextColor(0,0,60); |
$pdf->SetTextColor(0,0,60); |
581 |
$pdf->MultiCell(100, 10, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R'); |
$pdf->MultiCell(100, 10, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R'); |
582 |
|
|
583 |
/* |
// Emetteur |
|
* Emetteur |
|
|
*/ |
|
584 |
$posy=42; |
$posy=42; |
585 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
586 |
$pdf->SetFont('Arial','',8); |
$pdf->SetFont('Arial','',8); |
641 |
} |
} |
642 |
|
|
643 |
|
|
644 |
/* |
// Client destinataire |
|
* Client |
|
|
*/ |
|
645 |
$posy=42; |
$posy=42; |
646 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
647 |
$pdf->SetFont('Arial','',8); |
$pdf->SetFont('Arial','',8); |
657 |
$pdf->SetFont('Arial','B',9); |
$pdf->SetFont('Arial','B',9); |
658 |
$pdf->SetXY(102,$posy+12); |
$pdf->SetXY(102,$posy+12); |
659 |
$pdf->MultiCell(86,4, $prop->client->adresse . "\n" . $prop->client->cp . " " . $prop->client->ville); |
$pdf->MultiCell(86,4, $prop->client->adresse . "\n" . $prop->client->cp . " " . $prop->client->ville); |
660 |
|
// Cadre client destinataire |
661 |
$pdf->rect(100, $posy, 100, 34); |
$pdf->rect(100, $posy, 100, 34); |
662 |
|
|
663 |
/* |
// Montants exprimés en |
|
* |
|
|
*/ |
|
664 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
665 |
$pdf->SetFont('Arial','',10); |
$pdf->SetFont('Arial','',10); |
666 |
$titre = $langs->trans("AmountInCurrency")." ".$langs->trans("Currency".$conf->monnaie); |
$titre = $langs->trans("AmountInCurrency",$langs->trans("Currency".$conf->monnaie)); |
667 |
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre); |
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre); |
|
/* |
|
|
*/ |
|
668 |
|
|
669 |
} |
} |
670 |
|
|
680 |
$langs->load("bills"); |
$langs->load("bills"); |
681 |
$langs->load("companies"); |
$langs->load("companies"); |
682 |
|
|
683 |
|
$html=new Form($this->db); |
684 |
|
|
685 |
|
$footy=14; |
686 |
|
$pdf->SetY(-$footy); |
687 |
|
$pdf->SetDrawColor(224,224,224); |
688 |
|
$pdf->line(10, 282, 200, 282); |
689 |
|
|
690 |
$footy=13; |
$footy=13; |
691 |
$pdf->SetFont('Arial','',8); |
$pdf->SetFont('Arial','',8); |
692 |
|
|
693 |
if (defined(MAIN_INFO_CAPITAL)) { |
$ligne=""; |
694 |
$pdf->SetY(-$footy); |
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE) |
695 |
$ligne="SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie; |
{ |
696 |
if (defined(MAIN_INFO_SIREN) && MAIN_INFO_SIREN) { |
$ligne=($ligne?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); |
697 |
$ligne.=" - ".$langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIREN; |
} |
698 |
|
if ($conf->global->MAIN_INFO_CAPITAL) |
699 |
|
{ |
700 |
|
$ligne=($ligne?" - ":"")."Capital de " . MAIN_INFO_CAPITAL." ".$langs->trans("Currency".$conf->monnaie); |
701 |
|
} |
702 |
|
if ($conf->global->MAIN_INFO_SIREN) |
703 |
|
{ |
704 |
|
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->code_pays).": ".MAIN_INFO_SIREN; |
705 |
} |
} |
706 |
if (defined(MAIN_INFO_RCS) && MAIN_INFO_RCS) { |
if ($conf->global->MAIN_INFO_SIRET) |
707 |
$ligne.=" - ".$langs->transcountry("ProfId3",$this->code_pays).": ".MAIN_INFO_RCS; |
{ |
708 |
|
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIRET; |
709 |
} |
} |
710 |
|
if ($conf->global->MAIN_INFO_RCS) |
711 |
|
{ |
712 |
|
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->code_pays).": ".MAIN_INFO_RCS; |
713 |
|
} |
714 |
|
if ($ligne) |
715 |
|
{ |
716 |
|
$pdf->SetY(-$footy); |
717 |
$pdf->MultiCell(190, 3, $ligne, 0, 'C'); |
$pdf->MultiCell(190, 3, $ligne, 0, 'C'); |
|
$footy-=3; |
|
718 |
} |
} |
719 |
|
|
720 |
// Affiche le numéro de TVA intracommunautaire |
// Affiche le numéro de TVA intracommunautaire |
721 |
if (MAIN_INFO_TVAINTRA == 'MAIN_INFO_TVAINTRA') { |
if ($conf->global->MAIN_INFO_TVAINTRA == 'MAIN_INFO_TVAINTRA') { |
722 |
|
$footy-=3; |
723 |
$pdf->SetY(-$footy); |
$pdf->SetY(-$footy); |
724 |
$pdf->SetTextColor(200,0,0); |
$pdf->SetTextColor(200,0,0); |
725 |
$pdf->SetFont('Arial','B',8); |
$pdf->SetFont('Arial','B',8); |
727 |
$pdf->MultiCell(190, 3, $langs->trans("ErrorGoToGlobalSetup"),0,'L',0); |
$pdf->MultiCell(190, 3, $langs->trans("ErrorGoToGlobalSetup"),0,'L',0); |
728 |
$pdf->SetTextColor(0,0,0); |
$pdf->SetTextColor(0,0,0); |
729 |
} |
} |
730 |
elseif (MAIN_INFO_TVAINTRA != '') { |
elseif ($conf->global->MAIN_INFO_TVAINTRA != '') { |
731 |
|
$footy-=3; |
732 |
$pdf->SetY(-$footy); |
$pdf->SetY(-$footy); |
733 |
$pdf->MultiCell(190, 3, $langs->trans("TVAIntra")." : ".MAIN_INFO_TVAINTRA, 0, 'C'); |
$pdf->MultiCell(190, 3, $langs->trans("TVAIntra")." : ".MAIN_INFO_TVAINTRA, 0, 'C'); |
734 |
} |
} |
735 |
|
|
736 |
$pdf->SetXY(-10,-10); |
$pdf->SetXY(-20,-$footy); |
737 |
$pdf->MultiCell(10, 3, $pdf->PageNo().'/{nb}', 0, 'R'); |
$pdf->MultiCell(10, 3, $pdf->PageNo().'/{nb}', 0, 'R'); |
738 |
} |
} |
739 |
|
|