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';
65 public $phpmin = array(5, 6);
71 public $version =
'dolibarr';
121 global $conf, $langs, $mysoc;
124 $langs->loadLangs(array(
"main",
"bills",
"sendings",
"companies"));
127 $this->
name =
"Typhon";
128 $this->
description = $langs->trans(
"DocumentModelTyphon");
133 $this->page_largeur = $formatarray[
'width'];
134 $this->page_hauteur = $formatarray[
'height'];
135 $this->format = array($this->page_largeur, $this->page_hauteur);
136 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
137 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
138 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
139 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
141 $this->option_logo = 1;
142 $this->option_tva = 1;
143 $this->option_codeproduitservice = 1;
146 $this->emetteur = $mysoc;
147 if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2);
150 $this->posxdesc = $this->marge_gauche + 1;
151 $this->posxcomm = 112;
154 $this->posxqty = 165;
155 $this->posxremainingqty = 185;
158 if ($this->page_largeur < 210)
160 $this->posxcomm -= 20;
163 $this->posxqty -= 20;
168 $this->tva = array();
169 $this->atleastoneratenotnull = 0;
170 $this->atleastonediscount = 0;
186 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
189 global $user, $langs, $conf, $mysoc, $hookmanager;
191 if (!is_object($outputlangs)) $outputlangs = $langs;
193 if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output =
'ISO-8859-1';
196 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"sendings",
"deliveries"));
198 if ($conf->expedition->dir_output)
200 $object->fetch_thirdparty();
203 if ($object->specimen)
205 $dir = $conf->expedition->dir_output.
"/receipt";
206 $file = $dir.
"/SPECIMEN.pdf";
209 $dir = $conf->expedition->dir_output.
"/receipt/".$objectref;
210 $file = $dir.
"/".$objectref.
".pdf";
213 if (!file_exists($dir))
217 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
222 if (file_exists($dir))
225 if (!is_object($hookmanager))
227 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
230 $hookmanager->initHooks(array(
'pdfgeneration'));
231 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
233 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
235 $nblines = count($object->lines);
240 $heightforinfotot = 30;
241 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
242 $heightforfooter = $this->marge_basse + 8;
243 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) $heightforfooter += 6;
244 $pdf->SetAutoPageBreak(1, 0);
246 if (class_exists(
'TCPDF'))
248 $pdf->setPrintHeader(
false);
249 $pdf->setPrintFooter(
false);
253 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
255 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
256 $tplidx = $pdf->importPage(1);
261 $result = $expedition->fetch($object->origin_id);
264 if ($expedition->origin ==
'commande')
266 $commande->fetch($expedition->origin_id);
268 $object->commande = $commande;
269 $object->commande->loadExpeditions();
274 $pdf->SetDrawColor(128, 128, 128);
276 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
277 $pdf->SetSubject($outputlangs->transnoentities(
"DeliveryOrder"));
278 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
279 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
280 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"DeliveryOrder"));
281 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(
false);
283 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
307 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
309 $this->
_pagehead($pdf, $object, 1, $outputlangs);
310 $pdf->SetFont(
'',
'', $default_font_size - 1);
311 $pdf->MultiCell(0, 3,
'');
312 $pdf->SetTextColor(0, 0, 0);
315 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10);
317 $tab_height_newpage = 150;
320 $height_incoterms = 0;
321 if (!empty($conf->incoterm->enabled))
323 $desc_incoterms = $object->getIncotermsForPDF();
328 $pdf->SetFont(
'',
'', $default_font_size - 1);
329 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
330 $nexY = $pdf->GetY();
331 $height_incoterms = $nexY - $tab_top;
334 $pdf->SetDrawColor(192, 192, 192);
335 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
337 $tab_top = $nexY + 6;
338 $height_incoterms += 4;
343 if (!empty($object->note_public))
345 $tab_top = 88 + $height_incoterms;
347 $pdf->SetFont(
'',
'', $default_font_size - 1);
348 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($object->note_public), 0, 1);
349 $nexY = $pdf->GetY();
350 $height_note = $nexY - $tab_top;
353 $pdf->SetDrawColor(192, 192, 192);
354 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
356 $tab_height = $tab_height - $height_note;
357 $tab_top = $nexY + 6;
362 $iniY = $tab_top + 11;
363 $curY = $tab_top + 11;
364 $nexY = $tab_top + 11;
367 for ($i = 0; $i < $nblines; $i++)
370 $pdf->SetFont(
'',
'', $default_font_size - 1);
371 $pdf->SetTextColor(0, 0, 0);
373 $pdf->setTopMargin($tab_top_newpage);
374 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
375 $pageposbefore = $pdf->getPage();
378 $curX = $this->posxdesc - 1;
380 $showpricebeforepagebreak = 1;
382 $pdf->startTransaction();
383 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxcomm - $curX, 3, $curX, $curY, $hideref, $hidedesc);
384 $pageposafter = $pdf->getPage();
385 if ($pageposafter > $pageposbefore)
387 $pdf->rollbackTransaction(
true);
388 $pageposafter = $pageposbefore;
390 $pdf->setPageOrientation(
'', 1, $heightforfooter);
391 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxcomm - $curX, 4, $curX, $curY, $hideref, $hidedesc);
392 $posyafter = $pdf->GetY();
393 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)))
395 if ($i == ($nblines - 1))
397 $pdf->AddPage(
'',
'',
true);
398 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
399 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
400 $pdf->setPage($pageposafter + 1);
405 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
406 $showpricebeforepagebreak = 1;
407 else $showpricebeforepagebreak = 0;
411 $pdf->commitTransaction();
414 $nexY = $pdf->GetY();
415 $pageposafter = $pdf->getPage();
416 $pdf->setPage($pageposbefore);
417 $pdf->setTopMargin($this->marge_haute);
418 $pdf->setPageOrientation(
'', 1, 0);
421 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
422 $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
425 $pdf->SetFont(
'',
'', $default_font_size - 1);
438 $pdf->SetXY($this->posxqty, $curY);
439 $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 3, $object->lines[$i]->qty_shipped, 0,
'R');
442 $pdf->SetXY($this->posxremainingqty, $curY);
443 $qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line];
444 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxremainingqty, 3, $qtyRemaining, 0,
'R');
466 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
468 $pdf->setPage($pageposafter);
469 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
471 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
472 $pdf->SetLineStyle(array(
'dash'=>0));
478 while ($pagenb < $pageposafter)
480 $pdf->setPage($pagenb);
483 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
485 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
487 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
489 $pdf->setPage($pagenb);
490 $pdf->setPageOrientation(
'', 1, 0);
491 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
493 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak)
497 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
499 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
501 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
504 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
506 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
513 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
514 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
516 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
517 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
521 $this->
_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
524 $this->
_pagefoot($pdf, $object, $outputlangs);
526 if (method_exists($pdf,
'AliasNbPages')) $pdf->AliasNbPages();
591 $pdf->Output($file,
'F');
594 if (!is_object($hookmanager))
596 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
599 $hookmanager->initHooks(array(
'pdfgeneration'));
600 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
602 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
605 $this->error = $hookmanager->error;
606 $this->errors = $hookmanager->errors;
609 if (!empty($conf->global->MAIN_UMASK))
610 @chmod($file, octdec($conf->global->MAIN_UMASK));
612 $this->result = array(
'fullpath'=>$file);
616 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
621 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"DELIVERY_OUTPUTDIR");
639 global $conf, $mysoc;
642 $pdf->SetFont(
'',
'', $default_font_size);
643 $pdf->SetXY($this->marge_gauche, $posy);
645 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
646 $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25);
647 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
648 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"For").
' '.$outputlangs->convToOutputCharset($mysoc->name).
":",
'',
'L');
650 $pdf->Rect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25);
651 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
652 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"ForCustomer").
':',
'',
'L');
668 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
670 global $conf, $mysoc;
674 if ($hidetop) $hidetop = -1;
679 $pdf->SetTextColor(0, 0, 0);
680 $pdf->SetFont(
'',
'', $default_font_size - 2);
683 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
687 $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10);
690 $pdf->SetDrawColor(128, 128, 128);
691 $pdf->SetFont(
'',
'', $default_font_size - 1);
695 $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
696 $pdf->MultiCell($this->posxcomm - $this->posxdesc, 2, $outputlangs->transnoentities(
"Designation"),
'',
'L');
700 $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height);
701 if (empty($hidetop)) {
702 $pdf->SetXY($this->posxcomm, $tab_top + 1);
703 $pdf->MultiCell($this->posxqty - $this->posxcomm, 2, $outputlangs->transnoentities(
"Comments"),
'',
'L');
707 $pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height);
708 if (empty($hidetop)) {
709 $pdf->SetXY($this->posxqty, $tab_top + 1);
710 $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities(
"QtyShippedShort"),
'',
'R');
714 $pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height);
715 if (empty($hidetop)) {
716 $pdf->SetXY($this->posxremainingqty, $tab_top + 1);
717 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxremainingqty, 2, $outputlangs->transnoentities(
"KeepToShipShort"),
'',
'R');
731 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
733 global $conf, $langs, $hookmanager;
740 if ($object->statut == 0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)))
742 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm', $conf->global->COMMANDE_DRAFT_WATERMARK);
745 $pdf->SetTextColor(0, 0, 60);
746 $pdf->SetFont(
'',
'B', $default_font_size + 3);
748 $posy = $this->marge_haute;
749 $posx = $this->page_largeur - $this->marge_droite - 100;
751 $pdf->SetXY($this->marge_gauche, $posy);
754 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
755 if ($this->emetteur->logo)
757 if (is_readable($logo))
760 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
762 $pdf->SetTextColor(200, 0, 0);
763 $pdf->SetFont(
'',
'B', $default_font_size - 2);
764 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
765 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
767 }
else $pdf->MultiCell(100, 4, $this->emetteur->name, 0,
'L');
769 $pdf->SetFont(
'',
'B', $default_font_size + 2);
770 $pdf->SetXY($posx, $posy);
771 $pdf->SetTextColor(0, 0, 60);
772 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"DeliveryOrder").
" ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
774 $pdf->SetFont(
'',
'', $default_font_size + 2);
777 $pdf->SetXY($posx, $posy);
778 $pdf->SetTextColor(0, 0, 60);
779 if ($object->date_valid)
781 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date_delivery,
"%d %b %Y",
false, $outputlangs,
true),
'',
'R');
783 $pdf->SetTextColor(255, 0, 0);
784 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DeliveryNotValidated"),
'',
'R');
785 $pdf->SetTextColor(0, 0, 60);
788 if ($object->thirdparty->code_client)
791 $pdf->SetXY($posx, $posy);
792 $pdf->SetTextColor(0, 0, 60);
793 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
796 $pdf->SetTextColor(0, 0, 60);
801 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3,
'R', $default_font_size);
806 $carac_emetteur =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
810 $posx = $this->marge_gauche;
811 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80;
815 $pdf->SetTextColor(0, 0, 0);
816 $pdf->SetFont(
'',
'', $default_font_size - 2);
817 $pdf->SetXY($posx, $posy - 5);
818 $pdf->MultiCell(66, 5, $outputlangs->transnoentities(
"BillFrom").
":", 0,
'L');
819 $pdf->SetXY($posx, $posy);
820 $pdf->SetFillColor(230, 230, 230);
821 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
822 $pdf->SetTextColor(0, 0, 60);
825 $pdf->SetXY($posx + 2, $posy + 3);
826 $pdf->SetFont(
'',
'B', $default_font_size);
827 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
828 $posy = $pdf->getY();
831 $pdf->SetXY($posx + 2, $posy);
832 $pdf->SetFont(
'',
'', $default_font_size - 1);
833 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
838 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche;
839 $pdf->SetTextColor(0, 0, 0);
840 $pdf->SetFont(
'',
'', $default_font_size - 2);
841 $pdf->SetXY($posx, $posy - 5);
842 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"DeliveryAddress").
":", 0,
'L');
846 $arrayidcontact = $object->commande->getIdContact(
'external',
'SHIPPING');
847 if ($arrayidcontact && count($arrayidcontact) > 0)
850 $result = $object->fetch_contact($arrayidcontact[0]);
854 if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
855 $thirdparty = $object->contact;
857 $thirdparty = $object->thirdparty;
862 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact :
''), $usecontact,
'target', $object);
866 if ($this->page_largeur < 210) $widthrecbox = 84;
868 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
869 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche;
872 $pdf->SetTextColor(0, 0, 0);
873 $pdf->SetFont(
'',
'', $default_font_size - 2);
874 $pdf->SetXY($posx + 2, $posy - 5);
876 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
879 $pdf->SetXY($posx + 2, $posy + 3);
880 $pdf->SetFont(
'',
'B', $default_font_size);
881 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
883 $posy = $pdf->getY();
886 $pdf->SetFont(
'',
'', $default_font_size - 1);
887 $pdf->SetXY($posx + 2, $posy);
888 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
891 $pdf->SetTextColor(0, 0, 60);
904 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
907 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
908 return pdf_pagefoot($pdf, $outputlangs,
'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
pdf_getFormat(Translate $outputlangs=null, $mode= 'setup')
Return array with format properties of default PDF format.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
write_file($object, $outputlangs, $srctemplatepath= '', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
__construct($db)
Constructor.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
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...
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
Class to manage shipments.
Class to manage customers orders.
Classe mere des modeles de bon de livraison.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getInstance($format= '', $metric= 'mm', $pagetype= 'P')
Return a PDF instance object.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany= '', $targetcontact= '', $usecontact=0, $mode= 'source', $object=null)
Return a string with full address formated for output on documents.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0)
Output line description into PDF.
Class to build Delivery Order documents with typhon model.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)