From ff6708840ddd8c30deade00ed72d7c27c5a3813a Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas <maxime@atm-consulting.fr>
Date: Fri, 22 May 2015 09:23:28 +0200
Subject: [PATCH] Fix : facturestats was not filtering on invoice type

---
 htdocs/compta/facture/class/facturestats.class.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php
index d1b39da15ce..5d8d22cfa9d 100644
--- a/htdocs/compta/facture/class/facturestats.class.php
+++ b/htdocs/compta/facture/class/facturestats.class.php
@@ -84,6 +84,8 @@ class FactureStats extends Stats
 			$this->where.=" AND f.fk_soc = ".$this->socid;
 		}
         if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid;
+		if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2)";
+		else $this->where.= " AND f.type IN (0,1,2,3)";
 	}
 
 
-- 
GitLab