From fec2a3e4e323921b75442beca5ed2997411dd6a8 Mon Sep 17 00:00:00 2001
From: "d.buechler" <d.buechler@adito.de>
Date: Thu, 22 Aug 2019 09:57:22 +0200
Subject: [PATCH] =?UTF-8?q?Detailansicht=20zeigt=20nun=20alle=20Kontakte?=
 =?UTF-8?q?=20innerhalb=20des=20selektierten=20Clusters=20ausgenommen=20de?=
 =?UTF-8?q?r=20ignorierten=20Dubletten=20in=20der=20personfilter=5Fview.?=
 =?UTF-8?q?=20Die=20ignorierten=20werden=20demn=C3=A4chst=20in=20einer=20s?=
 =?UTF-8?q?eparaten=20Detailansicht=20dargestellt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 process/DuplicateScanner_lib/process.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js
index f9c657b2de..085e9684fb 100644
--- a/process/DuplicateScanner_lib/process.js
+++ b/process/DuplicateScanner_lib/process.js
@@ -100,10 +100,12 @@ DuplicateScannerUtils.GetCachedDuplicatesForContactId = function(pDuplicateId)
 
 DuplicateScannerUtils.GetCachedDuplicatesForClusterId = function(pClusterId)
 {
-    let query = "select DUPLICATEID from DUPLICATECLUSTERS"
-                + " where CLUSTERID = '"+ pClusterId +"' ";
-            
-    return db.array(db.COLUMN, query);
+    let duplicateIdsOfClusterWithoutUnrelated = SqlCondition.begin()
+    .and("DUPLICATEID not in (select UNRELATEDDUPLICATES.UNRELATEDDUPLICATEID from UNRELATEDDUPLICATES)")
+    .andIn("DUPLICATECLUSTERS.CLUSTERID", [pClusterId])
+    .buildSql("select DUPLICATEID from DUPLICATECLUSTERS");
+     
+    return db.array(db.COLUMN, duplicateIdsOfClusterWithoutUnrelated);
 }
 
 DuplicateScannerUtils.GetCachedDuplicatesForId = function(pClusterRecordId)
-- 
GitLab