diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index e3876491055..ff23193441e 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -295,7 +295,7 @@ function getDefaultDatesForTransfer() $sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'"; $sql .= $db->plimit(1); $res = $db->query($sql); - if ($res->num_rows > 0) { + if ($db->num_rows($res) > 0) { $obj = $db->fetch_object($res); $date_start = $db->jdate($obj->date_start);