Skip to content
Snippets Groups Projects
Commit ab337c74 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #1602 from atm-alexis/3.5

FIX alert for customer order wasn't on delivery_date if exist
parents 6bfff8b2 fa212438
No related branches found
No related tags found
No related merge requests found
...@@ -2516,7 +2516,7 @@ class Commande extends CommonOrder ...@@ -2516,7 +2516,7 @@ class Commande extends CommonOrder
$this->nbtodo=$this->nbtodolate=0; $this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE"; $clause = " WHERE";
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut"; $sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) if (!$user->rights->societe->client->voir && !$user->societe_id)
{ {
...@@ -2535,7 +2535,9 @@ class Commande extends CommonOrder ...@@ -2535,7 +2535,9 @@ class Commande extends CommonOrder
while ($obj=$this->db->fetch_object($resql)) while ($obj=$this->db->fetch_object($resql))
{ {
$this->nbtodo++; $this->nbtodo++;
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
} }
return 1; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment