163 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
166 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
168 dol_syslog(
"write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang :
'null'));
170 if (!is_object($outputlangs)) {
171 $outputlangs = $langs;
175 $outputlangs->charset_output =
'ISO-8859-1';
179 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
186 global $outputlangsbis;
187 $outputlangsbis =
null;
189 $outputlangsbis =
new Translate(
'', $conf);
191 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
194 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
202 $realpatharray = array();
203 $this->atleastonephoto =
false;
205 $objphoto =
new Product($this->db);
207 for ($i = 0; $i < $nblines; $i++) {
208 if (empty(
$object->lines[$i]->fk_product)) {
214 $objphoto->fetch(
$object->lines[$i]->fk_product);
217 $pdir[0] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
218 $pdir[1] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
220 $pdir[0] =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
221 $pdir[1] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
225 foreach ($pdir as $midir) {
227 if ($conf->entity != $objphoto->entity) {
228 $dir = $conf->product->multidir_output[$objphoto->entity].
'/'.$midir;
230 $dir = $conf->product->dir_output.
'/'.$midir;
233 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
235 if ($obj[
'photo_vignette']) {
236 $filename = $obj[
'photo_vignette'];
238 $filename = $obj[
'photo'];
241 $filename = $obj[
'photo'];
244 $realpath = $dir.$filename;
246 $this->atleastonephoto =
true;
251 if ($realpath && $arephoto) {
252 $realpatharray[$i] = $realpath;
267 $file = $dir.
"/SPECIMEN.pdf";
271 $file = $dir.
"/".$objectref.
".pdf";
274 if (!file_exists($dir)) {
276 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
281 if (file_exists($dir)) {
283 if (!is_object($hookmanager)) {
284 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
287 $hookmanager->initHooks(array(
'pdfgeneration'));
288 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
290 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
293 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
298 $pdf->SetAutoPageBreak(1, 0);
300 $heightforinfotot = 40;
302 $heightforfooter = $this->marge_basse + 8;
304 $heightforfooter += 6;
307 if (class_exists(
'TCPDF')) {
308 $pdf->setPrintHeader(
false);
309 $pdf->setPrintFooter(
false);
314 $logodir = $conf->mycompany->dir_output;
315 if (!empty($conf->mycompany->multidir_output[
$object->entity])) {
316 $logodir = $conf->mycompany->multidir_output[
$object->entity];
318 $pagecount = $pdf->setSourceFile($logodir.
'/'.
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
319 $tplidx = $pdf->importPage(1);
324 $pdf->SetDrawColor(128, 128, 128);
326 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
327 $pdf->SetSubject($outputlangs->transnoentities(
"PdfOrderTitle"));
328 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
329 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
330 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".$outputlangs->transnoentities(
"PdfOrderTitle").
" ".$outputlangs->convToOutputCharset(
$object->thirdparty->name));
332 $pdf->SetCompression(
false);
336 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
339 for ($i = 0; $i < $nblines; $i++) {
340 if (
$object->lines[$i]->remise_percent) {
341 $this->atleastonediscount++;
348 if (!empty($tplidx)) {
349 $pdf->useTemplate($tplidx);
352 $top_shift = $this->
_pagehead($pdf,
$object, 1, $outputlangs, (is_object($outputlangsbis) ? $outputlangsbis :
null));
353 $pdf->SetFont(
'',
'', $default_font_size - 1);
354 $pdf->MultiCell(0, 3,
'');
355 $pdf->SetTextColor(0, 0, 0);
358 $tab_top = 90 + $top_shift;
359 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
361 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
363 $nexY = $tab_top - 1;
366 $height_incoterms = 0;
367 if (isModEnabled(
'incoterm')) {
368 $desc_incoterms =
$object->getIncotermsForPDF();
369 if ($desc_incoterms) {
372 $pdf->SetFont(
'',
'', $default_font_size - 1);
373 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
374 $nexY = max($pdf->GetY(), $nexY);
375 $height_incoterms = $nexY - $tab_top;
378 $pdf->SetDrawColor(192, 192, 192);
379 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
381 $tab_top = $nexY + 6;
386 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
389 if (is_object(
$object->thirdparty)) {
390 $salereparray =
$object->thirdparty->getSalesRepresentatives($user);
391 $salerepobj =
new User($this->db);
392 $salerepobj->fetch($salereparray[0][
'id']);
393 if (!empty($salerepobj->signature)) {
394 $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
399 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
400 if (!empty($extranote)) {
404 $pagenb = $pdf->getPage();
408 $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
409 $pageposbeforenote = $pagenb;
416 $pdf->startTransaction();
418 $pdf->SetFont(
'',
'', $default_font_size - 1);
419 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
421 $pageposafternote = $pdf->getPage();
422 $posyafter = $pdf->GetY();
424 if ($pageposafternote > $pageposbeforenote) {
425 $pdf->rollbackTransaction(
true);
428 while ($pagenb < $pageposafternote) {
431 if (!empty($tplidx)) {
432 $pdf->useTemplate($tplidx);
438 $pdf->setTopMargin($tab_top_newpage);
440 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
444 $pdf->setPage($pageposbeforenote);
445 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
446 $pdf->SetFont(
'',
'', $default_font_size - 1);
447 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
448 $pageposafternote = $pdf->getPage();
450 $posyafter = $pdf->GetY();
452 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
453 $pdf->AddPage(
'',
'',
true);
456 $pdf->setPage($pageposafternote);
457 $pdf->setTopMargin($tab_top_newpage);
459 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
465 $i = $pageposbeforenote;
466 while ($i < $pageposafternote) {
470 $pdf->SetDrawColor(128, 128, 128);
472 if ($i > $pageposbeforenote) {
473 $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
474 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
476 $height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
477 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
481 $pdf->setPageOrientation(
'', 1, 0);
488 $pdf->setPage($pageposafternote);
489 if (!empty($tplidx)) {
490 $pdf->useTemplate($tplidx);
495 $height_note = $posyafter - $tab_top_newpage;
496 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
499 $pdf->commitTransaction();
500 $posyafter = $pdf->GetY();
501 $height_note = $posyafter - $tab_top;
502 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
505 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
507 $pdf->AddPage(
'',
'',
true);
510 $pdf->setPage($pageposafternote);
511 if (!empty($tplidx)) {
512 $pdf->useTemplate($tplidx);
518 $posyafter = $tab_top_newpage;
522 $tab_height = $tab_height - $height_note;
523 $tab_top = $posyafter + 6;
533 $pdf->startTransaction();
534 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
535 $pdf->rollbackTransaction(
true);
537 $nexY = $tab_top + $this->tabTitleHeight;
540 $pageposbeforeprintlines = $pdf->getPage();
541 $pagenb = $pageposbeforeprintlines;
542 for ($i = 0; $i < $nblines; $i++) {
544 $pdf->SetFont(
'',
'', $default_font_size - 1);
545 $pdf->SetTextColor(0, 0, 0);
548 $imglinesize = array();
549 if (!empty($realpatharray[$i])) {
553 $pdf->setTopMargin($tab_top_newpage);
554 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
555 $pageposbefore = $pdf->getPage();
558 $showpricebeforepagebreak = 1;
560 $posYAfterDescription = 0;
564 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
565 $pdf->AddPage(
'',
'',
true);
566 if (!empty($tplidx)) {
567 $pdf->useTemplate($tplidx);
569 $pdf->setPage($pageposbefore + 1);
571 $curY = $tab_top_newpage;
575 $showpricebeforepagebreak = 1;
577 $showpricebeforepagebreak = 0;
581 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height'])) {
582 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY + 1, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
584 $posYAfterImage = $curY + $imglinesize[
'height'];
590 $pdf->startTransaction();
593 $pageposafter = $pdf->getPage();
595 if ($pageposafter > $pageposbefore) {
596 $pdf->rollbackTransaction(
true);
597 $pageposafter = $pageposbefore;
599 $pdf->setPageOrientation(
'', 1, $heightforfooter);
602 $pageposafter = $pdf->getPage();
603 $posyafter = $pdf->GetY();
604 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
605 if ($i == ($nblines - 1)) {
606 $pdf->AddPage(
'',
'',
true);
607 if (!empty($tplidx)) {
608 $pdf->useTemplate($tplidx);
610 $pdf->setPage($pageposafter + 1);
616 $showpricebeforepagebreak = 1;
618 $showpricebeforepagebreak = 0;
622 $pdf->commitTransaction();
624 $posYAfterDescription = $pdf->GetY();
628 $nexY = max($pdf->GetY(), $posYAfterImage);
631 $pageposafter = $pdf->getPage();
633 $pdf->setPage($pageposbefore);
634 $pdf->setTopMargin($this->marge_haute);
635 $pdf->setPageOrientation(
'', 1, 0);
638 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
639 $pdf->setPage($pageposafter);
640 $curY = $tab_top_newpage;
643 $pdf->SetFont(
'',
'', $default_font_size - 1);
654 $nexY = max($pdf->GetY(), $nexY);
661 $nexY = max($pdf->GetY(), $nexY);
669 $nexY = max($pdf->GetY(), $nexY);
677 $nexY = max($pdf->GetY(), $nexY);
684 $nexY = max($pdf->GetY(), $nexY);
691 $nexY = max($pdf->GetY(), $nexY);
698 $nexY = max($pdf->GetY(), $nexY);
702 if (!empty(
$object->lines[$i]->array_options)) {
703 foreach (
$object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
707 $nexY = max($pdf->GetY(), $nexY);
718 'outputlangs' => $outputlangs,
719 'hidedetails' => $hidedetails
721 $reshook = $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
725 if (isModEnabled(
"multicurrency") &&
$object->multicurrency_tx != 1) {
726 $tvaligne =
$object->lines[$i]->multicurrency_total_tva;
728 $tvaligne =
$object->lines[$i]->total_tva;
731 $localtax1ligne =
$object->lines[$i]->total_localtax1;
732 $localtax2ligne =
$object->lines[$i]->total_localtax2;
733 $localtax1_rate =
$object->lines[$i]->localtax1_tx;
734 $localtax2_rate =
$object->lines[$i]->localtax2_tx;
735 $localtax1_type =
$object->lines[$i]->localtax1_type;
736 $localtax2_type =
$object->lines[$i]->localtax2_type;
738 $vatrate = (string)
$object->lines[$i]->tva_tx;
741 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
742 && (!empty($localtax1_rate) || !empty($localtax2_rate))) {
744 $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] :
'';
745 $localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] :
'';
749 if ($localtax1_type && $localtax1ligne != 0) {
750 if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) {
751 $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne;
753 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
756 if ($localtax2_type && $localtax2ligne != 0) {
757 if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
758 $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
760 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
764 if ((
$object->lines[$i]->info_bits & 0x01) == 0x01) {
769 if (!isset($this->tva[$vatrate])) {
770 $this->tva[$vatrate] = 0;
772 $this->tva[$vatrate] += $tvaligne;
773 $vatcode =
$object->lines[$i]->vat_src_code;
774 if (empty($this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'])) {
775 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] = 0;
777 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')] = array(
'vatrate' => $vatrate,
'vatcode' => $vatcode,
'amount' => $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] + $tvaligne);
780 if (
getDolGlobalInt(
'MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
781 $pdf->setPage($pageposafter);
782 $pdf->SetLineStyle(array(
'dash' =>
'1,1',
'color' => array(80, 80, 80)));
784 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
785 $pdf->SetLineStyle(array(
'dash' => 0));
790 while ($pagenb < $pageposafter) {
791 $pdf->setPage($pagenb);
792 if ($pagenb == $pageposbeforeprintlines) {
793 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
795 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
799 $pdf->setPage($pagenb);
800 $pdf->setPageOrientation(
'', 1, 0);
804 if (!empty($tplidx)) {
805 $pdf->useTemplate($tplidx);
808 if (isset(
$object->lines[$i + 1]->pagebreak) &&
$object->lines[$i + 1]->pagebreak) {
809 if ($pagenb == $pageposafter) {
810 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
812 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
817 if (!empty($tplidx)) {
818 $pdf->useTemplate($tplidx);
828 if ($pagenb == $pageposbeforeprintlines) {
829 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0,
$object->multicurrency_code, $outputlangsbis);
831 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0,
$object->multicurrency_code, $outputlangsbis);
833 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
851 if (method_exists($pdf,
'AliasNbPages')) {
852 $pdf->AliasNbPages();
857 $pdf->Output($file,
'F');
860 $hookmanager->initHooks(array(
'pdfgeneration'));
861 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
863 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
865 $this->error = $hookmanager->error;
866 $this->errors = $hookmanager->errors;
871 $this->result = array(
'fullpath' => $file);
875 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
879 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"COMMANDE_OUTPUTDIR");
909 global $conf, $mysoc;
912 $pdf->SetFont(
'',
'', $default_font_size - 1);
914 $diffsizetitle = (!
getDolGlobalString(
'PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
917 if ($this->emetteur->country_code ==
'FR' && empty($mysoc->tva_assuj)) {
918 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
919 $pdf->SetXY($this->marge_gauche, $posy);
920 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"VATIsNotUsedForInvoice"), 0,
'L', 0);
922 $posy = $pdf->GetY() + 4;
927 $diffsizetitle = (!
getDolGlobalString(
'PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
931 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
932 $pdf->SetXY($this->marge_gauche, $posy);
933 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
934 $pdf->MultiCell(43, 4, $titre, 0,
'L');
936 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
937 $pdf->SetXY($posxval, $posy);
938 $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);
939 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
940 if (
$object->deposit_percent > 0) {
941 $lib_condition_paiement = str_replace(
'__DEPOSIT_PERCENT__', (
string)
$object->deposit_percent, $lib_condition_paiement);
943 $pdf->MultiCell(67, 4, $lib_condition_paiement, 0,
'L');
945 $posy = $pdf->GetY() + 3;
976 if (!empty(
$object->delivery_date)) {
977 $outputlangs->load(
"sendings");
978 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
979 $pdf->SetXY($this->marge_gauche, $posy);
980 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
981 $pdf->MultiCell(80, 4, $titre, 0,
'L');
982 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
983 $pdf->SetXY($posxval, $posy);
985 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
987 $posy = $pdf->GetY() + 1;
989 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
990 $pdf->SetXY($this->marge_gauche, $posy);
991 $titre = $outputlangs->transnoentities(
"AvailabilityPeriod").
':';
992 $pdf->MultiCell(80, 4, $titre, 0,
'L');
993 $pdf->SetTextColor(0, 0, 0);
994 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
995 $pdf->SetXY($posxval, $posy);
996 $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 :
'');
997 $lib_availability = str_replace(
'\n',
"\n", $lib_availability);
998 $pdf->MultiCell(80, 4, $lib_availability, 0,
'L');
1000 $posy = $pdf->GetY() + 1;
1004 if (
$object->mode_reglement_code
1005 &&
$object->mode_reglement_code !=
'CHQ'
1006 &&
$object->mode_reglement_code !=
'VIR') {
1007 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1008 $pdf->SetXY($this->marge_gauche, $posy);
1009 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
1010 $pdf->MultiCell(80, 5, $titre, 0,
'L');
1012 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1013 $pdf->SetXY($posxval, $posy);
1014 $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);
1015 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
1017 $posy = $pdf->GetY() + 2;
1021 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'CHQ') {
1025 $account =
new Account($this->db);
1028 $pdf->SetXY($this->marge_gauche, $posy);
1029 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1030 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->owner_name), 0,
'L', 0);
1031 $posy = $pdf->GetY() + 1;
1034 $pdf->SetXY($this->marge_gauche, $posy);
1035 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1036 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
1037 $posy = $pdf->GetY() + 2;
1040 if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
1041 $pdf->SetXY($this->marge_gauche, $posy);
1042 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1043 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
1044 $posy = $pdf->GetY() + 1;
1047 $pdf->SetXY($this->marge_gauche, $posy);
1048 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1049 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
1050 $posy = $pdf->GetY() + 2;
1057 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'VIR') {
1059 $bankid = (
$object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER :
$object->fk_account);
1063 $account =
new Account($this->db);
1064 $account->fetch($bankid);
1066 $curx = $this->marge_gauche;
1069 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
1092 global $conf, $mysoc, $hookmanager;
1097 $outputlangsbis =
new Translate(
'', $conf);
1099 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
1100 $default_font_size--;
1105 $pdf->SetFont(
'',
'', $default_font_size - 1);
1110 if ($this->page_largeur < 210) {
1113 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
1119 $pdf->SetFillColor(255, 255, 255);
1120 $pdf->SetXY($col1x, $tab2_top);
1121 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"TotalHT") :
''), 0,
'L', 1);
1122 $total_ht = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
$object->multicurrency_total_ht :
$object->total_ht);
1123 $pdf->SetXY($col2x, $tab2_top);
1124 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ht + (!empty(
$object->remise) ?
$object->remise : 0), 0, $outputlangs), 0,
'R', 1);
1127 $pdf->SetFillColor(248, 248, 248);
1129 $total_ttc = (isModEnabled(
"multicurrency") &&
$object->multicurrency_tx != 1) ?
$object->multicurrency_total_ttc :
$object->total_ttc;
1131 $this->atleastoneratenotnull = 0;
1133 $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva[
'0.000']) && is_float($this->tva[
'0.000'])) ?
true :
false);
1134 if (
getDolGlobalString(
'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
1138 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1139 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
1142 foreach ($localtax_rate as $tvakey => $tvaval) {
1146 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1149 if (preg_match(
'/\*/', (
string) $tvakey)) {
1150 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1151 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1153 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1157 $totalvat .= $tvacompl;
1159 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1162 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1164 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1166 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1167 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1173 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1174 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
1177 foreach ($localtax_rate as $tvakey => $tvaval) {
1182 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1185 if (preg_match(
'/\*/', (
string) $tvakey)) {
1186 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1187 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1189 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1193 $totalvat .= $tvacompl;
1195 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1198 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1200 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1202 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1203 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1209 foreach ($this->tva_array as $tvakey => $tvaval) {
1211 $this->atleastoneratenotnull++;
1214 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1217 if (preg_match(
'/\*/', $tvakey)) {
1218 $tvakey = str_replace(
'*',
'', $tvakey);
1219 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1221 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalVAT", $mysoc->country_code) :
'');
1224 $totalvat .=
vatrate($tvaval[
'vatrate'], 1).$tvacompl;
1226 $totalvat .= $tvaval[
'vatcode'].$tvacompl;
1228 $totalvat .= $tvacompl;
1230 $totalvat .=
vatrate($tvaval[
'vatrate'], 1).($tvaval[
'vatcode'] ?
' ('.$tvaval[
'vatcode'].
')' :
'').$tvacompl;
1232 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1234 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1235 $pdf->MultiCell($largcol2, $tab2_hl,
price(
price2num($tvaval[
'amount'],
'MT'), 0, $outputlangs), 0,
'R', 1);
1240 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1241 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1245 foreach ($localtax_rate as $tvakey => $tvaval) {
1250 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1253 if (preg_match(
'/\*/', (
string) $tvakey)) {
1254 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1255 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1257 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1261 $totalvat .= $tvacompl;
1263 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1266 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1268 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1270 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1271 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1277 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1278 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1282 foreach ($localtax_rate as $tvakey => $tvaval) {
1288 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1291 if (preg_match(
'/\*/', (
string) $tvakey)) {
1292 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1293 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1295 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1299 $totalvat .= $tvacompl;
1301 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1304 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1306 $total_localtax = ((isModEnabled(
"multicurrency") && isset(
$object->multicurrency_tx) &&
$object->multicurrency_tx != 1) ?
price2num($tvaval *
$object->multicurrency_tx,
'MT') : $tvaval);
1308 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1309 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R', 1);
1317 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1318 $pdf->SetTextColor(0, 0, 60);
1319 $pdf->SetFillColor(224, 224, 224);
1320 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalTTC", $mysoc->country_code) :
''), $useborder,
'L', 1);
1322 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1323 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1327 $pdf->SetTextColor(0, 0, 0);
1329 $creditnoteamount = 0;
1330 $depositsamount = 0;
1334 $resteapayer =
price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount,
'MT');
1339 if ($deja_regle > 0) {
1343 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1344 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"AlreadyPaid") :
''), 0,
'L', 0);
1345 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1346 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1349 $pdf->SetTextColor(0, 0, 60);
1350 $pdf->SetFillColor(224, 224, 224);
1351 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1352 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"RemainderToPay") :
''), $useborder,
'L', 1);
1354 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1355 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1357 $pdf->SetFont(
'',
'', $default_font_size - 1);
1358 $pdf->SetTextColor(0, 0, 0);
1361 $parameters = array(
'pdf' => &$pdf,
'object' => &
$object,
'outputlangs' => $outputlangs,
'index' => &$index,
'posy' => $posy);
1363 $reshook = $hookmanager->executeHooks(
'afterPDFTotalTable', $parameters, $this);
1365 $this->error = $hookmanager->error;
1366 $this->errors = $hookmanager->errors;
1370 return ($tab2_top + ($tab2_hl * $index));
1447 protected function _pagehead(&$pdf,
$object, $showaddress, $outputlangs, $outputlangsbis =
null, $titlekey =
"PdfOrderTitle")
1450 global $conf, $langs, $hookmanager, $mysoc;
1452 $ltrdirection =
'L';
1453 if ($outputlangs->trans(
"DIRECTION") ==
'rtl') {
1454 $ltrdirection =
'R';
1458 $outputlangs->loadLangs(array(
"main",
"bills",
"propal",
"orders",
"companies"));
1464 $pdf->SetTextColor(0, 0, 60);
1465 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1469 $posy = $this->marge_haute;
1470 $posx = $this->page_largeur - $this->marge_droite - $w;
1472 $pdf->SetXY($this->marge_gauche, $posy);
1476 if ($this->emetteur->logo) {
1477 $logodir = $conf->mycompany->dir_output;
1482 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1484 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1486 if (is_readable($logo)) {
1488 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1490 $pdf->SetTextColor(200, 0, 0);
1491 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1492 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1493 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1496 $text = $this->emetteur->name;
1497 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
1501 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1502 $pdf->SetXY($posx, $posy);
1503 $pdf->SetTextColor(0, 0, 60);
1504 $title = $outputlangs->transnoentities($titlekey);
1505 if (
getDolGlobalInt(
'PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
1507 $title .= $outputlangsbis->transnoentities($titlekey);
1509 $title .=
' '.$outputlangs->convToOutputCharset(
$object->ref);
1510 if (
$object->statut == $object::STATUS_DRAFT) {
1511 $pdf->SetTextColor(128, 0, 0);
1512 $title .=
' - '.$outputlangs->transnoentities(
"NotValidated");
1515 $pdf->MultiCell($w, 3, $title,
'',
'R');
1517 $pdf->SetFont(
'',
'B', $default_font_size);
1532 $pdf->SetFont(
'',
'', $default_font_size - 2);
1536 $pdf->SetXY($posx, $posy);
1537 $pdf->SetTextColor(0, 0, 60);
1538 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".
dol_trunc($outputlangs->convToOutputCharset(
$object->ref_client), 65),
'',
'R');
1543 if (!empty(
$object->project->ref)) {
1545 $pdf->SetXY($posx, $posy);
1546 $pdf->SetTextColor(0, 0, 60);
1547 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty(
$object->project->title) ?
'' :
$object->project->title),
'',
'R');
1553 if (!empty(
$object->project->ref)) {
1554 $outputlangs->load(
"projects");
1556 $pdf->SetXY($posx, $posy);
1557 $pdf->SetTextColor(0, 0, 60);
1558 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefProject").
" : ".(empty(
$object->project->ref) ?
'' :
$object->project->ref),
'',
'R');
1564 $pdf->SetXY($posx, $posy);
1565 $pdf->SetTextColor(0, 0, 60);
1566 $title = $outputlangs->transnoentities(
"OrderDate");
1567 if (
getDolGlobalInt(
'PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
1568 $title .=
' - '.$outputlangsbis->transnoentities(
"DateInvoice");
1570 $pdf->MultiCell($w, 3, $title.
" : ".
dol_print_date(
$object->date,
"day",
false, $outputlangs,
true),
'',
'R');
1574 $pdf->SetXY($posx, $posy);
1575 $pdf->SetTextColor(0, 0, 60);
1576 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities(
$object->thirdparty->code_client),
'',
'R');
1581 $arrayidcontact =
$object->getIdContact(
'internal',
'SALESREPFOLL');
1582 if (count($arrayidcontact) > 0) {
1583 $usertmp =
new User($this->db);
1584 $usertmp->fetch($arrayidcontact[0]);
1586 $pdf->SetXY($posx, $posy);
1587 $pdf->SetTextColor(0, 0, 60);
1588 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"SalesRepresentative").
" : ".$usertmp->getFullName($langs),
'',
'R');
1596 $current_y = $pdf->getY();
1598 if ($current_y < $pdf->getY()) {
1599 $top_shift = $pdf->getY() - $current_y;
1604 $carac_emetteur =
'';
1606 $arrayidcontact =
$object->getIdContact(
'internal',
'SALESREPFOLL');
1607 if (count($arrayidcontact) > 0) {
1608 $object->fetch_user($arrayidcontact[0]);
1609 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
1610 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$labelbeforecontactname.
" ".$outputlangs->convToOutputCharset(
$object->user->getFullName($outputlangs));
1612 $carac_emetteur .= (
getDolGlobalInt(
'PDF_SHOW_PHONE_AFTER_USER_CONTACT') && !empty(
$object->user->office_phone)) ?
$object->user->office_phone :
'';
1616 $carac_emetteur .=
"\n";
1623 $posy += $top_shift;
1624 $posx = $this->marge_gauche;
1626 $posx = $this->page_largeur - $this->marge_droite - 80;
1630 $widthrecbox =
getDolGlobalInt(
'MAIN_PDF_USE_ISO_LOCATION') ? 92 : 82;
1635 $pdf->SetTextColor(0, 0, 0);
1636 $pdf->SetFont(
'',
'', $default_font_size - 2);
1637 $pdf->SetXY($posx, $posy - 5);
1638 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillFrom"), 0, $ltrdirection);
1639 $pdf->SetXY($posx, $posy);
1640 $pdf->SetFillColor(230, 230, 230);
1641 $pdf->MultiCell($widthrecbox, $hautcadre,
"", 0,
'R', 1);
1642 $pdf->SetTextColor(0, 0, 60);
1647 $pdf->SetXY($posx + 2, $posy + 3);
1648 $pdf->SetFont(
'',
'B', $default_font_size);
1649 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
1650 $posy = $pdf->getY();
1654 $pdf->SetXY($posx + 2, $posy);
1655 $pdf->SetFont(
'',
'', $default_font_size - 1);
1656 $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, $ltrdirection);
1659 $usecontact =
false;
1660 $arrayidcontact =
$object->getIdContact(
'external',
'CUSTOMER');
1661 if (count($arrayidcontact) > 0) {
1663 $result =
$object->fetch_contact($arrayidcontact[0]);
1668 $thirdparty =
$object->contact;
1670 $thirdparty =
$object->thirdparty;
1673 if (is_object($thirdparty)) {
1681 $widthrecbox =
getDolGlobalInt(
'MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100;
1682 if ($this->page_largeur < 210) {
1686 $posy += $top_shift;
1687 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1689 $posx = $this->marge_gauche;
1694 $pdf->SetTextColor(0, 0, 0);
1695 $pdf->SetFont(
'',
'', $default_font_size - 2);
1696 $pdf->SetXY($posx + 2, $posy - 5);
1697 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo"), 0, $ltrdirection);
1698 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1702 $pdf->SetXY($posx + 2, $posy + 3);
1703 $pdf->SetFont(
'',
'B', $default_font_size);
1705 $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
1707 $posy = $pdf->getY();
1710 $pdf->SetFont(
'',
'', $default_font_size - 1);
1711 $pdf->SetXY($posx + 2, $posy);
1713 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
1716 $pdf->SetTextColor(0, 0, 0);