From 51f0facd1655326c60835bb6bc2afb89a0f637ec Mon Sep 17 00:00:00 2001
From: Andre Loreth <a.loreth@adito.de>
Date: Tue, 18 Feb 2020 11:36:04 +0100
Subject: [PATCH] #1051579: Organisation: Implement OrganisationReport_view

---
 .../Organisation_entity/Organisation_entity.aod |  4 ++++
 .../organisation_report_data/valueProcess.js    |  9 +++++++++
 neonContext/Organisation/Organisation.aod       |  4 ++++
 .../OrganisationReport_view.aod                 | 17 +++++++++++++++++
 4 files changed, 34 insertions(+)
 create mode 100644 entity/Organisation_entity/entityfields/organisation_report_data/valueProcess.js
 create mode 100644 neonView/OrganisationReport_view/OrganisationReport_view.aod

diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod
index 136ad209d5..e27931c274 100644
--- a/entity/Organisation_entity/Organisation_entity.aod
+++ b/entity/Organisation_entity/Organisation_entity.aod
@@ -1035,6 +1035,10 @@
     <entityField>
       <name>STANDARD_CITY</name>
     </entityField>
+    <entityField>
+      <name>ORGANISATION_REPORT_DATA</name>
+      <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisation_report_data/valueProcess.js</valueProcess>
+    </entityField>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/Organisation_entity/entityfields/organisation_report_data/valueProcess.js b/entity/Organisation_entity/entityfields/organisation_report_data/valueProcess.js
new file mode 100644
index 0000000000..83e6813560
--- /dev/null
+++ b/entity/Organisation_entity/entityfields/organisation_report_data/valueProcess.js
@@ -0,0 +1,9 @@
+import("system.vars");
+import("system.result");
+import("Organisation_lib");
+
+var reportData = OrgUtils.buildOrgReport(vars.get("$field.ORGANISATIONID"))
+
+if (reportData != null) {
+    result.string(reportData[1]);
+}
\ No newline at end of file
diff --git a/neonContext/Organisation/Organisation.aod b/neonContext/Organisation/Organisation.aod
index 53f784596e..956f247c22 100644
--- a/neonContext/Organisation/Organisation.aod
+++ b/neonContext/Organisation/Organisation.aod
@@ -55,5 +55,9 @@
       <name>a97ac17d-171b-4c9a-83fa-bb5a466c7b20</name>
       <view>OrganisationDuplicateEditview_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>ade0ed85-260d-4da5-bf4c-f838cfdcc693</name>
+      <view>OrganisationReport_view</view>
+    </neonViewReference>
   </references>
 </neonContext>
diff --git a/neonView/OrganisationReport_view/OrganisationReport_view.aod b/neonView/OrganisationReport_view/OrganisationReport_view.aod
new file mode 100644
index 0000000000..0853ebf242
--- /dev/null
+++ b/neonView/OrganisationReport_view/OrganisationReport_view.aod
@@ -0,0 +1,17 @@
+<?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.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.4">
+  <name>OrganisationReport_view</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <boxLayout>
+      <name>layout</name>
+    </boxLayout>
+  </layout>
+  <children>
+    <reportViewTemplate>
+      <name>Report</name>
+      <reportData>ORGANISATION_REPORT_DATA</reportData>
+      <entityField>#ENTITY</entityField>
+    </reportViewTemplate>
+  </children>
+</neonView>
-- 
GitLab