From 63ef1f7a4110d4a77a67d2b36ede912441061e97 Mon Sep 17 00:00:00 2001 From: Mohamed Mansour <m.mansour@adito.de> Date: Wed, 24 Jul 2019 15:46:34 +0200 Subject: [PATCH] =?UTF-8?q?Made=20offers=20changeable=20in=20Receipt,=20ad?= =?UTF-8?q?ded=20Auswahlm=C3=B6glichkeit=20f=C3=BCr=20Kopf=20und=20Fu?= =?UTF-8?q?=C3=9Ftexte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../init_DocumentTemplateTypeCategory.xml | 30 +++++++++ .../DocumentTemplate_entity.aod | 12 ++++ entity/Offer_entity/Offer_entity.aod | 6 ++ entity/Order_entity/Order_entity.aod | 67 ++++++++++++++++++- .../valueProcess.js | 2 + .../valueProcess.js | 2 + .../valueProcess.js | 2 + .../valueProcess.js | 2 + .../entityfields/footer/valueProcess.js | 23 +++++++ .../entityfields/header/valueProcess.js | 28 ++++++-- .../children/contactid_param/valueProcess.js | 10 +++ neonView/OrderEdit_view/OrderEdit_view.aod | 8 +++ 12 files changed, 185 insertions(+), 7 deletions(-) create mode 100644 entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetype_param/valueProcess.js create mode 100644 entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetypeclassification_param/valueProcess.js create mode 100644 entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetype_param/valueProcess.js create mode 100644 entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js create mode 100644 entity/Order_entity/entityfields/footer/valueProcess.js create mode 100644 entity/Order_entity/entityfields/offers/children/contactid_param/valueProcess.js diff --git a/.liquibase/Data_alias/basic/2019.1.4/AditoBasic/init_DocumentTemplateTypeCategory.xml b/.liquibase/Data_alias/basic/2019.1.4/AditoBasic/init_DocumentTemplateTypeCategory.xml index 6d75abdd21c..86306988045 100644 --- a/.liquibase/Data_alias/basic/2019.1.4/AditoBasic/init_DocumentTemplateTypeCategory.xml +++ b/.liquibase/Data_alias/basic/2019.1.4/AditoBasic/init_DocumentTemplateTypeCategory.xml @@ -97,5 +97,35 @@ <column name="AB_KEYWORD_ATTRIBUTE_ID" value="14c2d515-a42f-4618-b534-7a23369d2004"/> <column name="BOOL_VALUE" valueNumeric="1"/> </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="beb7691f-ff9e-4344-89e1-d2664f7384e0"/> + <column name="KEYID" value="5"/> + <column name="TITLE" value="Receipt Header Text"/> + <column name="CONTAINER" value="DocumentTemplateTypeCategory"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ATTRIBUTERELATION"> + <column name="AB_KEYWORD_ATTRIBUTERELATIONID" value="d57bf04f-574e-42b4-99e5-31f630239bf6"/> + <column name="AB_KEYWORD_ENTRY_ID" value="beb7691f-ff9e-4344-89e1-d2664f7384e0"/> + <column name="AB_KEYWORD_ATTRIBUTE_ID" value="14c2d515-a42f-4618-b534-7a23369d2004"/> + <column name="BOOL_VALUE" valueNumeric="1"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="267d1707-99db-40fa-914a-e36ba22e3ad6"/> + <column name="KEYID" value="6"/> + <column name="TITLE" value="Receipt Footer Text"/> + <column name="CONTAINER" value="DocumentTemplateTypeCategory"/> + <column name="SORTING" valueNumeric="5"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ATTRIBUTERELATION"> + <column name="AB_KEYWORD_ATTRIBUTERELATIONID" value="0d7d908e-6b0b-45ec-9e2f-d5b83e8d96df"/> + <column name="AB_KEYWORD_ENTRY_ID" value="267d1707-99db-40fa-914a-e36ba22e3ad6"/> + <column name="AB_KEYWORD_ATTRIBUTE_ID" value="14c2d515-a42f-4618-b534-7a23369d2004"/> + <column name="BOOL_VALUE" valueNumeric="1"/> + </insert> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 187d4262596..3b29453f9c1 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -244,6 +244,18 @@ <fieldName>Templates</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>93242043-ddc2-414e-84c8-610342b0bd85</name> + <entityName>Order_entity</entityName> + <fieldName>DocumentTemplateTexHeader</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>62dc5f05-4203-40b3-9d34-cbbefc8264ae</name> + <entityName>Order_entity</entityName> + <fieldName>DocumentTemplateTexFooter</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityParameter> diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index b5fbfbca3ba..9cc37684ef0 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -389,6 +389,12 @@ <fieldName>Offers</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>a74b02c4-bdb3-4ba8-9207-66a0af528b1b</name> + <entityName>Order_entity</entityName> + <fieldName>Offers</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 83b4514c585..e14fb226b1f 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -93,6 +93,7 @@ <entityField> <name>FOOTER</name> <title>Footer text</title> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/footer/valueProcess.js</valueProcess> </entityField> <entityConsumer> <name>Orderitems</name> @@ -372,8 +373,9 @@ <entityField> <name>OFFER_ID</name> <title>Offer</title> + <consumer>Offers</consumer> <linkedContext>Offer</linkedContext> - <state>READONLY</state> + <state>AUTO</state> <valueProcess>%aditoprj%/entity/Order_entity/entityfields/offer_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/offer_id/displayValueProcess.js</displayValueProcess> </entityField> @@ -714,6 +716,69 @@ <entityParameter> <name>OrderDeliveryTerm_param</name> </entityParameter> + <entityConsumer> + <name>Offers</name> + <dependency> + <name>dependency</name> + <entityName>Offer_entity</entityName> + <fieldName>ContactOffers</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContactId_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/offers/children/contactid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>DocumentTemplateTexHeader</name> + <dependency> + <name>dependency</name> + <entityName>DocumentTemplate_entity</entityName> + <fieldName>DocumentTemplateProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>DocumentTemplateType_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>DocumentTemplateTypeClassification_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>DocumentTemplateTexFooter</name> + <dependency> + <name>dependency</name> + <entityName>DocumentTemplate_entity</entityName> + <fieldName>DocumentTemplateProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>DocumentTemplateType_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>DocumentTemplateTypeClassification_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetypeclassification_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>ChosenTexHeader</name> + <title>Choose Header</title> + <consumer>DocumentTemplateTexHeader</consumer> + </entityField> + <entityField> + <name>ChosenTexFooter</name> + <title>Choose Footer</title> + <consumer>DocumentTemplateTexFooter</consumer> + </entityField> + <entityParameter> + <name>OrderFooter_param</name> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetype_param/valueProcess.js b/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetype_param/valueProcess.js new file mode 100644 index 00000000000..90d0786d0d5 --- /dev/null +++ b/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetype_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("TEX"); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetypeclassification_param/valueProcess.js b/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetypeclassification_param/valueProcess.js new file mode 100644 index 00000000000..d41d91fd2b9 --- /dev/null +++ b/entity/Order_entity/entityfields/documenttemplatetexfooter/children/documenttemplatetypeclassification_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string(6); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetype_param/valueProcess.js b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetype_param/valueProcess.js new file mode 100644 index 00000000000..90d0786d0d5 --- /dev/null +++ b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetype_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("TEX"); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js new file mode 100644 index 00000000000..1e149a6637c --- /dev/null +++ b/entity/Order_entity/entityfields/documenttemplatetexheader/children/documenttemplatetypeclassification_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("5") \ No newline at end of file diff --git a/entity/Order_entity/entityfields/footer/valueProcess.js b/entity/Order_entity/entityfields/footer/valueProcess.js new file mode 100644 index 00000000000..ec49268cd82 --- /dev/null +++ b/entity/Order_entity/entityfields/footer/valueProcess.js @@ -0,0 +1,23 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); +import("system.db"); +import("system.util"); + +if (vars.exists("$param.OrderFooter_param")) +{ + result.string(vars.get("$param.OrderFooter_param")); +} + + +else if(vars.get("$this.value")) + result.string(vars.get("$this.value")); + +else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("Danke sehr:") + +if (vars.get("$field.ChosenTexFooter") != "") +{ + var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChosenTexFooter") + "'", "_____SYSTEMALIAS"); + result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS"))); +} \ No newline at end of file diff --git a/entity/Order_entity/entityfields/header/valueProcess.js b/entity/Order_entity/entityfields/header/valueProcess.js index 5339918ba7c..96436bf9899 100644 --- a/entity/Order_entity/entityfields/header/valueProcess.js +++ b/entity/Order_entity/entityfields/header/valueProcess.js @@ -1,7 +1,23 @@ -import("system.result"); -import("system.vars"); - -if (vars.exists("$param.OrderHeader_param")) -{ - result.string(vars.get("$param.OrderHeader_param")); +import("system.result"); +import("system.vars"); +import("system.neon"); +import("system.db"); +import("system.util"); + +if (vars.exists("$param.OrderHeader_param")) +{ + result.string(vars.get("$param.OrderHeader_param")); +} + + +else if(vars.get("$this.value")) + result.string(vars.get("$this.value")); + +else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("Gerne bieten wir Ihnen wie folgt an:") + +if (vars.get("$field.ChosenTexHeader") != "") +{ + var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.ChosenTexHeader") + "'", "_____SYSTEMALIAS"); + result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS"))); } \ No newline at end of file diff --git a/entity/Order_entity/entityfields/offers/children/contactid_param/valueProcess.js b/entity/Order_entity/entityfields/offers/children/contactid_param/valueProcess.js new file mode 100644 index 00000000000..7b92c1bb14a --- /dev/null +++ b/entity/Order_entity/entityfields/offers/children/contactid_param/valueProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +if (vars.get("$field.CONTACT_ID")) +{ + var ids = ContactUtils.getPersOrgIds(vars.getString("$field.CONTACT_ID")); + if (ids.length >= 3 && ids[2]) + result.string(ids[2]); +} \ No newline at end of file diff --git a/neonView/OrderEdit_view/OrderEdit_view.aod b/neonView/OrderEdit_view/OrderEdit_view.aod index aa76c8d05ac..557e958a5bd 100644 --- a/neonView/OrderEdit_view/OrderEdit_view.aod +++ b/neonView/OrderEdit_view/OrderEdit_view.aod @@ -60,10 +60,18 @@ <name>f79c4c09-8082-4c88-83f5-a26aaf425c12</name> <entityField>OFFER_ID</entityField> </entityFieldLink> + <entityFieldLink> + <name>cd8bcf86-80d7-47f8-88da-f425417198d8</name> + <entityField>ChosenTexHeader</entityField> + </entityFieldLink> <entityFieldLink> <name>ed71986f-303c-4118-a895-51ec31ba8775</name> <entityField>HEADER</entityField> </entityFieldLink> + <entityFieldLink> + <name>f1729940-3df7-44c7-9acf-911f247ad832</name> + <entityField>ChosenTexFooter</entityField> + </entityFieldLink> <entityFieldLink> <name>c4b3c8ed-4625-4785-abc6-c726171ff7f4</name> <entityField>FOOTER</entityField> -- GitLab