Fix MAIN_GENERATE_RECEPTION_WITH_PICTURE

This commit is contained in:
Francis Appels 2021-06-24 12:27:39 +02:00
parent dc9e71084b
commit 88f7ca9214

View File

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