Skip to content
Snippets Groups Projects
Commit 5b8bdc55 authored by Dominik Lechner's avatar Dominik Lechner
Browse files

Use documenttemplate in offer

parent 2edde2e8
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<title>Document Template</title> <title>Document Template</title>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<icon>VAADIN:FILE_FONT</icon> <icon>VAADIN:FILE_FONT</icon>
<titleProcess>%aditoprj%/entity/DocumentTemplate_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
<entityFields> <entityFields>
<entityProvider> <entityProvider>
......
...@@ -4,11 +4,15 @@ import("system.vars"); ...@@ -4,11 +4,15 @@ import("system.vars");
import("system.db"); import("system.db");
import("Sql_lib"); import("Sql_lib");
var docTemplateType = vars.get("$param.DocumentTemplateType_param").trim(); var docTemplateType = vars.get("$param.DocumentTemplateType_param");
var docTemplateTypeClassification = vars.get("$param.DocumentTemplateTypeClassification_param").trim(); var docTemplateTypeClassification = vars.get("$param.DocumentTemplateTypeClassification_param");
if(docTemplateType != "" && docTemplateTypeClassification != "")
if(docTemplateType != null && docTemplateType != "" && docTemplateTypeClassification != null && docTemplateTypeClassification != "")
{ {
docTemplateType = docTemplateType.trim();
docTemplateTypeClassification = docTemplateTypeClassification.trim();
var cond = SqlCondition.begin() var cond = SqlCondition.begin()
.andPrepare("DOCUMENTTEMPLATE.TYPE", docTemplateType) .andPrepare("DOCUMENTTEMPLATE.TYPE", docTemplateType)
.andPrepare("DOCUMENTTEMPLATE.CLASSIFICATION", docTemplateTypeClassification) .andPrepare("DOCUMENTTEMPLATE.CLASSIFICATION", docTemplateTypeClassification)
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
</entityField> </entityField>
<entityField> <entityField>
<name>HEADER</name> <name>HEADER</name>
<title>Cover letter</title>
<contentType>LONG_TEXT</contentType> <contentType>LONG_TEXT</contentType>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/header/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/header/valueProcess.js</valueProcess>
</entityField> </entityField>
...@@ -741,6 +740,7 @@ ...@@ -741,6 +740,7 @@
</entityConsumer> </entityConsumer>
<entityField> <entityField>
<name>chooseTEXHeader</name> <name>chooseTEXHeader</name>
<title>Cover letter</title>
<consumer>DocumentTemplateText</consumer> <consumer>DocumentTemplateText</consumer>
</entityField> </entityField>
</entityFields> </entityFields>
......
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
import("system.neon"); import("system.neon");
import("system.db");
import("system.util");
if(vars.exists("$param.OfferHeader_param") && vars.get("$param.OfferHeader_param")) if(vars.exists("$param.OfferHeader_param") && vars.get("$param.OfferHeader_param"))
result.string(vars.get("$param.OfferHeader_param")); result.string(vars.get("$param.OfferHeader_param"));
...@@ -10,3 +12,9 @@ else if(vars.get("$this.value")) ...@@ -10,3 +12,9 @@ else if(vars.get("$this.value"))
else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) else if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string("gerne bieten wir Ihnen wie folgt an:") result.string("gerne bieten wir Ihnen wie folgt an:")
if (vars.get("$field.chooseTEXHeader") != "")
{
var binaryId = db.cell("select ID from ASYS_BINARIES where ROW_ID = '" + vars.get("$field.chooseTEXHeader") + "'", "_____SYSTEMALIAS");
result.string(util.decodeBase64String(db.getBinaryContent(binaryId, "_____SYSTEMALIAS")));
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment