diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index ee3f0b6563963bbdb2f82f1f2cb04072d07bd332..9c6e9d80594298d43bb31e736bd893eff024e7e1 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -537,8 +537,8 @@ if ($resql) $productidselected=$key; $productlabelselected=$val; } - $datebefore=dol_get_first_day($year, $month?$month:1, true); - $dateafter=dol_get_last_day($year, $month?$month:12, true); + $datebefore=dol_get_first_day($year?$year:strftime("%Y",time()), $month?$month:1, true); + $dateafter=dol_get_last_day($year?$year:strftime("%Y",time()), $month?$month:12, true); $balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter);