27 require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture-rec.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/compta/deplacement/class/deplacement.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
47 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
75 public $update_main_doc_field;
86 public $version =
'dolibarr';
106 public $marge_gauche;
111 public $marge_droite;
127 private $orientation;
138 public $posxamountht;
139 public $posxamountttc;
150 global $conf, $langs, $mysoc;
153 $langs->loadLangs(array(
"main",
"projects",
"companies"));
156 $this->
name =
"beluga";
157 $this->
description = $langs->trans(
"DocumentModelBeluga");
158 $this->update_main_doc_field = 1;
163 $this->orientation =
'L';
164 if ($this->orientation ==
'L' || $this->orientation ==
'Landscape') {
165 $this->page_largeur = $formatarray[
'height'];
166 $this->page_hauteur = $formatarray[
'width'];
168 $this->page_largeur = $formatarray[
'width'];
169 $this->page_hauteur = $formatarray[
'height'];
171 $this->format = array($this->page_largeur, $this->page_hauteur);
177 $this->option_logo = 1;
178 $this->option_tva = 1;
181 $this->emetteur = $mysoc;
182 if (!$this->emetteur->country_code) {
183 $this->emetteur->country_code = substr($langs->defaultlang, -2);
187 if ($this->orientation ==
'L' || $this->orientation ==
'Landscape') {
188 $this->posxref = $this->marge_gauche + 1;
189 $this->posxdate = $this->marge_gauche + 105;
190 $this->posxsociety = $this->marge_gauche + 126;
191 $this->posxamountht = $this->marge_gauche + 190;
192 $this->posxamountttc = $this->marge_gauche + 215;
193 $this->posxstatut = $this->marge_gauche + 245;
195 $this->posxref = $this->marge_gauche + 1;
196 $this->posxdate = $this->marge_gauche + 25;
197 $this->posxsociety = $this->marge_gauche + 46;
198 $this->posxamountht = $this->marge_gauche + 110;
199 $this->posxamountttc = $this->marge_gauche + 135;
200 $this->posxstatut = $this->marge_gauche + 165;
202 if ($this->page_largeur < 210) {
203 $this->posxref -= 20;
204 $this->posxdate -= 20;
205 $this->posxsociete -= 20;
206 $this->posxamountht -= 20;
207 $this->posxamountttc -= 20;
208 $this->posstatut -= 20;
224 global $conf, $hookmanager, $langs, $user;
228 if (!is_object($outputlangs)) {
229 $outputlangs = $langs;
232 if (!empty($conf->global->MAIN_USE_FPDF)) {
233 $outputlangs->charset_output =
'ISO-8859-1';
237 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"projects"));
239 if ($conf->project->multidir_output[$object->entity]) {
243 $dir = $conf->project->multidir_output[$object->entity];
244 if (!preg_match(
'/specimen/i', $objectref)) {
245 $dir .=
"/".$objectref;
247 $file = $dir.
"/".$objectref.
".pdf";
249 if (!file_exists($dir)) {
251 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
256 if (file_exists($dir)) {
258 if (!is_object($hookmanager)) {
259 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
262 $hookmanager->initHooks(array(
'pdfgeneration'));
263 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
265 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
270 $pdf->SetAutoPageBreak(1, 0);
272 $heightforinfotot = 40;
273 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
274 $heightforfooter = $this->marge_basse + 8;
275 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
276 $heightforfooter += 6;
279 if (class_exists(
'TCPDF')) {
280 $pdf->setPrintHeader(
false);
281 $pdf->setPrintFooter(
false);
285 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
286 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
287 $tplidx = $pdf->importPage(1);
291 $task =
new Task($this->db);
292 $tasksarray = array();
293 $tasksarray = $task->getTasksArray(0, 0, $object->id);
296 if (!$object->id > 0) {
297 $tasksarray = array_slice($tasksarray, 0, min(5, count($tasksarray)));
300 $object->lines = $tasksarray;
301 $nblines = count($object->lines);
305 $pdf->SetDrawColor(128, 128, 128);
307 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
308 $pdf->SetSubject($outputlangs->transnoentities(
"Project"));
309 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
310 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
311 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"Project"));
313 $pdf->SetCompression(
false);
316 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
319 $pdf->AddPage($this->orientation);
320 if (!empty($tplidx)) {
321 $pdf->useTemplate($tplidx);
324 $this->
_pagehead($pdf, $object, 1, $outputlangs);
325 $pdf->SetFont(
'',
'', $default_font_size - 1);
326 $pdf->MultiCell(0, 3,
'');
327 $pdf->SetTextColor(0, 0, 0);
330 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
332 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
335 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
344 $pdf->SetFont(
'',
'', $default_font_size - 1);
345 $pdf->writeHTMLCell(190, 3, $this->posxref - 1, $tab_top - 2,
dol_htmlentitiesbr($notetoshow), 0, 1);
346 $nexY = $pdf->GetY();
347 $height_note = $nexY - $tab_top;
350 $pdf->SetDrawColor(192, 192, 192);
351 $pdf->Rect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2);
353 $tab_height = $tab_height - $height_note;
354 $tab_top = $nexY + 6;
359 $heightoftitleline = 10;
360 $iniY = $tab_top + $heightoftitleline + 1;
361 $curY = $tab_top + $heightoftitleline + 1;
362 $nexY = $tab_top + $heightoftitleline + 1;
364 $listofreferent = array(
367 'title'=>
"ListProposalsAssociatedProject",
370 'datefieldname'=>
'datep',
371 'test'=>
isModEnabled(
'propal') && $user->hasRight(
'propal',
'lire'),
374 'name'=>
"CustomersOrders",
375 'title'=>
"ListOrdersAssociatedProject",
378 'datefieldname'=>
'date_commande',
379 'test'=>
isModEnabled(
'commande') && $user->hasRight(
'commande',
'lire'),
382 'name'=>
"CustomersInvoices",
383 'title'=>
"ListInvoicesAssociatedProject",
387 'datefieldname'=>
'datef',
388 'test'=>
isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire'),
390 'invoice_predefined'=>array(
391 'name'=>
"PredefinedInvoices",
392 'title'=>
"ListPredefinedInvoicesAssociatedProject",
393 'class'=>
'FactureRec',
394 'table'=>
'facture_rec',
395 'datefieldname'=>
'datec',
396 'test'=>
isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire'),
398 'order_supplier'=>array(
399 'name'=>
"SuppliersOrders",
400 'title'=>
"ListSupplierOrdersAssociatedProject",
401 'class'=>
'CommandeFournisseur',
402 'table'=>
'commande_fournisseur',
403 'datefieldname'=>
'date_commande',
404 'test'=>(
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (
isModEnabled(
"supplier_order") && $user->rights->supplier_order->lire),
406 'invoice_supplier'=>array(
407 'name'=>
"BillsSuppliers",
408 'title'=>
"ListSupplierInvoicesAssociatedProject",
409 'class'=>
'FactureFournisseur',
411 'table'=>
'facture_fourn',
412 'datefieldname'=>
'datef',
413 'test'=>(
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (
isModEnabled(
"supplier_invoice") && $user->rights->supplier_invoice->lire),
417 'title'=>
"ListContractAssociatedProject",
420 'datefieldname'=>
'date_contrat',
421 'test'=>
isModEnabled(
'contrat') && $user->hasRight(
'contrat',
'lire'),
423 'intervention'=>array(
424 'name'=>
"Interventions",
425 'title'=>
"ListFichinterAssociatedProject",
426 'class'=>
'Fichinter',
427 'table'=>
'fichinter',
428 'datefieldname'=>
'date_valid',
430 'test'=>
isModEnabled(
'ficheinter') && $user->hasRight(
'ficheinter',
'lire'),
431 'lang'=>
'interventions'),
433 'name'=>
"TripsAndExpenses",
434 'title'=>
"ListExpenseReportsAssociatedProject",
435 'class'=>
'Deplacement',
436 'table'=>
'deplacement',
437 'datefieldname'=>
'dated',
440 'test'=>
isModEnabled(
'deplacement') && $user->rights->deplacement->lire,
442 'expensereport'=>array(
443 'name'=>
"ExpensesReports",
444 'title'=>
"ListExpenseReportsAssociatedProject",
445 'class'=>
'ExpenseReport',
446 'table'=>
'expensereport',
447 'datefieldname'=>
'dated',
450 'test'=>
isModEnabled(
'expensereport') && $user->rights->expensereport->lire,
454 'title'=>
"ListActionsAssociatedProject",
455 'class'=>
'ActionComm',
456 'table'=>
'actioncomm',
457 'datefieldname'=>
'datep',
459 'test'=>
isModEnabled(
'agenda') && $user->rights->agenda->allactions->read,
463 $hookmanager->initHooks(array(
'completeListOfReferent'));
464 $hookmanager->executeHooks(
'completeListOfReferent', [
'listofreferent'=>$listofreferent], $object, $action);
465 if (!empty($hookmanager->resArray)) {
466 $listofreferent = array_merge($listofreferent, $hookmanager->resArray);
469 foreach ($listofreferent as $key => $value) {
470 $title = $value[
'title'];
471 $classname = $value[
'class'];
472 $tablename = $value[
'table'];
473 $datefieldname = $value[
'datefieldname'];
474 $qualified = $value[
'test'];
475 $langstoload = $value[
'lang'];
476 $projectField = isset($value[
'project_field']) ? $value[
'project_field'] :
'fk_projet';
477 $langs->load($langstoload);
484 $elementarray = $object->get_element_list($key, $tablename, $datefieldname,
'',
'', $projectField);
486 $num = count($elementarray);
488 $nexY = $pdf->GetY() + 5;
491 $pdf->SetFont(
'',
'', $default_font_size - 1);
492 $pdf->SetTextColor(0, 0, 0);
494 $pdf->SetXY($this->posxref, $curY);
495 $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0,
'L');
497 $selectList = $formproject->select_element($tablename, $object->thirdparty->id,
'', -2, $projectField);
498 $nexY = $pdf->GetY() + 1;
500 $pdf->SetXY($this->posxref, $curY);
501 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities(
"Ref"), 1,
'L');
502 $pdf->SetXY($this->posxdate, $curY);
503 $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities(
"Date"), 1,
'C');
504 $pdf->SetXY($this->posxsociety, $curY);
505 $titlethirdparty = $outputlangs->transnoentities(
"ThirdParty");
506 if ($classname ==
'ExpenseReport') {
507 $titlethirdparty = $langs->trans(
"User");
509 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $titlethirdparty, 1,
'L');
510 if (empty($value[
'disableamount'])) {
511 $pdf->SetXY($this->posxamountht, $curY);
512 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities(
"AmountHTShort"), 1,
'R');
513 $pdf->SetXY($this->posxamountttc, $curY);
514 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities(
"AmountTTCShort"), 1,
'R');
516 $pdf->SetXY($this->posxamountht, $curY);
517 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3,
"", 1,
'R');
519 $pdf->SetXY($this->posxstatut, $curY);
520 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities(
"Status"), 1,
'R');
522 if (is_array($elementarray) && count($elementarray) > 0) {
523 $nexY = $pdf->GetY();
527 $num = count($elementarray);
530 for ($i = 0; $i < $num; $i++) {
532 $pdf->SetFont(
'',
'', $default_font_size - 1);
533 $pdf->SetTextColor(0, 0, 0);
535 $pdf->setTopMargin($tab_top_newpage);
536 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
537 $pageposbefore = $pdf->getPage();
540 $idofelement = $elementarray[$i];
541 if ($classname ==
'ExpenseReport') {
544 $expensereportline->fetch($idofelement);
545 $idofelement = $expensereportline->fk_expensereport;
548 $element =
new $classname($this->db);
549 $element->fetch($idofelement);
550 $element->fetch_thirdparty();
553 $qualifiedfortotal =
true;
554 if ($key ==
'invoice') {
555 if ($element->close_code ==
'replaced') {
556 $qualifiedfortotal =
false;
560 $showpricebeforepagebreak = 1;
562 $pdf->startTransaction();
564 $pdf->SetXY($this->posxref, $curY);
565 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
566 $pageposafter = $pdf->getPage();
567 if ($pageposafter > $pageposbefore) {
568 $pdf->rollbackTransaction(
true);
569 $pageposafter = $pageposbefore;
571 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
573 $pdf->SetXY($this->posxref, $curY);
574 $posybefore = $pdf->GetY();
575 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
576 $pageposafter = $pdf->getPage();
577 $posyafter = $pdf->GetY();
578 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
579 if ($i == ($num - 1)) {
580 $pdf->AddPage($this->orientation,
'',
true);
581 if (!empty($tplidx)) {
582 $pdf->useTemplate($tplidx);
585 $this->
_pagehead($pdf, $object, 0, $outputlangs);
587 $pdf->setPage($pageposafter + 1);
593 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
594 $showpricebeforepagebreak = 1;
596 $showpricebeforepagebreak = 0;
599 $forcedesconsamepage = 1;
600 if ($forcedesconsamepage) {
601 $pdf->rollbackTransaction(
true);
602 $pageposafter = $pageposbefore;
603 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
605 $pdf->AddPage($this->orientation,
'',
true);
606 if (!empty($tplidx)) {
607 $pdf->useTemplate($tplidx);
610 $this->
_pagehead($pdf, $object, 0, $outputlangs);
612 $pdf->setPage($pageposafter + 1);
613 $pdf->SetFont(
'',
'', $default_font_size - 1);
614 $pdf->MultiCell(0, 3,
'');
615 $pdf->SetTextColor(0, 0, 0);
617 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
618 $curY = $tab_top_newpage + $heightoftitleline + 1;
621 $pdf->SetXY($this->posxref, $curY);
622 $posybefore = $pdf->GetY();
623 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
624 $pageposafter = $pdf->getPage();
625 $posyafter = $pdf->GetY();
631 $pdf->commitTransaction();
633 $posYAfterDescription = $pdf->GetY();
635 $nexY = $pdf->GetY();
636 $pageposafter = $pdf->getPage();
637 $pdf->setPage($pageposbefore);
638 $pdf->setTopMargin($this->marge_haute);
639 $pdf->setPageOrientation($this->orientation, 1, 0);
642 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
644 $pdf->setPage($pageposafter);
645 $curY = $tab_top_newpage + $heightoftitleline + 1;
648 $pdf->SetFont(
'',
'', $default_font_size - 1);
651 if ($tablename ==
'commande_fournisseur' || $tablename ==
'supplier_order') {
652 $date = $element->date_commande;
654 $date = $element->date;
656 $date = $element->datep;
659 $date = $element->date_contrat;
662 $date = $element->datev;
666 $pdf->SetXY($this->posxdate, $curY);
667 $pdf->MultiCell($this->posxsociety - $this->posxdate, 3,
dol_print_date($date,
'day'), 1,
'C');
669 $pdf->SetXY($this->posxsociety, $curY);
670 if ($classname ==
'ExpenseReport') {
671 $fuser =
new User($this->db);
672 $fuser->fetch($element->fk_user_author);
673 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1,
'L');
675 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty) ? $element->thirdparty->name :
''), 1,
'L');
679 if (empty($value[
'disableamount'])) {
680 $pdf->SetXY($this->posxamountht, $curY);
681 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ?
price($element->total_ht) :
''), 1,
'R');
682 $pdf->SetXY($this->posxamountttc, $curY);
683 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ?
price($element->total_ttc) :
''), 1,
'R');
685 $pdf->SetXY($this->posxamountht, $curY);
686 if ($key ==
'agenda') {
687 $textforamount =
dol_trunc($element->label, 26);
688 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, $textforamount, 1,
'L');
690 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3,
"", 1,
'R');
697 $outputstatut = $element->getLibStatut(1, $element->getSommePaiement());
699 $outputstatut = $element->getLibStatut(1);
701 $pdf->SetXY($this->posxstatut, $curY);
702 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1,
'R',
false, 1,
'',
'',
true, 0,
true);
704 if ($qualifiedfortotal) {
705 $total_ht = $total_ht + $element->total_ht;
706 $total_ttc = $total_ttc + $element->total_ttc;
708 $nexY = $pdf->GetY();
712 if (empty($value[
'disableamount'])) {
714 $pdf->SetXY($this->posxref, $curY);
715 $pdf->MultiCell($this->posxamountttc - $this->posxref, 3,
"TOTAL", 1,
'L');
716 $pdf->SetXY($this->posxamountht, $curY);
717 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ?
price($total_ht) :
''), 1,
'R');
718 $pdf->SetXY($this->posxamountttc, $curY);
719 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ?
price($total_ttc) :
''), 1,
'R');
720 $pdf->SetXY($this->posxstatut, $curY);
721 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities(
"Nb").
" ".$num, 1,
'L');
723 $nexY = $pdf->GetY() + 5;
731 while ($pagenb < $pageposafter) {
732 $pdf->setPage($pagenb);
733 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
735 $pdf->setPage($pagenb);
736 $pdf->setPageOrientation($this->orientation, 1, 0);
738 $this->
_pagehead($pdf, $object, 0, $outputlangs);
740 if (!empty($tplidx)) {
741 $pdf->useTemplate($tplidx);
747 $this->
_pagefoot($pdf, $object, $outputlangs);
748 if (method_exists($pdf,
'AliasNbPages')) {
749 $pdf->AliasNbPages();
754 $pdf->Output($file,
'F');
757 $hookmanager->initHooks(array(
'pdfgeneration'));
758 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
760 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
762 $this->error = $hookmanager->error;
763 $this->errors = $hookmanager->errors;
768 $this->result = array(
'fullpath'=>$file);
772 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
776 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"PROJECT_OUTPUTDIR");
794 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
796 $heightoftitleline = 10;
800 $pdf->SetDrawColor(128, 128, 128);
803 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
806 $pdf->line($this->marge_gauche, $tab_top + $heightoftitleline, $this->page_largeur - $this->marge_droite, $tab_top + $heightoftitleline);
808 $pdf->SetTextColor(0, 0, 0);
809 $pdf->SetFont(
'',
'', $default_font_size);
822 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
824 global $langs, $conf, $mysoc;
830 $pdf->SetTextColor(0, 0, 60);
831 $pdf->SetFont(
'',
'B', $default_font_size + 3);
833 $posx = $this->page_largeur - $this->marge_droite - 100;
834 $posy = $this->marge_haute;
836 $pdf->SetXY($this->marge_gauche, $posy);
839 $logo = $conf->mycompany->dir_output.
'/logos/'.$mysoc->logo;
841 if (is_readable($logo)) {
843 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
845 $pdf->SetTextColor(200, 0, 0);
846 $pdf->SetFont(
'',
'B', $default_font_size - 2);
847 $pdf->MultiCell(100, 3, $langs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
848 $pdf->MultiCell(100, 3, $langs->transnoentities(
"ErrorGoToModuleSetup"), 0,
'L');
851 $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0,
'L');
854 $pdf->SetFont(
'',
'B', $default_font_size + 3);
855 $pdf->SetXY($posx, $posy);
856 $pdf->SetTextColor(0, 0, 60);
857 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Project").
" ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
858 $pdf->SetFont(
'',
'', $default_font_size + 2);
861 $pdf->SetXY($posx, $posy);
862 $pdf->SetTextColor(0, 0, 60);
863 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DateStart").
" : ".
dol_print_date($object->date_start,
'day',
false, $outputlangs,
true),
'',
'R');
866 $pdf->SetXY($posx, $posy);
867 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DateEnd").
" : ".
dol_print_date($object->date_end,
'day',
false, $outputlangs,
true),
'',
'R');
869 if (is_object($object->thirdparty)) {
871 $pdf->SetXY($posx, $posy);
872 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"ThirdParty").
" : ".$object->thirdparty->getFullName($outputlangs),
'',
'R');
875 $pdf->SetTextColor(0, 0, 60);
888 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
890 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
891 return pdf_pagefoot($pdf, $outputlangs,
'PROJECT_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);