diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 0418326a5360e0760bc3aee6657ad77b09b85c0b..c82ddacd864cd815761847db40073084396993d2 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -3300,6 +3300,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>OFFER_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 4afb6c516c1caa25aecd7211b004f98488fdce70..8fbf47e00ecdc20bf88663a5cd212b63a4d10e4c 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -385,6 +385,13 @@ <onActionProcess>%aditoprj%/entity/Order_entity/entityfields/newactivity/onActionProcess.js</onActionProcess> <iconId>NEON:HISTORY</iconId> </entityActionField> + <entityField> + <name>OFFER_ID</name> + <title>Offer</title> + <linkedContext>Offer</linkedContext> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/offer_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/offer_id/displayValueProcess.js</displayValueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -502,6 +509,10 @@ <name>LANGUAGE.displayValue</name> <expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/language.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_ID.value</name> + <recordfield>SALESORDER.OFFER_ID</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Order_entity/entityfields/offer_id/displayValueProcess.js b/entity/Order_entity/entityfields/offer_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..cde400be01b43a5033045030aded015ecc2060b8 --- /dev/null +++ b/entity/Order_entity/entityfields/offer_id/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("Offer_lib"); + +result.string(OfferUtils.getOfferTitleById(vars.get("$field.OFFER_ID"))); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/offer_id/valueProcess.js b/entity/Order_entity/entityfields/offer_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aed6796329941efdf70888e87e642c9bfffb0154 --- /dev/null +++ b/entity/Order_entity/entityfields/offer_id/valueProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.vars"); + +if (vars.exists("$param.OfferId_param")) +{ + result.string(vars.get("$param.OfferId_param")); +} \ No newline at end of file diff --git a/neonView/OrderPreview_view/OrderPreview_view.aod b/neonView/OrderPreview_view/OrderPreview_view.aod index 64b69fb6a161632d7b213c79daac399caadce6bc..f3a585b3433614f9587f9a282101862ffeaa3062 100644 --- a/neonView/OrderPreview_view/OrderPreview_view.aod +++ b/neonView/OrderPreview_view/OrderPreview_view.aod @@ -69,6 +69,10 @@ <name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name> <entityField>SALESPROJECT_ID</entityField> </entityFieldLink> + <entityFieldLink> + <name>ca9602d9-03fe-450b-9349-949bf206b4bf</name> + <entityField>OFFER_ID</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> diff --git a/others/db_changes/data_alias/basic/2019.2/SalesOrder_source_offer.xml b/others/db_changes/data_alias/basic/2019.2/SalesOrder_source_offer.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c8b67ae2a64cb9c23468933b521a1d8c9c0a4d7 --- /dev/null +++ b/others/db_changes/data_alias/basic/2019.2/SalesOrder_source_offer.xml @@ -0,0 +1,8 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="s.listl" id="1dda5c72-2c07-46ff-9fc4-00a364fa5c9f"> + <addColumn tableName="SALESORDER"> + <column name="OFFER_ID" type="CHAR(36)"/> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/data_alias/basic/2019.2/changelog.xml b/others/db_changes/data_alias/basic/2019.2/changelog.xml index 140a9af7beae114bb95376f10bbe0ac2b02efdd3..ffd6d31f5469cc1a187680df419f33e5e4b916fd 100644 --- a/others/db_changes/data_alias/basic/2019.2/changelog.xml +++ b/others/db_changes/data_alias/basic/2019.2/changelog.xml @@ -80,4 +80,5 @@ <include relativeToChangelogFile="true" file="SalesProjectCompetitionPhase.xml"/> <include relativeToChangelogFile="true" file="AttributeKeyword.xml"/> <include relativeToChangelogFile="true" file="Contact_add_columns.xml"/> + <include relativeToChangelogFile="true" file="SalesOrder_source_offer.xml"/> </databaseChangeLog> diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 6cf2ac0f1641836470f3adc8b34c6306761ba91d..bbb515daf376a665313bee286a5b95f5de89ad52 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -348,6 +348,21 @@ OfferUtils.copyToOrder = function (pOfferId, pSalesprojectId, pContactId, pLangu neon.openContext("Order", null, null, neon.OPERATINGSTATE_NEW, params); } +/** + * gets the title of an offer from the id + * + * @param pOfferId {String} offer-id + * + * @return {String} offer title + */ +OfferUtils.getOfferTitleById = function (pOfferId) +{ + var offerNumber = db.array(db.ROW, SqlCondition.begin() + .andPrepare("OFFER.OFFERID", pOfferId) + .buildSql("select OFFERCODE, VERSNR from OFFER")); + return translate.text("Offer") + " " + offerNumber.join("-"); +} + /******************************************************************************/