From 82a0e17e21d45d7b3e24582906e3ef0231dd5a3c Mon Sep 17 00:00:00 2001
From: "j.goderbauer" <j.goderbauer@adito.de>
Date: Thu, 28 Feb 2019 16:43:42 +0100
Subject: [PATCH] =?UTF-8?q?[Projekt:=20Entwicklung=20-=20Neon][TicketNr.:?=
 =?UTF-8?q?=201032312][Keywords=20f=C3=BCr=20bestehende=20Module=20anlegen?=
 =?UTF-8?q?]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 process/KeywordRegistry_basic/process.js | 6 ++++++
 process/Organisation_lib/process.js      | 2 +-
 process/PostalAddress_lib/process.js     | 3 ++-
 process/Product_lib/process.js           | 5 +++--
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js
index ce5e562a29..6d8a44d295 100644
--- a/process/KeywordRegistry_basic/process.js
+++ b/process/KeywordRegistry_basic/process.js
@@ -23,7 +23,10 @@ $KeywordRegistry.contractPayment = function(){return "ContractPayment"};
 $KeywordRegistry.contractStatus = function(){return "ContractStatus"};
 $KeywordRegistry.contractType = function(){return "ContractType"};
 $KeywordRegistry.activityDirection = function(){return "ActivityDirection"};
+
 $KeywordRegistry.contactStatus = function(){return "ContactStatus"};
+$KeywordRegistry.contactStatus$active = function(){return "BSIC0rel-stat-actv-ae03-b6b04430e90b"};
+
 $KeywordRegistry.currency = function(){return "Currency"};
 $KeywordRegistry.productGroupcode = function(){return "ProductGroupcode"};
 $KeywordRegistry.offerStatus = function(){return "OfferStatus"};
@@ -31,7 +34,10 @@ $KeywordRegistry.organisationType = function(){return "OrganisationType"};
 $KeywordRegistry.personGender = function(){return "PersonGender"};
 $KeywordRegistry.taskStatus = function(){return "TaskStatus"};
 $KeywordRegistry.taskType = function(){return "TaskType"};
+
 $KeywordRegistry.productPricelist = function(){return "ProductPricelist"};
+$KeywordRegistry.productPricelist$standardList = function(){return "02553fc7-4611-4914-8ff5-0b7c4e7531c9"};
+
 $KeywordRegistry.quantityUnit = function(){return "QuantityUnit"};
 $KeywordRegistry.salesprojectMemberRole = function(){return "SalesprojectMemberRole"};
 $KeywordRegistry.salesprojectSource = function(){return "SalesprojectSource"};
diff --git a/process/Organisation_lib/process.js b/process/Organisation_lib/process.js
index 5296413175..b54d93d93e 100644
--- a/process/Organisation_lib/process.js
+++ b/process/Organisation_lib/process.js
@@ -86,7 +86,7 @@ OrgUtils.openOrgReport = function(pOrgId)
         + " from PERSON join CONTACT on PERSONID = PERSON_ID";
     persSql = SqlCondition.begin()
         .andPrepare("CONTACT.ORGANISATION_ID", pOrgId)
-        .and("CONTACT.STATUS = 'BSIC0rel-stat-actv-ae03-b6b04430e90b'") //TODO: replace this with something that isn't a hard coded id
+        .and("CONTACT.STATUS = '" + $KeywordRegistry.contactStatus$active() + "'") //TODO: replace this with something that isn't a hard coded id
         .buildSql(persSql, "", " order by PERSON.LASTNAME asc");
     var persData = db.table(persSql);
     
diff --git a/process/PostalAddress_lib/process.js b/process/PostalAddress_lib/process.js
index 8d31f07afe..c18e69398a 100644
--- a/process/PostalAddress_lib/process.js
+++ b/process/PostalAddress_lib/process.js
@@ -1,3 +1,4 @@
+import("KeywordRegistry_basic");
 import("system.db");
 import("Sql_lib");
 import("Contact_lib");
@@ -137,7 +138,7 @@ AddressUtils.getAllPossibleAddresses = function(pRelationId) {
                                                      .buildSql("select ADDRESSID, ADDR_TYPE, ADDRIDENTIFIER from ADDRESS join CONTACT on CONTACTID = CONTACT_ID or CONTACT_ID = ORGANISATION_ID", "1=0"));
                                                      
     return addresses.map(function(pAddress) {
-        return [pAddress[0], LegacyKeywordUtils.get("ADDRESS.TYPE", pAddress[1])[1] + " " + pAddress[2]]
+        return [pAddress[0], KeywordUtils.getViewValue($KeywordRegistry.addressType(), pAddress[1]) + ": " + pAddress[2]];
     });
 }
 
diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js
index 217d65e532..33c29bed91 100644
--- a/process/Product_lib/process.js
+++ b/process/Product_lib/process.js
@@ -4,6 +4,7 @@ import("system.datetime");
 import("system.db");
 import("system.vars");
 import("system.translate");
+import("KeywordRegistry_basic");
 import("Util_lib");
 import("Binary_lib");
 import("Sql_lib");
@@ -44,7 +45,7 @@ ProductUtils.getCurrentProductPrice = function(pid, buySell) {
         var productPriceData = db.array(db.ROW, actualPriceCondition.buildSql("select PRICE, CURRENCY from PRODUCTPRICE", "1 = 2", "order by VALID_FROM desc"));
         
         if (productPriceData[0] && productPriceData[1])
-            return  productPriceData[0] + " " + LegacyKeywordUtils.get("CURRENCY", productPriceData[1])[1];
+            return  productPriceData[0] + " " + KeywordUtils.getViewValue($KeywordRegistry.currency(), productPriceData[1]);
         else
             return "";
     } else {
@@ -272,7 +273,7 @@ ProductUtils.getProductDetails = function(pid, priceListFilter, additionalProduc
                 return priceLists[list];
             }
             //default price list
-            if (priceLists[list].priceList == "1") {
+            if (priceLists[list].priceList == $KeywordRegistry.productPricelist$standardList()) {
                 return priceLists[list];
             }
         }
-- 
GitLab