Skip to content
Snippets Groups Projects
Commit 2fc117ea authored by Markus Escher's avatar Markus Escher
Browse files

Merge remote-tracking branch 'origin/master'

parents 96b266d1 a48a4ae0
No related branches found
No related tags found
No related merge requests found
Showing
with 94 additions and 38 deletions
......@@ -2,12 +2,13 @@ import("system.db");
import("system.result");
import("system.vars");
import("IndexSearch_lib");
var indexHelper, infoContainer, onUpdFn, tableName, res;
import("Sql_lib");
var infoContainer, onUpdFn, tableName, res;
indexHelper = new IndexsearchUtils();
tableName = vars.get("$local.table");
idValue = vars.get("$local.idvalue");
infoContainer = indexHelper.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
infoContainer = IndexsearchUtils.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
,function (){return vars.get("$local.columns")}
,function (){return vars.get("$local.oldvalues")}
,function (){return vars.get("$local.values")});
......@@ -21,16 +22,16 @@ switch (tableName)
res = db.array(db.COLUMN, "select RELATION.RELATIONID from RELATION where RELATION.PERS_ID is null and RELATION.ORG_ID = '" + idValue + "'");
break;
case "ADDRESS":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
res = IndexsearchUtils.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [
[id, db.getColumnTypes("ADDRESS", ["ADDRESSID"])[0]]
[id, SqlUtils.getSingleColumnType("ADDRESS", ["ADDRESSID"])]
]]);
});
break;
case "COMM":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
res = IndexsearchUtils.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from COMM where COMMID = ?", [
[id, db.getColumnTypes("COMM", ["COMMID"])[0]]
[id, SqlUtils.getSingleColumnType("COMM", ["COMMID"])]
]]);
});
break;
......
......@@ -2,12 +2,13 @@ import("system.db");
import("system.result");
import("system.vars");
import("IndexSearch_lib");
var indexHelper, infoContainer, onUpdFn, tableName, res;
import("Sql_lib");
var infoContainer, onUpdFn, tableName, res;
indexHelper = new IndexsearchUtils();
tableName = vars.get("$local.table");
idValue = vars.get("$local.idvalue");
infoContainer = indexHelper.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
infoContainer = IndexsearchUtils.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
,function (){return vars.get("$local.columns")}
,function (){return vars.get("$local.oldvalues")}
,function (){return vars.get("$local.values")});
......@@ -24,16 +25,16 @@ switch (tableName)
res = db.array(db.COLUMN, "select RELATION.RELATIONID from RELATION where RELATION.PERS_ID is not null and RELATION.ORG_ID = '" + idValue + "'");
break;
case "ADDRESS":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
res = IndexsearchUtils.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [
[id, db.getColumnTypes("ADDRESS", ["ADDRESSID"])[0]]
[id, SqlUtils.getSingleColumnType("ADDRESS", ["ADDRESSID"])]
]]);
});
break;
case "COMM":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
res = IndexsearchUtils.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from COMM where COMMID = ?", [
[id, db.getColumnTypes("COMM", ["COMMID"])[0]]
[id, SqlUtils.getSingleColumnType("COMM", ["COMMID"])]
]]);
});
break;
......
......@@ -7,6 +7,7 @@ import("system.mail");
import("Keyword_lib");
import("Comm_lib");
import("Util_lib");
import("Entity_lib");
var kwdUtil = new KeywordUtils();
var kwd = kwdUtil.createKeyword("COMM.MEDIUM");
......@@ -15,7 +16,7 @@ var commCategory = kwd.getPropForKey(commMedium, "contentType", true);//TODO: ma
var fn = CommValidationUtil.makeValidationFn(commCategory);
if (fn != null){
var commAddr = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.ADDR"));
var commAddr = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.ADDR"));
var additional = CommValidationUtil.getExtensionsBlueprint();
additional.countryCode = vars.get("$param.RelationsMainCountry_param");//TODO: try to use users language first and then the companies
var res = fn.call(null, commAddr, additional);
......
......@@ -3,8 +3,12 @@ import("system.result");
import("system.vars");
import("system.db");
import("Util_lib");
import("Entity_lib");
var codeCount = db.cell("select count(CONTRACTCODE) from CONTRACT where CONTRACTCODE = '" + ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTCODE")) + "'"
var contractCode, codeCount;
contractCode = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTCODE"));
codeCount = db.cell("select count(CONTRACTCODE) from CONTRACT where CONTRACTCODE = '" + contractCode + "'"
+ " and CONTRACTID <> '" + vars.get("$field.CONTRACTID") + "'");
if(codeCount > 0)
{
......
......@@ -3,10 +3,10 @@ import("system.translate");
import("system.vars");
import("Date_lib");
import("Util_lib");
import("Entity_lib");
var dateUtils = new DateUtils();
var cDue = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTDUE"));
var cDue = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTDUE"));
if (dateUtils.validateBeginnBeforeEnd(vars.get("$field.CONTRACTSTART"), cDue) === false || dateUtils.validateBeginnBeforeEnd(cDue, vars.get("$field.CONTRACTEND")) === false) {
if (DateUtils.validateBeginnBeforeEnd(vars.get("$field.CONTRACTSTART"), cDue) === false || DateUtils.validateBeginnBeforeEnd(cDue, vars.get("$field.CONTRACTEND")) === false) {
result.string(translate.text("The next due date must be after the start of the contract and before the expiry of the contract!"));
}
......@@ -2,10 +2,10 @@ import("system.result");
import("system.vars");
import("Date_lib");
import("Util_lib");
import("Entity_lib");
var dateUtils = new DateUtils();
var cEnd = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTEND"));
var cEnd = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTEND"));
var cDue = vars.get("$field.CONTRACTDUE");
if (dateUtils.validateBeginnBeforeEnd(vars.get("$field.CONTRACTSTART"), cEnd) === false)
result.string(dateUtils.getValidationFailString());
\ No newline at end of file
if (DateUtils.validateBeginnBeforeEnd(vars.get("$field.CONTRACTSTART"), cEnd) === false)
result.string(DateUtils.getValidationFailString());
\ No newline at end of file
import("system.vars");
import("Util_lib");
import("Entity_lib");
var cEnd = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTEND"));
var cEnd = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTEND"));
var cDue = vars.get("$field.CONTRACTDUE");
if (cDue > cEnd && cDue != "")
......
......@@ -3,10 +3,10 @@ import("system.result");
import("system.vars");
import("Date_lib");
import("Util_lib");
import("Entity_lib");
var dateUtils = new DateUtils();
var cStart = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTSTART"));
var cStart = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTSTART"));
var cDue = vars.get("$field.CONTRACTDUE");
if (dateUtils.validateBeginnBeforeEnd(cStart, vars.get("$field.CONTRACTEND")) === false)
result.string(dateUtils.getValidationFailString());
\ No newline at end of file
if (DateUtils.validateBeginnBeforeEnd(cStart, vars.get("$field.CONTRACTEND")) === false)
result.string(DateUtils.getValidationFailString());
\ No newline at end of file
import("system.vars");
import("Util_lib");
import("Entity_lib");
var cStart = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.CONTRACTSTART"));
var cStart = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.CONTRACTSTART"));
var cDue = vars.get("$field.CONTRACTDUE");
if (cDue < cStart && cDue != "")
......
......@@ -3,6 +3,7 @@
<name>Offer_entity</name>
<title>Offer</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Offer_entity/documentation.adoc</documentation>
<grantUpdateProcess>%aditoprj%/entity/Offer_entity/grantUpdateProcess.js</grantUpdateProcess>
<grantDeleteProcess>%aditoprj%/entity/Offer_entity/grantDeleteProcess.js</grantDeleteProcess>
<recordContainerType>DB</recordContainerType>
......@@ -37,6 +38,7 @@
</entityField>
<entityField>
<name>OFFERCODE</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/offercode/documentation.adoc</documentation>
<title>Offer number</title>
<tableName>OFFER</tableName>
<columnName>OFFERCODE</columnName>
......@@ -69,6 +71,7 @@
</entityField>
<entityField>
<name>RELATION_ID</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/relation_id/documentation.adoc</documentation>
<title>Contact / Company</title>
<tableName>OFFER</tableName>
<columnName>RELATION_ID</columnName>
......@@ -182,6 +185,7 @@
</entityField>
<entityField>
<name>TotalGross</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/totalgross/documentation.adoc</documentation>
<title>Total gross</title>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/totalgross/valueProcess.js</valueProcess>
......@@ -222,6 +226,7 @@
</entityActionField>
<entityField>
<name>VERSNR</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/versnr/documentation.adoc</documentation>
<title>Vers. no.</title>
<tableName>OFFER</tableName>
<columnName>VERSNR</columnName>
......@@ -230,6 +235,7 @@
</entityField>
<entityField>
<name>OFFER_ID</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/offer_id/documentation.adoc</documentation>
</entityField>
<entityFieldGroup>
<name>OfferCode_VersNr</name>
......
= OFFER
:hardbreaks:
Entity contains meta data of the Offer module.
It provides data from database table _OFFER_.
== Actions
* _Copy offer_: All values, offeritems included, are copyed and inserted in a new offer (new offer code, versnr. _1_).
* _New offer version_: All values, offeritems included, are copyed and inserted in a **new offer version** (versnr. + _1_).
== Submodules
* Offeritem
\ No newline at end of file
......@@ -2,9 +2,9 @@ import("system.logging");
import("system.vars");
import("system.neon");
import("Util_lib");
import("Neon_lib");
import("OfferOrder_lib");
var CMUtils = new CopyModuleUtils();
var offUtils = new OfferUtils();
var InputMapping = {
......@@ -24,6 +24,6 @@ var InputMapping = {
}
}
var ModulesMapping = CMUtils.copyModule(InputMapping);
var ModulesMapping = CopyModuleUtils.copyModule(InputMapping);
CMUtils.openNewModules("Offer_context", ModulesMapping);
\ No newline at end of file
CopyModuleUtils.openNewModules("Offer_context", ModulesMapping);
\ No newline at end of file
......@@ -2,9 +2,9 @@ import("system.logging");
import("system.vars");
import("system.neon");
import("Util_lib");
import("Neon_lib");
import("OfferOrder_lib");
var CMUtils = new CopyModuleUtils();
var offUtils = new OfferUtils();
var InputMapping = {
......@@ -24,6 +24,6 @@ var InputMapping = {
}
}
var ModulesMapping = CMUtils.copyModule(InputMapping);
var ModulesMapping = CopyModuleUtils.copyModule(InputMapping);
CMUtils.openNewModules("Offer_context", ModulesMapping);
\ No newline at end of file
CopyModuleUtils.openNewModules("Offer_context", ModulesMapping);
\ No newline at end of file
= OFFER_ID
:hardbreaks:
This field contains link information to previous offer version.
\ No newline at end of file
= OFFERCODE
:hardbreaks:
Unique identification number of the offer.
It's automatically generated from the starting number _1000_.
\ No newline at end of file
......@@ -3,11 +3,12 @@ import("system.result");
import("system.neon");
import("OfferOrder_lib");
import("Util_lib");
import("Entity_lib");
var OfferUtils = new OfferUtils();
if( vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW
&& !OfferUtils.validateOfferNumber(ProcessHandlingUtil.getOnValidationValue(vars.get("$field.OFFERCODE"))) )
&& !OfferUtils.validateOfferNumber(ProcessHandlingUtils.getOnValidationValue(vars.get("$field.OFFERCODE"))) )
{
vars.set( "$field.OFFERCODE", SalesprojectUtils.getNextOfferNumber().toString() );
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import("Date_lib");
if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == "")
{
var DateUtils = new DateUtils();
result.string(DateUtils.getTodayUTC());
}
else
......
= RELATION_ID
:hardbreaks:
Over this field the company or contact person of customer is linked.
== onValueChange
If set in the selected company or contact person, the following field value are taken over:
* LANGUAGE
\ No newline at end of file
import("system.vars");
import("system.db");
import("Util_lib");
import("Entity_lib");
var relid = ProcessHandlingUtil.getOnValidationValue(vars.get("$field.RELATION_ID"));
var relid = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.RELATION_ID"));
if(relid != "")
{
var relData = db.array(db.ROW, "select LANGUAGE from RELATION where RELATIONID = '" + relid + "'");
......
= TotalGross
:hardbreaks:
Contains the total gross of the offer (net).
This is calculated as follows: _NET_ + _VAT_.
Both are calculated in *_Offeritem_entity_* at _onDBInsert_, _onDBUpdate_ and _onDBDelete_.
\ 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