Skip to content
Snippets Groups Projects
Commit dc854ef6 authored by Tobias Feldmann's avatar Tobias Feldmann
Browse files

Salesproject integration in offer

parent 331dea9c
No related branches found
No related tags found
No related merge requests found
......@@ -72,10 +72,13 @@
<entityField>
<name>SALESPROJECT_ID</name>
<title>Salesproject</title>
<linkedContext>Salesproject_context</linkedContext>
<mandatory v="true" />
<outgoingField>OfferSalesproject_dfo</outgoingField>
<state>INVISIBLE</state>
<stateProcess>%aditoprj%/entity/Offer_entity/entityfields/salesproject_id/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/salesproject_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/salesproject_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>STATUS</name>
......@@ -325,6 +328,15 @@
<entityField>
<name>ORG_NAME</name>
</entityField>
<entityOutgoingField>
<name>OfferSalesproject_dfo</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Salesproject_entity</entityName>
<fieldName>#INCOMING</fieldName>
</dependency>
</entityOutgoingField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
import("system.vars");
if (vars.exists("$param.RelationId_param"))
if (vars.exists("$param.RelationId_param"))
{
result.string(vars.get("$param.RelationId_param"))
result.string(vars.get("$param.RelationId_param"));
}
\ No newline at end of file
import("system.vars");
import("system.result");
import("Salesproject_lib");
result.string(Salesproject.getSalesProjectTitleById(vars.getString("$field.SALESPROJECT_ID")));
\ No newline at end of file
import("system.vars");
import("Offer_lib");
OfferUtils.createNewOffer(null, vars.getString("$field.RELATIONID"));
\ No newline at end of file
......@@ -4,10 +4,19 @@
<title>Salesproject</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<iconId>VAADIN:BOOK_DOLLAR</iconId>
<titleProcess>%aditoprj%/entity/Salesproject_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<entityFields>
<entityIncomingField>
<name>#INCOMING</name>
<dependencies>
<entityDependency>
<name>525fd920-ea50-45d6-97a8-20e0aaaa830c</name>
<entityName>Offer_entity</entityName>
<fieldName>OfferSalesproject_dfo</fieldName>
<isOutgoing v="false" />
</entityDependency>
</dependencies>
</entityIncomingField>
<entityField>
<name>DATE_EDIT</name>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.PROJECTTITLE"));
\ No newline at end of file
......@@ -74,7 +74,7 @@ OfferUtils.createNewOffer = function(pSalesprojectId, pRelationId)
if (pRelationId)
params["RelationId_param"] = pRelationId;
neon.openContext("Offer_context", null, neon.OPERATINGSTATE_NEW, params);
neon.openContext("Offer_context", null, null, neon.OPERATINGSTATE_NEW, params);
}
......
......@@ -66,4 +66,17 @@ Salesproject.insertMilestone = function(salesprojectId, type, value, notifyForec
Salesproject.notifyToUpdateForecast = function() {
// TODO: logging.show durch sinnvolle Meldung ersetzen oder ähnlich...
logging.show(translate.text("Please update the forecast."));
}
/**
* get the title of a salesproject by id
* @param {String} pSalesProjectId
* <br>
* @return {String} title of the salesproject
*/
Salesproject.getSalesProjectTitleById = function(pSalesProjectId)
{
return db.cell( SqlCondition.begin()
.andPrepare("SALESPROJECT.SALESPROJECTID", pSalesProjectId)
.buildSelect("select PROJECTTITLE from SALESPROJECT", "1=0"));
}
\ 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