30 require_once DOL_DOCUMENT_ROOT.
'/core/modules/delivery/modules_delivery.php';
31 require_once DOL_DOCUMENT_ROOT.
'/delivery/class/delivery.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
59 public $update_main_doc_field;
70 public $phpmin = array(7, 0);
76 public $version =
'dolibarr';
101 public $marge_droite;
126 global $conf, $langs, $mysoc;
129 $langs->loadLangs(array(
"main",
"bills",
"sendings",
"companies"));
132 $this->
name =
"Typhon";
133 $this->
description = $langs->trans(
"DocumentModelTyphon");
134 $this->update_main_doc_field = 1;
139 $this->page_largeur = $formatarray[
'width'];
140 $this->page_hauteur = $formatarray[
'height'];
141 $this->format = array($this->page_largeur, $this->page_hauteur);
147 $this->option_logo = 1;
148 $this->option_tva = 1;
151 $this->emetteur = $mysoc;
152 if (empty($this->emetteur->country_code)) {
153 $this->emetteur->country_code = substr($langs->defaultlang, -2);
157 $this->posxdesc = $this->marge_gauche + 1;
158 $this->posxcomm = 112;
161 $this->posxqty = 165;
162 $this->posxremainingqty = 185;
165 if ($this->page_largeur < 210) {
166 $this->posxcomm -= 20;
169 $this->posxqty -= 20;
174 $this->tva = array();
175 $this->tva_array = array();
176 $this->localtax1 = array();
177 $this->localtax2 = array();
178 $this->atleastoneratenotnull = 0;
179 $this->atleastonediscount = 0;
195 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
198 global $user, $langs, $conf, $mysoc, $hookmanager;
200 if (!is_object($outputlangs)) {
201 $outputlangs = $langs;
204 if (!empty($conf->global->MAIN_USE_FPDF)) {
205 $outputlangs->charset_output =
'ISO-8859-1';
209 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"sendings",
"deliveries"));
211 if ($conf->expedition->dir_output) {
212 $object->fetch_thirdparty();
215 if ($object->specimen) {
216 $dir = $conf->expedition->dir_output.
"/receipt";
217 $file = $dir.
"/SPECIMEN.pdf";
220 $dir = $conf->expedition->dir_output.
"/receipt/".$objectref;
221 $file = $dir.
"/".$objectref.
".pdf";
224 if (!file_exists($dir)) {
226 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
231 if (file_exists($dir)) {
233 if (!is_object($hookmanager)) {
234 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
237 $hookmanager->initHooks(array(
'pdfgeneration'));
238 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
240 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
242 $nblines = count($object->lines);
247 $heightforinfotot = 30;
248 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
249 $heightforfooter = $this->marge_basse + 8;
250 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
251 $heightforfooter += 6;
253 $pdf->SetAutoPageBreak(1, 0);
255 if (class_exists(
'TCPDF')) {
256 $pdf->setPrintHeader(
false);
257 $pdf->setPrintFooter(
false);
261 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
262 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
263 $tplidx = $pdf->importPage(1);
268 $result = $expedition->fetch($object->origin_id);
271 if ($expedition->origin ==
'commande') {
272 $commande->fetch($expedition->origin_id);
274 $object->commande = $commande;
275 $object->commande->loadExpeditions();
280 $pdf->SetDrawColor(128, 128, 128);
282 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
283 $pdf->SetSubject($outputlangs->transnoentities(
"DeliveryOrder"));
284 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
285 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
286 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"DeliveryOrder"));
288 $pdf->SetCompression(
false);
291 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
315 if (!empty($tplidx)) {
316 $pdf->useTemplate($tplidx);
319 $this->
_pagehead($pdf, $object, 1, $outputlangs);
320 $pdf->SetFont(
'',
'', $default_font_size - 1);
321 $pdf->MultiCell(0, 3,
'');
322 $pdf->SetTextColor(0, 0, 0);
325 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
327 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
330 $height_incoterms = 0;
332 $desc_incoterms = $object->getIncotermsForPDF();
333 if ($desc_incoterms) {
336 $pdf->SetFont(
'',
'', $default_font_size - 1);
337 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
338 $nexY = $pdf->GetY();
339 $height_incoterms = $nexY - $tab_top;
342 $pdf->SetDrawColor(192, 192, 192);
343 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
345 $tab_top = $nexY + 6;
346 $height_incoterms += 4;
351 if (!empty($object->note_public)) {
352 $tab_top = 88 + $height_incoterms;
354 $pdf->SetFont(
'',
'', $default_font_size - 1);
355 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($object->note_public), 0, 1);
356 $nexY = $pdf->GetY();
357 $height_note = $nexY - $tab_top;
360 $pdf->SetDrawColor(192, 192, 192);
361 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
363 $tab_height = $tab_height - $height_note;
364 $tab_top = $nexY + 6;
369 $iniY = $tab_top + 11;
370 $curY = $tab_top + 11;
371 $nexY = $tab_top + 11;
374 for ($i = 0; $i < $nblines; $i++) {
376 $pdf->SetFont(
'',
'', $default_font_size - 1);
377 $pdf->SetTextColor(0, 0, 0);
379 $pdf->setTopMargin($tab_top_newpage);
380 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
381 $pageposbefore = $pdf->getPage();
384 $curX = $this->posxdesc - 1;
386 $showpricebeforepagebreak = 1;
388 $pdf->startTransaction();
389 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxcomm - $curX, 3, $curX, $curY, $hideref, $hidedesc);
390 $pageposafter = $pdf->getPage();
391 if ($pageposafter > $pageposbefore) {
392 $pdf->rollbackTransaction(
true);
393 $pageposafter = $pageposbefore;
395 $pdf->setPageOrientation(
'', 1, $heightforfooter);
396 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxcomm - $curX, 4, $curX, $curY, $hideref, $hidedesc);
397 $posyafter = $pdf->GetY();
398 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
399 if ($i == ($nblines - 1)) {
400 $pdf->AddPage(
'',
'',
true);
401 if (!empty($tplidx)) {
402 $pdf->useTemplate($tplidx);
405 $this->
_pagehead($pdf, $object, 0, $outputlangs);
407 $pdf->setPage($pageposafter + 1);
412 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
413 $showpricebeforepagebreak = 1;
415 $showpricebeforepagebreak = 0;
420 $pdf->commitTransaction();
423 $nexY = $pdf->GetY();
424 $pageposafter = $pdf->getPage();
425 $pdf->setPage($pageposbefore);
426 $pdf->setTopMargin($this->marge_haute);
427 $pdf->setPageOrientation(
'', 1, 0);
430 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
431 $pdf->setPage($pageposafter);
432 $curY = $tab_top_newpage;
435 $pdf->SetFont(
'',
'', $default_font_size - 1);
448 $pdf->SetXY($this->posxqty, $curY);
449 $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 3, $object->lines[$i]->qty_shipped, 0,
'R');
452 $pdf->SetXY($this->posxremainingqty, $curY);
453 $qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line];
454 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxremainingqty, 3, $qtyRemaining, 0,
'R');
476 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
477 $pdf->setPage($pageposafter);
478 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
480 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
481 $pdf->SetLineStyle(array(
'dash'=>0));
487 while ($pagenb < $pageposafter) {
488 $pdf->setPage($pagenb);
490 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
492 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
494 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
496 $pdf->setPage($pagenb);
497 $pdf->setPageOrientation(
'', 1, 0);
499 $this->
_pagehead($pdf, $object, 0, $outputlangs);
501 if (!empty($tplidx)) {
502 $pdf->useTemplate($tplidx);
505 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
507 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
509 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
511 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
514 if (!empty($tplidx)) {
515 $pdf->useTemplate($tplidx);
519 $this->
_pagehead($pdf, $object, 0, $outputlangs);
526 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
527 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
529 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
530 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
534 $this->
_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
537 $this->
_pagefoot($pdf, $object, $outputlangs);
539 if (method_exists($pdf,
'AliasNbPages')) {
540 $pdf->AliasNbPages();
606 $pdf->Output($file,
'F');
609 if (!is_object($hookmanager)) {
610 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
613 $hookmanager->initHooks(array(
'pdfgeneration'));
614 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
616 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
618 $this->error = $hookmanager->error;
619 $this->errors = $hookmanager->errors;
622 if (!empty($conf->global->MAIN_UMASK)) {
623 @chmod($file, octdec($conf->global->MAIN_UMASK));
626 $this->result = array(
'fullpath'=>$file);
630 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
635 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"DELIVERY_OUTPUTDIR");
653 global $conf, $mysoc;
656 $pdf->SetFont(
'',
'', $default_font_size);
657 $pdf->SetXY($this->marge_gauche, $posy);
659 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
660 $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25);
661 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
662 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"For").
' '.$outputlangs->convToOutputCharset($mysoc->name).
":",
'',
'L');
664 $pdf->Rect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25);
665 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
666 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"ForCustomer").
':',
'',
'L');
682 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
684 global $conf, $mysoc;
695 $pdf->SetTextColor(0, 0, 0);
696 $pdf->SetFont(
'',
'', $default_font_size - 2);
699 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
701 if (empty($hidetop)) {
702 $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10);
705 $pdf->SetDrawColor(128, 128, 128);
706 $pdf->SetFont(
'',
'', $default_font_size - 1);
708 if (empty($hidetop)) {
709 $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
710 $pdf->MultiCell($this->posxcomm - $this->posxdesc, 2, $outputlangs->transnoentities(
"Designation"),
'',
'L');
714 $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height);
715 if (empty($hidetop)) {
716 $pdf->SetXY($this->posxcomm, $tab_top + 1);
717 $pdf->MultiCell($this->posxqty - $this->posxcomm, 2, $outputlangs->transnoentities(
"Comments"),
'',
'L');
721 $pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height);
722 if (empty($hidetop)) {
723 $pdf->SetXY($this->posxqty, $tab_top + 1);
724 $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities(
"QtyShippedShort"),
'',
'R');
728 $pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height);
729 if (empty($hidetop)) {
730 $pdf->SetXY($this->posxremainingqty, $tab_top + 1);
731 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxremainingqty, 2, $outputlangs->transnoentities(
"KeepToShipShort"),
'',
'R');
745 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
747 global $conf, $langs, $hookmanager;
758 $pdf->SetTextColor(0, 0, 60);
759 $pdf->SetFont(
'',
'B', $default_font_size + 3);
761 $posy = $this->marge_haute;
762 $posx = $this->page_largeur - $this->marge_droite - 100;
764 $pdf->SetXY($this->marge_gauche, $posy);
767 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
768 if ($this->emetteur->logo) {
769 if (is_readable($logo)) {
771 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
773 $pdf->SetTextColor(200, 0, 0);
774 $pdf->SetFont(
'',
'B', $default_font_size - 2);
775 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
776 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
779 $pdf->MultiCell(100, 4, $this->emetteur->name, 0,
'L');
782 $pdf->SetFont(
'',
'B', $default_font_size + 2);
783 $pdf->SetXY($posx, $posy);
784 $pdf->SetTextColor(0, 0, 60);
785 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"DeliveryOrder").
" ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
787 $pdf->SetFont(
'',
'', $default_font_size + 2);
790 $pdf->SetXY($posx, $posy);
791 $pdf->SetTextColor(0, 0, 60);
792 if ($object->date_valid) {
793 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date_delivery,
"%d %b %Y",
false, $outputlangs,
true),
'',
'R');
795 $pdf->SetTextColor(255, 0, 0);
796 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DeliveryNotValidated"),
'',
'R');
797 $pdf->SetTextColor(0, 0, 60);
800 if ($object->thirdparty->code_client) {
802 $pdf->SetXY($posx, $posy);
803 $pdf->SetTextColor(0, 0, 60);
804 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
807 $pdf->SetTextColor(0, 0, 60);
812 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3,
'R', $default_font_size);
816 $carac_emetteur =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
820 $posx = $this->marge_gauche;
821 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
822 $posx = $this->page_largeur - $this->marge_droite - 80;
827 $pdf->SetTextColor(0, 0, 0);
828 $pdf->SetFont(
'',
'', $default_font_size - 2);
829 $pdf->SetXY($posx, $posy - 5);
830 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"BillFrom"), 0,
'L');
831 $pdf->SetXY($posx, $posy);
832 $pdf->SetFillColor(230, 230, 230);
833 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
834 $pdf->SetTextColor(0, 0, 60);
837 $pdf->SetXY($posx + 2, $posy + 3);
838 $pdf->SetFont(
'',
'B', $default_font_size);
839 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
840 $posy = $pdf->getY();
843 $pdf->SetXY($posx + 2, $posy);
844 $pdf->SetFont(
'',
'', $default_font_size - 1);
845 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
850 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
851 $posx = $this->marge_gauche;
853 $pdf->SetTextColor(0, 0, 0);
854 $pdf->SetFont(
'',
'', $default_font_size - 2);
855 $pdf->SetXY($posx, $posy - 5);
856 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"DeliveryAddress"), 0,
'L');
860 $arrayidcontact = $object->commande->getIdContact(
'external',
'SHIPPING');
861 if ($arrayidcontact && count($arrayidcontact) > 0) {
863 $result = $object->fetch_contact($arrayidcontact[0]);
867 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
868 $thirdparty = $object->contact;
870 $thirdparty = $object->thirdparty;
875 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact :
''), $usecontact,
'target', $object);
879 if ($this->page_largeur < 210) {
883 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
884 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
885 $posx = $this->marge_gauche;
889 $pdf->SetTextColor(0, 0, 0);
890 $pdf->SetFont(
'',
'', $default_font_size - 2);
891 $pdf->SetXY($posx + 2, $posy - 5);
893 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
896 $pdf->SetXY($posx + 2, $posy + 3);
897 $pdf->SetFont(
'',
'B', $default_font_size);
898 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
900 $posy = $pdf->getY();
903 $pdf->SetFont(
'',
'', $default_font_size - 1);
904 $pdf->SetXY($posx + 2, $posy);
905 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
908 $pdf->SetTextColor(0, 0, 60);
921 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
923 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
924 return pdf_pagefoot($pdf, $outputlangs,
'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
Class to manage customers orders.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Class to manage shipments.
Classe mere des modeles de bon de livraison.
Class to build Delivery Order documents with typhon model.
__construct($db)
Constructor.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
isModEnabled($module)
Is Dolibarr module enabled.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getFormat(Translate $outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0)
Output line description into PDF.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formated for output on documents.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.