From 438e37ed59b3594948490dc25624ae580da9c685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 24 Jun 2021 21:12:32 +0200 Subject: [PATCH] fix warnings --- htdocs/product/stock/stockatdate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 77923d9e7c9..63c8172568d 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -294,8 +294,8 @@ if ($sortfield == 'stock' && $fk_warehouse > 0) { } $sql .= $db->order($sortfield, $sortorder); +$nbtotalofrecords = 0; if ($date && $dateIsValid) { // We avoid a heavy sql if mandatory parameter date not yet defined - $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); @@ -618,7 +618,9 @@ if (empty($date) || ! $dateIsValid) { print ''; print ''; -$db->free($resql); +if (!empty($resql)) { + $db->free($resql); +} print dol_get_fiche_end();