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 6d75abdd21c241eeafbece321f7774bec687a11e..8630698804562d0df6c14f796b1afa1bc7f0b910 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 187d42625963e360f39b82dbb7a553f13b1bd56f..3b29453f9c103dcfad3fd7afe033c5bf361019c5 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 b5fbfbca3ba4fdf99c057e8473deb7e93db28022..9cc37684ef04edcdc31309c05205f06128151b0c 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 83b4514c585e76afd22209b9c4543038ada0bac0..e14fb226b1f2243b4bad68e29a769e0f39bb4172 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 0000000000000000000000000000000000000000..90d0786d0d58c1664a2c481e5583a260dd7da783 --- /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 0000000000000000000000000000000000000000..d41d91fd2b945318cc85efb3bfeb69181d952bbd --- /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 0000000000000000000000000000000000000000..90d0786d0d58c1664a2c481e5583a260dd7da783 --- /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 0000000000000000000000000000000000000000..1e149a6637cc2036183e47fee37c68d5eab4fcd3 --- /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 0000000000000000000000000000000000000000..ec49268cd825416d5119cb58d8c81d8d1e24022e --- /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 5339918ba7cc5cf540ca69af540d8e26fe3c6d90..96436bf9899f3155c3ca1a924edcc28556654611 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 0000000000000000000000000000000000000000..7b92c1bb14aa08001b7d5738111337ab7e81f4cc --- /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 aa76c8d05ac3c759054fcde7fd92ed962d4d779f..557e958a5bd6bfc12c3ae6d9099bee075396fcf9 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>