diff --git a/.liquibase/Data_alias/basic/2019.1.4/create_ordertype_keyword.xml b/.liquibase/Data_alias/basic/2019.1.4/create_ordertype_keyword.xml index e84df1905ea1f6827919e9aa5685d58d7c5d0e23..7074f406b0660d3d2905fc83247ebb2a770ecaa9 100644 --- a/.liquibase/Data_alias/basic/2019.1.4/create_ordertype_keyword.xml +++ b/.liquibase/Data_alias/basic/2019.1.4/create_ordertype_keyword.xml @@ -33,7 +33,7 @@ <column name="KEYID" value="623886cf-b2ce-4c55-b472-0c17980f7606"/> <column name="TITLE" value="Credit"/> <column name="CONTAINER" value="OrderType"/> - <column name="SORTING" valueNumeric="2"/> + <column name="SORTING" valueNumeric="3"/> <column name="ISACTIVE" valueNumeric="1"/> <column name="ISESSENTIAL" valueNumeric="0"/> </insert> @@ -42,7 +42,7 @@ <column name="KEYID" value="b982cd81-9389-4352-8031-116140e5e7ef"/> <column name="TITLE" value="Cancellation"/> <column name="CONTAINER" value="OrderType"/> - <column name="SORTING" valueNumeric="2"/> + <column name="SORTING" valueNumeric="4"/> <column name="ISACTIVE" valueNumeric="1"/> <column name="ISESSENTIAL" valueNumeric="0"/> </insert> diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml index c31392d80602cfce21f1add32f068ce48eddebc2..74a2b3d99f950b01b459eabc9213c3bb42072d2b 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/SALESORDER.xml @@ -9,7 +9,8 @@ <column name="SALESORDERCODE" valueNumeric="1000"/> <column name="SALESORDERDATE" valueDate="2017-11-21T01:00:00"/> <column name="SALESORDERID" value="2e661772-951f-47bc-a862-5aa3c5aa2731"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="39.90"/> <column name="VERSNR" valueNumeric="1"/> @@ -22,7 +23,8 @@ <column name="SALESORDERCODE" valueNumeric="1001"/> <column name="SALESORDERDATE" valueDate="2018-08-12T02:00:00"/> <column name="SALESORDERID" value="41197800-027b-47f5-923a-f1004d09a969"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -35,7 +37,8 @@ <column name="SALESORDERCODE" valueNumeric="1002"/> <column name="SALESORDERDATE" valueDate="2016-06-14T02:00:00"/> <column name="SALESORDERID" value="373f28a5-a812-433b-8196-a6bf8bdd5656"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="119.70"/> <column name="VERSNR" valueNumeric="1"/> @@ -48,7 +51,8 @@ <column name="SALESORDERCODE" valueNumeric="1003"/> <column name="SALESORDERDATE" valueDate="2018-08-23T02:00:00"/> <column name="SALESORDERID" value="5a34f4a2-13b2-46ec-8f61-939fe27ba484"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATCHECK"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -61,7 +65,8 @@ <column name="SALESORDERCODE" valueNumeric="1004"/> <column name="SALESORDERDATE" valueDate="2017-05-09T02:00:00"/> <column name="SALESORDERID" value="545ffd81-cfa5-4be6-b62c-df269909dcd4"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATCHECK"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -74,7 +79,8 @@ <column name="SALESORDERCODE" valueNumeric="1005"/> <column name="SALESORDERDATE" valueDate="2017-11-21T01:00:00"/> <column name="SALESORDERID" value="de09c9c2-7560-4f3f-9284-853ad1341cf9"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="39.90"/> <column name="VERSNR" valueNumeric="1"/> @@ -87,7 +93,8 @@ <column name="SALESORDERCODE" valueNumeric="1006"/> <column name="SALESORDERDATE" valueDate="2018-08-12T02:00:00"/> <column name="SALESORDERID" value="3ce30718-ecc6-4543-95c8-1b25e1b6db43"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -100,7 +107,8 @@ <column name="SALESORDERCODE" valueNumeric="1007"/> <column name="SALESORDERDATE" valueDate="2016-06-14T02:00:00"/> <column name="SALESORDERID" value="fae74315-d7ac-4757-b952-cc71ae83f4b5"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATSENT"/> <column name="VAT" valueNumeric="119.70"/> <column name="VERSNR" valueNumeric="1"/> @@ -113,7 +121,8 @@ <column name="SALESORDERCODE" valueNumeric="1008"/> <column name="SALESORDERDATE" valueDate="2018-08-23T02:00:00"/> <column name="SALESORDERID" value="4b0e2423-d09d-47fc-b274-5a9fde013b64"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATCHECK"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -126,7 +135,8 @@ <column name="SALESORDERCODE" valueNumeric="1009"/> <column name="SALESORDERDATE" valueDate="2017-05-09T02:00:00"/> <column name="SALESORDERID" value="f5cf5ef9-ce09-4885-bcb0-421cd9cfac69"/> - <column name="SALESPROJECT_ID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_ROWID" value="0833465c-8851-4fbb-b7e3-8c1d73c903da"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATCHECK"/> <column name="VAT" valueNumeric="79.80"/> <column name="VERSNR" valueNumeric="1"/> @@ -138,7 +148,8 @@ <column name="SALESORDERCODE" valueNumeric="1010"/> <column name="SALESORDERDATE" valueDate="2019-05-17T02:00:00"/> <column name="SALESORDERID" value="a846d596-b9ce-4a73-a842-e9084ebf612a"/> - <column name="SALESPROJECT_ID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_ROWID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="VAT" valueNumeric="0.00"/> <column name="VERSNR" valueNumeric="1"/> </insert> @@ -154,7 +165,8 @@ <column name="SALESORDERCODE" valueNumeric="1011"/> <column name="SALESORDERDATE" valueDate="2019-05-22T02:00:00"/> <column name="SALESORDERID" value="1b9bd530-f45b-4074-872f-b8362cfc5ed0"/> - <column name="SALESPROJECT_ID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_ROWID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATWON"/> <column name="VAT" valueNumeric="0.00"/> <column name="VERSNR" valueNumeric="1"/> @@ -170,7 +182,8 @@ <column name="SALESORDERCODE" valueNumeric="1012"/> <column name="SALESORDERDATE" valueDate="2019-05-22T02:00:00"/> <column name="SALESORDERID" value="9069d098-7237-4fed-a365-ad2e60bf740f"/> - <column name="SALESPROJECT_ID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_ROWID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATWON"/> <column name="VAT" valueNumeric="0.00"/> <column name="VERSNR" valueNumeric="1"/> @@ -186,7 +199,8 @@ <column name="SALESORDERCODE" valueNumeric="1013"/> <column name="SALESORDERDATE" valueDate="2019-05-22T02:00:00"/> <column name="SALESORDERID" value="5e082fe5-99d4-43be-aaad-e596f844fa8a"/> - <column name="SALESPROJECT_ID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_ROWID" value="6d3d16cd-733e-41d1-ab6c-8a6cba63ba4a"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATWON"/> <column name="VAT" valueNumeric="10165.00"/> <column name="VERSNR" valueNumeric="1"/> @@ -202,7 +216,8 @@ <column name="SALESORDERCODE" valueNumeric="1014"/> <column name="SALESORDERDATE" valueDate="2019-05-22T02:00:00"/> <column name="SALESORDERID" value="fc691949-4f61-485c-8e97-8f3d0d3d3962"/> - <column name="SALESPROJECT_ID" value="d422ad81-717f-42b0-bd64-fc892744aac7"/> + <column name="OBJECT_ROWID" value="d422ad81-717f-42b0-bd64-fc892744aac7"/> + <column name="OBJECT_TYPE" value="Salesproject"/> <column name="STATUS" value="SALORDERSTATWON"/> <column name="VAT" valueNumeric="0.00"/> <column name="VERSNR" valueNumeric="1"/> diff --git a/entity/Offer_entity/entityfields/neworder/onActionProcess.js b/entity/Offer_entity/entityfields/neworder/onActionProcess.js index dce051360b6f16b9ac6d5c2e9dab793eb6f02aa8..6f9ea04c4db03ecdff0c3720b4dfb489f065f3f6 100644 --- a/entity/Offer_entity/entityfields/neworder/onActionProcess.js +++ b/entity/Offer_entity/entityfields/neworder/onActionProcess.js @@ -3,12 +3,13 @@ import("system.neon"); import("Offer_lib"); var contactId = vars.getString("$field.CONTACT_ID"); -var salesprojectId = vars.getString("$field.OBJECT_ROWID"); +var pRowId = vars.getString("$field.OBJECT_ROWID"); +var pContext=vars.getString("$field.OBJECT_TYPE") var currency = vars.getString("$field.CURRENCY"); var language = vars.getString("$field.LANGUAGE"); var header = vars.getString("$field.HEADER"); var address = vars.getString("$field.ADDRESS"); var offerId = vars.getString("$field.OFFERID"); -OfferUtils.copyToOrder(offerId, salesprojectId, contactId, language, currency, address, header); +OfferUtils.copyToOrder(offerId, pContext, pRowId, contactId, language, currency, address, header); \ No newline at end of file diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index ecb08c01ed058930b37dc0d203b7fc1f7cc1f9a7..fb5b6856636951499446262c1e0b0fcd85c149ab 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -466,12 +466,16 @@ <name>ORDERTYPE</name> <title>Order Type</title> <consumer>KeywordOrderTypes</consumer> + <usePermissions v="true" /> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/ordertype/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/ordertype/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>ORDERSTATUS</name> <title>Sent</title> <contentType>BOOLEAN</contentType> <dropDownProcess>%aditoprj%/entity/Order_entity/entityfields/orderstatus/dropDownProcess.js</dropDownProcess> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/orderstatus/valueProcess.js</valueProcess> </entityField> <entityField> <name>PAID</name> @@ -486,6 +490,7 @@ <title>Cancelled</title> <contentType>BOOLEAN</contentType> <dropDownProcess>%aditoprj%/entity/Order_entity/entityfields/cancellation/dropDownProcess.js</dropDownProcess> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/cancellation/valueProcess.js</valueProcess> </entityField> <entityField> <name>DUNNINGDATE</name> @@ -686,10 +691,6 @@ <name>SALESORDERID.value</name> <recordfield>SALESORDER.SALESORDERID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SALESPROJECT_ID.value</name> - <recordfield>SALESORDER.SALESPROJECT_ID</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>STATUS.value</name> <recordfield>SALESORDER.STATUS</recordfield> @@ -734,10 +735,6 @@ <name>OFFER_ID.value</name> <recordfield>SALESORDER.OFFER_ID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SALESPROJECT_ID.displayValue</name> - <recordfield>SALESPROJECT.PROJECTTITLE</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>CONTACT_ORG_ID.displayValue</name> <recordfield>ORGANISATION.NAME</recordfield> @@ -786,6 +783,14 @@ <name>OBJECT_ROWID.displayValue</name> <expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_ID.displayValue</name> + <expression>%aditoprj%/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECT_TYPE.value</name> + <recordfield>SALESORDER.OBJECT_TYPE</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Order_entity/entityfields/activities/children/presetlinks_param/valueProcess.js b/entity/Order_entity/entityfields/activities/children/presetlinks_param/valueProcess.js index e4c6c134df6be187331e47d8c2c4d5a9871b7c2b..79d0000b63ba5e7e2506b50c800d9fc5d51749e6 100644 --- a/entity/Order_entity/entityfields/activities/children/presetlinks_param/valueProcess.js +++ b/entity/Order_entity/entityfields/activities/children/presetlinks_param/valueProcess.js @@ -10,9 +10,9 @@ if (contactId) links.push([ContactUtils.getContextByContactId(contactId), contactId]); } -if (vars.get("$field.SALESPROJECT_ID")) +if (vars.get("$field.OBJECT_ROWID")) { - links.push(["Salesproject", vars.get("$field.SALESPROJECT_ID")]); + links.push(["$field.OBJECT_TYPE", vars.get("$field.OBJECT_ROWID")]); } result.object(links); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/cancellation/valueProcess.js b/entity/Order_entity/entityfields/cancellation/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..063991ec9e2332c4202f1b0d463b516c6c7b1cf6 --- /dev/null +++ b/entity/Order_entity/entityfields/cancellation/valueProcess.js @@ -0,0 +1,6 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("0"); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/language/displayValueProcess.js b/entity/Order_entity/entityfields/language/displayValueProcess.js index d60342f7264e2cb7c41a787563070a80c827eb53..bcbf2118161a42f079dfa6ece4df7fb4d6b6774e 100644 --- a/entity/Order_entity/entityfields/language/displayValueProcess.js +++ b/entity/Order_entity/entityfields/language/displayValueProcess.js @@ -4,12 +4,9 @@ import("system.result"); import("system.vars"); import("Sql_lib"); -if (vars.exists("$param.OrderLanguage_param") && vars.get("$param.OrderLanguage_param")) -{ - var iso3 = vars.get("$param.OrderLanguage_param"); - var latinName = db.cell(SqlCondition.begin() - .andPrepare("AB_LANGUAGE.ISO3", iso3) - .buildSql("select NAME_LATIN from AB_LANGUAGE", "1=0")); - latinName = translate.text(latinName); - result.string(latinName); -} \ No newline at end of file +var iso3 = vars.get("$field.LANGUAGE"); +var latinName = db.cell(SqlCondition.begin() + .andPrepare("AB_LANGUAGE.ISO3", iso3) + .buildSql("select NAME_LATIN from AB_LANGUAGE", "1=0")); +latinName = translate.text(latinName); +result.string(latinName); diff --git a/entity/Order_entity/entityfields/newactivity/onActionProcess.js b/entity/Order_entity/entityfields/newactivity/onActionProcess.js index 1a27d3d454d20447d05ec6064c1852a7d9e49d01..03bcfb1a67584b5cbc89b05565e2972b17531ea4 100644 --- a/entity/Order_entity/entityfields/newactivity/onActionProcess.js +++ b/entity/Order_entity/entityfields/newactivity/onActionProcess.js @@ -10,9 +10,9 @@ if (contactId) links.push([ContactUtils.getContextByContactId(contactId), contactId]); } -if (vars.get("$field.SALESPROJECT_ID")) +if (vars.get("$field.OBJECT_ROWID")) { - links.push(["Salesproject", vars.get("$field.SALESPROJECT_ID")]); + links.push(["$field.OBJECT_TYPE", vars.get("$field.OBJECT_ROWID")]); } ActivityUtils.createNewActivity(vars.get("$field.SALESORDERID"), links); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/newtask/onActionProcess.js b/entity/Order_entity/entityfields/newtask/onActionProcess.js index 3d0aeaf0beab976054701f3a58a709df8e67de92..1f7b450c690fb86b131d6a856c69c7bc6bb521cd 100644 --- a/entity/Order_entity/entityfields/newtask/onActionProcess.js +++ b/entity/Order_entity/entityfields/newtask/onActionProcess.js @@ -10,9 +10,8 @@ if (contactId) links.push([ContactUtils.getContextByContactId(contactId), contactId]); } -if (vars.get("$field.SALESPROJECT_ID")) +if (vars.get("$field.OBJECT_ROWID")) { - links.push(["Salesproject", vars.get("$field.SALESPROJECT_ID")]); + links.push(["$field.OBJECT_TYPE", vars.get("$field.OBJECT_ROWID")]); } - TaskUtils.createNewTask(vars.get("$field.SALESORDERID"), links); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/object_rowid/valueProcess.js b/entity/Order_entity/entityfields/object_rowid/valueProcess.js index 487f3796607ca533ac64223afd8f1284b3baca38..807c0b21def9a889604b04e180db301d24f57d72 100644 --- a/entity/Order_entity/entityfields/object_rowid/valueProcess.js +++ b/entity/Order_entity/entityfields/object_rowid/valueProcess.js @@ -3,6 +3,5 @@ import("system.neon"); import("system.vars"); import("system.result"); -logging.log("--- " + JSON.stringify(vars.get("$sys.recordstate"), vars.exists("$param.ObjectRowId_param"), null, "\t")) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param")) result.string(vars.get("$param.ObjectRowId_param")); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/openadminview/onActionProcess.js b/entity/Order_entity/entityfields/openadminview/onActionProcess.js index a253442813b4782139e4af275015c1fffc7f2e14..79f53cbdde3097ca224b83afaac2a8945c983785 100644 --- a/entity/Order_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/Order_entity/entityfields/openadminview/onActionProcess.js @@ -2,7 +2,7 @@ import("system.vars"); import("Context_lib"); AdminViewUtils.open("SALESORDERID", [ - ["SALESPROJECT_ID", vars.get("$field.SALESPROJECT_ID")], + ["SALESPROJECT_ID", vars.get("$field.OBJECT_ROWID")], ["OFFER_ID", vars.get("$field.OFFER_ID")], ["CONTACT_ID", vars.get("$field.CONTACT_ID")], ["CONTACT_ORG_ID", vars.get("$field.CONTACT_ORG_ID")], diff --git a/entity/Order_entity/entityfields/orderstatus/valueProcess.js b/entity/Order_entity/entityfields/orderstatus/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..063991ec9e2332c4202f1b0d463b516c6c7b1cf6 --- /dev/null +++ b/entity/Order_entity/entityfields/orderstatus/valueProcess.js @@ -0,0 +1,6 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("0"); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/ordertype/displayValueProcess.js b/entity/Order_entity/entityfields/ordertype/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..645ec2dfed45f33bf8783a208c0da8aca32f088e --- /dev/null +++ b/entity/Order_entity/entityfields/ordertype/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.vars"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getViewValue($KeywordRegistry.orderType(), vars.get("$field.ORDERTYPE"))); diff --git a/entity/Order_entity/entityfields/ordertype/valueProcess.js b/entity/Order_entity/entityfields/ordertype/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ae532d35c2dc8183345b9b5ff51956a63d74219f --- /dev/null +++ b/entity/Order_entity/entityfields/ordertype/valueProcess.js @@ -0,0 +1,14 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); +import("AttributeRegistry_basic"); +import("system.neon"); +import("system.result"); +import("system.vars"); +import("Attribute_lib"); +import("Contact_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +{ + + result.string(KeywordUtils.getFirst($KeywordRegistry.orderType())); +} \ No newline at end of file diff --git a/entity/Order_entity/entityfields/tasks/children/presetlinks_param/valueProcess.js b/entity/Order_entity/entityfields/tasks/children/presetlinks_param/valueProcess.js index e4c6c134df6be187331e47d8c2c4d5a9871b7c2b..79d0000b63ba5e7e2506b50c800d9fc5d51749e6 100644 --- a/entity/Order_entity/entityfields/tasks/children/presetlinks_param/valueProcess.js +++ b/entity/Order_entity/entityfields/tasks/children/presetlinks_param/valueProcess.js @@ -10,9 +10,9 @@ if (contactId) links.push([ContactUtils.getContextByContactId(contactId), contactId]); } -if (vars.get("$field.SALESPROJECT_ID")) +if (vars.get("$field.OBJECT_ROWID")) { - links.push(["Salesproject", vars.get("$field.SALESPROJECT_ID")]); + links.push(["$field.OBJECT_TYPE", vars.get("$field.OBJECT_ROWID")]); } result.object(links); \ No newline at end of file diff --git a/entity/Order_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js b/entity/Order_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js index 4ac0690f62f32b1b0ad6df14648740404256a945..bbe883a82964ab9693ce6c4fca792a9c27e01363 100644 --- a/entity/Order_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js +++ b/entity/Order_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js @@ -1,4 +1,4 @@ import("system.result"); import("Context_lib"); -result.string(ContextUtils.getNameSubselectSql("OBJECT_TYPE", "OBJECT_ROWID")) \ No newline at end of file +result.string(ContextUtils.getNameSubselectSql("SALESORDER.OBJECT_TYPE", "SALESORDER.OBJECT_ROWID")) \ No newline at end of file diff --git a/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js b/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..a86ac585f271d61227c89ec425d97d7c43e2a73d --- /dev/null +++ b/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getNameSubselectSql("'Offer'", "SALESORDER.OFFER_ID")); \ No newline at end of file diff --git a/neonView/OrderEdit_view/OrderEdit_view.aod b/neonView/OrderEdit_view/OrderEdit_view.aod index 3c6ebeeba30217a48db453d2b50b2ad892c1ccf6..d4dd5fbc34d9c24e6f671cbef255b01a12030e2a 100644 --- a/neonView/OrderEdit_view/OrderEdit_view.aod +++ b/neonView/OrderEdit_view/OrderEdit_view.aod @@ -40,6 +40,14 @@ <name>7ab3eb65-b713-4251-9eb1-3119432565f5</name> <entityField>LANGUAGE</entityField> </entityFieldLink> + <entityFieldLink> + <name>c9efcb50-ed61-453b-baa3-02071d99e4b0</name> + <entityField>OBJECT_ROWID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>acb42613-102e-42cc-984f-5820b36ad2a8</name> + <entityField>OBJECT_TYPE</entityField> + </entityFieldLink> <entityFieldLink> <name>cf2fd509-eaa5-4b35-8775-063f31dafc2c</name> <entityField>OFFER_ID</entityField> @@ -76,14 +84,6 @@ <name>c14ed3d5-0442-4b3e-8410-2a3285a2e8fd</name> <entityField>CANCELLATION</entityField> </entityFieldLink> - <entityFieldLink> - <name>c9efcb50-ed61-453b-baa3-02071d99e4b0</name> - <entityField>OBJECT_ROWID</entityField> - </entityFieldLink> - <entityFieldLink> - <name>acb42613-102e-42cc-984f-5820b36ad2a8</name> - <entityField>OBJECT_TYPE</entityField> - </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> diff --git a/neonView/OrderLink_view/OrderLink_view.aod b/neonView/OrderLink_view/OrderLink_view.aod index 316a6a1de5339b1571d9e9b5fc05697b9c196cb9..c86c026dfed25cf5c769e88b12b15090d1063824 100644 --- a/neonView/OrderLink_view/OrderLink_view.aod +++ b/neonView/OrderLink_view/OrderLink_view.aod @@ -18,8 +18,12 @@ <entityField>OFFER_ID</entityField> </entityFieldLink> <entityFieldLink> - <name>71e18993-a011-45f2-bb3c-053e8d032c25</name> - <entityField>SALESPROJECT_ID</entityField> + <name>11cb37e5-d902-44ba-8494-c26215e2a46a</name> + <entityField>OBJECT_ROWID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>470b177a-7df6-4433-acf5-e43d77ebb04b</name> + <entityField>OBJECT_TYPE</entityField> </entityFieldLink> </fields> </genericViewTemplate> diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 10328c4da9f2586247b32099f3c6d830bfa2cebf..90d35fbe295fce54175292c8ba8adb9e2268833a 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -362,11 +362,12 @@ OfferUtils.copyOfferItems = function (pSourceOfferId, pTargetOfferId) * @param pAddress {String} [address=""] * @param pHeader {String} [header=""] */ -OfferUtils.copyToOrder = function (pOfferId, pSalesprojectId, pContactId, pLanguage, pCurrency, pAddress, pHeader) +OfferUtils.copyToOrder = function (pOfferId, pContextId, pRowId, pContactId, pLanguage, pCurrency, pAddress, pHeader) { var params = { "ContactId_param" : pContactId, - "SalesprojectId_param" : pSalesprojectId, + "ObjectRowId_param" : pRowId, + "ObjectType_param" : pContextId, "OrderLanguage_param" : pLanguage, "OfferId_param" : pOfferId, "OrderCurrency_param" : pCurrency || "", diff --git a/process/Order_lib/process.js b/process/Order_lib/process.js index fe4915c08ac0d696a17e7ffbbc2e4c6de2d41d8f..b6a17ffbc2d9aa01e10c72e5e9ba1abbb2cb2af0 100644 --- a/process/Order_lib/process.js +++ b/process/Order_lib/process.js @@ -65,12 +65,15 @@ OrderUtils.isEditable = function(status) { /** * Create a new order */ -OrderUtils.createNewOrder = function(pSalesprojectId, pRelationId) +OrderUtils.createNewOrder = function(pContextId, pRowId, pRelationId) { var params = {}; - if (pSalesprojectId) - params["SalesprojectId_param"] = pSalesprojectId; + if (pRowId && pContextId) + { + params["ObjectRowId_param"] = pRowId; + params["ObjectType_param"] = pContextId; + } if (pRelationId) params["ContactId_param"] = pRelationId;