diff --git a/entity/BulkMail_entity/entityfields/documenttemplate_id/onValueChange.js b/entity/BulkMail_entity/entityfields/documenttemplate_id/onValueChange.js index c581ed319d6abf9a33281237cd2ccee9cdbfdd69..fa553b4c0ebe856c7b540afcf5f4c2e4504ecd7d 100644 --- a/entity/BulkMail_entity/entityfields/documenttemplate_id/onValueChange.js +++ b/entity/BulkMail_entity/entityfields/documenttemplate_id/onValueChange.js @@ -4,6 +4,7 @@ import("system.util"); import("system.mail"); import("DocumentTemplate_lib"); import("Entity_lib"); +import("EmailUtil_lib"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) { diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstep_id.displayvalue/expression.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstep_id.displayvalue/expression.js index c2a7f5503d93c7ac48568fb0476a41b0bb4193ef..840d4c2dc1202bd94f31491b84d05e76e55adf03 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstep_id.displayvalue/expression.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstep_id.displayvalue/expression.js @@ -1,3 +1,4 @@ import("system.result"); import("Sql_lib"); + result.string(newSelect("CAMPAIGNSTEP.NAME").from("CAMPAIGNSTEP").where("CAMPAIGNSTEP.CAMPAIGNSTEPID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID").toString()); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstepcurrentparticipantcount.value/expression.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstepcurrentparticipantcount.value/expression.js index 7d896cba463f89dde65274356f8bbc5fb2a1097e..d563f19045726a045494d9156cadf3f53389589e 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstepcurrentparticipantcount.value/expression.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/campaignstepcurrentparticipantcount.value/expression.js @@ -1,3 +1,4 @@ import("system.result"); import("Sql_lib"); + result.string(newSelect("COUNT(*)").from("CAMPAIGNPARTICIPANT", "p1").where("p1.CAMPAIGNSTEP_ID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID").toString()); \ No newline at end of file diff --git a/entity/Favorite_entity/recordcontainers/jditorecordcontainer/contentProcess.js b/entity/Favorite_entity/recordcontainers/jditorecordcontainer/contentProcess.js index 58d538be7dfd130e9c953f05ff1d7f2145d3e1ac..1c6923b2958dfd7578394cc3a7bd2a7374d19846 100644 --- a/entity/Favorite_entity/recordcontainers/jditorecordcontainer/contentProcess.js +++ b/entity/Favorite_entity/recordcontainers/jditorecordcontainer/contentProcess.js @@ -8,6 +8,9 @@ import("system.favorite"); import("system.tools"); import("system.entities"); +/* + * loading favorites by id + */ if(vars.get("$local.idvalues") && vars.get("$local.idvalues").length != 0) { var seekedByCore = vars.get("$local.idvalues"); @@ -18,21 +21,35 @@ if(vars.get("$local.idvalues") && vars.get("$local.idvalues").length != 0) result.object(seekedByCoreFavos); } + +/* + * loading and filtering by UI + */ else { - + //save active filters and their logical operator var filters = vars.get("$local.filter"); var activeFilters = []; + var logicalConnectionOperator; if(filters["filter"] != null) + { + logicalConnectionOperator = filters["filter"]["operator"]; for(g = 0; g < filters["filter"]["childs"].length; g++) activeFilters.push(filters["filter"]["childs"][g]) + } var finishedFavoritesForDisplay = []; + /* + * load all contexts and all favorites + */ var allContexts = getAllFavoriteEnabledContexts(); - var allFavorites = favorite.getFavorites(favorite.createGetFavoritesConfig() - .setUserId(tools.getCurrentUser()[tools.NAME])); + var allFavorites = favorite.getFavorites(favorite.createGetFavoritesConfig().setUserId(tools.getCurrentUser()[tools.NAME])); + + /* + * complete-load (in buildFavorites) favorites by one context at a time + */ for(i = 0; i < allContexts.length; i++) { var contextFavorites = []; @@ -45,7 +62,7 @@ else for(let x = 0; x < builtFavos.length; x++) { var favo = builtFavos[x]; - if(isFiltered(activeFilters, favo)) + if(isFiltered(activeFilters, logicalConnectionOperator, favo)) finishedFavoritesForDisplay.push(favo); } } @@ -53,44 +70,46 @@ else result.object(finishedFavoritesForDisplay); } -function isFiltered(filters, fav) +function isFiltered(filters, logicalConnectionOperator, fav) { + if(filters == null || filters.length == 0) + return true; + var favoObjectType = fav[3]; var favoGroupName = fav[1]; var favoRowId = fav[5]; var favoTitle = fav[6]; - var isFiltered = true; + var allFilterFulfilled = true; + var oneFilterFulfilled = false; for(let i = 0; i < filters.length; i++) { + var attributeValue = ""; if(filters[i]["name"].includes("groupTypeExtension")) - { - if(!isValid(favoObjectType, filters[i])) - { - isFiltered = false; - break; - } - } - if(filters[i]["name"].includes("groupTitleExtension")) - { - if(!isValid(favoTitle, filters[i])) - { - isFiltered = false; - break; - } - } - if(filters[i]["name"].includes("groupGroupNameExtension")) - { - if(!isValid(favoGroupName, filters[i])) - { - isFiltered = false; - break; - } - } + attributeValue = favoObjectType; + else if(filters[i]["name"].includes("groupTitleExtension")) + attributeValue = favoTitle; + else if(filters[i]["name"].includes("groupGroupNameExtension")) + attributeValue = favoGroupName; + + if(!isValid(attributeValue, filters[i])) + allFilterFulfilled = false; + else + oneFilterFulfilled = true; } - - return isFiltered; + + if(logicalConnectionOperator == "AND") + if(allFilterFulfilled) + return true; + else + return false; + + if(logicalConnectionOperator == "OR") + if(oneFilterFulfilled) + return true; + else + return false; } function isValid(value, filter) diff --git a/entity/Offer_entity/entityfields/object_rowid/displayValueProcess.js b/entity/Offer_entity/entityfields/object_rowid/displayValueProcess.js index 44cc4476bcc740985830e3575cd626e03b526918..8074aca46e2680d0b0d19060e41f370b84830fa1 100644 --- a/entity/Offer_entity/entityfields/object_rowid/displayValueProcess.js +++ b/entity/Offer_entity/entityfields/object_rowid/displayValueProcess.js @@ -1,11 +1,11 @@ -//import("system.neon"); -//import("system.vars"); -//import("system.db"); -//import("system.result"); -//import("Context_lib"); -// -//if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.OBJECT_ROWID") == null) { -// result.string(""); -//} else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE")) { -// result.string(ContextUtils.getTitleByContext(vars.get("$field.OBJECT_TYPE"), vars.get("$field.OBJECT_ROWID"))); -//} \ No newline at end of file +import("system.neon"); +import("system.vars"); +import("system.db"); +import("system.result"); +import("Context_lib"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.OBJECT_ROWID") == null) { + result.string(""); +} else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE")) { + result.string(ContextUtils.getTitleByContext(vars.get("$field.OBJECT_TYPE"), vars.get("$field.OBJECT_ROWID"))); +} \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 102426d691186b36517e6cc0d625e0f722697fdc..6854c39edf4048c36eefcdfac6e6fe5ec99f12b3 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -1941,6 +1941,9 @@ <indexFieldType>ADDRESS</indexFieldType> <isGlobalSearchField v="false" /> </indexRecordFieldMapping> + <indexRecordFieldMapping> + <name>PICTURE.value</name> + </indexRecordFieldMapping> </indexFieldMappings> </indexRecordContainer> </recordContainers> diff --git a/entity/Organisation_entity/recordcontainers/index/query.js b/entity/Organisation_entity/recordcontainers/index/query.js index e26250598edb296c39f96f355d82fae6f096a7df..c2b15cd1890eac332871fee390b5c4137359adec 100644 --- a/entity/Organisation_entity/recordcontainers/index/query.js +++ b/entity/Organisation_entity/recordcontainers/index/query.js @@ -42,7 +42,7 @@ var querySelect = newSelect([ sqlHelper.concatWithSeparator([sqlHelper.concatWithSeparator(["standardAddress.ADDRESS", "standardAddress.BUILDINGNO"]) ,sqlHelper.concatWithSeparator(["standardAddress.COUNTRY", "standardAddress.ZIP", "standardAddress.CITY"]) ], " - ") - ]) + , "ORGANISATION.PICTURE"]) .from("ORGANISATION") .join("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null") .leftJoin("ADDRESS", "standardAddress.ADDRESSID = CONTACT.ADDRESS_ID", "standardAddress") diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index bbc841f5ca577aa1a2509a3aefe2d47fc542a603..2a6ffeac76c04b98516fd5b4f0c9841f1df0d0df 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1455,6 +1455,7 @@ <name>deleteFunction</name> <title>Delete this Function</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/deletefunction/onActionProcess.js</onActionProcess> + <iconId>NEON:TRASH</iconId> <stateProcess>%aditoprj%/entity/Person_entity/entityfields/deletefunction/stateProcess.js</stateProcess> </entityActionField> </entityFields> @@ -1879,6 +1880,9 @@ </additionalFieldNameAliases> <isMultiValued v="true" /> </indexRecordFieldMapping> + <indexRecordFieldMapping> + <name>PICTURE.value</name> + </indexRecordFieldMapping> </indexFieldMappings> </indexRecordContainer> </recordContainers> diff --git a/entity/Person_entity/recordcontainers/index/query.js b/entity/Person_entity/recordcontainers/index/query.js index e5c704e81ad9981791035100cf08dade778bc713..61ec0a66cbf788e47523eaa832bedf9fcb12e562 100644 --- a/entity/Person_entity/recordcontainers/index/query.js +++ b/entity/Person_entity/recordcontainers/index/query.js @@ -38,7 +38,8 @@ var querySelect = newSelect([ "ADDRESS.ZIP", "ADDRESS.CITY", "COMMUNICATION.ADDR", - "PHONE.ADDR" + "PHONE.ADDR", + "PERSON.PICTURE" ]) .from("PERSON") .join("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID") diff --git a/entity/Role_entity/entityfields/permissionoverviews/children/roletitle_param/valueProcess.js b/entity/Role_entity/entityfields/permissionoverviews/children/roletitle_param/valueProcess.js deleted file mode 100644 index c4fc6bffb984a2312dbe938d59b5770b9703ce50..0000000000000000000000000000000000000000 --- a/entity/Role_entity/entityfields/permissionoverviews/children/roletitle_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.ROLENAME")); \ No newline at end of file diff --git a/entity/Role_entity/entityfields/theirpermissions/children/roletitle_param/valueProcess.js b/entity/Role_entity/entityfields/theirpermissions/children/roletitle_param/valueProcess.js deleted file mode 100644 index 7b3054d1905ef4ec956c69802f6cc103966b4d08..0000000000000000000000000000000000000000 --- a/entity/Role_entity/entityfields/theirpermissions/children/roletitle_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.ROLENAME")); \ No newline at end of file diff --git a/entity/Task_entity/entityfields/newoffer/onActionProcess.js b/entity/Task_entity/entityfields/newoffer/onActionProcess.js index 7d951f8def4f9946c424f94ef6d137410da2c862..f80e61d2535e668b8afa4ad5ff2767e3ee068aaf 100644 --- a/entity/Task_entity/entityfields/newoffer/onActionProcess.js +++ b/entity/Task_entity/entityfields/newoffer/onActionProcess.js @@ -1,4 +1,20 @@ +import("Sql_lib"); import("system.vars"); import("Offer_lib"); -OfferUtils.createNewOffer(); +var links = newSelect("TASKLINK.OBJECT_TYPE, TASKLINK.OBJECT_ROWID") + .from("TASKLINK") + .where("TASKLINK.TASK_ID", vars.get("$field.TASKID")) + .and("TASKLINK.OBJECT_TYPE", ["Person", "Organisation", "Salesproject"], SqlBuilder.IN()) + .table(); + +//make a map from the 2d-array to easily access the ids by objectType +var linkMap = new Map(links); + +//if we only have one Person: that person is the contact. +//otherwise: we check for organisations: if we only have one then we use that one. +//same logic for salesprojects: if we have only one: use that one +var contactId = linkMap.get("Person") || linkMap.get("Organisation"); +var salesprojectId = linkMap.get("Salesproject"); + +OfferUtils.createNewOffer("Salesproject", salesprojectId, contactId); \ No newline at end of file diff --git a/neonView/OfferEdit_view/OfferEdit_view.aod b/neonView/OfferEdit_view/OfferEdit_view.aod index 37b79ebaaa60ed1e412ff2cd67900352df527fa8..c15cb497c5093831abcc3098413ee63b6c9cf057 100644 --- a/neonView/OfferEdit_view/OfferEdit_view.aod +++ b/neonView/OfferEdit_view/OfferEdit_view.aod @@ -36,10 +36,6 @@ <name>768683f3-08c8-4e85-bb4c-7e5c74a8dec0</name> <entityField>OFFERDATE</entityField> </entityFieldLink> - <entityFieldLink> - <name>35804879-e866-477a-a0e6-9fea1506fc1d</name> - <entityField>DISCOUNT</entityField> - </entityFieldLink> <entityFieldLink> <name>64cb7376-3a7c-4ce9-99e8-e70bc91b41d0</name> <entityField>CURRENCY</entityField> @@ -52,13 +48,17 @@ <name>7ab3eb65-b713-4251-9eb1-3119432565f5</name> <entityField>ISOLANGUAGE</entityField> </entityFieldLink> + <entityFieldLink> + <name>1e98fe37-8d52-4eef-8825-8ea14e7e20b5</name> + <entityField>PAYMENTTERMS</entityField> + </entityFieldLink> <entityFieldLink> <name>7a9b0943-eb06-4b44-a111-ed4e2749da6a</name> <entityField>DELIVERYTERMS</entityField> </entityFieldLink> <entityFieldLink> - <name>1e98fe37-8d52-4eef-8825-8ea14e7e20b5</name> - <entityField>PAYMENTTERMS</entityField> + <name>35804879-e866-477a-a0e6-9fea1506fc1d</name> + <entityField>DISCOUNT</entityField> </entityFieldLink> <entityFieldLink> <name>45ddf7c2-531b-4e18-826d-9c652ecc4d01</name> diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js index bffbe633e28bdc6119fdea0898094c96809e493e..8f560c533ad7994e8b1896715b41ee6aabb311b6 100644 --- a/process/Email_lib/process.js +++ b/process/Email_lib/process.js @@ -13,6 +13,7 @@ import("system.neon"); import("system.mail"); import("Bulkmail_lib"); import("system.tools"); +import("EmailUtil_lib"); function EmailWritingUtils () {} diff --git a/process/Keyword_lib/process.js b/process/Keyword_lib/process.js index 994fd55c07d07fda603f24db728838663dd844f2..dd8986377eaaff95d792cc821b8be28b39634724 100644 --- a/process/Keyword_lib/process.js +++ b/process/Keyword_lib/process.js @@ -26,7 +26,7 @@ function KeywordUtils(){} KeywordUtils.getResolvedTitleSqlPart = function(pContainerName, pDbFieldName, pLocale) { var keywordData = KeywordData.getSimpleData(pContainerName, pLocale); - var resSql = SqlUtils.getResolvingCaseWhen(keywordData, pDbFieldName, pLocale); + var resSql = SqlUtils.getResolvingCaseWhen(keywordData, pDbFieldName, false); return SqlUtils.translateStatementWithQuotes(resSql); }; diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 0527be16d824a0c41bb9195f59d951b30ba437ea..b8a2058becb86bd3c9fa63221d7f06fb24323203 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -398,6 +398,7 @@ OfferUtils.copyOffer = function (pOfferId, pOfferData) * * @param {String} pSourceOfferId * @param {String} pTargetOfferId + * @param {Number} pDiscount */ OfferUtils.copyOfferItems = function (pSourceOfferId, pTargetOfferId, pDiscount) { diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 8c981ecd4db360cd95a00663a447f1ebf3f8be5c..fc7918d66d118477455fae249da67ff726a009cb 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -2279,6 +2279,9 @@ SqlBuilder.prototype._prepare = function(pField, pValue, pCondition, pFieldType, else { var type = pFieldType; + //booleans are normally stored with TINYINT, this is to support true/false directly + if (_isIntegerType(type) && Utils.isBoolean(pValue)) + pValue = Number(pValue); values = [[pValue.toString(), type]]; } @@ -2286,6 +2289,14 @@ SqlBuilder.prototype._prepare = function(pField, pValue, pCondition, pFieldType, pCondition = SqlUtils.replaceConditionTemplate(pCondition, "#", alias); return [pCondition, values]; + + function _isIntegerType (pType) + { + return pType == SQLTYPES.TINYINT + || pType == SQLTYPES.SMALLINT + || pType == SQLTYPES.INTEGER + || pType == SQLTYPES.BIGINT; + } } /** diff --git a/process/mstBot_rest/process.js b/process/mstBot_rest/process.js index c93ca1c87aa2e9770cf5510c7b46c8c6f1871878..26fc6409b451e12b8f4f4a4203009a0be62c8fb9 100644 --- a/process/mstBot_rest/process.js +++ b/process/mstBot_rest/process.js @@ -12,6 +12,7 @@ function restpost(pRequestAsJson) //Umformen, dass man den Body des Requests als JsonFormat Base64 decodiert hat var jsonRequest = JSON.parse(pRequestAsJson); var body = jsonRequest.body; + body = util.decodeBase64String(body); var jsonBody = JSON.parse(body); diff --git a/report/Salesorder_report/reportData.jrxml b/report/Salesorder_report/reportData.jrxml index dddb5cf7b47625ee6351e06257b40734c7dbbf38..e885e5f6bceda798028872ef5bc26c7c7f393d88 100644 --- a/report/Salesorder_report/reportData.jrxml +++ b/report/Salesorder_report/reportData.jrxml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Beleg" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e7a916c8-3f9a-497d-84bb-3909b15271ea"> - <property name="ireport.zoom" value="1.0"/> - <property name="ireport.x" value="0"/> - <property name="ireport.y" value="0"/> + <property name="ireport.zoom" value="2.3579476910000023"/> + <property name="ireport.x" value="175"/> + <property name="ireport.y" value="665"/> <parameter name="myAddr" class="java.lang.String"/> <parameter name="Artikelbezeichnung" class="java.lang.String"/> <parameter name="Artikel-Nr" class="java.lang.String"/> @@ -27,7 +27,7 @@ <parameter name="SUMITEMSUM" class="java.lang.Double"/> <parameter name="TOTAL" class="java.lang.String"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> - <defaultValueExpression><![CDATA["C:\\dev\\project\\basic\\report\\Salesorder_report\\"]]></defaultValueExpression> + <defaultValueExpression><![CDATA["C:\\Entwicklung\\2020.2\\project\\basic2\\report\\Salesorder_report\\"]]></defaultValueExpression> </parameter> <parameter name="adito.datasource.subdata" class="java.lang.Object" isForPrompting="false"/> <parameter name="adito.image.myLogo" class="java.lang.String"/> @@ -77,7 +77,7 @@ <variable name="Menge_Einheit" class="java.lang.String"> <variableExpression><![CDATA[$F{QUANTITY}.toString() + " " + $F{UNITTEXT}]]></variableExpression> </variable> - <group name="SALESORDERID"> + <group name="SALESORDERID" isStartNewPage="true"> <groupExpression><![CDATA[$F{SALESORDERID}]]></groupExpression> <groupHeader> <band height="53"> @@ -302,6 +302,15 @@ <textFieldExpression><![CDATA[$P{OrderDeliveryTerm}]]></textFieldExpression> </textField> </band> + <band height="50"> + <textField isStretchWithOverflow="true"> + <reportElement x="0" y="0" width="555" height="50" uuid="678c4956-6136-49ba-8199-ed41c384e3ea"/> + <textElement> + <font size="8"/> + </textElement> + <textFieldExpression><![CDATA[$F{FOOTER}]]></textFieldExpression> + </textField> + </band> </groupFooter> </group> <group name="VAT"> @@ -397,17 +406,6 @@ </textField> </band> </detail> - <columnFooter> - <band height="21" splitType="Stretch"> - <textField isStretchWithOverflow="true"> - <reportElement x="0" y="0" width="555" height="20" uuid="678c4956-6136-49ba-8199-ed41c384e3ea"/> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$F{FOOTER}]]></textFieldExpression> - </textField> - </band> - </columnFooter> <pageFooter> <band height="46" splitType="Stretch"> <textField pattern="EEEEE dd MMMMM yyyy">