Skip to content
Snippets Groups Projects
Commit d47041b7 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '#1049212-Vertriebscontrolling' into '2020.2.0'

#1063050 Dynamische Auswertungen zu Aktivitäten und #1063052  Dynamische Auswertungen zur Conversion Rate von Vertriebsprojekten für #1049212 vertriebscontrolling

See merge request xrm/basic!344
parents 6ee2f364 efc07384
No related branches found
No related tags found
No related merge requests found
Showing
with 231 additions and 29 deletions
......@@ -96,6 +96,10 @@
<kind v="10077" />
<title></title>
</entityNode>
<entityNode>
<name>SalesprojectConversionRate</name>
<kind v="10077" />
</entityNode>
</childNodes>
</entityNode>
<entityNode>
......
......@@ -4,9 +4,6 @@
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Activity_entity/documentation.adoc</documentation>
<title>Activity</title>
<siblings>
<element>ActivityLink_entity</element>
</siblings>
<grantDeleteProcess>%aditoprj%/entity/Activity_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/Activity_entity/contentTitleProcess.js</contentTitleProcess>
<afterUiInit>%aditoprj%/entity/Activity_entity/afterUiInit.js</afterUiInit>
......@@ -317,6 +314,7 @@
<documentation>%aditoprj%/entity/Activity_entity/entityfields/responsible/documentation.adoc</documentation>
<title>Responsible</title>
<consumer>Employees</consumer>
<groupable v="true" />
<linkedContext>Person</linkedContext>
<valueProcess>%aditoprj%/entity/Activity_entity/entityfields/responsible/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Activity_entity/entityfields/responsible/displayValueProcess.js</displayValueProcess>
......@@ -634,6 +632,7 @@
<name>db</name>
<alias>Data_alias</alias>
<maximumDbRows v="10000" />
<fromClauseProcess>%aditoprj%/entity/Activity_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/Activity_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/Activity_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<onDBInsert>%aditoprj%/entity/Activity_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
......@@ -734,6 +733,10 @@
<recordfield>ACTIVITY.ACTIVITYID</recordfield>
<aggregateType>COUNT</aggregateType>
</aggregateFieldDbMapping>
<dbRecordFieldMapping>
<name>COUNT.value</name>
<expression>%aditoprj%/entity/Activity_entity/recordcontainers/db/recordfieldmappings/count.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ENTRYDAY.value</name>
<expression>%aditoprj%/entity/Activity_entity/recordcontainers/db/recordfieldmappings/entryday.value/expression.js</expression>
......@@ -767,6 +770,15 @@
<isLookupFilter v="false" />
<filtertype>BASIC</filtertype>
</filterExtension>
<filterExtension>
<name>ResponsibleDepartment_filter</name>
<title>Responsible Department</title>
<contentType>TEXT</contentType>
<filterValuesProcess>%aditoprj%/entity/Activity_entity/recordcontainers/db/filterextensions/responsibledepartment_filter/filterValuesProcess.js</filterValuesProcess>
<filterConditionProcess>%aditoprj%/entity/Activity_entity/recordcontainers/db/filterextensions/responsibledepartment_filter/filterConditionProcess.js</filterConditionProcess>
<isLookupFilter v="false" />
<filtertype>BASIC</filtertype>
</filterExtension>
</filterExtensions>
</dbRecordContainer>
</recordContainers>
......
import("system.datetime");
import("system.result");
import("system.vars");
var entryDate = vars.get("$field.ENTRYDATE");
result.string(datetime.toDate(entryDate, "dd MMMM yyyy"));
\ No newline at end of file
import("system.translate");
import("system.datetime");
import("system.result");
import("system.vars");
let m = vars.get("$field.ENTRYMONTH");
if (m) {
// When convert the Number of the Month to the Month name it doesn't matter which Year is used, so here is the Year 2020 hard-coded.
let monthDate = new Date(2020, m-1);
result.string(translate.text(datetime.toDate(monthDate.getTime(), "MMMM", "UTC")));
}
import("system.datetime");
import("system.result");
import("system.vars");
var entryDate = vars.get("$field.ENTRYDATE");
result.string(datetime.toDate(entryDate, "MMMM yyyy"));
\ No newline at end of file
import("system.datetime");
import("system.result");
import("system.vars");
var entryDate = vars.get("$field.ENTRYDATE");
result.string(datetime.toDate(entryDate, "yyyy"));
\ No newline at end of file
import("system.tools");
import("Sql_lib");
import("Attribute_lib");
import("system.logging");
import("system.vars");
import("PermissionCalendar_lib");
import("system.result");
var contactIDs = [];
var data = tools.getUsersByAttribute("department", AttributeUtil.getAllChildren([vars.get("$local.rawvalue")]).concat([vars.get("$local.rawvalue")]));
for (let i = 0; i < data.length; i++) {
contactIDs.push(data[i].params.contactID);
}
if (data.length > 0) {
result.string(newWhere("ACTIVITY.RESPONSIBLE", contactIDs, SqlBuilder.IN()).toString());
} else {
result.string(newWhere("1 = 2").toString());
}
\ No newline at end of file
import("Sql_lib");
import("AttributeRegistry_basic");
import("Attribute_lib");
import("system.result");
import("system.translate");
let data = newSelect("AB_ATTRIBUTE.AB_ATTRIBUTEID, AB_ATTRIBUTE.ATTRIBUTE_NAME").from("AB_ATTRIBUTE").where("AB_ATTRIBUTE.AB_ATTRIBUTEID", AttributeUtil.getAllChildren($AttributeRegistry.departments()), SqlBuilder.IN()).table()
for (let row of data){
row[1] = translate.text(row[1]);
}
result.object(data);
\ No newline at end of file
import("system.result");
result.string("ACTIVITY left join CONTACT on CONTACT.CONTACTID = ACTIVITY.RESPONSIBLE left join PERSON on PERSON.PERSONID = CONTACT.PERSON_ID");
\ No newline at end of file
import("system.SQLTYPES");
import("Sql_lib");
import("system.result");
import("Sql_lib");
var helper = new SqlMaskingUtils();
result.string(helper.dayFromDate("ACTIVITY.ENTRYDATE"));
\ No newline at end of file
var sqlHelper = new SqlMaskingUtils();
result.string(sqlHelper.cast(sqlHelper.dayFromDate("ACTIVITY.ENTRYDATE"), SQLTYPES.CHAR, 2));
import("system.SQLTYPES");
import("Sql_lib");
import("system.result");
import("Sql_lib");
var helper = new SqlMaskingUtils();
result.string(helper.monthFromDate("ACTIVITY.ENTRYDATE"));
\ No newline at end of file
var sqlHelper = new SqlMaskingUtils();
result.string(sqlHelper.cast(sqlHelper.monthFromDate("ACTIVITY.ENTRYDATE"), SQLTYPES.CHAR, 2));
import("system.SQLTYPES");
import("Sql_lib");
import("system.result");
import("Sql_lib");
var helper = new SqlMaskingUtils();
result.string(helper.yearFromDate("ACTIVITY.ENTRYDATE"));
\ No newline at end of file
var sqlHelper = new SqlMaskingUtils();
result.string(sqlHelper.cast(sqlHelper.yearFromDate("ACTIVITY.ENTRYDATE"), SQLTYPES.CHAR, 4));
import("system.result");
import("Person_lib");
import("system.result");
result.string(PersUtils.getResolvingDisplaySubSql("RESPONSIBLE"))
\ No newline at end of file
result.string(PersUtils.getDisplaySqlExpression());
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.17" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.17">
<name>SalesprojectConversionRate_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/SalesprojectConversionRate_entity/documentation.adoc</documentation>
<title>Conversion Rate</title>
<initFilterProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/initFilterProcess.js</initFilterProcess>
<iconId>VAADIN:PIE_CHART</iconId>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
<title>AB_KEYWORD_ENTRYID</title>
</entityField>
<entityField>
<name>AB_KEYWORD_ENTRYID_TITLE</name>
<title>Phase</title>
<displayValueProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/entityfields/ab_keyword_entryid_title/displayValueProcess.js</displayValueProcess>
</entityField>
<entityActionField>
<name>openSalesprojects</name>
<onActionProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/entityfields/opensalesprojects/onActionProcess.js</onActionProcess>
</entityActionField>
<entityActionField>
<name>sentOffers</name>
<onActionProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/entityfields/sentoffers/onActionProcess.js</onActionProcess>
</entityActionField>
<entityActionField>
<name>openForecast</name>
<onActionProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/entityfields/openforecast/onActionProcess.js</onActionProcess>
</entityActionField>
<entityActionField>
<name>openTurnover</name>
<onActionProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/entityfields/openturnover/onActionProcess.js</onActionProcess>
</entityActionField>
<entityField>
<name>AB_KEYWORD_ENTRYID_KEYID</name>
<title>Phase</title>
<groupable v="true" />
</entityField>
<entityAggregateField>
<name>conversionRate_aggregate</name>
<parentField>conversionRate</parentField>
</entityAggregateField>
<entityField>
<name>conversionRate</name>
<title>Conversion Rate</title>
<contentType>NUMBER</contentType>
<outputFormat>0.00 %</outputFormat>
</entityField>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<isPageable v="true" />
<isFilterable v="true" />
<isGroupable v="true" />
<contentProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<rowCountProcess>%aditoprj%/entity/SalesprojectConversionRate_entity/recordcontainers/jdito/rowCountProcess.js</rowCountProcess>
<recordFieldMappings>
<jDitoRecordFieldMapping>
<name>UID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>AB_KEYWORD_ENTRYID_KEYID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>AB_KEYWORD_ENTRYID_TITLE.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
<aggregateFieldMappings>
<jDitoRecordFieldMapping>
<name>conversionRate_aggregate.value</name>
</jDitoRecordFieldMapping>
</aggregateFieldMappings>
<filterExtensions>
<filterExtension>
<name>Year</name>
<title>Year</title>
<contentType>NUMBER</contentType>
<isGroupable v="true" />
<filtertype>BASIC</filtertype>
</filterExtension>
<filterExtension>
<name>Month</name>
<title>Month</title>
<contentType>NUMBER</contentType>
<isGroupable v="true" />
<filtertype>BASIC</filtertype>
</filterExtension>
<filterExtension>
<name>DATE_START</name>
<title>Date</title>
<contentType>DATE</contentType>
<filtertype>BASIC</filtertype>
</filterExtension>
</filterExtensions>
</jDitoRecordContainer>
</recordContainers>
</entity>
== Salesproject Analyses ==
This entity provides analyses to display different things of all salesproject.
\ No newline at end of file
import("Keyword_lib");
import("KeywordRegistry_basic");
import("system.vars");
import("system.translate");
import("system.result");
// It's important to translate twice, because there are Phase with an extra translation.
result.string(KeywordUtils.getViewValue($KeywordRegistry.salesprojectPhase(), vars.get("$field.AB_KEYWORD_ENTRYID_TITLE")));
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.neon");
neon.openContext("Turnover", null, null, neon.OPERATINGSTATE_SEARCH, {
"ShowForecast_param": "true",
"ShowTurnover_param": "false"
});
import("KeywordRegistry_basic");
import("system.neon");
neon.openContext("Salesproject", null, null, neon.OPERATINGSTATE_SEARCH, {
"Status_param": $KeywordRegistry.salesprojectState$open()
});
import("KeywordRegistry_basic");
import("system.neon");
neon.openContext("Turnover", null, null, neon.OPERATINGSTATE_SEARCH, {
"ShowForecast_param": "false",
"ShowTurnover_param": "true"
});
import("KeywordRegistry_basic");
import("system.neon");
neon.openContext("Offer", null, null, neon.OPERATINGSTATE_SEARCH, {
"OfferStatus_param": $KeywordRegistry.offerStatus$sent()
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment