From 80eff6490db5a80fd5c6f13de652a32e80553764 Mon Sep 17 00:00:00 2001
From: Benjamin Ulrich <b.ulrich@adito.de>
Date: Mon, 18 Jan 2021 13:23:39 +0000
Subject: [PATCH] 1064227 small visit recommendation fixes

---
 .../generatedData/visitrecommendation.xml     |  2 +-
 entity/Contact_entity/Contact_entity.aod      | 66 +++++++++----------
 .../initFilterProcess.js                      |  2 +-
 3 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/visitrecommendation.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/visitrecommendation.xml
index 8c87c7d354..6f2b91485c 100644
--- a/.liquibase/Data_alias/basic/_demoData/generatedData/visitrecommendation.xml
+++ b/.liquibase/Data_alias/basic/_demoData/generatedData/visitrecommendation.xml
@@ -7,7 +7,7 @@
       <column name="DUE_DATE" valueDate="2020-09-16T12:00:00"/>
       <column name="SOURCE" value="MANUAL                              "/>
       <column name="PRIORITY" value="VISITPRIOCRITICAL                   "/>
-      <column name="CONTACT_ID" value="fb07cb0e-c391-4503-9c47-a39ec7388f4f"/>
+      <column name="CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/>
     </insert>
   </changeSet>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod
index 4a9633d191..08a76c0db8 100644
--- a/entity/Contact_entity/Contact_entity.aod
+++ b/entity/Contact_entity/Contact_entity.aod
@@ -65,17 +65,17 @@
     </entityField>
     <entityConsumer>
       <name>Organisations</name>
+      <dependency>
+        <name>dependency</name>
+        <entityName>Organisation_entity</entityName>
+        <fieldName>WithPersonIdFilter</fieldName>
+      </dependency>
       <children>
         <entityParameter>
           <name>ExcludeOrganisationsByPersonId</name>
           <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js</valueProcess>
         </entityParameter>
       </children>
-      <dependency>
-        <name>dependency</name>
-        <entityName>Organisation_entity</entityName>
-        <fieldName>WithPersonIdFilter</fieldName>
-      </dependency>
     </entityConsumer>
     <entityParameter>
       <name>PersonId_param</name>
@@ -86,12 +86,6 @@
       <name>PersonRelated</name>
       <targetContextField>targetContext</targetContextField>
       <targetIdField>CONTACTID</targetIdField>
-      <children>
-        <entityParameter>
-          <name>OwnContactId_param</name>
-          <expose v="false" />
-        </entityParameter>
-      </children>
       <dependencies>
         <entityDependency>
           <name>14975dad-907c-4f8c-bd39-243508ede721</name>
@@ -100,6 +94,12 @@
           <isConsumer v="false" />
         </entityDependency>
       </dependencies>
+      <children>
+        <entityParameter>
+          <name>OwnContactId_param</name>
+          <expose v="false" />
+        </entityParameter>
+      </children>
     </entityProvider>
     <entityField>
       <name>ADDRESS_ID</name>
@@ -115,31 +115,31 @@
     </entityField>
     <entityConsumer>
       <name>Communications</name>
-      <children>
-        <entityParameter>
-          <name>ContactId_param</name>
-          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/communications/children/contactid_param/valueProcess.js</valueProcess>
-        </entityParameter>
-      </children>
       <dependency>
         <name>dependency</name>
         <entityName>Communication_entity</entityName>
         <fieldName>AllCommunications</fieldName>
       </dependency>
-    </entityConsumer>
-    <entityConsumer>
-      <name>ContactAddresses</name>
       <children>
         <entityParameter>
           <name>ContactId_param</name>
-          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/contactaddresses/children/contactid_param/valueProcess.js</valueProcess>
+          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/communications/children/contactid_param/valueProcess.js</valueProcess>
         </entityParameter>
       </children>
+    </entityConsumer>
+    <entityConsumer>
+      <name>ContactAddresses</name>
       <dependency>
         <name>dependency</name>
         <entityName>Address_entity</entityName>
         <fieldName>ContactAddresses</fieldName>
       </dependency>
+      <children>
+        <entityParameter>
+          <name>ContactId_param</name>
+          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/contactaddresses/children/contactid_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
     </entityConsumer>
     <entityField>
       <name>LANGUAGE</name>
@@ -163,13 +163,6 @@
       <targetContextField>targetContext</targetContextField>
       <targetIdField>CONTACTID</targetIdField>
       <titlePlural>Other Contactroles</titlePlural>
-      <children>
-        <entityParameter>
-          <name>PersonId_param</name>
-          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/personscontactsexceptown/children/personid_param/valueProcess.js</valueProcess>
-          <expose v="false" />
-        </entityParameter>
-      </children>
       <dependencies>
         <entityDependency>
           <name>34cc85f4-5555-4631-94fc-f3ad35b7ce7e</name>
@@ -178,6 +171,13 @@
           <isConsumer v="false" />
         </entityDependency>
       </dependencies>
+      <children>
+        <entityParameter>
+          <name>PersonId_param</name>
+          <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/personscontactsexceptown/children/personid_param/valueProcess.js</valueProcess>
+          <expose v="false" />
+        </entityParameter>
+      </children>
     </entityProvider>
     <entityParameter>
       <name>OwnContactId_param</name>
@@ -198,17 +198,17 @@
     </entityField>
     <entityConsumer>
       <name>KeywordContactStates</name>
+      <dependency>
+        <name>dependency</name>
+        <entityName>KeywordEntry_entity</entityName>
+        <fieldName>SpecificContainerKeywords</fieldName>
+      </dependency>
       <children>
         <entityParameter>
           <name>ContainerName_param</name>
           <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/keywordcontactstates/children/containername_param/valueProcess.js</valueProcess>
         </entityParameter>
       </children>
-      <dependency>
-        <name>dependency</name>
-        <entityName>KeywordEntry_entity</entityName>
-        <fieldName>SpecificContainerKeywords</fieldName>
-      </dependency>
     </entityConsumer>
     <entityParameter>
       <name>LanguageKey_param</name>
diff --git a/entity/VisitRecommendation_entity/initFilterProcess.js b/entity/VisitRecommendation_entity/initFilterProcess.js
index bda986ba45..66870117e5 100644
--- a/entity/VisitRecommendation_entity/initFilterProcess.js
+++ b/entity/VisitRecommendation_entity/initFilterProcess.js
@@ -6,7 +6,7 @@ import("KeywordRegistry_basic");
 import("system.result");
 import("Employee_lib");
 
-
+var res;
 if (vars.get("$sys.presentationmode") === neon.CONTEXT_PRESENTATIONMODE_FILTER) 
 {
     var sourceKey = $KeywordRegistry.visitRecommendationPrioSource$manual()
-- 
GitLab