From b44ddaa69632000a8a665a16bdebb9a0ebc04762 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:04:03 +0200 Subject: [PATCH 1/2] FIX Use the wrong logo size on PDF --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 +++++++++- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 8aef1aff7b0..07383d96e7f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1453,9 +1453,17 @@ class pdf_azur extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo = $logodir.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c93fc9a7c81..18f3617bdc4 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1449,9 +1449,17 @@ class pdf_cyan extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo = $logodir.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); From 90854dc2bf7116cf4ce53fe5e48b15155b2d838b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 19:51:58 +0200 Subject: [PATCH 2/2] FIX Use the wrong logo size on PDF --- .../core/modules/commande/doc/pdf_einstein.modules.php | 10 +++++++++- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 778b6525d21..77b1eb60e25 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1251,9 +1251,17 @@ class pdf_einstein extends ModelePDFCommandes // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo = $logodir.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 37d63efb3e3..81fe6310dd4 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1563,9 +1563,17 @@ class pdf_crabe extends ModelePDFFactures // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo = $logodir.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo);