From af4d48aec02c17318883a9b850f547d494e27fd7 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Wed, 15 Jan 2014 15:42:14 +0100
Subject: [PATCH] Fix: If end date is not defined, we can't say it is too late.

---
 htdocs/fourn/class/fournisseur.facture.class.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index a237ef49a5f..060d2d51a83 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1378,7 +1378,7 @@ class FactureFournisseur extends CommonInvoice
             while ($obj=$this->db->fetch_object($resql))
             {
                 $this->nbtodo++;
-                if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++;
+                if (! empty($obj->datefin) && $this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++;
             }
             $this->db->free($resql);
             return 1;
-- 
GitLab