161 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
164 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
166 dol_syslog(
"write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang :
'null'));
168 if (!is_object($outputlangs)) {
169 $outputlangs = $langs;
173 $outputlangs->charset_output =
'ISO-8859-1';
177 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
184 global $outputlangsbis;
185 $outputlangsbis =
null;
187 $outputlangsbis =
new Translate(
'', $conf);
189 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
192 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
200 $realpatharray = array();
201 $this->atleastonephoto =
false;
203 $objphoto =
new Product($this->db);
205 for ($i = 0; $i < $nblines; $i++) {
206 if (empty(
$object->lines[$i]->fk_product)) {
212 $objphoto->fetch(
$object->lines[$i]->fk_product);
215 $pdir[0] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
216 $pdir[1] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
218 $pdir[0] =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
219 $pdir[1] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
223 foreach ($pdir as $midir) {
225 if ($conf->entity != $objphoto->entity) {
226 $dir = $conf->product->multidir_output[$objphoto->entity].
'/'.$midir;
228 $dir = $conf->product->dir_output.
'/'.$midir;
231 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
233 if ($obj[
'photo_vignette']) {
234 $filename = $obj[
'photo_vignette'];
236 $filename = $obj[
'photo'];
239 $filename = $obj[
'photo'];
242 $realpath = $dir.$filename;
244 $this->atleastonephoto =
true;
249 if ($realpath && $arephoto) {
250 $realpatharray[$i] = $realpath;
265 $file = $dir.
"/SPECIMEN.pdf";
269 $file = $dir.
"/".$objectref.
".pdf";
272 if (!file_exists($dir)) {
274 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
279 if (file_exists($dir)) {
281 if (!is_object($hookmanager)) {
282 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
285 $hookmanager->initHooks(array(
'pdfgeneration'));
286 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
288 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
291 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
296 $pdf->SetAutoPageBreak(1, 0);
298 $heightforinfotot = 40;
300 $heightforfooter = $this->marge_basse + 8;
302 $heightforfooter += 6;
305 if (class_exists(
'TCPDF')) {
306 $pdf->setPrintHeader(
false);
307 $pdf->setPrintFooter(
false);
312 $logodir = $conf->mycompany->dir_output;
313 if (!empty($conf->mycompany->multidir_output[
$object->entity])) {
314 $logodir = $conf->mycompany->multidir_output[
$object->entity];
316 $pagecount = $pdf->setSourceFile($logodir.
'/'.
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
317 $tplidx = $pdf->importPage(1);
322 $pdf->SetDrawColor(128, 128, 128);
324 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
325 $pdf->SetSubject($outputlangs->transnoentities(
"PdfOrderTitle"));
326 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
327 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
328 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".$outputlangs->transnoentities(
"PdfOrderTitle").
" ".$outputlangs->convToOutputCharset(
$object->thirdparty->name));
330 $pdf->SetCompression(
false);
334 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
337 for ($i = 0; $i < $nblines; $i++) {
338 if (
$object->lines[$i]->remise_percent) {
339 $this->atleastonediscount++;
346 if (!empty($tplidx)) {
347 $pdf->useTemplate($tplidx);
350 $top_shift = $this->
_pagehead($pdf,
$object, 1, $outputlangs, (is_object($outputlangsbis) ? $outputlangsbis :
null));
351 $pdf->SetFont(
'',
'', $default_font_size - 1);
352 $pdf->MultiCell(0, 3,
'');
353 $pdf->SetTextColor(0, 0, 0);
356 $tab_top = 90 + $top_shift;
357 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
359 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
361 $nexY = $tab_top - 1;
364 $height_incoterms = 0;
365 if (isModEnabled(
'incoterm')) {
366 $desc_incoterms =
$object->getIncotermsForPDF();
367 if ($desc_incoterms) {
370 $pdf->SetFont(
'',
'', $default_font_size - 1);
371 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
372 $nexY = max($pdf->GetY(), $nexY);
373 $height_incoterms = $nexY - $tab_top;
376 $pdf->SetDrawColor(192, 192, 192);
377 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
379 $tab_top = $nexY + 6;
384 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
387 if (is_object(
$object->thirdparty)) {
388 $salereparray =
$object->thirdparty->getSalesRepresentatives($user);
389 $salerepobj =
new User($this->db);
390 $salerepobj->fetch($salereparray[0][
'id']);
391 if (!empty($salerepobj->signature)) {
392 $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
397 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
398 if (!empty($extranote)) {
402 $pagenb = $pdf->getPage();
406 $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
407 $pageposbeforenote = $pagenb;
414 $pdf->startTransaction();
416 $pdf->SetFont(
'',
'', $default_font_size - 1);
417 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
419 $pageposafternote = $pdf->getPage();
420 $posyafter = $pdf->GetY();
422 if ($pageposafternote > $pageposbeforenote) {
423 $pdf->rollbackTransaction(
true);
426 while ($pagenb < $pageposafternote) {
429 if (!empty($tplidx)) {
430 $pdf->useTemplate($tplidx);
436 $pdf->setTopMargin($tab_top_newpage);
438 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
442 $pdf->setPage($pageposbeforenote);
443 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
444 $pdf->SetFont(
'',
'', $default_font_size - 1);
445 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
446 $pageposafternote = $pdf->getPage();
448 $posyafter = $pdf->GetY();
450 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
451 $pdf->AddPage(
'',
'',
true);
454 $pdf->setPage($pageposafternote);
455 $pdf->setTopMargin($tab_top_newpage);
457 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
463 $i = $pageposbeforenote;
464 while ($i < $pageposafternote) {
468 $pdf->SetDrawColor(128, 128, 128);
470 if ($i > $pageposbeforenote) {
471 $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
472 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
474 $height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
475 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
479 $pdf->setPageOrientation(
'', 1, 0);
486 $pdf->setPage($pageposafternote);
487 if (!empty($tplidx)) {
488 $pdf->useTemplate($tplidx);
493 $height_note = $posyafter - $tab_top_newpage;
494 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
497 $pdf->commitTransaction();
498 $posyafter = $pdf->GetY();
499 $height_note = $posyafter - $tab_top;
500 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
503 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
505 $pdf->AddPage(
'',
'',
true);
508 $pdf->setPage($pageposafternote);
509 if (!empty($tplidx)) {
510 $pdf->useTemplate($tplidx);
516 $posyafter = $tab_top_newpage;
520 $tab_height = $tab_height - $height_note;
521 $tab_top = $posyafter + 6;
531 $pdf->startTransaction();
532 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
533 $pdf->rollbackTransaction(
true);
535 $nexY = $tab_top + $this->tabTitleHeight;
538 $pageposbeforeprintlines = $pdf->getPage();
539 $pagenb = $pageposbeforeprintlines;
540 for ($i = 0; $i < $nblines; $i++) {
542 $pdf->SetFont(
'',
'', $default_font_size - 1);
543 $pdf->SetTextColor(0, 0, 0);
546 $imglinesize = array();
547 if (!empty($realpatharray[$i])) {
551 $pdf->setTopMargin($tab_top_newpage);
552 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
553 $pageposbefore = $pdf->getPage();
556 $showpricebeforepagebreak = 1;
558 $posYAfterDescription = 0;
566 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
567 $pdf->AddPage(
'',
'',
true);
568 if (!empty($tplidx)) {
569 $pdf->useTemplate($tplidx);
571 $pdf->setPage($pageposbefore + 1);
573 $curY = $tab_top_newpage;
577 $showpricebeforepagebreak = 1;
579 $showpricebeforepagebreak = 0;
583 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height'])) {
584 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY + 1, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
586 $posYAfterImage = $curY + $imglinesize[
'height'];
592 $pdf->startTransaction();
595 $pageposafter = $pdf->getPage();
597 if ($pageposafter > $pageposbefore) {
598 $pdf->rollbackTransaction(
true);
599 $pageposafter = $pageposbefore;
601 $pdf->setPageOrientation(
'', 1, $heightforfooter);
604 $pageposafter = $pdf->getPage();
605 $posyafter = $pdf->GetY();
606 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
607 if ($i == ($nblines - 1)) {
608 $pdf->AddPage(
'',
'',
true);
609 if (!empty($tplidx)) {
610 $pdf->useTemplate($tplidx);
612 $pdf->setPage($pageposafter + 1);
618 $showpricebeforepagebreak = 1;
620 $showpricebeforepagebreak = 0;
624 $pdf->commitTransaction();
626 $posYAfterDescription = $pdf->GetY();
630 $nexY = max($pdf->GetY(), $posYAfterImage);
633 $pageposafter = $pdf->getPage();
635 $pdf->setPage($pageposbefore);
636 $pdf->setTopMargin($this->marge_haute);
637 $pdf->setPageOrientation(
'', 1, 0);
640 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
641 $pdf->setPage($pageposafter);
642 $curY = $tab_top_newpage;
645 $pdf->SetFont(
'',
'', $default_font_size - 1);
651 $nexY = max($pdf->GetY(), $nexY);
658 $nexY = max($pdf->GetY(), $nexY);
666 $nexY = max($pdf->GetY(), $nexY);
674 $nexY = max($pdf->GetY(), $nexY);
681 $nexY = max($pdf->GetY(), $nexY);
688 $nexY = max($pdf->GetY(), $nexY);
695 $nexY = max($pdf->GetY(), $nexY);
699 if (!empty(
$object->lines[$i]->array_options)) {
700 foreach (
$object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
704 $nexY = max($pdf->GetY(), $nexY);
715 'outputlangs' => $outputlangs,
716 'hidedetails' => $hidedetails
718 $reshook = $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
722 if (isModEnabled(
"multicurrency") &&
$object->multicurrency_tx != 1) {
723 $tvaligne =
$object->lines[$i]->multicurrency_total_tva;
725 $tvaligne =
$object->lines[$i]->total_tva;
728 $localtax1ligne =
$object->lines[$i]->total_localtax1;
729 $localtax2ligne =
$object->lines[$i]->total_localtax2;
730 $localtax1_rate =
$object->lines[$i]->localtax1_tx;
731 $localtax2_rate =
$object->lines[$i]->localtax2_tx;
732 $localtax1_type =
$object->lines[$i]->localtax1_type;
733 $localtax2_type =
$object->lines[$i]->localtax2_type;
735 $vatrate = (string)
$object->lines[$i]->tva_tx;
738 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
739 && (!empty($localtax1_rate) || !empty($localtax2_rate))) {
741 $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] :
'';
742 $localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] :
'';
746 if ($localtax1_type && $localtax1ligne != 0) {
747 if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) {
748 $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne;
750 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
753 if ($localtax2_type && $localtax2ligne != 0) {
754 if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
755 $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
757 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
761 if ((
$object->lines[$i]->info_bits & 0x01) == 0x01) {
766 if (!isset($this->tva[$vatrate])) {
767 $this->tva[$vatrate] = 0;
769 $this->tva[$vatrate] += $tvaligne;
770 $vatcode =
$object->lines[$i]->vat_src_code;
771 if (empty($this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'])) {
772 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] = 0;
774 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')] = array(
'vatrate' => $vatrate,
'vatcode' => $vatcode,
'amount' => $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] + $tvaligne);
777 if (
getDolGlobalInt(
'MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
778 $pdf->setPage($pageposafter);
779 $pdf->SetLineStyle(array(
'dash' =>
'1,1',
'color' => array(80, 80, 80)));
781 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
782 $pdf->SetLineStyle(array(
'dash' => 0));
787 while ($pagenb < $pageposafter) {
788 $pdf->setPage($pagenb);
789 if ($pagenb == $pageposbeforeprintlines) {
790 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
792 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
796 $pdf->setPage($pagenb);
797 $pdf->setPageOrientation(
'', 1, 0);
801 if (!empty($tplidx)) {
802 $pdf->useTemplate($tplidx);
805 if (isset(
$object->lines[$i + 1]->pagebreak) &&
$object->lines[$i + 1]->pagebreak) {
806 if ($pagenb == $pageposafter) {
807 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
809 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
814 if (!empty($tplidx)) {
815 $pdf->useTemplate($tplidx);
825 if ($pagenb == $pageposbeforeprintlines) {
826 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0,
$object->multicurrency_code, $outputlangsbis);
828 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0,
$object->multicurrency_code, $outputlangsbis);
830 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
848 if (method_exists($pdf,
'AliasNbPages')) {
849 $pdf->AliasNbPages();
854 $pdf->Output($file,
'F');
857 $hookmanager->initHooks(array(
'pdfgeneration'));
858 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
860 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
862 $this->error = $hookmanager->error;
863 $this->errors = $hookmanager->errors;
868 $this->result = array(
'fullpath' => $file);
872 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
876 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"COMMANDE_OUTPUTDIR");
906 global $conf, $mysoc;
909 $pdf->SetFont(
'',
'', $default_font_size - 1);
911 $diffsizetitle = (!
getDolGlobalString(
'PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
914 if ($this->emetteur->country_code ==
'FR' && empty($mysoc->tva_assuj)) {
915 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
916 $pdf->SetXY($this->marge_gauche, $posy);
917 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"VATIsNotUsedForInvoice"), 0,
'L', 0);
919 $posy = $pdf->GetY() + 4;
924 $diffsizetitle = (!
getDolGlobalString(
'PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
928 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
929 $pdf->SetXY($this->marge_gauche, $posy);
930 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
931 $pdf->MultiCell(43, 4, $titre, 0,
'L');
933 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
934 $pdf->SetXY($posxval, $posy);
935 $lib_condition_paiement = ($outputlangs->transnoentities(
"PaymentCondition".
$object->cond_reglement_code) !=
'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities(
"PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset(
$object->cond_reglement_doc ?
$object->cond_reglement_doc :
$object->cond_reglement_label);
936 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
937 if (
$object->deposit_percent > 0) {
938 $lib_condition_paiement = str_replace(
'__DEPOSIT_PERCENT__', (
string)
$object->deposit_percent, $lib_condition_paiement);
940 $pdf->MultiCell(67, 4, $lib_condition_paiement, 0,
'L');
942 $posy = $pdf->GetY() + 3;
973 if (!empty(
$object->delivery_date)) {
974 $outputlangs->load(
"sendings");
975 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
976 $pdf->SetXY($this->marge_gauche, $posy);
977 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
978 $pdf->MultiCell(80, 4, $titre, 0,
'L');
979 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
980 $pdf->SetXY($posxval, $posy);
982 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
984 $posy = $pdf->GetY() + 1;
986 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
987 $pdf->SetXY($this->marge_gauche, $posy);
988 $titre = $outputlangs->transnoentities(
"AvailabilityPeriod").
':';
989 $pdf->MultiCell(80, 4, $titre, 0,
'L');
990 $pdf->SetTextColor(0, 0, 0);
991 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
992 $pdf->SetXY($posxval, $posy);
993 $lib_availability = $outputlangs->transnoentities(
"AvailabilityType".
$object->availability_code) !=
'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities(
"AvailabilityType".
$object->availability_code) : $outputlangs->convToOutputCharset(isset(
$object->availability) ?
$object->availability :
'');
994 $lib_availability = str_replace(
'\n',
"\n", $lib_availability);
995 $pdf->MultiCell(80, 4, $lib_availability, 0,
'L');
997 $posy = $pdf->GetY() + 1;
1001 if (
$object->mode_reglement_code
1002 &&
$object->mode_reglement_code !=
'CHQ'
1003 &&
$object->mode_reglement_code !=
'VIR') {
1004 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1005 $pdf->SetXY($this->marge_gauche, $posy);
1006 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
1007 $pdf->MultiCell(80, 5, $titre, 0,
'L');
1009 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1010 $pdf->SetXY($posxval, $posy);
1011 $lib_mode_reg = $outputlangs->transnoentities(
"PaymentType".
$object->mode_reglement_code) !=
'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities(
"PaymentType".
$object->mode_reglement_code) : $outputlangs->convToOutputCharset(
$object->mode_reglement);
1012 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
1014 $posy = $pdf->GetY() + 2;
1018 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'CHQ') {
1022 $account =
new Account($this->db);
1025 $pdf->SetXY($this->marge_gauche, $posy);
1026 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1027 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->owner_name), 0,
'L', 0);
1028 $posy = $pdf->GetY() + 1;
1031 $pdf->SetXY($this->marge_gauche, $posy);
1032 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1033 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
1034 $posy = $pdf->GetY() + 2;
1037 if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
1038 $pdf->SetXY($this->marge_gauche, $posy);
1039 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1040 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
1041 $posy = $pdf->GetY() + 1;
1044 $pdf->SetXY($this->marge_gauche, $posy);
1045 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1046 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
1047 $posy = $pdf->GetY() + 2;
1054 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'VIR') {
1056 $bankid = (
$object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER :
$object->fk_account);
1060 $account =
new Account($this->db);
1061 $account->fetch($bankid);
1063 $curx = $this->marge_gauche;
1066 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
1089 global $conf, $mysoc, $hookmanager;
1094 $outputlangsbis =
new Translate(
'', $conf);
1096 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
1097 $default_font_size--;
1102 $pdf->SetFont(
'',
'', $default_font_size - 1);
1107 if ($this->page_largeur < 210) {
1110 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
1116 $pdf->SetFillColor(255, 255, 255);
1117 $pdf->SetXY($col1x, $tab2_top);
1118 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"TotalHT") :
''), 0,
'L', 1);
1119 $total_ht = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
$object->multicurrency_total_ht :
$object->total_ht);
1120 $pdf->SetXY($col2x, $tab2_top);
1121 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ht + (!empty(
$object->remise) ?
$object->remise : 0), 0, $outputlangs), 0,
'R', 1);
1124 $pdf->SetFillColor(248, 248, 248);
1126 $total_ttc = (isModEnabled(
"multicurrency") &&
$object->multicurrency_tx != 1) ?
$object->multicurrency_total_ttc :
$object->total_ttc;
1128 $this->atleastoneratenotnull = 0;
1130 $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva[
'0.000']) && is_float($this->tva[
'0.000'])) ?
true :
false);
1131 if (
getDolGlobalString(
'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
1135 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1136 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
1139 foreach ($localtax_rate as $tvakey => $tvaval) {
1143 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1146 if (preg_match(
'/\*/', (
string) $tvakey)) {
1147 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1148 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1150 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1154 $totalvat .= $tvacompl;
1156 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1159 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1161 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1163 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1164 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1170 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1171 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
1174 foreach ($localtax_rate as $tvakey => $tvaval) {
1179 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1182 if (preg_match(
'/\*/', (
string) $tvakey)) {
1183 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1184 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1186 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1190 $totalvat .= $tvacompl;
1192 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1195 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1197 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1199 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1200 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1206 foreach ($this->tva_array as $tvakey => $tvaval) {
1208 $this->atleastoneratenotnull++;
1211 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1214 if (preg_match(
'/\*/', $tvakey)) {
1215 $tvakey = str_replace(
'*',
'', $tvakey);
1216 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1218 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalVAT", $mysoc->country_code) :
'');
1221 $totalvat .=
vatrate($tvaval[
'vatrate'], 1).$tvacompl;
1223 $totalvat .= $tvaval[
'vatcode'].$tvacompl;
1225 $totalvat .= $tvacompl;
1227 $totalvat .=
vatrate($tvaval[
'vatrate'], 1).($tvaval[
'vatcode'] ?
' ('.$tvaval[
'vatcode'].
')' :
'').$tvacompl;
1229 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1231 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1232 $pdf->MultiCell($largcol2, $tab2_hl,
price(
price2num($tvaval[
'amount'],
'MT'), 0, $outputlangs), 0,
'R', 1);
1237 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1238 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1242 foreach ($localtax_rate as $tvakey => $tvaval) {
1247 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1250 if (preg_match(
'/\*/', (
string) $tvakey)) {
1251 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1252 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1254 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1258 $totalvat .= $tvacompl;
1260 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1263 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1265 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1267 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1268 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1274 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1275 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1279 foreach ($localtax_rate as $tvakey => $tvaval) {
1285 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1288 if (preg_match(
'/\*/', (
string) $tvakey)) {
1289 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1290 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1292 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1296 $totalvat .= $tvacompl;
1298 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1301 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1303 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1305 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1306 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1314 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1315 $pdf->SetTextColor(0, 0, 60);
1316 $pdf->SetFillColor(224, 224, 224);
1317 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalTTC", $mysoc->country_code) :
''), $useborder,
'L', 1);
1319 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1320 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1324 $pdf->SetTextColor(0, 0, 0);
1326 $creditnoteamount = 0;
1327 $depositsamount = 0;
1331 $resteapayer =
price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount,
'MT');
1336 if ($deja_regle > 0) {
1340 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1341 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"AlreadyPaid") :
''), 0,
'L', 0);
1342 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1343 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1346 $pdf->SetTextColor(0, 0, 60);
1347 $pdf->SetFillColor(224, 224, 224);
1348 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1349 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"RemainderToPay") :
''), $useborder,
'L', 1);
1351 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1352 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1354 $pdf->SetFont(
'',
'', $default_font_size - 1);
1355 $pdf->SetTextColor(0, 0, 0);
1358 $parameters = array(
'pdf' => &$pdf,
'object' => &
$object,
'outputlangs' => $outputlangs,
'index' => &$index,
'posy' => $posy);
1360 $reshook = $hookmanager->executeHooks(
'afterPDFTotalTable', $parameters, $this);
1362 $this->error = $hookmanager->error;
1363 $this->errors = $hookmanager->errors;
1367 return ($tab2_top + ($tab2_hl * $index));
1444 protected function _pagehead(&$pdf,
$object, $showaddress, $outputlangs, $outputlangsbis =
null, $titlekey =
"PdfOrderTitle")
1447 global $conf, $langs, $hookmanager, $mysoc;
1449 $ltrdirection =
'L';
1450 if ($outputlangs->trans(
"DIRECTION") ==
'rtl') {
1451 $ltrdirection =
'R';
1455 $outputlangs->loadLangs(array(
"main",
"bills",
"propal",
"orders",
"companies"));
1461 $pdf->SetTextColor(0, 0, 60);
1462 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1466 $posy = $this->marge_haute;
1467 $posx = $this->page_largeur - $this->marge_droite - $w;
1469 $pdf->SetXY($this->marge_gauche, $posy);
1473 if ($this->emetteur->logo) {
1474 $logodir = $conf->mycompany->dir_output;
1479 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1481 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1483 if (is_readable($logo)) {
1485 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1487 $pdf->SetTextColor(200, 0, 0);
1488 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1489 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1490 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1493 $text = $this->emetteur->name;
1494 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
1498 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1499 $pdf->SetXY($posx, $posy);
1500 $pdf->SetTextColor(0, 0, 60);
1501 $title = $outputlangs->transnoentities($titlekey);
1502 if (
getDolGlobalInt(
'PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
1504 $title .= $outputlangsbis->transnoentities($titlekey);
1506 $title .=
' '.$outputlangs->convToOutputCharset(
$object->ref);
1507 if (
$object->statut == $object::STATUS_DRAFT) {
1508 $pdf->SetTextColor(128, 0, 0);
1509 $title .=
' - '.$outputlangs->transnoentities(
"NotValidated");
1512 $pdf->MultiCell($w, 3, $title,
'',
'R');
1514 $pdf->SetFont(
'',
'B', $default_font_size);
1529 $pdf->SetFont(
'',
'', $default_font_size - 2);
1533 $pdf->SetXY($posx, $posy);
1534 $pdf->SetTextColor(0, 0, 60);
1535 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".
dol_trunc($outputlangs->convToOutputCharset(
$object->ref_client), 65),
'',
'R');
1540 if (!empty(
$object->project->ref)) {
1542 $pdf->SetXY($posx, $posy);
1543 $pdf->SetTextColor(0, 0, 60);
1544 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty(
$object->project->title) ?
'' :
$object->project->title),
'',
'R');
1550 if (!empty(
$object->project->ref)) {
1551 $outputlangs->load(
"projects");
1553 $pdf->SetXY($posx, $posy);
1554 $pdf->SetTextColor(0, 0, 60);
1555 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefProject").
" : ".(empty(
$object->project->ref) ?
'' :
$object->project->ref),
'',
'R');
1561 $pdf->SetXY($posx, $posy);
1562 $pdf->SetTextColor(0, 0, 60);
1563 $title = $outputlangs->transnoentities(
"OrderDate");
1564 if (
getDolGlobalInt(
'PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
1565 $title .=
' - '.$outputlangsbis->transnoentities(
"DateInvoice");
1567 $pdf->MultiCell($w, 3, $title.
" : ".
dol_print_date(
$object->date,
"day",
false, $outputlangs,
true),
'',
'R');
1571 $pdf->SetXY($posx, $posy);
1572 $pdf->SetTextColor(0, 0, 60);
1573 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities(
$object->thirdparty->code_client),
'',
'R');
1578 $arrayidcontact =
$object->getIdContact(
'internal',
'SALESREPFOLL');
1579 if (count($arrayidcontact) > 0) {
1580 $usertmp =
new User($this->db);
1581 $usertmp->fetch($arrayidcontact[0]);
1583 $pdf->SetXY($posx, $posy);
1584 $pdf->SetTextColor(0, 0, 60);
1585 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"SalesRepresentative").
" : ".$usertmp->getFullName($langs),
'',
'R');
1593 $current_y = $pdf->getY();
1595 if ($current_y < $pdf->getY()) {
1596 $top_shift = $pdf->getY() - $current_y;
1601 $carac_emetteur =
'';
1603 $arrayidcontact =
$object->getIdContact(
'internal',
'SALESREPFOLL');
1604 if (count($arrayidcontact) > 0) {
1605 $object->fetch_user($arrayidcontact[0]);
1606 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
1607 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$labelbeforecontactname.
" ".$outputlangs->convToOutputCharset(
$object->user->getFullName($outputlangs));
1609 $carac_emetteur .= (
getDolGlobalInt(
'PDF_SHOW_PHONE_AFTER_USER_CONTACT') && !empty(
$object->user->office_phone)) ?
$object->user->office_phone :
'';
1613 $carac_emetteur .=
"\n";
1620 $posy += $top_shift;
1621 $posx = $this->marge_gauche;
1623 $posx = $this->page_largeur - $this->marge_droite - 80;
1627 $widthrecbox =
getDolGlobalInt(
'MAIN_PDF_USE_ISO_LOCATION') ? 92 : 82;
1632 $pdf->SetTextColor(0, 0, 0);
1633 $pdf->SetFont(
'',
'', $default_font_size - 2);
1634 $pdf->SetXY($posx, $posy - 5);
1635 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillFrom"), 0, $ltrdirection);
1636 $pdf->SetXY($posx, $posy);
1637 $pdf->SetFillColor(230, 230, 230);
1638 $pdf->MultiCell($widthrecbox, $hautcadre,
"", 0,
'R', 1);
1639 $pdf->SetTextColor(0, 0, 60);
1644 $pdf->SetXY($posx + 2, $posy + 3);
1645 $pdf->SetFont(
'',
'B', $default_font_size);
1646 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
1647 $posy = $pdf->getY();
1651 $pdf->SetXY($posx + 2, $posy);
1652 $pdf->SetFont(
'',
'', $default_font_size - 1);
1653 $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, $ltrdirection);
1656 $usecontact =
false;
1657 $arrayidcontact =
$object->getIdContact(
'external',
'CUSTOMER');
1658 if (count($arrayidcontact) > 0) {
1660 $result =
$object->fetch_contact($arrayidcontact[0]);
1665 $thirdparty =
$object->contact;
1667 $thirdparty =
$object->thirdparty;
1670 if (is_object($thirdparty)) {
1678 $widthrecbox =
getDolGlobalInt(
'MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100;
1679 if ($this->page_largeur < 210) {
1683 $posy += $top_shift;
1684 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1686 $posx = $this->marge_gauche;
1691 $pdf->SetTextColor(0, 0, 0);
1692 $pdf->SetFont(
'',
'', $default_font_size - 2);
1693 $pdf->SetXY($posx + 2, $posy - 5);
1694 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo"), 0, $ltrdirection);
1695 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1699 $pdf->SetXY($posx + 2, $posy + 3);
1700 $pdf->SetFont(
'',
'B', $default_font_size);
1702 $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
1704 $posy = $pdf->getY();
1707 $pdf->SetFont(
'',
'', $default_font_size - 1);
1708 $pdf->SetXY($posx + 2, $posy);
1710 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
1713 $pdf->SetTextColor(0, 0, 0);