Skip to content
Snippets Groups Projects
Commit 77209059 authored by Johannes Hörmann's avatar Johannes Hörmann Committed by David Büchler
Browse files

CampaignCosts

parent f6c18620
No related branches found
No related tags found
No related merge requests found
Showing
with 240 additions and 3 deletions
......@@ -9,7 +9,7 @@
<column name="CONTAINER" value="CampaignManagementStates"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="0"/>
<column name="ISESSENTIAL" valueNumeric="1"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="3e5036a1-43a1-4bb1-ad56-ed42df7c9538"/>
......
......@@ -9,7 +9,7 @@
<column name="CONTAINER" value="CampaignManagementStepStates"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="0"/>
<column name="ISESSENTIAL" valueNumeric="1"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="b1f5ea38-1b8c-47a8-a8ad-4c6ed9c26cda"/>
......
......@@ -9,28 +9,41 @@
</entityProvider>
<entityField>
<name>CAMPAIGNCOSTID</name>
<mandatory v="true" />
<searchable v="false" />
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/campaigncostid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CAMPAIGN_ID</name>
<title>Campaign</title>
<consumer>Campaigns</consumer>
<mandatory v="true" />
<groupable v="true" />
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/campaign_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/campaign_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>CAMPAIGNSTEP_ID</name>
<title>Campaign Step</title>
<consumer>CampaignSteps</consumer>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/campaignstep_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>CATEGORY</name>
<title>Category</title>
<consumer>KeywordCampaignManagementCostCategory</consumer>
<mandatory v="true" />
<groupable v="true" />
<displayValueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/category/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>NET</name>
<title>Cost</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<mandatory v="true" />
</entityField>
<entityField>
<name>USER_NEW</name>
......@@ -57,6 +70,8 @@
<entityProvider>
<name>CampaignCosts</name>
<fieldType>DEPENDENCY_IN</fieldType>
<targetContextField>TARGET_CONTEXT</targetContextField>
<targetIdField>TARGET_ROWID</targetIdField>
<dependencies>
<entityDependency>
<name>7131288b-af5c-4914-96f5-c5d70217fc23</name>
......@@ -65,10 +80,41 @@
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>CampaignStepId_param</name>
<expose v="false" />
</entityParameter>
<entityParameter>
<name>Uid_param</name>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityProvider>
<name>StepCosts</name>
<fieldType>DEPENDENCY_IN</fieldType>
<targetContextField>TARGET_CONTEXT</targetContextField>
<targetIdField>TARGET_ROWID</targetIdField>
<dependencies>
<entityDependency>
<name>af147f3e-a1bd-4eb0-9ac8-325dbdaba17d</name>
<entityName>CampaignStep_entity</entityName>
<fieldName>CampaignStepCosts</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>CampaignStepId_param</name>
<expose v="true" />
<mandatory v="true" />
</entityParameter>
<entityParameter>
<name>Uid_param</name>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityConsumer>
<name>Campaigns</name>
......@@ -88,11 +134,63 @@
<fieldName>CampaignSteps</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>KeywordCampaignManagementCostCategory</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/keywordcampaignmanagementcostcategory/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityActionGroup>
<name>alter</name>
<children>
<entityActionField>
<name>edit</name>
<fieldType>ACTION</fieldType>
<onActionProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/alter/children/edit/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>NEON:PENCIL</iconId>
</entityActionField>
</children>
</entityActionGroup>
<entityParameter>
<name>CampaignId_param</name>
<expose v="true" />
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>CampaignStepId_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>TARGET_CONTEXT</name>
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/target_context/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>TARGET_ROWID</name>
<valueProcess>%aditoprj%/entity/CampaignCost_entitiy/entityfields/target_rowid/valueProcess.js</valueProcess>
</entityField>
<entityParameter>
<name>Uid_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/CampaignCost_entitiy/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>70824b95-c84c-406c-89df-c5b9bb379b08</name>
......@@ -139,6 +237,10 @@
<name>USER_NEW.value</name>
<recordfield>CAMPAIGNCOST.USER_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CATEGORY.displayValue</name>
<expression>%aditoprj%/entity/CampaignCost_entitiy/recordcontainers/db/recordfieldmappings/category.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
......
import("system.neon");
import("system.vars");
var params = {
"Uid_param" : vars.get("$sys.uid")
}
neon.openContext("CampaignCost", "CampaignCostEdit_view", null, neon.OPERATINGSTATE_EDIT, params);
\ No newline at end of file
import("system.result");
import("system.db");
import("system.vars");
import("Campaign_lib");
var campaignId = vars.get("$field.CAMPAIGN_ID");
var campaignName = CampaignUtils.getCampaignNameById(campaignId);
result.string(campaignName);
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param"))
{
result.string(vars.get("$param.CampaignId_param"));
}
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.db");
import("system.vars");
import("Campaign_lib");
var campaignStepId = vars.get("$field.CAMPAIGNSTEP_ID");
if (campaignStepId)
{
var campaignStepName = CampaignUtils.getCampaignStepNameById(campaignStepId);
result.string(translate.text("Step") + ": " + campaignStepName);
}
else
{
result.string(translate.text("Fix cost"));
}
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.CampaignStepId_param") && vars.get("$param.CampaignStepId_param"))
{
result.string(vars.get("$param.CampaignStepId_param"));
}
\ No newline at end of file
import("system.result");
import("system.vars");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string(KeywordUtils.getViewValue($KeywordRegistry.campaignStepCostCategory(), vars.get("$this.value")));
\ No newline at end of file
import("system.result");
import("KeywordRegistry_basic");
result.string($KeywordRegistry.campaignStepCostCategory());
\ No newline at end of file
import("system.result");
import("system.vars");
if (vars.exists("$field.CAMPAIGNSTEP_ID") && vars.get("$field.CAMPAIGNSTEP_ID"))
{
result.string("CampaignStep");
}
else
{
result.string("Campaign");
}
\ No newline at end of file
import("system.result");
import("system.vars");
if (vars.exists("$field.CAMPAIGNSTEP_ID") && vars.get("$field.CAMPAIGNSTEP_ID"))
{
result.string(vars.get("$field.CAMPAIGNSTEP_ID"));
}
else
{
result.string(vars.get("$field.CAMPAIGN_ID"));
}
\ No newline at end of file
import("system.logging");
import("system.db");
import("system.result");
import("Sql_lib");
var cond = SqlCondition.begin()
.andPrepareVars("CAMPAIGNCOST.CAMPAIGNCOSTID", "$param.Uid_param")
.andPrepareVars("CAMPAIGNCOST.CAMPAIGN_ID", "$param.CampaignId_param")
.andPrepareVars("CAMPAIGNCOST.CAMPAIGNSTEP_ID", "$param.CampaignStepId_param");
result.string(db.translateCondition(cond.build("1=2")));
\ No newline at end of file
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.campaignStepCostCategory(), "CAMPAIGNCOST.CATEGORY");
result.string(sql);
\ No newline at end of file
......@@ -198,6 +198,26 @@
<fieldName>Employees</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>CampaignStepCosts</name>
<title>Cost</title>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>CampaignCost_entitiy</entityName>
<fieldName>StepCosts</fieldName>
</dependency>
<children>
<entityParameter>
<name>CampaignId_param</name>
<valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/campaignstepcosts/children/campaignid_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>CampaignStepId_param</name>
<valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/campaignstepcosts/children/campaignstepid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.CAMPAIGN_ID"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$sys.uid"));
\ No newline at end of file
......@@ -3,4 +3,4 @@ import("system.vars");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string(KeywordUtils.getViewValue($KeywordRegistry.campaignStepState(), vars.get("$field.STATE")));
\ No newline at end of file
result.string(KeywordUtils.getViewValue($KeywordRegistry.campaignStepState(), vars.get("$this.value")));
\ No newline at end of file
......@@ -184,6 +184,12 @@
<entityName>CampaignCost_entitiy</entityName>
<fieldName>CampaignCosts</fieldName>
</dependency>
<children>
<entityParameter>
<name>CampaignId_param</name>
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaigncosts/children/campaignid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
......
import("system.result");
import("system.vars");
result.string(vars.get("$sys.uid"));
\ 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