From 4b410d5aba393e2e7e57ddf5e5063065107a8512 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Tue, 27 Oct 2009 11:20:34 +0000
Subject: [PATCH] Fix: uniformize code

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

diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php
index 85d86b1fe95..9468d979693 100644
--- a/htdocs/commande/liste.php
+++ b/htdocs/commande/liste.php
@@ -81,13 +81,13 @@ 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;
 if ($sref)
 {
-	$sql.= " AND c.ref like '%".addslashes($sref)."%'";
+	$sql.= " AND c.ref LIKE '%".addslashes($sref)."%'";
 }
 if ($sall)
 {
-	$sql.= " AND (c.ref like '%".addslashes($sall)."%' OR c.note like '%".addslashes($sall)."%')";
+	$sql.= " AND (c.ref LIKE '%".addslashes($sall)."%' OR c.note LIKE '%".addslashes($sall)."%')";
 }
-if ($viewstatut <> '')
+if (!empty($viewstatut))
 {
 	if ($viewstatut < 4 && $viewstatut > -2)
 	{
@@ -103,7 +103,7 @@ if ($viewstatut <> '')
 	}
 	if ($viewstatut == -2)	// To process
 	{
-		$sql .= ' AND c.fk_statut > 0 and c.fk_statut <= 3 and c.facture = 0';
+		$sql .= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
 	}
 }
 if ($_GET['month'] > 0)
@@ -116,11 +116,11 @@ if ($_GET['year'] > 0)
 }
 if (!empty($snom))
 {
-	$sql.= ' AND s.nom like \'%'.addslashes($snom).'%\'';
+	$sql.= ' AND s.nom LIKE \'%'.addslashes($snom).'%\'';
 }
 if (!empty($sref_client))
 {
-	$sql.= ' AND c.ref_client like \'%'.addslashes($sref_client).'%\'';
+	$sql.= ' AND c.ref_client LIKE \'%'.addslashes($sref_client).'%\'';
 }
 
 $sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
-- 
GitLab