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 = '';