From 4f98618d4cf72c882452a08389639141439f6bd4 Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Thu, 2 May 2019 11:03:56 +0200
Subject: [PATCH] Campaign Charts

---
 .../CampaignCostChart_entity.aod              | 55 ++++++++++++++
 .../recordcontainers/jdito/contentProcess.js  | 72 +++++++++++++++++++
 .../CampaignParticipantChart_entity.aod       | 56 +++++++++++++++
 .../recordcontainers/jdito/contentProcess.js  | 55 ++++++++++++++
 entity/Campaign_entity/Campaign_entity.aod    | 34 ++++++++-
 .../children/campaignid_param/valueProcess.js |  4 ++
 .../children/campaignid_param/valueProcess.js |  4 ++
 .../_____LANGUAGE_EXTRA.aod                   |  3 +
 .../_____LANGUAGE_de/_____LANGUAGE_de.aod     | 12 ++++
 .../_____LANGUAGE_en/_____LANGUAGE_en.aod     |  6 +-
 neonContext/Campaign/Campaign.aod             |  4 ++
 .../CampaignCostChart/CampaignCostChart.aod   | 12 ++++
 .../CampaignParticipantChart.aod              | 12 ++++
 .../CampaignCharts_view.aod                   | 23 ++++++
 .../CampaignCostChart_view.aod                | 21 ++++++
 .../CampaignMain_view/CampaignMain_view.aod   |  5 ++
 .../CampaignParticipantChart_view.aod         | 21 ++++++
 process/Data_lib/process.js                   |  2 +-
 18 files changed, 396 insertions(+), 5 deletions(-)
 create mode 100644 entity/CampaignCostChart_entity/CampaignCostChart_entity.aod
 create mode 100644 entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js
 create mode 100644 entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod
 create mode 100644 entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js
 create mode 100644 entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js
 create mode 100644 entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js
 create mode 100644 neonContext/CampaignCostChart/CampaignCostChart.aod
 create mode 100644 neonContext/CampaignParticipantChart/CampaignParticipantChart.aod
 create mode 100644 neonView/CampaignCharts_view/CampaignCharts_view.aod
 create mode 100644 neonView/CampaignCostChart_view/CampaignCostChart_view.aod
 create mode 100644 neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod

diff --git a/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod b/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod
new file mode 100644
index 00000000000..6dde02c1be9
--- /dev/null
+++ b/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.2">
+  <name>CampaignCostChart_entity</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <recordContainer>jdito</recordContainer>
+  <entityFields>
+    <entityProvider>
+      <name>#PROVIDER</name>
+    </entityProvider>
+    <entityField>
+      <name>UID</name>
+    </entityField>
+    <entityField>
+      <name>PARENT</name>
+    </entityField>
+    <entityField>
+      <name>X</name>
+    </entityField>
+    <entityField>
+      <name>Y</name>
+    </entityField>
+    <entityParameter>
+      <name>CampaignId_param</name>
+      <expose v="true" />
+      <mandatory v="true" />
+      <description>PARAMETER</description>
+    </entityParameter>
+    <entityProvider>
+      <name>CostChart</name>
+      <fieldType>DEPENDENCY_IN</fieldType>
+      <dependencies>
+        <entityDependency>
+          <name>e519262b-ff42-4c26-9d28-4d9566eafcdc</name>
+          <entityName>Campaign_entity</entityName>
+          <fieldName>CampaignCostsChart</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
+      </dependencies>
+    </entityProvider>
+  </entityFields>
+  <recordContainers>
+    <jDitoRecordContainer>
+      <name>jdito</name>
+      <jDitoRecordAlias>Data_alias</jDitoRecordAlias>
+      <contentProcess>%aditoprj%/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
+      <recordFields>
+        <element>UID.value</element>
+        <element>PARENT.value</element>
+        <element>X.value</element>
+        <element>X.displayValue</element>
+        <element>Y.value</element>
+      </recordFields>
+    </jDitoRecordContainer>
+  </recordContainers>
+</entity>
diff --git a/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js b/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js
new file mode 100644
index 00000000000..148ffa8a083
--- /dev/null
+++ b/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js
@@ -0,0 +1,72 @@
+import("system.result");
+import("system.util");
+import("Sql_lib");
+import("system.db");
+import("system.translate");
+import("system.vars");
+import("KeywordRegistry_basic");
+import("Keyword_lib");
+import("Campaign_lib");
+
+var campaignId = vars.get("$param.CampaignId_param");
+var campaignName = CampaignUtils.getCampaignNameById(campaignId);
+
+var costSqlSelect = "select CAMPAIGNCOSTID, CAMPAIGNSTEP_ID, CAMPAIGNSTEP.NAME, CATEGORY, " 
+    + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.campaignStepCostCategory(), "CAMPAIGNCOST.CATEGORY") 
+    + ", NET from CAMPAIGNCOST left join CAMPAIGNSTEP on CAMPAIGNSTEP_ID = CAMPAIGNSTEPID";
+var costData = db.table(SqlCondition.begin()
+    .andPrepare("CAMPAIGNCOST.CAMPAIGN_ID", campaignId)
+    .buildSql(costSqlSelect, "1=2")
+);
+
+var types = {
+    FIX : "FIX",
+    VARIABLE : "VARIABLE"
+};
+var campaignCost = {};
+
+costData.forEach(function ([costId, stepId, stepName, categoryId, categoryName, netCost]) 
+{
+    let type = stepId
+        ? types.VARIABLE
+        : types.FIX;
+    
+    if (!(type in this))
+    {
+        let typeName = type == types.FIX 
+            ? translate.text("Fix cost")
+            : translate.text("Variable costs")
+        this[type] = new CampaignCostNode("", typeName, 0);
+    }
+    if (type == types.VARIABLE && !(stepId in this))
+        this[stepId] = new CampaignCostNode(type, translate.text("Step") + ": " + stepName, 0);
+
+    categoryId = categoryId + stepId + type;
+    if (!(categoryId in this))
+        this[categoryId] = new CampaignCostNode(stepId || type, categoryName, 0);
+        
+    netCost = Number(netCost);
+    this[categoryId].value += netCost;
+    this[type].value += netCost;
+    if (stepId)
+        this[stepId].value += netCost;
+}, campaignCost);
+
+var records = [];
+for (let i in campaignCost)
+    records.push([
+        i,
+        campaignCost[i].parent,
+        i,
+        campaignCost[i].title,
+        campaignCost[i].value
+    ]);
+
+result.object(records);
+
+function CampaignCostNode (pParent, pTitle, pValue)
+{
+    this.parent = pParent;
+    this.title = pTitle;
+    this.value = Number(pValue);
+}
\ No newline at end of file
diff --git a/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod b/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod
new file mode 100644
index 00000000000..ff777c45158
--- /dev/null
+++ b/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.2">
+  <name>CampaignParticipantChart_entity</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <recordContainer>jdito</recordContainer>
+  <entityFields>
+    <entityProvider>
+      <name>#PROVIDER</name>
+    </entityProvider>
+    <entityProvider>
+      <name>ParticipantChart</name>
+      <fieldType>DEPENDENCY_IN</fieldType>
+      <dependencies>
+        <entityDependency>
+          <name>59e7c7ff-a649-4efe-89dd-8fdb7967261b</name>
+          <entityName>Campaign_entity</entityName>
+          <fieldName>CampaignParticipantsChart</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
+      </dependencies>
+    </entityProvider>
+    <entityField>
+      <name>UID</name>
+    </entityField>
+    <entityField>
+      <name>X</name>
+    </entityField>
+    <entityField>
+      <name>Y</name>
+    </entityField>
+    <entityField>
+      <name>CATEGORY</name>
+    </entityField>
+    <entityParameter>
+      <name>CampaignId_param</name>
+      <expose v="true" />
+      <mandatory v="true" />
+      <description>PARAMETER</description>
+    </entityParameter>
+  </entityFields>
+  <recordContainers>
+    <jDitoRecordContainer>
+      <name>jdito</name>
+      <jDitoRecordAlias>Data_alias</jDitoRecordAlias>
+      <contentProcess>%aditoprj%/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
+      <recordFields>
+        <element>UID.value</element>
+        <element>CATEGORY.value</element>
+        <element>CATEGORY.displayValue</element>
+        <element>X.value</element>
+        <element>X.displayValue</element>
+        <element>Y.value</element>
+      </recordFields>
+    </jDitoRecordContainer>
+  </recordContainers>
+</entity>
diff --git a/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js b/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js
new file mode 100644
index 00000000000..e210588e47d
--- /dev/null
+++ b/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js
@@ -0,0 +1,55 @@
+import("system.translate");
+import("system.result");
+import("system.db");
+import("Sql_lib");
+import("system.vars");
+
+var campaignId = vars.get("$param.CampaignId_param");
+
+var sqlSelect = "select CAMPAIGNSTEPID, CAMPAIGNSTEP.NAME, count(distinct CAMPAIGNPARTICIPANTID), MAXPARTICIPANTS, count(distinct CAMPAIGNPARTICIPANTLOGID) "
+    + "from CAMPAIGNSTEP left join CAMPAIGNPARTICIPANT on CAMPAIGNSTEPID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID "
+    + "left join CAMPAIGNPARTICIPANTLOG on CAMPAIGNSTEPID = CAMPAIGNPARTICIPANTLOG.CAMPAIGNSTEP_ID ";
+var sqlGroupOrderBy = "group by CAMPAIGNSTEPID, CAMPAIGNSTEP.NAME, MAXPARTICIPANTS, CAMPAIGNSTEP.SORTING order by CAMPAIGNSTEP.SORTING";
+
+var sqlQuery = SqlCondition.begin()
+    .andPrepare("CAMPAIGNSTEP.CAMPAIGN_ID", campaignId)
+    .buildSql(sqlSelect, "1=2", sqlGroupOrderBy);
+
+var stepData = db.table(sqlQuery);
+
+var categories = {
+    CURRENT : "CURRENT",
+    MAX : "MAX",
+    LOGGED : "LOGGED"
+};
+var records = [];
+
+stepData.forEach(function ([stepId, stepName, currentCount, maxCount, loggedCount]) 
+{
+    records.push([
+        stepId + categories.CURRENT,
+        categories.CURRENT,
+        translate.text("Current participants"),
+        stepId,
+        stepName,
+        currentCount || 0,
+    ]);
+    records.push([
+        stepId + categories.MAX,
+        categories.MAX,
+        translate.text("Max participants"),
+        stepId,
+        stepName,
+        maxCount || 0,
+    ]);
+    records.push([
+        stepId + categories.LOGGED,
+        categories.LOGGED,
+        translate.text("Participated"),
+        stepId,
+        stepName,
+        loggedCount || 0,
+    ]);
+});
+
+result.object(records);
\ No newline at end of file
diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod
index d3fedb96ae9..6a7611c27c2 100644
--- a/entity/Campaign_entity/Campaign_entity.aod
+++ b/entity/Campaign_entity/Campaign_entity.aod
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.2">
   <name>Campaign_entity</name>
-  <title>Campaign</title>
   <majorModelMode>DISTRIBUTED</majorModelMode>
   <icon>VAADIN:GROUP</icon>
+  <title>Campaign</title>
   <titleProcess>%aditoprj%/entity/Campaign_entity/titleProcess.js</titleProcess>
   <recordContainer>db</recordContainer>
   <entityFields>
@@ -293,6 +293,38 @@
       <onActionProcess>%aditoprj%/entity/Campaign_entity/entityfields/newtask/onActionProcess.js</onActionProcess>
       <iconId>VAADIN:TASKS</iconId>
     </entityActionField>
+    <entityConsumer>
+      <name>CampaignCostsChart</name>
+      <title>Charts</title>
+      <fieldType>DEPENDENCY_OUT</fieldType>
+      <dependency>
+        <name>dependency</name>
+        <entityName>CampaignCostChart_entity</entityName>
+        <fieldName>CostChart</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>CampaignId_param</name>
+          <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
+    <entityConsumer>
+      <name>CampaignParticipantsChart</name>
+      <title>Chart 2</title>
+      <fieldType>DEPENDENCY_OUT</fieldType>
+      <dependency>
+        <name>dependency</name>
+        <entityName>CampaignParticipantChart_entity</entityName>
+        <fieldName>ParticipantChart</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>CampaignId_param</name>
+          <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js b/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js
new file mode 100644
index 00000000000..3814648f507
--- /dev/null
+++ b/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.vars");
+import("system.result");
+
+result.string(vars.get("$field.CAMPAIGNID"));
\ No newline at end of file
diff --git a/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js b/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js
new file mode 100644
index 00000000000..3814648f507
--- /dev/null
+++ b/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.vars");
+import("system.result");
+
+result.string(vars.get("$field.CAMPAIGNID"));
\ No newline at end of file
diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
index a0793df80f3..eb9b8a809e7 100644
--- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
+++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
@@ -3093,6 +3093,9 @@
     <entry>
       <key>The max participants count has to be equal or greater than the count of the current participants!</key>
     </entry>
+    <entry>
+      <key>Variable costs</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
   <sqlModels>
diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
index b1de3f41065..9dd927040ab 100644
--- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
+++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
@@ -2573,6 +2573,10 @@
       <key>Jersey</key>
       <value>Jersey</value>
     </entry>
+    <entry>
+      <key>Overview</key>
+      <value>Ãœbersicht</value>
+    </entry>
     <entry>
       <key>Slovenia</key>
       <value>Slowenien</value>
@@ -2585,6 +2589,10 @@
       <key>Annually</key>
       <value>jährlich</value>
     </entry>
+    <entry>
+      <key>Participated</key>
+      <value>Teilgenommen</value>
+    </entry>
     <entry>
       <key>Colombia</key>
       <value>Kolumbien</value>
@@ -3794,6 +3802,10 @@
     <entry>
       <key>Imminent appointments for today </key>
     </entry>
+    <entry>
+      <key>Variable costs</key>
+      <value>Variable Kosten</value>
+    </entry>
     <entry>
       <key>To-Do</key>
     </entry>
diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
index fd770a0a612..d199b4f347d 100644
--- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
+++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
@@ -3118,9 +3118,6 @@
       <key>${WEBSERVICE_ERROR} url:%0 status:%1</key>
       <value>Webservice not available. URL: %0 %1</value>
     </entry>
-    <entry>
-      <key>yyyy-MM-dd HH:mm:ss</key>
-    </entry>
     <entry>
       <key>per</key>
     </entry>
@@ -3130,6 +3127,9 @@
     <entry>
       <key>The max participants count has to be equal or greater than the count of the current participants!</key>
     </entry>
+    <entry>
+      <key>Variable costs</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/neonContext/Campaign/Campaign.aod b/neonContext/Campaign/Campaign.aod
index 44da77e955a..9d15d6f3ac8 100644
--- a/neonContext/Campaign/Campaign.aod
+++ b/neonContext/Campaign/Campaign.aod
@@ -31,5 +31,9 @@
       <name>4a5377cc-af00-49c7-aad2-ac93e2752b3f</name>
       <view>CampaignCost_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>484d39ea-5135-4bb2-a12d-cb7114e2981c</name>
+      <view>CampaignCharts_view</view>
+    </neonViewReference>
   </references>
 </neonContext>
diff --git a/neonContext/CampaignCostChart/CampaignCostChart.aod b/neonContext/CampaignCostChart/CampaignCostChart.aod
new file mode 100644
index 00000000000..a7a868378f8
--- /dev/null
+++ b/neonContext/CampaignCostChart/CampaignCostChart.aod
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0">
+  <name>CampaignCostChart</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <entity>CampaignCostChart_entity</entity>
+  <references>
+    <neonViewReference>
+      <name>c859b91d-d802-49c6-b330-5f66e80fe5c6</name>
+      <view>CampaignCostChart_view</view>
+    </neonViewReference>
+  </references>
+</neonContext>
diff --git a/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod b/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod
new file mode 100644
index 00000000000..9f0506d6c94
--- /dev/null
+++ b/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0">
+  <name>CampaignParticipantChart</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <entity>CampaignParticipantChart_entity</entity>
+  <references>
+    <neonViewReference>
+      <name>820b8b1b-9b8e-47f9-a5b8-f0afb934909b</name>
+      <view>CampaignParticipantChart_view</view>
+    </neonViewReference>
+  </references>
+</neonContext>
diff --git a/neonView/CampaignCharts_view/CampaignCharts_view.aod b/neonView/CampaignCharts_view/CampaignCharts_view.aod
new file mode 100644
index 00000000000..bb0f266e21d
--- /dev/null
+++ b/neonView/CampaignCharts_view/CampaignCharts_view.aod
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
+  <name>CampaignCharts_view</name>
+  <title>Overview</title>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <boxLayout>
+      <name>layout</name>
+    </boxLayout>
+  </layout>
+  <children>
+    <neonViewReference>
+      <name>e96b6827-e47e-4d85-a1fd-b1b52f36fe31</name>
+      <entityField>CampaignCostsChart</entityField>
+      <view>CampaignCostChart_view</view>
+    </neonViewReference>
+    <neonViewReference>
+      <name>e6d6c775-3d85-4a59-8df0-d57e7174ed90</name>
+      <entityField>CampaignParticipantsChart</entityField>
+      <view>CampaignParticipantChart_view</view>
+    </neonViewReference>
+  </children>
+</neonView>
diff --git a/neonView/CampaignCostChart_view/CampaignCostChart_view.aod b/neonView/CampaignCostChart_view/CampaignCostChart_view.aod
new file mode 100644
index 00000000000..70c5e7f5cbc
--- /dev/null
+++ b/neonView/CampaignCostChart_view/CampaignCostChart_view.aod
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
+  <name>CampaignCostChart_view</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <boxLayout>
+      <name>layout</name>
+    </boxLayout>
+  </layout>
+  <children>
+    <singleDataChartViewTemplate>
+      <name>SingleDataChart</name>
+      <chartTitle>Cost</chartTitle>
+      <chartType>DONUT</chartType>
+      <xAxis>X</xAxis>
+      <yAxis>Y</yAxis>
+      <parentField>PARENT</parentField>
+      <entityField>#ENTITY</entityField>
+    </singleDataChartViewTemplate>
+  </children>
+</neonView>
diff --git a/neonView/CampaignMain_view/CampaignMain_view.aod b/neonView/CampaignMain_view/CampaignMain_view.aod
index 3d9df5dea94..5c6f7bd263b 100644
--- a/neonView/CampaignMain_view/CampaignMain_view.aod
+++ b/neonView/CampaignMain_view/CampaignMain_view.aod
@@ -15,6 +15,11 @@
       <entityField>#ENTITY</entityField>
       <view>CampaignPreview_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>400f5a85-2691-47f6-9cc0-e7635828c5a5</name>
+      <entityField>#ENTITY</entityField>
+      <view>CampaignCharts_view</view>
+    </neonViewReference>
     <neonViewReference>
       <name>ad66a5a6-65fb-45d5-bf62-45661fc16e30</name>
       <entityField>CampaignSteps</entityField>
diff --git a/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod b/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod
new file mode 100644
index 00000000000..eb58fcc3ea6
--- /dev/null
+++ b/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
+  <name>CampaignParticipantChart_view</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <boxLayout>
+      <name>layout</name>
+    </boxLayout>
+  </layout>
+  <children>
+    <multiDataChartViewTemplate>
+      <name>MultiDataChart</name>
+      <chartTitle>Participants</chartTitle>
+      <chartType>BAR</chartType>
+      <xAxis>X</xAxis>
+      <yAxis>Y</yAxis>
+      <categoryField>CATEGORY</categoryField>
+      <entityField>#ENTITY</entityField>
+    </multiDataChartViewTemplate>
+  </children>
+</neonView>
diff --git a/process/Data_lib/process.js b/process/Data_lib/process.js
index e6802ed44f1..f6c7d2295ac 100644
--- a/process/Data_lib/process.js
+++ b/process/Data_lib/process.js
@@ -1,7 +1,7 @@
 import("system.util");
 
 /**
- * This class is for data which is built in a children -> parent -  way. Eich "row" consists of one UID and one parentId.<br>
+ * This class is for data which is built in a children -> parent -  way. Each "row" consists of one UID and one parentId.<br>
  * The class makes sure that even if you add an child multiple times, the ID is corrected, so that the resulting array has only unique id's.<br>
  * <br>
  * Keep in mind for performance reasons that as soon, as you add a seccond item withe the same UID as an already added child, a tree-object is buiilt internally.<br>
-- 
GitLab