From fa5fe7ebf8da0655387cb7a981b8af84ef7f512f Mon Sep 17 00:00:00 2001 From: Camile <98384867+camilevahviraki@users.noreply.github.com> Date: Mon, 20 Jul 2026 01:09:32 +0300 Subject: [PATCH] FIX|Fix #34947 PDF top margin breaks layout in multiple templates (#35919) * Fix pdf top margin break layout * Fix others pdf theme's top margin --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 4 ++-- .../core/modules/bank/doc/pdf_sepamandate.modules.php | 6 +++--- .../modules/commande/doc/pdf_einstein.modules.php | 10 +++++----- .../modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 10 +++++----- .../modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- .../modules/expedition/doc/pdf_rouget.modules.php | 8 ++++---- .../core/modules/facture/doc/pdf_octopus.modules.php | 10 +++++----- .../core/modules/facture/doc/pdf_sponge.modules.php | 11 ++++++----- .../core/modules/fichinter/doc/pdf_soleil.modules.php | 10 +++++----- .../hrm/doc/pdf_standard_evaluation.modules.php | 9 +++++---- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 +++++----- .../modules/reception/doc/pdf_squille.modules.php | 10 +++++----- .../modules/stock/doc/pdf_standard_stock.modules.php | 4 ++-- .../modules/supplier_order/doc/pdf_cornas.modules.php | 8 ++++---- .../supplier_order/doc/pdf_muscadet.modules.php | 8 ++++---- .../supplier_proposal/doc/pdf_aurore.modules.php | 8 ++++---- .../supplier_proposal/doc/pdf_zenith.modules.php | 8 ++++---- .../pdf_standard_recruitmentjobposition.modules.php | 8 ++++---- 21 files changed, 88 insertions(+), 86 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index dde34d9194a..a73438b4f91 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -197,8 +197,8 @@ class pdf_ban extends ModeleBankAccountDoc $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 50; - $tab_top_newpage = 40; + $tab_top = 40 + $this->marge_haute; + $tab_top_newpage = 30 + $this->marge_haute; $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 11f2c23ccf9..b29a8d9746e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -229,8 +229,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 50; - $tab_top_newpage = 40; + $tab_top = 40 + $this->marge_haute; + $tab_top_newpage = 30 + $this->marge_haute; $tab_height = $this->page_hauteur - $tab_top - $this->heightforfooter - $this->heightforfreetext ; @@ -561,7 +561,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $tab_hl = 4; $posx = $this->marge_gauche; - $pdf->SetXY($posx, $tab_top); + $pdf->SetXY($posx, $tab_top + $this->marge_haute); $pdf->SetFont('', '', $default_font_size - 2); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 21c14832f4b..fa11b6e16f0 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -331,8 +331,8 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift + $shipp_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift + $shipp_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); // Incoterm $height_incoterms = 0; @@ -1525,7 +1525,7 @@ class pdf_einstein extends ModelePDFCommandes $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $top_shift + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1583,8 +1583,8 @@ class pdf_einstein extends ModelePDFCommandes if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; - $posy += $top_shift; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 : 32; + $posy += $top_shift + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 9e88400b0cb..c051b25c116 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -372,8 +372,8 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift + $shipp_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift + $shipp_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $this->marge_haute + 32 + $top_shift : $this->marge_haute); if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display $tab_top_newpage += $this->tabTitleHeight; @@ -1776,7 +1776,7 @@ class pdf_eratosthene extends ModelePDFCommandes $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute : $this->marge_haute + 32; $posy += $top_shift; $posx = $this->marge_gauche; if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) { @@ -1841,7 +1841,7 @@ class pdf_eratosthene extends ModelePDFCommandes if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : 32 + $this->marge_haute; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index ca83924f2ee..32f93edfea8 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -272,8 +272,8 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10); + $tab_top = 80 + $this->marge_haute; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute : $this->marge_haute); // Display notes $notetoshow = empty($object->note_public) ? '' : $object->note_public; @@ -762,7 +762,7 @@ class pdf_strato extends ModelePDFContract $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42; + $posy = 32 + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -823,8 +823,8 @@ class pdf_strato extends ModelePDFContract if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; - $posy += $top_shift; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 : 32; + $posy += $top_shift + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 7cfcb24b8ce..8cfff6e7422 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -308,8 +308,8 @@ class pdf_espadon extends ModelePdfExpedition $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90; // position of top tab - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; // position of top tab + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $this->marge_haute + 32 + $top_shift : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -1213,7 +1213,7 @@ class pdf_espadon extends ModelePdfExpedition $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1273,7 +1273,7 @@ class pdf_espadon extends ModelePdfExpedition if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 2e4e3c68159..34fffcecfc2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -339,8 +339,8 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90; // position of top tab - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute; // position of top tab + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $this->marge_haute + 42 + $top_shift : $this->marge_haute + 10); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -1076,7 +1076,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1136,7 +1136,7 @@ class pdf_rouget extends ModelePdfExpedition if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 1c9a6f33597..cc7b9fbb449 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -534,9 +534,9 @@ class pdf_octopus extends ModelePDFFactures // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher - // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) - $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + // $this->tab_top is y where we must continue content (80 = 32 + 48: 32 is height of logo and ref, 48 is address blocks) + $this->tab_top = $this->marge_haute + 80 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) + $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $this->marge_haute + 32 + $top_shift : $this->marge_haute); // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; @@ -2264,7 +2264,7 @@ class pdf_octopus extends ModelePDFFactures $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posy += $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { @@ -2324,7 +2324,7 @@ class pdf_octopus extends ModelePDFFactures if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index c52d56940d5..7e782753315 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -468,9 +468,9 @@ class pdf_sponge extends ModelePDFFactures // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher - // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) - $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + // $this->tab_top is y where we must continue content (80 = 32 + 48: 32 is height of logo and ref, 48 is address blocks) + $this->tab_top = $this->marge_haute + 80 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) + $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $this->marge_haute + 32 + $top_shift : $this->marge_haute); // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; @@ -2446,7 +2446,8 @@ class pdf_sponge extends ModelePDFFactures $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + // $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = (getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32); $posy += $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { @@ -2506,7 +2507,7 @@ class pdf_sponge extends ModelePDFFactures if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? $this->marge_haute + 30 : $this->marge_haute + 32; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index c188fe75708..010bcc2e37e 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -238,8 +238,8 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); - $tab_top = 90; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10); + $tab_top = 80 + $this->marge_haute; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -251,7 +251,7 @@ class pdf_soleil extends ModelePDFFicheinter $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow); - $tab_top = 88; + $tab_top = 78 + $this->marge_haute; $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); @@ -633,7 +633,7 @@ class pdf_soleil extends ModelePDFFicheinter $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42; + $posy = 32 + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -689,7 +689,7 @@ class pdf_soleil extends ModelePDFFicheinter if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42; + $posy = 32 + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index c5d7bb9c9e5..407732972bf 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -276,14 +276,15 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 65; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 35 : 10); + $top_margin = 55 + $this->marge_haute; + $tab_top = $top_margin; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? $top_margin + 32 : $top_margin); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; // Show notes if (!empty($object->note_public)) { - $tab_top = 65; + $tab_top = $top_margin; $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', false, 0, 12, $tab_top); @@ -664,7 +665,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation // Show sender - $posy = 40; + $posy = $this->marge_haute + 30; $posx = $this->marge_gauche; $hautcadre = 20; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index ac239c6dabc..897692f4fc8 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -268,8 +268,8 @@ class pdf_vinci extends ModelePDFMo $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -1199,7 +1199,7 @@ class pdf_vinci extends ModelePDFMo $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1253,7 +1253,7 @@ class pdf_vinci extends ModelePDFMo //if ($this->page_largeur < 210) { // $widthrecbox = 84; // To work with US executive format //} - //$posy = 42 + $top_shift; + //$posy = 32 + $this->marge_haute + $top_shift; //$posx = $this->page_largeur - $this->marge_droite - $widthrecbox; //if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { // $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 5869aee3142..95a97a6f613 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -392,8 +392,8 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); // Incoterm $height_incoterms = 0; @@ -1745,7 +1745,7 @@ class pdf_azur extends ModelePDFPropales $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1803,7 +1803,7 @@ class pdf_azur extends ModelePDFPropales if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 6f5b436d223..46009bbee04 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -361,8 +361,8 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display $tab_top_newpage += $this->tabTitleHeight; @@ -1881,8 +1881,8 @@ class pdf_cyan extends ModelePDFPropales $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; - $posy += $top_shift; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 : 32; + $posy += $top_shift + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1943,7 +1943,7 @@ class pdf_cyan extends ModelePDFPropales if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 + $this->marge_haute : 32 + $this->marge_haute; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 781f4997217..411314d5ce6 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -297,8 +297,8 @@ class pdf_squille extends ModelePdfReception $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90; // position of top tab - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10); + $tab_top = 80 + $this->marge_haute; // position of top tab + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -987,7 +987,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size + 3); - $Yoff = 25; + $Yoff = 25 + $this->marge_haute; // Add list of linked orders $origin = $object->origin; @@ -1047,7 +1047,7 @@ class pdf_squille extends ModelePdfReception $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 + $this->marge_haute : 32 + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1104,7 +1104,7 @@ class pdf_squille extends ModelePdfReception if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 + $this->marge_haute : 32 + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 848277396a6..395a7f495c6 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -266,8 +266,8 @@ class pdf_standard_stock extends ModelePDFStock $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 65 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 55 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 4c24527975a..1707e25dd54 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -331,8 +331,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $top_shift + $this->marge_haute; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $top_shift + $this->marge_haute : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -1424,7 +1424,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $top_shift + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1478,7 +1478,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42 + $top_shift; + $posy = 32 + $top_shift + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 77d8b4c22d3..8da33d905ea 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -346,8 +346,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $top_shift + $this->marge_haute; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $top_shift + $this->marge_haute : $this->marge_haute); // Incoterm if (isModEnabled('incoterm')) { @@ -1290,7 +1290,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $top_shift + $this->marge_haute; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1343,7 +1343,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42 + $top_shift; + $posy = 32 + $top_shift + $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 517768ece82..bd88f65c94b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -334,8 +334,8 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); // Affiche notes $notetoshow = empty($object->note_public) ? '' : $object->note_public; @@ -1338,7 +1338,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1399,7 +1399,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 21687b595b6..c00fdea4d0e 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -323,8 +323,8 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $this->marge_haute + $top_shift; + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute + $top_shift : $this->marge_haute); $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -1396,7 +1396,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; @@ -1454,7 +1454,7 @@ class pdf_zenith extends ModelePDFSupplierProposal if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = 42 + $top_shift; + $posy = 32 + $this->marge_haute + $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index b759ca0a28c..7222e88963b 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -324,8 +324,8 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 90 + $top_shift; - $tab_top_newpage = (!getDolGlobalString('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $tab_top = 80 + $top_shift + $this->marge_haute; // position of top tab + $tab_top_newpage = (!getDolGlobalString('MAIN_PDF_DONOTREPEAT_HEAD') ? 30 + $this->marge_haute + $top_shift : $this->marge_haute); $tab_height = 130 - $top_shift; $tab_height_newpage = 150; if (!getDolGlobalString('MAIN_PDF_DONOTREPEAT_HEAD')) { @@ -870,7 +870,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; + $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 30 + $this->marge_haute : 32 + $this->marge_haute; $posy += $top_shift; $posx = $this->marge_gauche; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) { @@ -926,7 +926,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio // Show recipient $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; if ($this->page_largeur < 210) $widthrecbox = 84; // To work with US executive format - $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; + $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 30 + $this->marge_haute : 32 + $this->marge_haute; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) $posx = $this->marge_gauche;