From 7b1ba3121e1251350520dc589bc9c83a10f33c6a Mon Sep 17 00:00:00 2001
From: "a.voegl" <a.voegl@adito.de>
Date: Tue, 11 Aug 2020 08:50:19 +0200
Subject: [PATCH] Order resolve Merge Conflicts and small Changes

---
 .liquibase/Data_alias/basic/2020.1.2/changelog.xml        | 2 --
 .liquibase/Data_alias/basic/2020.1.3/changelog.xml        | 2 ++
 .../{2020.1.2 => 2020.1.3}/drop_salesorder_unpaid.xml     | 0
 .../{2020.1.2 => 2020.1.3}/drop_salesorder_versnr.xml     | 0
 entity/Order_entity/Order_entity.aod                      | 3 ++-
 .../entityfields/copy_param/documentation.adoc            | 2 ++
 process/Order_lib/process.js                              | 8 ++++----
 7 files changed, 10 insertions(+), 7 deletions(-)
 rename .liquibase/Data_alias/basic/{2020.1.2 => 2020.1.3}/drop_salesorder_unpaid.xml (100%)
 rename .liquibase/Data_alias/basic/{2020.1.2 => 2020.1.3}/drop_salesorder_versnr.xml (100%)
 create mode 100644 entity/Order_entity/entityfields/copy_param/documentation.adoc

diff --git a/.liquibase/Data_alias/basic/2020.1.2/changelog.xml b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml
index 1c85cb3902a..f8307f5735c 100644
--- a/.liquibase/Data_alias/basic/2020.1.2/changelog.xml
+++ b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml
@@ -5,6 +5,4 @@
     <include file="AddNullableToDateNew.xml" relativeToChangelogFile="true" />    
     <include file="insert_workflowCategory_keyword.xml" relativeToChangelogFile="true"/>
     <include file="Notification/changelog.xml" relativeToChangelogFile="true" />
-    <include relativeToChangelogFile="true" file="drop_salesorder_unpaid.xml"/>
-    <include relativeToChangelogFile="true" file="drop_salesorder_versnr.xml"/>
 </databaseChangeLog>
diff --git a/.liquibase/Data_alias/basic/2020.1.3/changelog.xml b/.liquibase/Data_alias/basic/2020.1.3/changelog.xml
index 2144ba2aa05..93e891be3d7 100644
--- a/.liquibase/Data_alias/basic/2020.1.3/changelog.xml
+++ b/.liquibase/Data_alias/basic/2020.1.3/changelog.xml
@@ -5,4 +5,6 @@
     <include file="DeleteNotificationtypeKeywords.xml" relativeToChangelogFile="true" />
     <include file="add_Address_LatLon.xml" relativeToChangelogFile="true"/>
     <include file="VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml" relativeToChangelogFile="true" />
+    <include file="drop_salesorder_unpaid.xml" relativeToChangelogFile="true"/>
+    <include file="drop_salesorder_versnr.xml" relativeToChangelogFile="true"/>
 </databaseChangeLog>
diff --git a/.liquibase/Data_alias/basic/2020.1.2/drop_salesorder_unpaid.xml b/.liquibase/Data_alias/basic/2020.1.3/drop_salesorder_unpaid.xml
similarity index 100%
rename from .liquibase/Data_alias/basic/2020.1.2/drop_salesorder_unpaid.xml
rename to .liquibase/Data_alias/basic/2020.1.3/drop_salesorder_unpaid.xml
diff --git a/.liquibase/Data_alias/basic/2020.1.2/drop_salesorder_versnr.xml b/.liquibase/Data_alias/basic/2020.1.3/drop_salesorder_versnr.xml
similarity index 100%
rename from .liquibase/Data_alias/basic/2020.1.2/drop_salesorder_versnr.xml
rename to .liquibase/Data_alias/basic/2020.1.3/drop_salesorder_versnr.xml
diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod
index dab543deb07..4afa1212c43 100644
--- a/entity/Order_entity/Order_entity.aod
+++ b/entity/Order_entity/Order_entity.aod
@@ -872,6 +872,7 @@
     <entityParameter>
       <name>Copy_param</name>
       <expose v="true" />
+      <documentation>%aditoprj%/entity/Order_entity/entityfields/copy_param/documentation.adoc</documentation>
     </entityParameter>
     <entityField>
       <name>COUNT</name>
@@ -1140,4 +1141,4 @@
       </indexFieldMappings>
     </indexRecordContainer>
   </recordContainers>
-</entity>
\ No newline at end of file
+</entity>
diff --git a/entity/Order_entity/entityfields/copy_param/documentation.adoc b/entity/Order_entity/entityfields/copy_param/documentation.adoc
new file mode 100644
index 00000000000..5ec36081ee1
--- /dev/null
+++ b/entity/Order_entity/entityfields/copy_param/documentation.adoc
@@ -0,0 +1,2 @@
+This Param is filled after the action "new Order" is activated. It fills close to all fields with values from the order before. 
+Therefor it uses a stringified JSON-Object, look up "OrderUtils.copyOrder()" for more details
\ No newline at end of file
diff --git a/process/Order_lib/process.js b/process/Order_lib/process.js
index 73b3a8ff6fe..22b0f95f8fe 100644
--- a/process/Order_lib/process.js
+++ b/process/Order_lib/process.js
@@ -480,8 +480,8 @@ OrderUtils.buildReminderReport = function (pOrderID)
     var sums = [];
     var vatsum = 0;
     var printDiscount = false;
-    var brutto=eMath.addDec(orderData[16], orderData[9]);
-    var offen=eMath.subDec(brutto, orderData[15]);
+    var grossPrice=eMath.addDec(orderData[16], orderData[9]);
+    var open=eMath.subDec(grossPrice, orderData[15]);
     itemData = itemData.map(function (item)
     {
         //quantity * price
@@ -512,8 +512,8 @@ OrderUtils.buildReminderReport = function (pOrderID)
             text.formatDouble(orderData[9], "#,##0.00", true), //vat
             orderData[10], //ordercode
             orderData[16],       //net      
-            text.formatDouble(brutto, "#,##0.00", true),//brutto
-            text.formatDouble(offen, "#,##0.00", true),//offen
+            text.formatDouble(grossPrice, "#,##0.00", true),//grossPrice
+            text.formatDouble(open, "#,##0.00", true),//open
             orderData[17], //due date
             orderData[19], //dunning text
             orderData[18]  //dunninglevel
-- 
GitLab