Skip to content
Snippets Groups Projects
Commit 7d1eee16 authored by Mohamed Mansour's avatar Mohamed Mansour
Browse files

merged origin/master into Receipt

parents 4e712270 15ff7b1f
No related branches found
No related tags found
No related merge requests found
Showing
with 745 additions and 413 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">
<changeSet author="s.listl" id="28c04b3e-c643-4ef9-b1fa-4a8816e9ad0d">
<addColumn tableName="CAMPAIGN">
<column name="CURRENCY" type="CHAR(36)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
......@@ -6,4 +6,6 @@
<include relativeToChangelogFile="true" file="alter_SerialLetter.xml"/>
<include relativeToChangelogFile="true" file="insert_SerialLetterStatus_keyword.xml"/>
<include relativeToChangelogFile="true" file="insert_AttributeType_Theme_keyword.xml"/>
<include relativeToChangelogFile="true" file="alter_Campaign_currency.xml"/>
</databaseChangeLog>
This diff is collapsed.
......@@ -148,6 +148,10 @@
<name>DisplaySimpleName_param</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/specificattribute/children/displaysimplename_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>AttributeTypes_param</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/specificattribute/children/attributetypes_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
......
import("system.result");
import("Attribute_lib");
var isTheme = vars.exists("$param.IsTheme_param") && vars.getString("$param.IsTheme_param") == "true";
if (isTheme)
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME);
else
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME, "# != ?");
result.object([$AttributeTypes.THEME.toString()]);
\ No newline at end of file
......@@ -74,14 +74,11 @@ if (rowId)
sqlCondition.and("1=1");
}
var IsTheme = vars.exists("$param.IsTheme_param") && vars.getString("$param.IsTheme_param") == "true";
if (IsTheme){
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", 'THEME');
}
var isTheme = vars.exists("$param.IsTheme_param") && vars.getString("$param.IsTheme_param") == "true";
if (isTheme)
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME);
else
{
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", 'THEME', "# != ?");
}
sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME, "# != ?");
joinCondition.and("AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID");
......
......@@ -49,6 +49,7 @@
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<valueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/variablecosts/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/variablecosts/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>FixCosts</name>
......@@ -56,6 +57,7 @@
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<valueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/fixcosts/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/fixcosts/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>TotalCosts</name>
......@@ -63,6 +65,7 @@
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<valueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/totalcosts/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/totalcosts/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>CostsPerParticipant</name>
......@@ -70,6 +73,7 @@
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<valueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/costsperparticipant/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/costsperparticipant/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>UID</name>
......@@ -99,6 +103,10 @@
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>Currency</name>
<valueProcess>%aditoprj%/entity/CampaignAnalysis_entity/entityfields/currency/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.CostsPerParticipant"), translate.text("#,##0.00"), vars.get("$field.Currency")));
\ No newline at end of file
import("system.result");
import("system.vars");
result.string(parseFloat(vars.getString("$field.TotalCosts")) / parseInt(vars.get("$field.ParticipantCount")));
\ No newline at end of file
var cost = parseFloat(vars.getString("$field.TotalCosts")) / parseInt(vars.get("$field.ParticipantCount"));
result.string(isFinite(cost) ? cost : 0); //if there is no participant, it would cause a division by zero and the result would be infinity
\ No newline at end of file
import("system.db");
import("system.result");
import("Sql_lib");
result.string(db.cell(SqlCondition.begin()
.andPrepareVars("CAMPAIGN.CAMPAIGNID", "$param.CampaignId_param")
.buildSql("select CURRENCY from CAMPAIGN", "1=2")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.FixCosts"), translate.text("#,##0.00"), vars.get("$field.Currency")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.TotalCosts"), translate.text("#,##0.00"), vars.get("$field.Currency")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.VariableCosts"), translate.text("#,##0.00"), vars.get("$field.Currency")));
\ No newline at end of file
......@@ -55,6 +55,7 @@
<outputFormat>#,##0.00</outputFormat>
<inputFormat>#,##0.00</inputFormat>
<mandatory v="true" />
<displayValueProcess>%aditoprj%/entity/CampaignCost_entity/entityfields/net/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>USER_NEW</name>
......@@ -215,6 +216,7 @@
<state>READONLY</state>
<titleProcess>%aditoprj%/entity/CampaignCost_entity/entityfields/netperparticipant/titleProcess.js</titleProcess>
<valueProcess>%aditoprj%/entity/CampaignCost_entity/entityfields/netperparticipant/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignCost_entity/entityfields/netperparticipant/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>countParticipants</name>
......@@ -232,6 +234,9 @@
<documentation>%aditoprj%/entity/CampaignCost_entity/entityfields/campaignsteps_param/documentation.adoc</documentation>
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>CURRENCY</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -242,19 +247,26 @@
<orderClauseProcess>%aditoprj%/entity/CampaignCost_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<linkInformation>
<linkInformation>
<name>70c2db20-0695-4189-92cb-7da585bff401</name>
<name>6010c581-04c5-4578-b07b-5ab5ce27093b</name>
<tableName>CAMPAIGNCOST</tableName>
<primaryKey>CAMPAIGNCOSTID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
<linkInformation>
<name>b97b7f67-86ea-4d0a-8303-abc05863ed66</name>
<name>e5fcdb82-a4f4-4bf8-a7e5-81b94d6377bb</name>
<tableName>CAMPAIGNSTEP</tableName>
<primaryKey>CAMPAIGNSTEPID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
<linkInformation>
<name>22980b1e-ea89-4dc6-a648-bddb77401c6a</name>
<tableName>CAMPAIGN</tableName>
<primaryKey>CAMPAIGNID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
......@@ -297,6 +309,10 @@
<name>CATEGORY.displayValue</name>
<expression>%aditoprj%/entity/CampaignCost_entity/recordcontainers/db/recordfieldmappings/category.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CURRENCY.value</name>
<recordfield>CAMPAIGN.CURRENCY</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
......
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.NET"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$field.netPerParticipant"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("system.result");
result.string("CAMPAIGNCOST left join CAMPAIGNSTEP on CAMPAIGNCOST.CAMPAIGNSTEP_ID = CAMPAIGNSTEP.CAMPAIGNSTEPID")
\ No newline at end of file
result.string("CAMPAIGNCOST left join CAMPAIGNSTEP on CAMPAIGNCOST.CAMPAIGNSTEP_ID = CAMPAIGNSTEP.CAMPAIGNSTEPID \
join CAMPAIGN on CAMPAIGNCOST.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID");
\ No newline at end of file
......@@ -486,6 +486,28 @@
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>CURRENCY</name>
<title>Currency</title>
<consumer>KeywordCurrency</consumer>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/currency/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Campaign_entity/entityfields/currency/displayValueProcess.js</displayValueProcess>
</entityField>
<entityConsumer>
<name>KeywordCurrency</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/keywordcurrency/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -568,6 +590,14 @@
<name>STATUS.displayValue</name>
<expression>%aditoprj%/entity/Campaign_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CURRENCY.value</name>
<recordfield>CAMPAIGN.CURRENCY</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CURRENCY.displayValue</name>
<expression>%aditoprj%/entity/Campaign_entity/recordcontainers/db/recordfieldmappings/currency.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
<filterExtensions>
<filterExtensionSet>
......
import("system.result");
import("system.vars");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string(KeywordUtils.getViewValue($KeywordRegistry.currency(), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
import("KeywordRegistry_basic");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
result.string($KeywordRegistry.currency$eur());
\ 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