Merge pull request #1602 from atm-alexis/3.5
FIX alert for customer order wasn't on delivery_date if exist
This commit is contained in:
commit
ab337c7485
@ -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
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user