diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 6c22346f3ab88947f172bb1c3b0f8231b5c0aa50..7e1f94098ab7703f193cb5698e7ef5f61dfd586a 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -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> diff --git a/entity/Offer_entity/entityfields/relation_id/valueProcess.js b/entity/Offer_entity/entityfields/relation_id/valueProcess.js index 250a8378a044a36db5fe2ebbf4bd5538b291283e..3e39bab540d53deba3913bc0d398034ab5bce404 100644 --- a/entity/Offer_entity/entityfields/relation_id/valueProcess.js +++ b/entity/Offer_entity/entityfields/relation_id/valueProcess.js @@ -1,7 +1,7 @@ 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 diff --git a/entity/Offer_entity/entityfields/salesproject_id/displayValueProcess.js b/entity/Offer_entity/entityfields/salesproject_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..65afbf6e950eebef0268138074bc97f00869eb0a --- /dev/null +++ b/entity/Offer_entity/entityfields/salesproject_id/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("Salesproject_lib"); + +result.string(Salesproject.getSalesProjectTitleById(vars.getString("$field.SALESPROJECT_ID"))); \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/newoffer/onActionProcess.js b/entity/Pers_entity/entityfields/newoffer/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fdee58dbfa82c4c75a4482a0df109f56ffd47762 --- /dev/null +++ b/entity/Pers_entity/entityfields/newoffer/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("Offer_lib"); + +OfferUtils.createNewOffer(null, vars.getString("$field.RELATIONID")); \ No newline at end of file diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index bcb7ba7ea9d26165ed4efcfc4e9b8cd5ba15e5cd..3b218bb0a58fb85b80fb3dc6697d0318e34239d2 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -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> diff --git a/entity/Salesproject_entity/titleProcess.js b/entity/Salesproject_entity/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..96a0a030e216f22364464faa38814240f086e885 --- /dev/null +++ b/entity/Salesproject_entity/titleProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.PROJECTTITLE")); \ No newline at end of file diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 3143c1b695f52ec7c599c59a1a1ba42b544d633b..a84bde50803639cb1dfd24d4c509fdb612132921 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -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); } diff --git a/process/Salesproject_lib/process.js b/process/Salesproject_lib/process.js index a7a26eb60f366f028bee4f911216f58fc123225f..2b50b3b61d1f328051a22e39282bbf647d711aff 100644 --- a/process/Salesproject_lib/process.js +++ b/process/Salesproject_lib/process.js @@ -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