From 815206cb15d8881e80c8eb2aaba905e77950e92e Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 08:59:22 +0100 Subject: [PATCH] Add Project Title in header of pdf Add project Title if Global Constant PDF_SHOW_PROJECT_TITLE is active. --- .../core/modules/facture/doc/pdf_crabe.modules.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ed99a04fcc2..597c612d6f1 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1634,6 +1634,18 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } $objectidnext=$object->getIdReplacingInvoice('validated'); if ($object->type == 0 && $objectidnext)