From 7da0580b68baaa355f49f20402aaa6d36888dcd9 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 5 Jan 2025 19:06:28 +0100 Subject: [PATCH] Fix INVOICE_HIDE_LINKED_OBJECT --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++++---- .../core/modules/facture/doc/pdf_octopus.modules.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a5c514576e1..9b540229124 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -2201,10 +2201,12 @@ class pdf_crabe extends ModelePDFFactures $top_shift = 0; // Show list of linked objects - $current_y = $pdf->getY(); - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size); - if ($current_y < $pdf->getY()) { - $top_shift = $pdf->getY() - $current_y; + if (!getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT')) { + $current_y = $pdf->getY(); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) { + $top_shift = $pdf->getY() - $current_y; + } } if ($showaddress) { diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 6c75e61ae9c..4eb664c6f00 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -2380,10 +2380,12 @@ class pdf_octopus extends ModelePDFFactures $top_shift = 0; $shipp_shift = 0; // Show list of linked objects - $current_y = $pdf->getY(); - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size); - if ($current_y < $pdf->getY()) { - $top_shift = $pdf->getY() - $current_y; + if (!getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT')) { + $current_y = $pdf->getY(); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) { + $top_shift = $pdf->getY() - $current_y; + } } if ($showaddress) {