diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php
index 340fd7dc0df..26991915c2f 100644
--- a/htdocs/product/stock/stockatdate.php
+++ b/htdocs/product/stock/stockatdate.php
@@ -615,11 +615,12 @@ if ($mode == 'future') {
$colspan++;
}
-print '
| '.$langs->trans("Totalforthispage").' | ';
-print ' | | '.price(price2num($totalbuyingprice, 'MT')).' | | | | |
';
if (empty($date) || !$dateIsValid) {
print '| '.$langs->trans("EnterADateCriteria").' |
';
+} else {
+ print '| '.$langs->trans("Totalforthispage").' | ';
+ print ' | | '.price(price2num($totalbuyingprice, 'MT')).' | | | | |
';
}
print '';