Skip to content
Snippets Groups Projects
Commit c2ac0d7e authored by Andreas Schindlbeck's avatar Andreas Schindlbeck
Browse files

Merge branch 'master' of gitlab.adito.de:xrm/basic

parents 0febc14a 3787ccfd
No related branches found
No related tags found
No related merge requests found
Showing
with 210 additions and 82 deletions
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Address_entity</name>
<title>Addresses</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainerType>DB</recordContainerType>
<caption>Addresses</caption>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Address_entity/conditionProcess.js</conditionProcess>
<recordContainerType>DB</recordContainerType>
<caption>Addresses</caption>
<entityFields>
<entityField>
<name>ADDRESS</name>
......
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Comm_entity</name>
<title>Communication</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
......@@ -15,7 +15,7 @@
<columnName>ADDR</columnName>
<caption>${COMM_ADDRESS}</caption>
<contentTypeProcess>%aditoprj%/entity/Comm_entity/entityfields/addr/contentTypeProcess.js</contentTypeProcess>
<valueProcess>%aditoprj%/entity/Comm_entity/entityfields/addr/valueProcess.js</valueProcess>
<onValidation>%aditoprj%/entity/Comm_entity/entityfields/addr/onValidation.js</onValidation>
</entityField>
<entityField>
<name>COMMID</name>
......@@ -41,6 +41,7 @@
<columnName>MEDIUM_ID</columnName>
<caption>Medium</caption>
<possibleItemsProcess>%aditoprj%/entity/Comm_entity/entityfields/medium_id/possibleItemsProcess.js</possibleItemsProcess>
<valueProcess>%aditoprj%/entity/Comm_entity/entityfields/medium_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>RELATION_ID</name>
......@@ -87,6 +88,12 @@ So, for only showing telephone-types you&amp;apos;ve to specify this parameter w
<entityIncomingField>
<name>#INCOMING</name>
</entityIncomingField>
<entityParameter>
<name>RelationsMainCountry_param</name>
<code>%aditoprj%/entity/Comm_entity/entityfields/relationsmaincountry_param/code.js</code>
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<linkInformation>
<linkInformation>
......
import("system.logging");
import("system.text");
import("system.result");
import("system.vars");
import("Sql_lib");
import("Keyword_lib");
var cond, relId, mediumCategories, keywordUtil;
cond = "";
if(vars.exists("$param.RelId_param")){
relId = vars.get("$param.RelId_param");
if (relId != null && relId != "" && relId != undefined)
{
cond += " and COMM.RELATION_ID in ('" + relId + "')";//TODO: quoting/prevent sql-injection
}
}
if (vars.exists("$param.MediumCategoriesFilter_param")){
mediumCategories = vars.get("$param.MediumCategoriesFilter_param");
if (mediumCategories != null && mediumCategories != "" && mediumCategories != undefined)
{
mediumCategories = text.decodeMS(mediumCategories);
keywordUtil = new KeywordUtils();
var kwd = keywordUtil.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
return mediumCategories.indexOf(customs.category) > -1;
});
mediumIds = kwd.toArray("id");
if (mediumIds.length == 0)
throw new Error();//TODO: add message
cond += " and COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")";
}
}
result.string(cond ? "1 = 1 " + cond: "1 = 2");
\ No newline at end of file
import("system.db");
import("system.logging");
import("system.text");
import("system.result");
import("system.vars");
import("Sql_lib");
import("Keyword_lib");
var cond, relId, mediumCategories, keywordUtil, condStr;
cond = new SqlCondition();
if(vars.exists("$param.RelId_param")){
relId = vars.get("$param.RelId_param");
if (relId != null && relId != ""){
cond.andPrepare("COMM.RELATION_ID", "# = ?", relId);
}
}
if (vars.exists("$param.MediumCategoriesFilter_param")){
mediumCategories = vars.get("$param.MediumCategoriesFilter_param");
if (mediumCategories != null && mediumCategories != "") {
mediumCategories = text.decodeMS(mediumCategories);
keywordUtil = new KeywordUtils();
var kwd = keywordUtil.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
return mediumCategories.indexOf(customs.category) > -1;
});
mediumIds = kwd.toArray("id");
if (mediumIds.length == 0)
throw new Error();//TODO: add message
cond.and("COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")");
}
}
condStr = db.translateCondition([cond.toString("1 = 2"), cond.preparedValues]);//TODO: this should not be necessary in the future
result.string(condStr);
\ No newline at end of file
......@@ -3,26 +3,12 @@ import("system.vars");
import("system.result");
import("system.neon");
var keywordUtils, category, medium, contentType;
var keywordUtils, medium, contentType;
//TODO: add constants for contentTypes #1022547
medium = vars.get("$field.MEDIUM_ID");
if (medium){
keywordUtils = new KeywordUtils();
category = keywordUtils.createKeyword("COMM.MEDIUM").getPropForKey(medium, "category", true);
switch (category) {
case "PHONE":
contentType = "TELEPHONE";
break;
case "EMAIL":
contentType = "EMAIL";
break;
case "WEBSITE":
contentType = "LINK";
break;
default:
contentType = "TEXT";
break;
}
contentType = keywordUtils.createKeyword("COMM.MEDIUM").getPropForKey(medium, "contentType", true) || "TEXT";
}
else {
contentType = "TEXT";
......
import("system.logging");
import("system.translate");
import("system.vars");
import("system.net");
import("system.result");
import("system.mail");
import("Keyword_lib");
import("Comm_lib");
var kwdUtil = new KeywordUtils();
var kwd = kwdUtil.createKeyword("COMM.MEDIUM");
var commMedium = vars.get("$field.MEDIUM_ID");
var commCategory = kwd.getPropForKey(commMedium, "contentType", true);//TODO: maybe accessible via $property - then it's not needed to keep this information within the keyword
var fn = CommValidationUtil.makeValidationFn(commCategory);
if (fn != null){
var commAddr = vars.get("$local.value");//contains the entered value - the field contains the value only after successfull validation
var additional = CommValidationUtil.getExtensionsBlueprint();
additional.countryCode = vars.get("$param.RelationsMainCountry_param");//TODO: try to use users language first and then the companies
var res = fn.call(null, commAddr, additional);
if (res != null)
result.string(res);
}
\ No newline at end of file
import("system.logging");
import("system.text");
import("system.vars");
import("system.result");
......@@ -6,7 +7,7 @@ import("Keyword_lib");
var mediumCategories, kwdUtils, kwd, items;
kwdUtils = new KeywordUtils();
if (vars.exists("$param.MediumCategoriesFilter_param") && (mediumCategories = vars.get("$param.MediumCategoriesFilter_param")) != null){
if (vars.exists("$param.MediumCategoriesFilter_param") && (mediumCategories = vars.get("$param.MediumCategoriesFilter_param")) != ""){
mediumCategories = text.decodeMS(mediumCategories);
kwd = kwdUtils.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
......
import("system.result");
import("system.db");
import("system.logging");
import("system.vars");
import("Sql_lib");
var relId, country;
if (vars.exists("$param.RelId_param")) {
relId = vars.get("$param.RelId_param");
if (relId != "" && relId != null){
var cond = new SqlCondition();
cond.andPrepare("RELATION.RELATIONID", "# = ?", relId);
//TODO: this should happen by 1:1 links instead of manually requesting the data by a select
country = db.cell(["select ADDRESS.COUNTRY from ADDRESS "
+ "join RELATION on RELATION.ADDRESS_ID = ADDRESS.ADDRESSID "
+ cond.toWhereString(), cond.preparedValues]);
if (country != "")
result.string(country);
}
}
\ 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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Contract_entity</name>
<title>Contract</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Contract_entity/conditionProcess.js</conditionProcess>
<recordContainerType>DB</recordContainerType>
<caption>Contract</caption>
<iconId>VAADIN:FORM</iconId>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Contract_entity/conditionProcess.js</conditionProcess>
<entityFields>
<entityField>
<name>CONTRACTCODE</name>
......
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Countries_Entity</name>
<title>Countries</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
......
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Gender_keyword</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
......
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>History_entity</name>
<title>History</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainerType>DB</recordContainerType>
<caption>History</caption>
<iconId>NEON:HISTORY</iconId>
<imageProcess>%aditoprj%/entity/History_entity/imageProcess.js</imageProcess>
<alias>Data_alias</alias>
<fromClauseProcess>%aditoprj%/entity/History_entity/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/History_entity/conditionProcess.js</conditionProcess>
<onDBInsert>%aditoprj%/entity/History_entity/onDBInsert.js</onDBInsert>
<onDBDelete>%aditoprj%/entity/History_entity/onDBDelete.js</onDBDelete>
<recordContainerType>DB</recordContainerType>
<caption>History</caption>
<iconId>NEON:HISTORY</iconId>
<imageProcess>%aditoprj%/entity/History_entity/imageProcess.js</imageProcess>
<entityFields>
<entityField>
<name>DIRECTION</name>
......
<?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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Offer_entity</name>
<title>Offer</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
......@@ -41,12 +41,6 @@
<mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/Offer_entity/entityfields/language/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityField>
<name>NET</name>
<tableName>OFFER</tableName>
<columnName>NET</columnName>
<caption>Total net</caption>
</entityField>
<entityField>
<name>OFFERCODE</name>
<tableName>OFFER</tableName>
......@@ -116,6 +110,7 @@
<tableName>OFFER</tableName>
<columnName>VAT</columnName>
<caption>Total VAT</caption>
<state>READONLY</state>
</entityField>
<entityField>
<name>IMAGE</name>
......@@ -127,6 +122,7 @@
<tableName>OFFER</tableName>
<columnName>HEADER</columnName>
<caption>Header text</caption>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/header/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>FOOTER</name>
......@@ -153,6 +149,19 @@
<triggerRecalculation v="true" />
<mandatory v="true" />
</entityParameter>
<entityParameter>
<name>Currency_param</name>
<code>%aditoprj%/entity/Offer_entity/entityfields/offerofferitem_dfo/children/currency_param/code.js</code>
<expose v="true" />
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>RelationId_param</name>
<code>%aditoprj%/entity/Offer_entity/entityfields/offerofferitem_dfo/children/relationid_param/code.js</code>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="true" />
</entityParameter>
</children>
</entityOutgoingField>
<entityActionField>
......@@ -161,6 +170,25 @@
<onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/newofferversion/onActionProcess.js</onActionProcess>
<caption>New offer verison</caption>
</entityActionField>
<entityField>
<name>PreviewTitle</name>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/previewtitle/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>NET</name>
<tableName>OFFER</tableName>
<columnName>NET</columnName>
<caption>Total net</caption>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/net/valueProcess.js</valueProcess>
<fieldIdProcess>%aditoprj%/entity/Offer_entity/entityfields/net/fieldIdProcess.js</fieldIdProcess>
</entityField>
<entityField>
<name>TotalGross</name>
<caption>Total gross</caption>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/totalgross/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<linkInformation>
<linkInformation>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.CURRENCY"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.RELATION_ID"));
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.vars");
result.string(translate.text("Offer") + " " + vars.get("$field.OFFERCODE"));
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.eMath");
var netValue = vars.get("$field.NET");
var vatValue = vars.get("$field.VAT");
result.string( eMath.addDec(netValue, vatValue) );
\ 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.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.3">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.0.4">
<name>Offeritem_entity</name>
<title>Offeritem</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Offeritem_entity/conditionProcess.js</conditionProcess>
<onDBInsert>%aditoprj%/entity/Offeritem_entity/onDBInsert.js</onDBInsert>
<onDBUpdate>%aditoprj%/entity/Offeritem_entity/onDBUpdate.js</onDBUpdate>
<onDBDelete>%aditoprj%/entity/Offeritem_entity/onDBDelete.js</onDBDelete>
<recordContainerType>DB</recordContainerType>
<caption>Offeritem</caption>
<entityFields>
......@@ -44,6 +47,7 @@
<tableName>OFFERITEM</tableName>
<columnName>DESCRIPTION</columnName>
<caption>Description</caption>
<contentType>LONG_TEXT</contentType>
</entityField>
<entityField>
<name>DISCOUNT</name>
......@@ -56,6 +60,8 @@
<tableName>OFFERITEM</tableName>
<columnName>GROUPCODEID</columnName>
<caption>Commodity group</caption>
<possibleItemsProcess>%aditoprj%/entity/Offeritem_entity/entityfields/groupcodeid/possibleItemsProcess.js</possibleItemsProcess>
<state>READONLY</state>
</entityField>
<entityField>
<name>ITEMNAME</name>
......@@ -68,6 +74,7 @@
<tableName>OFFERITEM</tableName>
<columnName>ITEMPOSITION</columnName>
<caption>Position</caption>
<state>READONLY</state>
</entityField>
<entityField>
<name>ITEMSORT</name>
......@@ -78,6 +85,7 @@
<name>OFFERITEMID</name>
<tableName>OFFERITEM</tableName>
<columnName>OFFERITEMID</columnName>
<valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/offeritemid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OFFER_ID</name>
......@@ -90,6 +98,9 @@
<tableName>OFFERITEM</tableName>
<columnName>OPTIONAL</columnName>
<caption>Optional</caption>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Offeritem_entity/entityfields/optional/possibleItemsProcess.js</possibleItemsProcess>
<valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/optional/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>PRICE</name>
......@@ -102,18 +113,25 @@
<tableName>OFFERITEM</tableName>
<columnName>PRODUCT_ID</columnName>
<caption>Article</caption>
<possibleItemsProcess>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/possibleItemsProcess.js</possibleItemsProcess>
<onValidation>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/onValidation.js</onValidation>
<onValueChange>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>QUANTITY</name>
<tableName>OFFERITEM</tableName>
<columnName>QUANTITY</columnName>
<caption>Quantity</caption>
<valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/quantity/valueProcess.js</valueProcess>
<onValidation>%aditoprj%/entity/Offeritem_entity/entityfields/quantity/onValidation.js</onValidation>
<onValueChange>%aditoprj%/entity/Offeritem_entity/entityfields/quantity/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>UNIT</name>
<tableName>OFFERITEM</tableName>
<columnName>UNIT</columnName>
<caption>Unit</caption>
<possibleItemsProcess>%aditoprj%/entity/Offeritem_entity/entityfields/unit/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityField>
<name>USER_EDIT</name>
......@@ -132,6 +150,7 @@
<tableName>OFFERITEM</tableName>
<columnName>VAT</columnName>
<caption>VAT</caption>
<state>READONLY</state>
</entityField>
<entityParameter>
<name>OfferId_param</name>
......@@ -140,6 +159,31 @@
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>RelationId_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>Currency_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>TotalPrice</name>
<caption>Sum</caption>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/totalprice/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>IMAGE</name>
<contentType>IMAGE</contentType>
<valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/image/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<linkInformation>
<linkInformation>
......
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