31 require_once DOL_DOCUMENT_ROOT.
'/core/modules/contract/modules_contract.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
67 public $phpmin = array(5, 6);
73 public $version =
'dolibarr';
129 global $conf, $langs, $mysoc;
132 $this->
name =
'strato';
133 $this->
description = $langs->trans(
"StandardContractsTemplate");
139 $this->page_largeur = $formatarray[
'width'];
140 $this->page_hauteur = $formatarray[
'height'];
141 $this->format = array($this->page_largeur, $this->page_hauteur);
142 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
143 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
144 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
145 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
147 $this->option_logo = 1;
148 $this->option_tva = 0;
149 $this->option_modereg = 0;
150 $this->option_condreg = 0;
151 $this->option_codeproduitservice = 0;
152 $this->option_multilang = 0;
153 $this->option_draft_watermark = 1;
156 $this->emetteur = $mysoc;
157 if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2);
160 $this->posxdesc = $this->marge_gauche + 1;
175 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
178 global $user, $langs, $conf, $hookmanager, $mysoc;
180 if (!is_object($outputlangs)) $outputlangs = $langs;
182 if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output =
'ISO-8859-1';
185 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"contracts"));
187 if ($conf->contrat->dir_output)
189 $object->fetch_thirdparty();
192 if ($object->specimen)
194 $dir = $conf->contrat->dir_output;
195 $file = $dir.
"/SPECIMEN.pdf";
198 $dir = $conf->contrat->multidir_output[$object->entity].
"/".$objectref;
199 $file = $dir.
"/".$objectref.
".pdf";
202 if (!file_exists($dir))
206 $this->error = $outputlangs->trans(
"ErrorCanNotCreateDir", $dir);
211 if (file_exists($dir))
214 if (!is_object($hookmanager))
216 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
219 $hookmanager->initHooks(array(
'pdfgeneration'));
220 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
222 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
226 $heightforinfotot = 50;
227 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
228 $heightforfooter = $this->marge_basse + 8;
229 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) $heightforfooter += 6;
230 $pdf->SetAutoPageBreak(1, 0);
232 if (class_exists(
'TCPDF'))
234 $pdf->setPrintHeader(
false);
235 $pdf->setPrintFooter(
false);
239 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
241 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
242 $tplidx = $pdf->importPage(1);
247 $pdf->SetDrawColor(128, 128, 128);
249 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
250 $pdf->SetSubject($outputlangs->transnoentities(
"ContractCard"));
251 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
252 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
253 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"ContractCard").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
254 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(
false);
256 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
260 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
262 $this->
_pagehead($pdf, $object, 1, $outputlangs);
263 $pdf->SetFont(
'',
'', $default_font_size - 1);
264 $pdf->MultiCell(0, 3,
'');
265 $pdf->SetTextColor(0, 0, 0);
268 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10);
271 if (!empty($object->note_public))
275 $pdf->SetFont(
'',
'', $default_font_size - 1);
276 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($object->note_public), 0, 1);
277 $nexY = $pdf->GetY();
278 $height_note = $nexY - $tab_top;
281 $pdf->SetDrawColor(192, 192, 192);
282 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
284 $tab_top = $nexY + 6;
287 $iniY = $tab_top + 7;
288 $curY = $tab_top + 7;
289 $nexY = $tab_top + 2;
291 $pdf->SetXY($this->marge_gauche, $tab_top);
293 $pdf->MultiCell(0, 2,
'');
295 $nblines = count($object->lines);
298 for ($i = 0; $i < $nblines; $i++)
300 $objectligne = $object->lines[$i];
302 $valide = $objectligne->id ? 1 : 0;
304 if ($valide > 0 || $object->specimen)
306 $curX = $this->posxdesc - 1;
308 $pdf->SetFont(
'',
'', $default_font_size - 1);
309 $pdf->SetTextColor(0, 0, 0);
311 $pdf->setTopMargin($tab_top_newpage);
312 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
313 $pageposbefore = $pdf->getPage();
317 if ($objectligne->date_ouverture_prevue) {
318 $datei =
dol_print_date($objectligne->date_ouverture_prevue,
'day',
false, $outputlangs,
true);
320 $datei = $langs->trans(
"Unknown");
323 if ($objectligne->date_fin_validite) {
324 $durationi =
convertSecondToTime($objectligne->date_fin_validite - $objectligne->date_ouverture_prevue,
'allwithouthour');
325 $datee =
dol_print_date($objectligne->date_fin_validite,
'day',
false, $outputlangs,
true);
327 $durationi = $langs->trans(
"Unknown");
328 $datee = $langs->trans(
"Unknown");
331 if ($objectligne->date_ouverture) {
332 $daters =
dol_print_date($objectligne->date_ouverture,
'day',
false, $outputlangs,
true);
334 $daters = $langs->trans(
"Unknown");
337 if ($objectligne->date_cloture) {
338 $datere =
dol_print_date($objectligne->date_cloture,
'day',
false, $outputlangs,
true);
340 $datere = $langs->trans(
"Unknown");
343 $txtpredefinedservice = $objectligne->product_ref;
344 if ($objectligne->product_label)
346 $txtpredefinedservice .=
' - ';
347 $txtpredefinedservice .= $objectligne->product_label;
352 $txt .= $outputlangs->transnoentities(
"Quantity").
' : <strong>'.$objectligne->qty.
'</strong> - '.$outputlangs->transnoentities(
"UnitPrice").
' : <strong>'.
price($objectligne->subprice).
'</strong>';
353 if (empty($conf->global->CONTRACT_HIDE_PLANNED_DATE_ON_PDF))
356 $txt .= $outputlangs->transnoentities(
"DateStartPlannedShort").
" : <strong>".$datei.
"</strong> - ".$outputlangs->transnoentities(
"DateEndPlanned").
" : <strong>".$datee.
'</strong>';
358 if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF))
361 $txt .= $outputlangs->transnoentities(
"DateStartRealShort").
" : <strong>".$daters.
'</strong>';
362 if ($objectligne->date_cloture) $txt .=
" - ".$outputlangs->transnoentities(
"DateEndRealShort").
" : '<strong>'".$datere.
'</strong>';
365 $pdf->startTransaction();
367 $pageposafter = $pdf->getPage();
368 if ($pageposafter > $pageposbefore)
370 $pdf->rollbackTransaction(
true);
371 $pageposafter = $pageposbefore;
373 $pdf->setPageOrientation(
'', 1, $heightforfooter);
375 $pageposafter = $pdf->getPage();
376 $posyafter = $pdf->GetY();
378 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)))
380 if ($i == ($nblines - 1))
382 $pdf->AddPage(
'',
'',
true);
383 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
384 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
385 $pdf->setPage($pageposafter + 1);
391 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
392 $showpricebeforepagebreak = 1;
393 else $showpricebeforepagebreak = 0;
397 $pdf->commitTransaction();
400 $nexY = $pdf->GetY() + 2;
401 $pageposafter = $pdf->getPage();
403 $pdf->setPage($pageposbefore);
404 $pdf->setTopMargin($this->marge_haute);
405 $pdf->setPageOrientation(
'', 1, 0);
408 if ($pageposafter > $pageposbefore) {
409 $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
412 $pdf->SetFont(
'',
'', $default_font_size - 1);
415 while ($pagenb < $pageposafter)
417 $pdf->setPage($pagenb);
420 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
422 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
424 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
426 $pdf->setPage($pagenb);
427 $pdf->setPageOrientation(
'', 1, 0);
430 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak)
434 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
436 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
438 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
441 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
450 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
451 $this->
tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
452 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
454 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
455 $this->
tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
456 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
459 $this->
_pagefoot($pdf, $object, $outputlangs);
460 if (method_exists($pdf,
'AliasNbPages')) $pdf->AliasNbPages();
464 $pdf->Output($file,
'F');
467 if (!is_object($hookmanager))
469 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
472 $hookmanager->initHooks(array(
'pdfgeneration'));
473 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
475 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
478 $this->error = $hookmanager->error;
479 $this->errors = $hookmanager->errors;
482 if (!empty($conf->global->MAIN_UMASK))
483 @chmod($file, octdec($conf->global->MAIN_UMASK));
485 $this->result = array(
'fullpath'=>$file);
489 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
493 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"CONTRACT_OUTPUTDIR");
511 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
517 if ($hidetop) $hidetop = -1;
547 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 3);
558 protected function tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
560 $pdf->SetDrawColor(128, 128, 128);
561 $posmiddle = $this->marge_gauche + round(($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 2);
562 $posy = $tab_top + $tab_height + 3 + 3;
564 $pdf->SetXY($this->marge_gauche, $posy);
565 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->emetteur->name), 0,
'L', 0);
567 $pdf->SetXY($this->marge_gauche, $posy + 5);
568 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 20,
'', 1);
570 $pdf->SetXY($posmiddle + 5, $posy);
571 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->recipient->name), 0,
'L', 0);
573 $pdf->SetXY($posmiddle + 5, $posy + 5);
574 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 20,
'', 1);
587 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
589 global $conf, $langs;
594 $outputlangs->loadLangs(array(
"main",
"dict",
"contract",
"companies"));
599 if ($object->statut == 0 && (!empty($conf->global->CONTRACT_DRAFT_WATERMARK)))
601 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm', $conf->global->CONTRACT_DRAFT_WATERMARK);
605 $pdf->SetTextColor(0, 0, 60);
606 $pdf->SetFont(
'',
'B', $default_font_size + 3);
608 $posx = $this->page_largeur - $this->marge_droite - 100;
609 $posy = $this->marge_haute;
611 $pdf->SetXY($this->marge_gauche, $posy);
614 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
615 if ($this->emetteur->logo)
617 if (is_readable($logo))
620 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
622 $pdf->SetTextColor(200, 0, 0);
623 $pdf->SetFont(
'',
'B', $default_font_size - 2);
624 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
625 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
628 $text = $this->emetteur->name;
629 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
632 $pdf->SetFont(
'',
'B', $default_font_size + 3);
633 $pdf->SetXY($posx, $posy);
634 $pdf->SetTextColor(0, 0, 60);
635 $title = $outputlangs->transnoentities(
"ContractCard");
636 $pdf->MultiCell(100, 4, $title,
'',
'R');
638 $pdf->SetFont(
'',
'B', $default_font_size + 2);
641 $pdf->SetXY($posx, $posy);
642 $pdf->SetTextColor(0, 0, 60);
643 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
646 $pdf->SetFont(
'',
'', $default_font_size);
649 $pdf->SetXY($posx, $posy);
650 $pdf->SetTextColor(0, 0, 60);
651 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date_contrat,
"day",
false, $outputlangs,
true),
'',
'R');
653 if ($object->thirdparty->code_client)
656 $pdf->SetXY($posx, $posy);
657 $pdf->SetTextColor(0, 0, 60);
658 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
664 $carac_emetteur =
'';
666 $arrayidcontact = $object->getIdContact(
'internal',
'INTERREPFOLL');
667 if (count($arrayidcontact) > 0)
669 $object->fetch_user($arrayidcontact[0]);
670 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$outputlangs->transnoentities(
"Name").
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
673 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
677 $posx = $this->marge_gauche;
678 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80;
682 $pdf->SetTextColor(0, 0, 0);
683 $pdf->SetFont(
'',
'', $default_font_size - 2);
684 $pdf->SetXY($posx, $posy - 5);
685 $pdf->SetXY($posx, $posy);
686 $pdf->SetFillColor(230, 230, 230);
687 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
690 $pdf->SetXY($posx + 2, $posy + 3);
691 $pdf->SetTextColor(0, 0, 60);
692 $pdf->SetFont(
'',
'B', $default_font_size);
693 $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
694 $posy = $pdf->getY();
697 $pdf->SetFont(
'',
'', $default_font_size - 1);
698 $pdf->SetXY($posx + 2, $posy);
699 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
704 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
705 if (count($arrayidcontact) > 0)
708 $result = $object->fetch_contact($arrayidcontact[0]);
711 $this->recipient = $object->thirdparty;
714 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)))) {
715 $thirdparty = $object->contact;
717 $thirdparty = $object->thirdparty;
722 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact :
''), $usecontact,
'target', $object);
726 if ($this->page_largeur < 210) $widthrecbox = 84;
728 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
729 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche;
732 $pdf->SetTextColor(0, 0, 0);
733 $pdf->SetFont(
'',
'', $default_font_size - 2);
734 $pdf->SetXY($posx + 2, $posy - 5);
735 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
736 $pdf->SetTextColor(0, 0, 0);
739 $pdf->SetXY($posx + 2, $posy + 3);
740 $pdf->SetFont(
'',
'B', $default_font_size);
741 $pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0,
'L');
743 $posy = $pdf->getY();
746 $pdf->SetFont(
'',
'', $default_font_size - 1);
747 $pdf->SetXY($posx + 2, $posy);
748 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
762 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
765 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
766 return pdf_pagefoot($pdf, $outputlangs,
'CONTRACT_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.
tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
Show footer signature of page.
Parent class to manage intervention document templates.
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.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
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...
__construct($db)
Constructor.
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.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
$conf db
API class for accounts.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
write_file($object, $outputlangs, $srctemplatepath= '', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
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).
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
Class to build contracts documents with model Strato.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
convertSecondToTime($iSecond, $format= 'all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.