From d36733d79b130ad036b2f8ccf415bb0a03af248a Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 3 Jan 2024 19:54:15 +0100 Subject: [PATCH] Fix php warning --- htdocs/product/class/productbatch.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 20e3932ce33..c1f48884e84 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -523,10 +523,12 @@ class Productbatch extends CommonObject $tmp->context['stock_date_entry'] = $obj->date_entree; } - // Some properties of the lot - $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots - $tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); - $tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); + if ($fk_product > 0) { + // Some properties of the lot + $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots + $tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); + $tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); + } $ret[$tmp->batch] = $tmp; // $ret is for a $fk_product_stock and unique key is on $fk_product_stock+batch $i++;