Skip to content
Snippets Groups Projects
Commit 414e5afa authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Sebastian Pongratz
Browse files

Sales 1082524 enable linking orders to orders

parent a4fd5891
No related branches found
No related tags found
No related merge requests found
Showing
with 432 additions and 0 deletions
<?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">
<include relativeToChangelogFile="true" file="create_SalesorderLink.xml"/>
</databaseChangeLog>
\ No newline at end of file
<?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="b.ulrich" id="5f26fa1d-4949-4997-8bdc-1bc792f7bed8">
<createTable tableName="SALESORDERLINK">
<column name="SALESORDERLINKID" type="CHAR(36)">
<constraints primaryKey="true" primaryKeyName="PK_SALESORDERLINKID"/>
</column>
<column name="SALESORDER_ID" type="CHAR(36)">
<constraints nullable="false"/>
</column>
<column name="OBJECT_TYPE" type="NVARCHAR(63)">
<constraints nullable="false"/>
</column>
<column name="OBJECT_ROWID" type="CHAR(36)">
<constraints nullable="false"/>
</column>
<column name="USER_NEW" type="NVARCHAR(50)" />
<column name="DATE_NEW" type="DATETIME" />
<column name="USER_EDIT" type="NVARCHAR(50)" />
<column name="DATE_EDIT" type="DATETIME" />
</createTable>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -4,4 +4,5 @@
<include relativeToChangelogFile="true" file="CurrencyRate/changelog.xml"/>
<include relativeToChangelogFile="true" file="EmailFilter/alter_emailFilterHandling.xml"/>
<include relativeToChangelogFile="true" file="EmailFilter/insert_recipientStatusBounced.xml"/>
<include relativeToChangelogFile="true" file="SalesorderToSalesorderLinking/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -21272,6 +21272,138 @@
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
<name>SALESORDERLINK</name>
<dbName></dbName>
<idColumn>SALESORDERLINKID</idColumn>
<idGeneratorType v="0" />
<idGeneratorInterval v="1" />
<documentation></documentation>
<title></title>
<description></description>
<auditSyncConfig>
<name>auditSyncConfig</name>
<auditMode v="0" />
<syncActive v="false" />
<syncComplete v="true" />
<syncDirection v="1" />
<syncIds></syncIds>
</auditSyncConfig>
<entityFields>
<entityFieldDb>
<name>OBJECT_ROWID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>SALESORDERLINKID</name>
<dbName></dbName>
<primaryKey v="true" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="true" />
<index v="true" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>SALESORDER_ID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>OBJECT_TYPE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="63" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
</entityFields>
</entityDb>
</entities>
</entityGroup>
</aliasDefDb>
......
......@@ -104,6 +104,19 @@
</entityParameter>
</children>
</entityProvider>
<entityProvider>
<name>SalesorderLinkeable</name>
<children>
<entityParameter>
<name>InvertBlacklist_param</name>
<valueProcess>%aditoprj%/entity/Context_entity/entityfields/salesorderlinkeable/children/invertblacklist_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Blacklist_param</name>
<valueProcess>%aditoprj%/entity/Context_entity/entityfields/salesorderlinkeable/children/blacklist_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityProvider>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.result");
result.object(["Order"]);
\ No newline at end of file
import("system.result");
result.string(true);
\ No newline at end of file
import("system.result");
result.object(["Salesproject", "Salesorder"]);
\ No newline at end of file
import("system.result");
result.string(true);
\ 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.21" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.21">
<name>OrderLink_entity</name>
<title>Receipt</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/OrderLink_entity/documentation.adoc</documentation>
<titlePlural>Receipts</titlePlural>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>SALESORDERLINKID</name>
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/salesorderlinkid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_TYPE</name>
<title>{$OBJECTLINK_TYPE}</title>
<consumer>Contexts</consumer>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/object_type/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/object_type/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>SALESORDER_ID</name>
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/salesorder_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_NEW</name>
</entityField>
<entityField>
<name>USER_EDIT</name>
</entityField>
<entityField>
<name>DATE_NEW</name>
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_EDIT</name>
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/date_edit/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_ROWID</name>
<title>{$OBJECTLINK_OBJECT}</title>
<consumer>Objects</consumer>
<linkedContextProcess>%aditoprj%/entity/OrderLink_entity/entityfields/object_rowid/linkedContextProcess.js</linkedContextProcess>
<mandatory v="true" />
<displayValueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/object_rowid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityConsumer>
<name>Contexts</name>
<dependency>
<name>dependency</name>
<entityName>Context_entity</entityName>
<fieldName>SalesorderLinkeable</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>Objects</name>
<dependency>
<name>dependency</name>
<entityName>Object_entity</entityName>
<fieldName>AllObjects</fieldName>
</dependency>
<children>
<entityParameter>
<name>ObjectType_param</name>
<valueProcess>%aditoprj%/entity/OrderLink_entity/entityfields/objects/children/objecttype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityProvider>
<name>Links</name>
<targetContextField>OBJECT_TYPE</targetContextField>
<targetIdField>OBJECT_ROWID</targetIdField>
<children>
<entityParameter>
<name>SalesorderId_param</name>
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>SalesorderId_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<conditionProcess>%aditoprj%/entity/OrderLink_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBInsert>%aditoprj%/entity/OrderLink_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
<onDBUpdate>%aditoprj%/entity/OrderLink_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<onDBDelete>%aditoprj%/entity/OrderLink_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<alias>Data_alias</alias>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<recordfield>SALESORDERLINK.DATE_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<recordfield>SALESORDERLINK.DATE_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_ROWID.value</name>
<recordfield>SALESORDERLINK.OBJECT_ROWID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_TYPE.value</name>
<recordfield>SALESORDERLINK.OBJECT_TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>SALESORDER_ID.value</name>
<recordfield>SALESORDERLINK.SALESORDER_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>SALESORDERLINKID.value</name>
<recordfield>SALESORDERLINK.SALESORDERLINKID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<recordfield>SALESORDERLINK.USER_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<recordfield>SALESORDERLINK.USER_NEW</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
<name>ee3c9a6f-53e4-4579-b2b8-994913cba502</name>
<tableName>SALESORDERLINK</tableName>
<primaryKey>SALESORDERLINKID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
</dbRecordContainer>
</recordContainers>
</entity>
= OrderLink_entity
Displays the connection between an Activity and another module (currently only other Orders).
Functions the same way as ActivityLink for example.
You can easily enable linking other object_types using the blacklist_param & invertBlacklist_param.
The reason why you can link the Salesproject and the Offer directly in the Order_entity instead of here is because we only need a 1:1 relation for those ones.
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("Keyword_lib");
import("KeywordRegistry_basic");
import("Sql_lib");
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"))
{
result.string("");
}
else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE"))
{
if(vars.get("$field.OBJECT_TYPE") == "Order")//TODO: use another way to get the title, even tho it's probably still faster than ContextUtils.getTitleByContext()
{
var select = newSelect(["SALESORDER.SALESORDERCODE", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.orderType(), "SALESORDER.ORDERTYPE")])
.from("SALESORDER")
.where("SALESORDER.SALESORDERID", vars.get("$this.value"))
.arrayRow();
result.string(select[0] + " | " + select[1]);
}
else
{
result.string(ContextUtils.getTitleByContext(vars.get("$field.OBJECT_TYPE"), vars.get("$field.OBJECT_ROWID")));
}
}
\ No newline at end of file
import("system.vars");
import("system.result");
import("Context_lib");
result.string(ContextUtils.getContextName(vars.get("$field.OBJECT_TYPE")))
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
import("system.project");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.OBJECT_TYPE"))
{
result.string("");
}
else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE"))
{
result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.OBJECT_TYPE"))[1]);
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$this.value") == null && (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT))
{
result.string("Order");
}
\ No newline at end of file
import("system.result");
import("system.vars");
result.string(vars.get("$field.OBJECT_TYPE"));
\ No newline at end of file
import("system.vars");
import("system.result");
if(vars.get("$this.value") && vars.get("$param.SalesorderId_param"))
{
result.string(vars.get("$param.SalesorderId_param"))
}
\ No newline at end of file
import("system.neon");
import("system.util");
import("system.result");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
{
result.string(util.getNewUUID());
}
\ No newline at end of file
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