diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ea4b55abef7..1801d82b96d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2789,7 +2789,7 @@ class Facture extends CommonObject { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 3b19b37b4e6..1ee2a2c77c8 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -187,11 +187,10 @@ $sql.= " AND f.type in (0,1) AND f.fk_statut = 1"; $sql.= " AND f.paye = 0"; if ($option == 'late') { - $sql.=" AND f.date_lim_reglement < ".$db->idate(dol_now('tzref')); + $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; } if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql .= " AND s.rowid = ".$socid; - if ($_GET["filtre"]) { $filtrearr = explode(",", $_GET["filtre"]);