From 223195538a33165bb464ddb30b681117968a9bd1 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Tue, 9 Feb 2016 14:29:12 +0100
Subject: [PATCH] Return bad late or not status for order

---
 htdocs/commande/class/commande.class.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 3417419f892..53c914f7a3c 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3342,14 +3342,14 @@ class Commande extends CommonOrder
     /**
      * Is the customer order delayed?
      *
-     * @return bool
+     * @return bool     true if late, false if not
      */
     public function hasDelay()
     {
         global $conf;
 
-        if (!($this->statut > Commande::STATUS_DRAFT) && ($this->statut < Commande::STATUS_CLOSED)) {
-            return false;
+        if (! ($this->statut > Commande::STATUS_DRAFT && $this->statut < Commande::STATUS_CLOSED)) {
+            return false;   // Never late if not inside this status range
         }
 
         $now = dol_now();
-- 
GitLab