From 77ecd5c6fcd741fed191fba57bbb0430f77a6494 Mon Sep 17 00:00:00 2001
From: simnandez <jmenent@2byte.es>
Date: Thu, 20 Sep 2012 15:55:51 +0200
Subject: [PATCH] =?UTF-8?q?[=20task=20#104=20]=20Possibilit=C3=A9=20de=20f?=
 =?UTF-8?q?acturer=20plusieurs=20commandes.=20Working?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 htdocs/commande/orderstoinvoice.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 3cc4ded371b..5b1833ae50e 100755
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -503,7 +503,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 	$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 	$sql.= ' WHERE c.fk_soc = s.rowid';
+	
 	// Which invoice to show
+	/*
 	if ($viewstatut <> '')
 	{
 		if ($viewstatut < 4 && $viewstatut > -2)
@@ -524,6 +526,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 			$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";    // If status is 2 and facture=1, it must be selected
 		}
 	}
+	*/
+	$sql.= " AND c.fk_statut in (1, 2) AND c.facture = 0";
+	
 	$sql.= ' AND s.entity = '.$conf->entity;
 	if ($socid)	$sql.= ' AND s.rowid = '.$socid;
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
-- 
GitLab