From 055a20e0a8641de9bb1afb433998d3d93a06b1f8 Mon Sep 17 00:00:00 2001
From: Pascal Neub <p.neub@adito.de>
Date: Thu, 29 Apr 2021 07:38:07 +0000
Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-Sales][TicketNr.:=201079572][VT?=
 =?UTF-8?q?=20Projekt=20Wahrscheinlichkeit=20pro=20Phase=20als=20Schl?=
 =?UTF-8?q?=C3=BCsselwort-Eigenschaft]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../Checklists/alter_salesproject_phase.xml   |  10 ++
 .../basic/2021.0.3/Checklists/changelog.xml   |   1 +
 .../Data_alias/basic/2021.0.3/changelog.xml   |   1 +
 .../2021.0.3/create_probability_keywords.xml  | 120 ++++++++++++++++++
 aliasDefinition/Data_alias/Data_alias.aod     |  14 ++
 .../KeywordEntry_entity.aod                   |  18 +++
 entity/Offer_entity/Offer_entity.aod          |  18 ++-
 .../containername_param/valueProcess.js       |   4 +
 .../probability/dropDownProcess.js            |   9 --
 .../SalesprojectPhaseDefinition_entity.aod    |  27 ++++
 .../containername_param/valueProcess.js       |   4 +
 .../Salesproject_entity.aod                   |  18 ++-
 .../containername_param/valueProcess.js       |   4 +
 .../probability/dropDownProcess.js            |   9 --
 .../recordcontainers/db/onDBUpdate.js         |  10 ++
 .../_____LANGUAGE_de/_____LANGUAGE_de.aod     |   4 +
 .../SalesprojectPhaseDefinitionEdit_view.aod  |   4 +
 ...alesprojectPhaseDefinitionPreview_view.aod |  11 ++
 process/KeywordRegistry_basic/process.js      |   3 +
 19 files changed, 267 insertions(+), 22 deletions(-)
 create mode 100644 .liquibase/Data_alias/basic/2021.0.3/Checklists/alter_salesproject_phase.xml
 create mode 100644 .liquibase/Data_alias/basic/2021.0.3/create_probability_keywords.xml
 create mode 100644 entity/Offer_entity/entityfields/keywordprobabilityoffer/children/containername_param/valueProcess.js
 delete mode 100644 entity/Offer_entity/entityfields/probability/dropDownProcess.js
 create mode 100644 entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
 create mode 100644 entity/Salesproject_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
 delete mode 100644 entity/Salesproject_entity/entityfields/probability/dropDownProcess.js

diff --git a/.liquibase/Data_alias/basic/2021.0.3/Checklists/alter_salesproject_phase.xml b/.liquibase/Data_alias/basic/2021.0.3/Checklists/alter_salesproject_phase.xml
new file mode 100644
index 0000000000..7f258a8afe
--- /dev/null
+++ b/.liquibase/Data_alias/basic/2021.0.3/Checklists/alter_salesproject_phase.xml
@@ -0,0 +1,10 @@
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
+    <changeSet author="p.neub" id="eba94911-c6d4-4b26-8466-1a811d380908">
+        <addColumn tableName="SALESPROJECTPHASEDEFINITION">
+            <column name="AUTOPROBABILITY" type="DECIMAL(6, 2)"/>
+        </addColumn>
+    </changeSet>
+</databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/Data_alias/basic/2021.0.3/Checklists/changelog.xml b/.liquibase/Data_alias/basic/2021.0.3/Checklists/changelog.xml
index 15bb01b42a..bb7e5ba0e9 100644
--- a/.liquibase/Data_alias/basic/2021.0.3/Checklists/changelog.xml
+++ b/.liquibase/Data_alias/basic/2021.0.3/Checklists/changelog.xml
@@ -8,4 +8,5 @@
     <include relativeToChangelogFile="true" file="update_keyword.xml"/>
     <include relativeToChangelogFile="true" file="update_ab_attributeusage_salesprojectorigin.xml"/>
     <include relativeToChangelogFile="true" file="change_phase_translation.xml"/>
+    <include relativeToChangelogFile="true" file="alter_salesproject_phase.xml"/>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/Data_alias/basic/2021.0.3/changelog.xml b/.liquibase/Data_alias/basic/2021.0.3/changelog.xml
index 33011d5d95..743c8f9beb 100644
--- a/.liquibase/Data_alias/basic/2021.0.3/changelog.xml
+++ b/.liquibase/Data_alias/basic/2021.0.3/changelog.xml
@@ -11,4 +11,5 @@
     <include relativeToChangelogFile="true" file="alter_origin_attribute.xml"/>
     <include relativeToChangelogFile="true" file="Duplicate/changelog.xml"/>
     <include relativeToChangelogFile="true" file="DSGVO/changelog.xml"/>
+    <include relativeToChangelogFile="true" file="create_probability_keywords.xml"/>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/Data_alias/basic/2021.0.3/create_probability_keywords.xml b/.liquibase/Data_alias/basic/2021.0.3/create_probability_keywords.xml
new file mode 100644
index 0000000000..8243d75edb
--- /dev/null
+++ b/.liquibase/Data_alias/basic/2021.0.3/create_probability_keywords.xml
@@ -0,0 +1,120 @@
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
+    <changeSet author="p.neub" id="d9d6e2dd-5d9f-4c92-bd78-f33e6320b273">
+        <insert tableName="AB_KEYWORD_CATEGORY">
+            <column name="AB_KEYWORD_CATEGORYID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="NAME" value="ProbabilitySalesproject"/>
+            <column name="SORTINGBY" valueNumeric="0"/>
+            <column name="SORTINGDIRECTION" value="ASC"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="d8c35e5a-6935-4262-b919-84196bce8e6d"/>
+            <column name="CONTAINER" value="ProbabilitySalesproject"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="0"/>
+            <column name="TITLE" value="0%"/>
+            <column name="SORTING" valueNumeric="0"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="59fbb811-d183-4746-9b88-ed3c275f6f82"/>
+            <column name="CONTAINER" value="ProbabilitySalesproject"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="25"/>
+            <column name="TITLE" value="25%"/>
+            <column name="SORTING" valueNumeric="1"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="9fcc2591-9e96-466e-8fd0-223337a50a8f"/>
+            <column name="CONTAINER" value="ProbabilitySalesproject"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="50"/>
+            <column name="TITLE" value="50%"/>
+            <column name="SORTING" valueNumeric="2"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="70cef9ee-b221-4097-be5e-08a8f3e5a8b4"/>
+            <column name="CONTAINER" value="ProbabilitySalesproject"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="75"/>
+            <column name="TITLE" value="75%"/>
+            <column name="SORTING" valueNumeric="3"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="5de50a13-7871-4cee-9fab-9c419b2ce620"/>
+            <column name="CONTAINER" value="ProbabilitySalesproject"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="2d4a7918-6105-4746-b196-504ebe352250"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="100"/>
+            <column name="TITLE" value="100%"/>
+            <column name="SORTING" valueNumeric="4"/>
+        </insert>
+
+        <insert tableName="AB_KEYWORD_CATEGORY">
+            <column name="AB_KEYWORD_CATEGORYID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="NAME" value="ProbabilityOffer"/>
+            <column name="SORTINGBY" valueNumeric="0"/>
+            <column name="SORTINGDIRECTION" value="ASC"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="38f30441-2d94-4558-9c53-a29d066731b9"/>
+            <column name="CONTAINER" value="ProbabilityOffer"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="0"/>
+            <column name="TITLE" value="0%"/>
+            <column name="SORTING" valueNumeric="0"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="1f411441-7677-4c64-88c0-d0f5b24f8a4c"/>
+            <column name="CONTAINER" value="ProbabilityOffer"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="25"/>
+            <column name="TITLE" value="25%"/>
+            <column name="SORTING" valueNumeric="1"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="26225ece-fdf9-4e72-a2b3-8ea295429157"/>
+            <column name="CONTAINER" value="ProbabilityOffer"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="50"/>
+            <column name="TITLE" value="50%"/>
+            <column name="SORTING" valueNumeric="2"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="01865353-6137-44fe-8817-6d67e33f895e"/>
+            <column name="CONTAINER" value="ProbabilityOffer"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="75"/>
+            <column name="TITLE" value="75%"/>
+            <column name="SORTING" valueNumeric="3"/>
+        </insert>
+        <insert tableName="AB_KEYWORD_ENTRY">
+            <column name="AB_KEYWORD_ENTRYID" value="755eefec-ecb6-485d-91c9-8763b2a24ebf"/>
+            <column name="CONTAINER" value="ProbabilityOffer"/>
+            <column name="AB_KEYWORD_CATEGORY_ID" value="aba6b313-7e35-4eeb-95e2-0e262c66fa9c"/>
+            <column name="ISESSENTIAL" valueNumeric="0"/>
+            <column name="ISACTIVE" valueNumeric="1"/>
+            <column name="KEYID" value="100"/>
+            <column name="TITLE" value="100%"/>
+            <column name="SORTING" valueNumeric="4"/>
+        </insert>
+    </changeSet>
+</databaseChangeLog>
\ No newline at end of file
diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod
index aec7ecad42..113239f17a 100644
--- a/aliasDefinition/Data_alias/Data_alias.aod
+++ b/aliasDefinition/Data_alias/Data_alias.aod
@@ -17986,6 +17986,20 @@
                 <documentation></documentation>
                 <description></description>
               </entityFieldDb>
+              <entityFieldDb>
+                <name>AUTOPROBABILITY</name>
+                <dbName></dbName>
+                <primaryKey v="false" />
+                <columnType v="3" />
+                <size v="6" />
+                <scale v="2" />
+                <notNull v="false" />
+                <isUnique v="false" />
+                <index v="false" />
+                <documentation></documentation>
+                <title></title>
+                <description></description>
+              </entityFieldDb>
             </entityFields>
           </entityDb>
           <entityDb>
diff --git a/entity/KeywordEntry_entity/KeywordEntry_entity.aod b/entity/KeywordEntry_entity/KeywordEntry_entity.aod
index 41dd103062..4f6e03d382 100644
--- a/entity/KeywordEntry_entity/KeywordEntry_entity.aod
+++ b/entity/KeywordEntry_entity/KeywordEntry_entity.aod
@@ -732,6 +732,24 @@
           <fieldName>KeywordStatus</fieldName>
           <isConsumer v="false" />
         </entityDependency>
+        <entityDependency>
+          <name>050100cf-7f48-4951-a1dc-343927e0a2af</name>
+          <entityName>SalesprojectPhaseDefinition_entity</entityName>
+          <fieldName>KeywordProbabilitySalesproject</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
+        <entityDependency>
+          <name>6c34847b-56b1-4486-a31a-2279b15dfff0</name>
+          <entityName>Salesproject_entity</entityName>
+          <fieldName>KeywordProbabilitySalesproject</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
+        <entityDependency>
+          <name>9b82186e-f230-4af9-b77e-72b750c68d27</name>
+          <entityName>Offer_entity</entityName>
+          <fieldName>KeywordProbabilityOffer</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
       </dependencies>
       <children>
         <entityParameter>
diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod
index 2e4d0172c3..88bd70bb61 100644
--- a/entity/Offer_entity/Offer_entity.aod
+++ b/entity/Offer_entity/Offer_entity.aod
@@ -75,12 +75,12 @@
     <entityField>
       <name>PROBABILITY</name>
       <title>Probability</title>
+      <consumer>KeywordProbabilityOffer</consumer>
       <contentType>NUMBER</contentType>
       <maxValue v="100" />
       <minValue v="0" />
-      <outputFormat>0.00'%'</outputFormat>
+      <outputFormat>0'%'</outputFormat>
       <groupable v="true" />
-      <dropDownProcess>%aditoprj%/entity/Offer_entity/entityfields/probability/dropDownProcess.js</dropDownProcess>
       <stateProcess>%aditoprj%/entity/Offer_entity/entityfields/probability/stateProcess.js</stateProcess>
       <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/probability/valueProcess.js</valueProcess>
     </entityField>
@@ -1158,6 +1158,20 @@
       <name>TaskId_param</name>
       <expose v="true" />
     </entityParameter>
+    <entityConsumer>
+      <name>KeywordProbabilityOffer</name>
+      <dependency>
+        <name>dependency</name>
+        <entityName>KeywordEntry_entity</entityName>
+        <fieldName>SpecificContainerKeywords</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>ContainerName_param</name>
+          <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/keywordprobabilityoffer/children/containername_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/Offer_entity/entityfields/keywordprobabilityoffer/children/containername_param/valueProcess.js b/entity/Offer_entity/entityfields/keywordprobabilityoffer/children/containername_param/valueProcess.js
new file mode 100644
index 0000000000..919d72f494
--- /dev/null
+++ b/entity/Offer_entity/entityfields/keywordprobabilityoffer/children/containername_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.result");
+import("KeywordRegistry_basic");
+
+result.string($KeywordRegistry.probabilityOffer());
diff --git a/entity/Offer_entity/entityfields/probability/dropDownProcess.js b/entity/Offer_entity/entityfields/probability/dropDownProcess.js
deleted file mode 100644
index 0ce6525ee9..0000000000
--- a/entity/Offer_entity/entityfields/probability/dropDownProcess.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import("system.result");
-
-result.object([
-    ["0.00", "0%"],
-    ["25.00", "25%"],
-    ["50.00", "50%"],
-    ["75.00", "75%"],
-    ["100.00", "100%"]
-]);
diff --git a/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod b/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod
index a237428017..92dbe5cb1e 100644
--- a/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod
+++ b/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod
@@ -88,6 +88,29 @@
       <title>Description</title>
       <contentType>LONG_TEXT</contentType>
     </entityField>
+    <entityField>
+      <name>AUTOPROBABILITY</name>
+      <title>Auto probability</title>
+      <consumer>KeywordProbabilitySalesproject</consumer>
+      <contentType>NUMBER</contentType>
+      <maxValue v="100" />
+      <minValue v="0" />
+      <outputFormat>0'%'</outputFormat>
+    </entityField>
+    <entityConsumer>
+      <name>KeywordProbabilitySalesproject</name>
+      <dependency>
+        <name>dependency</name>
+        <entityName>KeywordEntry_entity</entityName>
+        <fieldName>SpecificContainerKeywords</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>ContainerName_param</name>
+          <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
@@ -132,6 +155,10 @@
           <name>USER_NEW.value</name>
           <recordfield>SALESPROJECTPHASEDEFINITION.USER_NEW</recordfield>
         </dbRecordFieldMapping>
+        <dbRecordFieldMapping>
+          <name>AUTOPROBABILITY.value</name>
+          <recordfield>SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY</recordfield>
+        </dbRecordFieldMapping>
       </recordFieldMappings>
       <linkInformation>
         <linkInformation>
diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
new file mode 100644
index 0000000000..79fdf41a10
--- /dev/null
+++ b/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.result");
+import("KeywordRegistry_basic");
+
+result.string($KeywordRegistry.probabilitySalesproject());
diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod
index c55710d2e8..a16be31103 100644
--- a/entity/Salesproject_entity/Salesproject_entity.aod
+++ b/entity/Salesproject_entity/Salesproject_entity.aod
@@ -139,12 +139,12 @@
     <entityField>
       <name>PROBABILITY</name>
       <title>Probability</title>
+      <consumer>KeywordProbabilitySalesproject</consumer>
       <contentType>NUMBER</contentType>
       <maxValue v="100" />
       <minValue v="0" />
-      <outputFormat>0.00'%'</outputFormat>
+      <outputFormat>0'%'</outputFormat>
       <groupable v="true" />
-      <dropDownProcess>%aditoprj%/entity/Salesproject_entity/entityfields/probability/dropDownProcess.js</dropDownProcess>
     </entityField>
     <entityConsumer>
       <name>SalesprojectSources</name>
@@ -882,6 +882,20 @@
         </entityParameter>
       </children>
     </entityConsumer>
+    <entityConsumer>
+      <name>KeywordProbabilitySalesproject</name>
+      <dependency>
+        <name>dependency</name>
+        <entityName>KeywordEntry_entity</entityName>
+        <fieldName>SpecificContainerKeywords</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>ContainerName_param</name>
+          <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
diff --git a/entity/Salesproject_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js b/entity/Salesproject_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
new file mode 100644
index 0000000000..79fdf41a10
--- /dev/null
+++ b/entity/Salesproject_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.result");
+import("KeywordRegistry_basic");
+
+result.string($KeywordRegistry.probabilitySalesproject());
diff --git a/entity/Salesproject_entity/entityfields/probability/dropDownProcess.js b/entity/Salesproject_entity/entityfields/probability/dropDownProcess.js
deleted file mode 100644
index 0ce6525ee9..0000000000
--- a/entity/Salesproject_entity/entityfields/probability/dropDownProcess.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import("system.result");
-
-result.object([
-    ["0.00", "0%"],
-    ["25.00", "25%"],
-    ["50.00", "50%"],
-    ["75.00", "75%"],
-    ["100.00", "100%"]
-]);
diff --git a/entity/Salesproject_entity/recordcontainers/db/onDBUpdate.js b/entity/Salesproject_entity/recordcontainers/db/onDBUpdate.js
index b81c1dd9c2..8c73baf3b5 100644
--- a/entity/Salesproject_entity/recordcontainers/db/onDBUpdate.js
+++ b/entity/Salesproject_entity/recordcontainers/db/onDBUpdate.js
@@ -23,6 +23,16 @@ vars.get("$local.changed").forEach(function(fieldName) {
     switch (fieldName) {
         case "SALESPROJECT.PHASE":
             typeValue = "SalesprojectPhase";
+            var autoProbab = newSelect("SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY")
+                .from("SALESPROJECTPHASEDEFINITION")
+                .where("SALESPROJECTPHASEDEFINITION.PHASE", vars.get("$field.PHASE")).cell();
+            if(!isNaN(parseInt(autoProbab)))
+            {
+                newWhere("SALESPROJECT.SALESPROJECTID", vars.get("$field.SALESPROJECTID"))
+                .updateFields({
+                    "PROBABILITY": autoProbab
+                }, "SALESPROJECT");
+            }
             break;
         case "SALESPROJECT.STATUS":
             // Milestone
diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
index 827c44f0eb..7e0ea6c3e5 100644
--- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
+++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
@@ -11224,6 +11224,10 @@ Bitte Datumseingabe prüfen</value>
     <entry>
       <key>Integer</key>
     </entry>
+    <entry>
+      <key>Auto probability</key>
+      <value>Automatische Wahrscheinlichkeit</value>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod b/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod
index eae1779df4..b51922e319 100644
--- a/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod
+++ b/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod
@@ -21,6 +21,10 @@
           <name>f0aa8dd0-2cc1-4634-9509-db8b511e602d</name>
           <entityField>DESCRIPTION</entityField>
         </entityFieldLink>
+        <entityFieldLink>
+          <name>b5e973f9-854e-4ddc-b980-2fac447cb292</name>
+          <entityField>AUTOPROBABILITY</entityField>
+        </entityFieldLink>
       </fields>
     </genericViewTemplate>
     <neonViewReference>
diff --git a/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod b/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod
index 25f7dc6572..d25d74cf44 100644
--- a/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod
+++ b/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod
@@ -16,6 +16,17 @@
       <titleField>PHASE</titleField>
       <entityField>#ENTITY</entityField>
     </cardViewTemplate>
+    <genericViewTemplate>
+      <name>Generic</name>
+      <showDrawer v="true" />
+      <drawerCaption>Info</drawerCaption>
+      <fields>
+        <entityFieldLink>
+          <name>d12a93ac-5c83-4b79-8cb9-4a2852bb3082</name>
+          <entityField>AUTOPROBABILITY</entityField>
+        </entityFieldLink>
+      </fields>
+    </genericViewTemplate>
     <neonViewReference>
       <name>786e8ccd-b846-4968-8b6c-9e8cf13ba63c</name>
       <entityField>ChecklistEntries</entityField>
diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js
index defb4e85cb..727098fede 100644
--- a/process/KeywordRegistry_basic/process.js
+++ b/process/KeywordRegistry_basic/process.js
@@ -149,6 +149,9 @@ $KeywordRegistry.salesprojectPhase$sal = function(){return "SALPROJPHASESAL"};
 $KeywordRegistry.salesprojectPhase$sqo = function(){return "SALPROJPHASESQO"};
 $KeywordRegistry.salesprojectPhase$mqc = function(){return "SALPROJPHASEMQC"};
 
+$KeywordRegistry.probabilitySalesproject = function(){return "ProbabilitySalesproject";};
+$KeywordRegistry.probabilityOffer = function(){return "ProbabilityOffer";};
+
 $KeywordRegistry.taskPriority = function(){return "TaskPriority";};
 $KeywordRegistry.taskPriority$none = function(){return "TASKPRIONONE";};
 $KeywordRegistry.taskPriority$low = function(){return "TASKPRIOLOW";};
-- 
GitLab