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';
66 public $update_main_doc_field;
77 public $phpmin = array(7, 0);
83 public $version =
'dolibarr';
103 public $marge_gauche;
108 public $marge_droite;
139 global $conf, $langs, $mysoc;
142 $this->
name =
'strato';
143 $this->
description = $langs->trans(
"StandardContractsTemplate");
144 $this->update_main_doc_field = 1;
150 $this->page_largeur = $formatarray[
'width'];
151 $this->page_hauteur = $formatarray[
'height'];
152 $this->format = array($this->page_largeur, $this->page_hauteur);
158 $this->option_logo = 1;
159 $this->option_tva = 0;
160 $this->option_modereg = 0;
161 $this->option_condreg = 0;
162 $this->option_multilang = 0;
163 $this->option_draft_watermark = 1;
166 $this->emetteur = $mysoc;
167 if (empty($this->emetteur->country_code)) {
168 $this->emetteur->country_code = substr($langs->defaultlang, -2);
172 $this->posxdesc = $this->marge_gauche + 1;
187 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
190 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
192 if (!is_object($outputlangs)) {
193 $outputlangs = $langs;
196 if (!empty($conf->global->MAIN_USE_FPDF)) {
197 $outputlangs->charset_output =
'ISO-8859-1';
201 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"contracts"));
204 if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->CONTRACT_DRAFT_WATERMARK))) {
205 $this->watermark = $conf->global->CONTRACT_DRAFT_WATERMARK;
208 global $outputlangsbis;
209 $outputlangsbis =
null;
210 if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
211 $outputlangsbis =
new Translate(
'', $conf);
212 $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
213 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
216 $nblines = count($object->lines);
218 if ($conf->contract->multidir_output[$conf->entity]) {
219 $object->fetch_thirdparty();
222 if ($object->specimen) {
223 $dir = $conf->contract->multidir_output[$conf->entity];
224 $file = $dir.
"/SPECIMEN.pdf";
227 $dir = $conf->contrat->multidir_output[$object->entity].
"/".$objectref;
228 $file = $dir.
"/".$objectref.
".pdf";
231 if (!file_exists($dir)) {
233 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
238 if (file_exists($dir)) {
240 if (!is_object($hookmanager)) {
241 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
244 $hookmanager->initHooks(array(
'pdfgeneration'));
245 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
247 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
250 $nblines = count($object->lines);
255 $pdf->SetAutoPageBreak(1, 0);
257 $heightforinfotot = 50;
258 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
259 $heightforfooter = $this->marge_basse + 9;
260 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
261 $heightforfooter += 6;
264 if (class_exists(
'TCPDF')) {
265 $pdf->setPrintHeader(
false);
266 $pdf->setPrintFooter(
false);
270 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
271 $logodir = $conf->mycompany->dir_output;
272 if (!empty($conf->mycompany->multidir_output[$object->entity])) {
273 $logodir = $conf->mycompany->multidir_output[$object->entity];
275 $pagecount = $pdf->setSourceFile($logodir.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
276 $tplidx = $pdf->importPage(1);
281 $pdf->SetDrawColor(128, 128, 128);
283 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
284 $pdf->SetSubject($outputlangs->transnoentities(
"Contract"));
285 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
286 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
287 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"Contract").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
289 $pdf->SetCompression(
false);
292 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
296 if (!empty($tplidx)) {
297 $pdf->useTemplate($tplidx);
300 $top_shift = $this->
_pagehead($pdf, $object, 1, $outputlangs, (is_object($outputlangsbis) ? $outputlangsbis :
null));
301 $pdf->SetFont(
'',
'', $default_font_size - 1);
302 $pdf->MultiCell(0, 3,
'');
303 $pdf->SetTextColor(0, 0, 0);
306 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
309 if (!empty($object->note_public)) {
312 $pdf->SetFont(
'',
'', $default_font_size - 1);
313 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($object->note_public), 0, 1);
314 $nexY = $pdf->GetY();
315 $height_note = $nexY - $tab_top;
318 $pdf->SetDrawColor(192, 192, 192);
319 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
321 $tab_top = $nexY + 6;
324 $iniY = $tab_top + 7;
325 $curY = $tab_top + 7;
326 $nexY = $tab_top + 2;
328 $pdf->SetXY($this->marge_gauche, $tab_top);
330 $pdf->MultiCell(0, 2,
'');
332 $nblines = count($object->lines);
335 for ($i = 0; $i < $nblines; $i++) {
336 $objectligne = $object->lines[$i];
338 $valide = $objectligne->id ? 1 : 0;
340 if ($valide > 0 || $object->specimen) {
341 $curX = $this->posxdesc - 1;
343 $pdf->SetFont(
'',
'', $default_font_size - 1);
344 $pdf->SetTextColor(0, 0, 0);
346 $pdf->setTopMargin($tab_top_newpage);
347 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
348 $pageposbefore = $pdf->getPage();
352 if (!empty($objectligne->date_start)) {
353 $datei =
dol_print_date((
int) $objectligne->date_start,
'day',
false, $outputlangs,
true);
355 $datei = $langs->trans(
"Unknown");
358 if (!empty($objectligne->date_end)) {
359 $durationi =
convertSecondToTime((
int) $objectligne->date_end - (
int) $objectligne->date_start,
'allwithouthour');
360 $datee =
dol_print_date($objectligne->date_end,
'day',
false, $outputlangs,
true);
362 $durationi = $langs->trans(
"Unknown");
363 $datee = $langs->trans(
"Unknown");
366 if (!empty($objectligne->date_start_real)) {
367 $daters =
dol_print_date((
int) $objectligne->date_start_real,
'day',
false, $outputlangs,
true);
369 $daters = $langs->trans(
"Unknown");
372 if (!empty($objectligne->date_end_real)) {
373 $datere =
dol_print_date((
int) $objectligne->date_end_real,
'day',
false, $outputlangs,
true);
375 $datere = $langs->trans(
"Unknown");
378 $txtpredefinedservice = $objectligne->product_ref;
379 if ($objectligne->product_label) {
380 $txtpredefinedservice .=
' - ';
381 $txtpredefinedservice .= $objectligne->product_label;
386 if (empty($conf->global->CONTRACT_HIDE_QTY_ON_PDF)) {
387 $txt .= $outputlangs->transnoentities(
"Quantity") .
' : <strong>' . $objectligne->qty .
'</strong>';
389 if (empty($conf->global->CONTRACT_HIDE_PRICE_ON_PDF)) {
390 $txt .=
' - ' . $outputlangs->transnoentities(
"UnitPrice") .
' : <strong>' .
price($objectligne->subprice) .
'</strong>';
392 if (empty($conf->global->CONTRACT_HIDE_PLANNED_DATE_ON_PDF)) {
394 $txt .= $outputlangs->transnoentities(
"DateStartPlannedShort").
" : <strong>".$datei.
"</strong> - ".$outputlangs->transnoentities(
"DateEndPlanned").
" : <strong>".$datee.
'</strong>';
396 if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF)) {
398 $txt .= $outputlangs->transnoentities(
"DateStartRealShort").
" : <strong>".$daters.
'</strong>';
399 if (!empty($objectligne->date_end_real)) {
400 $txt .=
" - ".$outputlangs->transnoentities(
"DateEndRealShort").
" : '<strong>'".$datere.
'</strong>';
404 $pdf->startTransaction();
406 $pageposafter = $pdf->getPage();
407 if ($pageposafter > $pageposbefore) {
408 $pdf->rollbackTransaction(
true);
409 $pageposafter = $pageposbefore;
411 $pdf->setPageOrientation(
'', 1, $heightforfooter);
413 $pageposafter = $pdf->getPage();
414 $posyafter = $pdf->GetY();
415 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
416 if ($i == ($nblines - 1)) {
417 $pdf->AddPage(
'',
'',
true);
418 if (!empty($tplidx)) {
419 $pdf->useTemplate($tplidx);
422 $this->
_pagehead($pdf, $object, 0, $outputlangs);
424 $pdf->setPage($pageposafter + 1);
430 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
431 $showpricebeforepagebreak = 1;
433 $showpricebeforepagebreak = 0;
438 $pdf->commitTransaction();
440 $posYAfterDescription = $pdf->GetY();
442 $nexY = $pdf->GetY() + 2;
443 $pageposafter = $pdf->getPage();
445 $pdf->setPage($pageposbefore);
446 $pdf->setTopMargin($this->marge_haute);
447 $pdf->setPageOrientation(
'', 1, 0);
450 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
451 $pdf->setPage($pageposafter);
452 $curY = $tab_top_newpage;
455 $pdf->SetFont(
'',
'', $default_font_size - 1);
458 while ($pagenb < $pageposafter) {
459 $pdf->setPage($pagenb);
461 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
463 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
465 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
467 $pdf->setPage($pagenb);
468 $pdf->setPageOrientation(
'', 1, 0);
469 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
470 $this->
_pagehead($pdf, $object, 0, $outputlangs);
472 if (!empty($tplidx)) {
473 $pdf->useTemplate($tplidx);
477 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
479 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
481 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
483 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
486 if (!empty($tplidx)) {
487 $pdf->useTemplate($tplidx);
497 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
498 $this->
tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
499 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
501 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
502 $this->
tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
503 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
506 $this->
_pagefoot($pdf, $object, $outputlangs);
507 if (method_exists($pdf,
'AliasNbPages')) {
508 $pdf->AliasNbPages();
513 $pdf->Output($file,
'F');
516 $hookmanager->initHooks(array(
'pdfgeneration'));
517 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
519 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
521 $this->error = $hookmanager->error;
522 $this->errors = $hookmanager->errors;
525 if (!empty($conf->global->MAIN_UMASK)) {
526 @chmod($file, octdec($conf->global->MAIN_UMASK));
529 $this->result = array(
'fullpath'=>$file);
533 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
537 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"CONTRACT_OUTPUTDIR");
555 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
565 $currency = !empty($currency) ? $currency : $conf->currency;
595 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 3);
606 protected function tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
608 $pdf->SetDrawColor(128, 128, 128);
609 $posmiddle = $this->marge_gauche + round(($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 2);
610 $posy = $tab_top + $tab_height + 3 + 3;
612 $pdf->SetXY($this->marge_gauche, $posy);
613 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->emetteur->name), 0,
'L', 0);
615 $pdf->SetXY($this->marge_gauche, $posy + 5);
616 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 20,
'', 1);
618 $pdf->SetXY($posmiddle + 5, $posy);
619 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->recipient->name), 0,
'L', 0);
621 $pdf->SetXY($posmiddle + 5, $posy + 5);
622 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 20,
'', 1);
637 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis =
null, $titlekey =
"Contract")
640 global $conf, $langs, $hookmanager;
643 if ($outputlangs->trans(
"DIRECTION") ==
'rtl') {
648 $outputlangs->loadLangs(array(
"main",
"dict",
"contract",
"companies"));
654 $pdf->SetTextColor(0, 0, 60);
655 $pdf->SetFont(
'',
'B', $default_font_size + 3);
659 $posy = $this->marge_haute;
660 $posx = $this->page_largeur - $this->marge_droite - $w;
662 $pdf->SetXY($this->marge_gauche, $posy);
665 if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
666 if ($this->emetteur->logo) {
667 $logodir = $conf->mycompany->dir_output;
668 if (!empty($conf->mycompany->multidir_output[$object->entity])) {
669 $logodir = $conf->mycompany->multidir_output[$object->entity];
671 if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
672 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
674 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
676 if (is_readable($logo)) {
678 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
680 $pdf->SetTextColor(200, 0, 0);
681 $pdf->SetFont(
'',
'B', $default_font_size - 2);
682 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
683 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
686 $text = $this->emetteur->name;
687 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
691 $pdf->SetFont(
'',
'B', $default_font_size + 3);
692 $pdf->SetXY($posx, $posy);
693 $pdf->SetTextColor(0, 0, 60);
694 $title = $outputlangs->transnoentities($titlekey);
695 $title .=
' '.$outputlangs->convToOutputCharset($object->ref);
696 if ($object->statut == $object::STATUS_DRAFT) {
697 $pdf->SetTextColor(128, 0, 0);
698 $title .=
' - '.$outputlangs->transnoentities(
"NotValidated");
700 $pdf->MultiCell($w, 3, $title,
'',
'R');
702 $pdf->SetFont(
'',
'B', $default_font_size);
712 $pdf->SetFont(
'',
'', $default_font_size - 1);
715 $pdf->SetXY($posx, $posy);
716 $pdf->SetTextColor(0, 0, 60);
717 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date_contrat,
"day",
false, $outputlangs,
true),
'',
'R');
719 if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) {
721 $pdf->SetXY($posx, $posy);
722 $pdf->SetTextColor(0, 0, 60);
723 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
728 $carac_emetteur =
'';
730 $arrayidcontact = $object->getIdContact(
'internal',
'INTERREPFOLL');
731 if (count($arrayidcontact) > 0) {
732 $object->fetch_user($arrayidcontact[0]);
733 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$outputlangs->transnoentities(
"Name").
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
736 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
740 $posx = $this->marge_gauche;
741 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
742 $posx = $this->page_largeur - $this->marge_droite - 80;
747 if (empty($conf->global->MAIN_PDF_NO_SENDER_FRAME)) {
748 $pdf->SetTextColor(0, 0, 0);
749 $pdf->SetFont(
'',
'', $default_font_size - 2);
750 $pdf->SetXY($posx, $posy - 5);
751 $pdf->SetXY($posx, $posy);
752 $pdf->SetFillColor(230, 230, 230);
753 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
754 $pdf->SetTextColor(0, 0, 60);
758 if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) {
759 $pdf->SetXY($posx + 2, $posy + 3);
760 $pdf->SetTextColor(0, 0, 60);
761 $pdf->SetFont(
'',
'B', $default_font_size);
762 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
763 $posy = $pdf->getY();
767 $pdf->SetXY($posx + 2, $posy);
768 $pdf->SetFont(
'',
'', $default_font_size - 1);
769 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
774 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
775 if (count($arrayidcontact) > 0) {
777 $result = $object->fetch_contact($arrayidcontact[0]);
780 $this->recipient = $object->thirdparty;
783 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)))) {
784 $thirdparty = $object->contact;
786 $thirdparty = $object->thirdparty;
792 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact :
''), $usecontact, $mode, $object);
795 $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
796 if ($this->page_largeur < 210) {
799 $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
801 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
802 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
803 $posx = $this->marge_gauche;
807 if (empty($conf->global->MAIN_PDF_NO_RECIPENT_FRAME)) {
808 $pdf->SetTextColor(0, 0, 0);
809 $pdf->SetFont(
'',
'', $default_font_size - 2);
810 $pdf->SetXY($posx + 2, $posy - 5);
811 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
812 $pdf->SetTextColor(0, 0, 0);
816 $pdf->SetXY($posx + 2, $posy + 3);
817 $pdf->SetFont(
'',
'B', $default_font_size);
818 $pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0, $ltrdirection);
820 $posy = $pdf->getY();
823 $pdf->SetFont(
'',
'', $default_font_size - 1);
824 $pdf->SetXY($posx + 2, $posy);
825 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
828 $pdf->SetTextColor(0, 0, 0);
842 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
844 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
845 return pdf_pagefoot($pdf, $outputlangs,
'CONTRACT_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Parent class to manage intervention document templates.
Class to manage translations.
Class to build contracts documents with model Strato.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
Show footer signature of page.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
_pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis=null, $titlekey="Contract")
Show top header of page.
__construct($db)
Constructor.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
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.
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.
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...
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...
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_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_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.
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.