Fix: Filter on late unpaid was wrong

This commit is contained in:
Laurent Destailleur 2010-12-31 10:59:50 +00:00
parent 66ece77b27
commit 4e8b22d23e
2 changed files with 2 additions and 3 deletions

View File

@ -2789,7 +2789,7 @@ class Facture extends CommonObject
{
global $conf, $user;
$now=gmmktime();
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";

View File

@ -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"]);