From 88f7ca9214048a88d0db09d5d2ac74e69ed791ff Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 24 Jun 2021 12:27:39 +0200 Subject: [PATCH] Fix MAIN_GENERATE_RECEPTION_WITH_PICTURE --- .../modules/reception/doc/pdf_squille.modules.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 4642e77f3e3..ee123471aa1 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -126,7 +126,7 @@ class pdf_squille extends ModelePdfReception // Loop on each lines to detect if there is at least one image to show $realpatharray = array(); - if (!empty($conf->global->MAIN_GENERATE_SHIPMENT_WITH_PICTURE)) + if (!empty($conf->global->MAIN_GENERATE_RECEPTION_WITH_PICTURE)) { $objphoto = new Product($this->db); @@ -137,8 +137,14 @@ class pdf_squille extends ModelePdfReception $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); - $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; - $dir = $conf->product->dir_output.'/'.$pdir; + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) + { + $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; + $dir = $conf->product->dir_output.'/'.$pdir; + } else { + $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product'); + $dir = $conf->product->dir_output.'/'.$pdir; + } $realpath = '';