From e420a75fa0ed9e7a97c8dce413cf6747a914bc90 Mon Sep 17 00:00:00 2001
From: florian HENRY <florian.henry@atm-consulting.fr>
Date: Tue, 26 Jul 2016 09:01:28 +0200
Subject: [PATCH] SQL query style

---
 htdocs/societe/class/societe.class.php | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index e42aea20035..58832950dd5 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3501,13 +3501,11 @@ class Societe extends CommonObject
 		 * Thirdparty commercials cannot be the same in both thirdparties so we look for them and remove some
 		 * Because this function is meant to be executed within a transaction, we won't take care of it.
 		 */
-		$sql = 'SELECT rowid
-FROM '.MAIN_DB_PREFIX.'societe_commerciaux
-WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN (
-  SELECT fk_user
-  FROM '.MAIN_DB_PREFIX.'societe_commerciaux
-  WHERE fk_soc = '.(int) $origin_id.'
-);';
+		$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'societe_commerciaux ';
+		$sql .= ' WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN ( ';
+		$sql = ' SELECT fk_user ';
+		$sql = ' FROM '.MAIN_DB_PREFIX.'societe_commerciaux ';
+		$sql = ' WHERE fk_soc = '.(int) $origin_id.') ';
 
 		$query = $db->query($sql);
 
-- 
GitLab