diff --git a/.gitignore b/.gitignore index 36b3dbfd3ad5ae4a9bd2aed19b089397b55c0f61..c0fbe9c2a9088a99c14d690350315c8581d5ca49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.aditoprj/cache /data /others/db_changes/liqui_update.bat -/others/db_changes/liqui_reset.ps1 \ No newline at end of file +/others/db_changes/liqui_reset.ps1 +/others/jsdocOut \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 5d94da608c95aa16f902a3d5523a11f3e93aca05..6cf60a5dd6fff1dcf326d830228c68ce8ac9118a 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -2548,19 +2548,6 @@ <title></title> <description></description> </entityFieldDb> - <entityFieldDb> - <name>DESCRIPTION</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="2005" /> - <size v="2147483647" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <title></title> - <description></description> - </entityFieldDb> <entityFieldDb> <name>ASSIGNEDTO</name> <dbName></dbName> @@ -2613,6 +2600,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>INFO</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="2005" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -4730,20 +4731,6 @@ <title></title> <description></description> </entityFieldDb> - <entityFieldDb> - <name>DESCRIPTION</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="2005" /> - <size v="2147483647" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <documentation></documentation> - <title></title> - <description></description> - </entityFieldDb> <entityFieldDb> <name>SALESORDER_ID</name> <dbName></dbName> @@ -4828,6 +4815,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>INFO</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="2005" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> </entities> diff --git a/entity/Appointment_entity/recordcontainers/jditorc/onInsert.js b/entity/Appointment_entity/recordcontainers/jditorc/onInsert.js index a5cd4a7eeb9c8339a024e0e000a8a6a86d8412f9..af2c2302ef38253d59b3d1f02f4394c56602a827 100644 --- a/entity/Appointment_entity/recordcontainers/jditorc/onInsert.js +++ b/entity/Appointment_entity/recordcontainers/jditorc/onInsert.js @@ -33,7 +33,7 @@ if (vars.get("$field.REMINDER") != undefined && vars.get("$field.REMINDER") != " event[calendars.REMINDER_DURATION] = vars.get("$field.REMINDER"); } event[calendars.ID] = calendars.insert([event])[0]; -vars.set("$image.editmode", calendars.MODE_UPDATE); +vars.set("$context.editmode", calendars.MODE_UPDATE); ok = true; @@ -42,7 +42,7 @@ ok = true; function getReadOnlyUser() { var writeable = calendars.getFullCalendarUsers(calendars.RIGHT_WRITE); - var affectedusers = vars.get("$image.affectedusers"); + var affectedusers = vars.get("$context.affectedusers"); var readonly = new Array(); for ( i = 0; i < affectedusers.length; i++) diff --git a/entity/Appointment_entity/recordcontainers/jditorc/onUpdate.js b/entity/Appointment_entity/recordcontainers/jditorc/onUpdate.js index 8daf50e78260dc27bec5a02d5f26117a75b67163..47097ad51623c2ff3faaef0707d77eec56ea1d86 100644 --- a/entity/Appointment_entity/recordcontainers/jditorc/onUpdate.js +++ b/entity/Appointment_entity/recordcontainers/jditorc/onUpdate.js @@ -55,7 +55,7 @@ if(vars.exists("$param.entry")) // Liefert die AffectedUsers function getAffectedUsers( pEvent ) { - var affectedusers = vars.get("$image.affectedusers"); + var affectedusers = vars.get("$context.affectedusers"); var attendess = pEvent[calendars.ATTENDEES] var calendarusers = []; for ( var i = 0; i < affectedusers.length; i++) @@ -89,7 +89,7 @@ function getAffectedUsers( pEvent ) function getReadOnlyUser() { var writeable = calendars.getFullCalendarUsers(calendars.RIGHT_WRITE); - var affectedusers = vars.get("$image.affectedusers"); + var affectedusers = vars.get("$context.affectedusers"); var readonly = new Array(); for ( i = 0; i < affectedusers.length; i++) diff --git a/entity/Document_entity/Document_entity.aod b/entity/Document_entity/Document_entity.aod index f620b3c9986480040faacebf3dc808592f95c9d9..eca9d6dbea3934f1e67eb6e54d18a93d2ab5ed2d 100644 --- a/entity/Document_entity/Document_entity.aod +++ b/entity/Document_entity/Document_entity.aod @@ -72,19 +72,16 @@ <entityParameter> <name>AssignmentTable_param</name> <expose v="true" /> - <triggerRecalculation v="false" /> <description>PARAMETER</description> </entityParameter> <entityParameter> <name>AssignmentName_param</name> <expose v="true" /> - <triggerRecalculation v="false" /> <description>PARAMETER</description> </entityParameter> <entityParameter> <name>AssignmentRowId_param</name> <expose v="true" /> - <triggerRecalculation v="false" /> <description>PARAMETER</description> </entityParameter> <entityIncomingField> @@ -234,6 +231,11 @@ </entityDependency> </dependencies> </entityIncomingField> + <entityActionField> + <name>downloadEntryAction</name> + <fieldType>ACTION</fieldType> + <onActionProcess>%aditoprj%/entity/Document_entity/entityfields/downloadentryaction/onActionProcess.js</onActionProcess> + </entityActionField> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Document_entity/entityfields/downloadentryaction/onActionProcess.js b/entity/Document_entity/entityfields/downloadentryaction/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a09e33e8f53dbe4fa9bf5ffa49f2eccaeec439dd --- /dev/null +++ b/entity/Document_entity/entityfields/downloadentryaction/onActionProcess.js @@ -0,0 +1,2 @@ +import("Document_lib"); +DocumentUtil.downloadSelectedDocuments(); diff --git a/entity/Offer_entity/entityfields/salesproject_id/valueProcess.js b/entity/Offer_entity/entityfields/salesproject_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..447b6962106b02b100555df3b988ac90b4528192 --- /dev/null +++ b/entity/Offer_entity/entityfields/salesproject_id/valueProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.vars"); + +if (vars.exists("$param.SalesprojectId_param")) +{ + result.string(vars.get("$param.SalesprojectId_param")); +} \ No newline at end of file diff --git a/entity/Offeritem_entity/Offeritem_entity.aod b/entity/Offeritem_entity/Offeritem_entity.aod index d9120e5fd556ff2dde1e5831a129a3106d3823e2..7b0e267ae2428f74bd60bc94c815917a1da31057 100644 --- a/entity/Offeritem_entity/Offeritem_entity.aod +++ b/entity/Offeritem_entity/Offeritem_entity.aod @@ -25,11 +25,6 @@ <contentType>DATE</contentType> <valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/date_new/valueProcess.js</valueProcess> </entityField> - <entityField> - <name>DESCRIPTION</name> - <title>Description</title> - <contentType>LONG_TEXT</contentType> - </entityField> <entityField> <name>DISCOUNT</name> <title>Discount</title> @@ -168,6 +163,13 @@ </entityDependency> </dependencies> </entityIncomingField> + <entityField> + <name>INFO</name> + <documentation>%aditoprj%/entity/Offeritem_entity/entityfields/info/documentation.adoc</documentation> + <title>Description</title> + <contentType>LONG_TEXT</contentType> + <valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/info/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -201,10 +203,6 @@ <name>DATE_NEW.value</name> <recordfield>OFFERITEM.DATE_NEW</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>DESCRIPTION.value</name> - <recordfield>OFFERITEM.DESCRIPTION</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DISCOUNT.value</name> <recordfield>OFFERITEM.DISCOUNT</recordfield> @@ -265,6 +263,10 @@ <name>VAT.value</name> <recordfield>OFFERITEM.VAT</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>INFO.value</name> + <recordfield>OFFERITEM.INFO</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Offeritem_entity/entityfields/info/documentation.adoc b/entity/Offeritem_entity/entityfields/info/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..8c8b222cffb2b4ffe82dab0d49d9facaa5145342 --- /dev/null +++ b/entity/Offeritem_entity/entityfields/info/documentation.adoc @@ -0,0 +1 @@ +The INFO field is copied from the product if in NEW-mode. \ No newline at end of file diff --git a/entity/Offeritem_entity/entityfields/info/valueProcess.js b/entity/Offeritem_entity/entityfields/info/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..584fb9fb5f36021714ff43451fa6a3a467f96bad --- /dev/null +++ b/entity/Offeritem_entity/entityfields/info/valueProcess.js @@ -0,0 +1,12 @@ +import("system.db"); +import("system.result"); +import("system.vars"); +import("system.neon"); +import("Sql_lib"); + +if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +{ + // TODO: loading from db until loading from dfo is possible. + var productId = vars.get("$field.PRODUCT_ID"); + result.string(db.cell(SqlCondition.begin().andPrepareVars("PRODUCT.PRODUCTID", "$field.PRODUCT_ID").buildSelect("select INFO from PRODUCT", "1=2"))); +} \ No newline at end of file diff --git a/entity/Orderitem_entity/Orderitem_entity.aod b/entity/Orderitem_entity/Orderitem_entity.aod index 47f80ab58117f704690751f0f872510107ebd3a4..fe1270a563643e5bd20dbae503c46a2e0ae4c9ec 100644 --- a/entity/Orderitem_entity/Orderitem_entity.aod +++ b/entity/Orderitem_entity/Orderitem_entity.aod @@ -25,11 +25,6 @@ <contentType>DATE</contentType> <valueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/date_new/valueProcess.js</valueProcess> </entityField> - <entityField> - <name>DESCRIPTION</name> - <title>Description</title> - <contentType>LONG_TEXT</contentType> - </entityField> <entityField> <name>DISCOUNT</name> <title>Discount</title> @@ -171,6 +166,10 @@ </entityDependency> </dependencies> </entityIncomingField> + <entityField> + <name>INFO</name> + <title>Description</title> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Org_entity/Org_entity.aod b/entity/Org_entity/Org_entity.aod index 581d1c750e4d7131969119933e560b2f261e153b..d56039b2ba6f4dcef549e9ccff54e4945e7ffd6e 100644 --- a/entity/Org_entity/Org_entity.aod +++ b/entity/Org_entity/Org_entity.aod @@ -353,6 +353,12 @@ <fieldName>SalesprojectCompetitionOrg_dfo</fieldName> <isOutgoing v="false" /> </entityDependency> + <entityDependency> + <name>14301a6c-7144-4d1b-800e-e4ca733769bb</name> + <entityName>SalesprojectCompetition_entity</entityName> + <fieldName>CompetitionOrg_lookup_dfo</fieldName> + <isOutgoing v="false" /> + </entityDependency> </dependencies> </entityIncomingField> <entityField> diff --git a/entity/Pers_entity/Pers_entity.aod b/entity/Pers_entity/Pers_entity.aod index 67dfe2639ac71593104e76a9304c60ae80fa7753..9624f5e576168a4c3cda2d802c48e9959b633e15 100644 --- a/entity/Pers_entity/Pers_entity.aod +++ b/entity/Pers_entity/Pers_entity.aod @@ -52,6 +52,7 @@ <name>PERSID</name> <searchable v="false" /> <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/persid/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Pers_entity/entityfields/persid/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>SALUTATION</name> @@ -143,19 +144,13 @@ </entityDependency> </dependencies> </entityIncomingField> - <entityField> - <name>PERS_ID</name> - <searchable v="false" /> - <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/pers_id/valueProcess.js</valueProcess> - </entityField> <entityField> <name>ORG_ID</name> <title>Firma</title> - <linkedContextProcess>%aditoprj%/entity/Pers_entity/entityfields/org_id/linkedContextProcess.js</linkedContextProcess> + <linkedContext>Org_context</linkedContext> <outgoingField>PersOrg_dfo</outgoingField> <searchable v="false" /> <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/org_id/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/Pers_entity/entityfields/org_id/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/Pers_entity/entityfields/org_id/onValueChange.js</onValueChange> </entityField> <entityField> @@ -221,12 +216,6 @@ </entityParameter> </children> </entityOutgoingField> - <entityField> - <name>ORGID</name> - <linkedContext>Org_context</linkedContext> - <outgoingField>PersOrg_dfo</outgoingField> - <searchable v="false" /> - </entityField> <entityOutgoingField> <name>PersOrg_dfo</name> <fieldType>DEPENDENCY_OUT</fieldType> @@ -511,10 +500,6 @@ <name>PERSID.value</name> <recordfield>PERS.PERSID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>ORGID.value</name> - <recordfield>ORG.ORGID</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DATEOFBIRTH.value</name> <recordfield>PERS.DATEOFBIRTH</recordfield> @@ -535,10 +520,6 @@ <name>LANGUAGE.value</name> <recordfield>RELATION.LANGUAGE</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>PERS_ID.value</name> - <recordfield>RELATION.PERS_ID</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>LASTNAME.value</name> <recordfield>PERS.LASTNAME</recordfield> diff --git a/entity/Pers_entity/entityfields/org_id/displayValueProcess.js b/entity/Pers_entity/entityfields/org_id/displayValueProcess.js deleted file mode 100644 index 93bb6fe066bbb02e207a0a76dc5fe8f84839fa96..0000000000000000000000000000000000000000 --- a/entity/Pers_entity/entityfields/org_id/displayValueProcess.js +++ /dev/null @@ -1,8 +0,0 @@ -import("system.result"); -import("system.vars"); -import("Sql_lib"); -import("system.db"); - -result.string(db.cell(SqlCondition.begin(db.getCurrentAlias()) - .andPrepareVars("ORG.ORGID", "$field.ORG_ID", "# = ?") - .buildSelect("SELECT ORG.NAME FROM ORG", "1 = 2"), db.getCurrentAlias())); diff --git a/entity/Pers_entity/entityfields/org_id/linkedContextProcess.js b/entity/Pers_entity/entityfields/org_id/linkedContextProcess.js deleted file mode 100644 index cd8a3d2174a5ff7098964ba6eb30c7edba0be739..0000000000000000000000000000000000000000 --- a/entity/Pers_entity/entityfields/org_id/linkedContextProcess.js +++ /dev/null @@ -1,9 +0,0 @@ -import("system.vars"); -import("system.result"); - -if(vars.get("$field.ORG_ID") != 0) { - result.string("Org_context"); -} -else { - result.string(""); -} \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/pers_id/valueProcess.js b/entity/Pers_entity/entityfields/pers_id/valueProcess.js deleted file mode 100644 index 53099fc99d63b97777f90fc9608687b5ba8b8501..0000000000000000000000000000000000000000 --- a/entity/Pers_entity/entityfields/pers_id/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.getString("$field.PERSID")); \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/persid/displayValueProcess.js b/entity/Pers_entity/entityfields/persid/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Pers_entity/entityfields/persorgsaddresses_dfo/children/relid_param/code.js b/entity/Pers_entity/entityfields/persorgsaddresses_dfo/children/relid_param/code.js index 9143843493999b2926596100050076743643eabb..30f588988c8d4e0b834fe1409cfff33034c0db5b 100644 --- a/entity/Pers_entity/entityfields/persorgsaddresses_dfo/children/relid_param/code.js +++ b/entity/Pers_entity/entityfields/persorgsaddresses_dfo/children/relid_param/code.js @@ -1,12 +1,12 @@ -import("system.result"); -import("system.db"); -import("system.vars"); -import("Sql_lib"); - -var orgId = vars.get("$field.ORGID"); -if (orgId) -{ - var cond = SqlCondition.begin().and("RELATION.PERS_ID is null").andPrepare("RELATION.ORG_ID", orgId); - var orgRelId = db.cell(cond.buildSelect("select RELATION.RELATIONID from RELATION", "1 = 1")); - result.string(orgRelId); +import("system.result"); +import("system.db"); +import("system.vars"); +import("Sql_lib"); + +var orgId = vars.get("$field.ORG_ID"); +if (orgId) +{ + var cond = SqlCondition.begin().and("RELATION.PERS_ID is null").andPrepare("RELATION.ORG_ID", orgId); + var orgRelId = db.cell(cond.buildSelect("select RELATION.RELATIONID from RELATION", "1 = 1")); + result.string(orgRelId); } \ No newline at end of file diff --git a/entity/Prod2prod_entity/Prod2prod_entity.aod b/entity/Prod2prod_entity/Prod2prod_entity.aod index b435ec40b1befc9da57d1901ab8ae7d5e1ac5bac..29507f9fe4733b2cea723f310b0fa63b7fdd13f7 100644 --- a/entity/Prod2prod_entity/Prod2prod_entity.aod +++ b/entity/Prod2prod_entity/Prod2prod_entity.aod @@ -49,7 +49,7 @@ <entityField> <name>TAKEPRICE</name> <documentation>%aditoprj%/entity/Prod2prod_entity/entityfields/takeprice/documentation.adoc</documentation> - <title>Price</title> + <title>Take price</title> <contentType>BOOLEAN</contentType> <possibleItemsProcess>%aditoprj%/entity/Prod2prod_entity/entityfields/takeprice/possibleItemsProcess.js</possibleItemsProcess> </entityField> diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 436062d5ee29541ae002ebbb3f18f20656eb2f76..b991396b63b6f0e1b94a744de90083605a5e1bb0 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -435,6 +435,10 @@ <name>PERS_LASTNAME.value</name> <recordfield>PERS.LASTNAME</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>INFO.value</name> + <recordfield>PRODUCT.INFO</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Product_entity/entityfields/image/onValueChange.js b/entity/Product_entity/entityfields/image/onValueChange.js index 147134e54ce8c1fa74578fa3c83e51112359e762..4997061690d757b4a7e50c905c0331a6f8897d40 100644 --- a/entity/Product_entity/entityfields/image/onValueChange.js +++ b/entity/Product_entity/entityfields/image/onValueChange.js @@ -1,12 +1,5 @@ import("system.vars"); +import("Entity_lib"); // TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process -var newImage = vars.get("$field.IMAGE"); -if (newImage) -{ - vars.set("$image.changedImage", newImage); -} -else -{ - vars.set("$image.changedImage", "deleted"); -} \ No newline at end of file +FieldChanges.setChange("$field.IMAGE"); \ No newline at end of file diff --git a/entity/Product_entity/recordcontainers/db/onDBUpdate.js b/entity/Product_entity/recordcontainers/db/onDBUpdate.js index 2c9deb924d4746a795bdfa98364a56bcacdc26a6..0c6ec72c75985fd9286df4b1a4327b2fdfc58978 100644 --- a/entity/Product_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Product_entity/recordcontainers/db/onDBUpdate.js @@ -1,21 +1,11 @@ import("system.vars"); import("Product_lib"); +import("Entity_lib"); // TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer -if (vars.exists("$image.changedImage")) -{ - if (vars.get("$image.changedImage")) - { - var imageData = vars.getString("$field.IMAGE"); - if (vars.get("$image.changedImage") != "deleted") - { - ProductUtils.setImage(vars.get("$field.PRODUCTID"), imageData); - } - else - { - ProductUtils.removeImage(vars.get("$field.PRODUCTID")); - } - } +FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function(state, value){ + if (state == FieldChanges.STATE_CHANGED()) + ProductUtils.setImage(vars.get("$field.PRODUCTID"), value); + else + ProductUtils.removeImage(vars.get("$field.PRODUCTID")); } - -vars.set("$image.changedImage", false); \ No newline at end of file diff --git a/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod b/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod index f31ade89bbb83a525426fae23f501ae4ebfbddf8..e3276ac8d54bd6f3836daeb9e160e71b5abfd717 100644 --- a/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod +++ b/entity/SalesprojectCompetition_entity/SalesprojectCompetition_entity.aod @@ -78,6 +78,8 @@ <entityField> <name>RELATION_ID</name> <title>Organisation</title> + <linkedContext>Org_context</linkedContext> + <outgoingField>CompetitionOrg_lookup_dfo</outgoingField> </entityField> <entityField> <name>ORG_NAME</name> @@ -123,6 +125,15 @@ <title>Weakness</title> <possibleItemsProcess>%aditoprj%/entity/SalesprojectCompetition_entity/entityfields/org_weakness/possibleItemsProcess.js</possibleItemsProcess> </entityField> + <entityOutgoingField> + <name>CompetitionOrg_lookup_dfo</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Org_entity</entityName> + <fieldName>SalesprojectCompetitionOrg_dfi</fieldName> + </dependency> + </entityOutgoingField> </entityFields> <recordContainers> <dbRecordContainer> @@ -211,6 +222,10 @@ <name>ORG_WEAKNESS.value</name> <recordfield>ORG.WEAKNESS</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>RELATION_ID.displayValue</name> + <recordfield>ORG.NAME</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index d23f9b29ab92a08b53d78c78ce259cc14362b127..a1b7a10089aa587214b7426e4c862e2cef42b8d7 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -289,7 +289,9 @@ <entityActionField> <name>newOffer</name> <fieldType>ACTION</fieldType> + <documentation>%aditoprj%/entity/Salesproject_entity/entityfields/newoffer/documentation.adoc</documentation> <title>New offer</title> + <description>Opens the Offer context in NEW-Mode and fills salesproject and relation.</description> <onActionProcess>%aditoprj%/entity/Salesproject_entity/entityfields/newoffer/onActionProcess.js</onActionProcess> </entityActionField> <entityOutgoingField> diff --git a/entity/Salesproject_entity/entityfields/newoffer/documentation.adoc b/entity/Salesproject_entity/entityfields/newoffer/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..4335f394386154f4a27208aee22d6ee3534a39b7 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/newoffer/documentation.adoc @@ -0,0 +1,2 @@ +== New Offer == +Calls Offer_lib.OfferUtils.createNewOffer(pSalesprojectId, pRelationId) which opens the offer_ontext in new-mode and fills salesproject and relation. \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/newoffer/onActionProcess.js b/entity/Salesproject_entity/entityfields/newoffer/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..670866d4c60af1d3c1cccb23b2a42b2edd10a227 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/newoffer/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("Offer_lib"); + +OfferUtils.createNewOffer(vars.get("$field.SALESPROJECTID"), vars.get("$field.RELATION_ID")); \ No newline at end of file diff --git a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js index cd127035717dc2dd7143cebab0f2e10893d8c897..3257897d9afb781e79d83c1472aacc7f9902cfe6 100644 --- a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js @@ -67,7 +67,7 @@ function _addMonthRows(pYear) if (turnoverSum != undefined && turnoverSum[0] == pYear && turnoverSum[2] == i.toString()) { _addRow(turnoverSum); - turnoverYearSum += turnoverSum[3]; + turnoverYearSum += parseInt(turnoverSum[3]); } else { @@ -79,7 +79,7 @@ function _addMonthRows(pYear) if (forecastSum != undefined && forecastSum[0] == pYear && forecastSum[2] == i) { _addRow(forecastSum); - forecastYearSum += forecastSum[3]; + forecastYearSum += parseInt(forecastSum[3]); } else { diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 4b37e9feec0dd61438d28135ee7312f0195dcea4..2b5f0dbfd15e8cbc7cca8c5c2c8d046841b30459 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -1362,6 +1362,57 @@ <entry> <key>Open salesprojects</key> </entry> + <entry> + <key>July</key> + </entry> + <entry> + <key>ADITO Facebook Feed</key> + </entry> + <entry> + <key>ADITO Twitter Feed</key> + </entry> + <entry> + <key>June</key> + </entry> + <entry> + <key>October</key> + </entry> + <entry> + <key>Take price</key> + </entry> + <entry> + <key>Twitter Feed</key> + </entry> + <entry> + <key>November</key> + </entry> + <entry> + <key>December</key> + </entry> + <entry> + <key>May</key> + </entry> + <entry> + <key>April</key> + </entry> + <entry> + <key>January</key> + </entry> + <entry> + <key>March</key> + </entry> + <entry> + <key>September</key> + </entry> + <entry> + <key>August</key> + </entry> + <entry> + <key>Category</key> + </entry> + <entry> + <key>February</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 3d984a421e51f37f3f11795e53f7b53a8e98f23b..fa29bffd2c5f718771704ec92e5eaac67d44a12e 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -1685,6 +1685,58 @@ <key>New activity</key> <value>Aktivität erstellen</value> </entry> + <entry> + <key>July</key> + </entry> + <entry> + <key>ADITO Facebook Feed</key> + </entry> + <entry> + <key>ADITO Twitter Feed</key> + </entry> + <entry> + <key>June</key> + </entry> + <entry> + <key>October</key> + </entry> + <entry> + <key>Take price</key> + <value>Preis übernehmen</value> + </entry> + <entry> + <key>Twitter Feed</key> + </entry> + <entry> + <key>November</key> + </entry> + <entry> + <key>December</key> + </entry> + <entry> + <key>May</key> + </entry> + <entry> + <key>April</key> + </entry> + <entry> + <key>January</key> + </entry> + <entry> + <key>March</key> + </entry> + <entry> + <key>September</key> + </entry> + <entry> + <key>August</key> + </entry> + <entry> + <key>Category</key> + </entry> + <entry> + <key>February</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 8de5af179949a4bfaeeeeeaf5b46a782e61e4daf..58cc1a94eda1570994113bdfe9ca23460ec6b26f 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -1379,6 +1379,57 @@ <entry> <key>Open salesprojects</key> </entry> + <entry> + <key>July</key> + </entry> + <entry> + <key>ADITO Facebook Feed</key> + </entry> + <entry> + <key>ADITO Twitter Feed</key> + </entry> + <entry> + <key>June</key> + </entry> + <entry> + <key>October</key> + </entry> + <entry> + <key>Take price</key> + </entry> + <entry> + <key>Twitter Feed</key> + </entry> + <entry> + <key>November</key> + </entry> + <entry> + <key>December</key> + </entry> + <entry> + <key>May</key> + </entry> + <entry> + <key>April</key> + </entry> + <entry> + <key>January</key> + </entry> + <entry> + <key>March</key> + </entry> + <entry> + <key>September</key> + </entry> + <entry> + <key>August</key> + </entry> + <entry> + <key>Category</key> + </entry> + <entry> + <key>February</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/SalesprojectCycle_context/SalesprojectCycle_context.aod b/neonContext/SalesprojectCycle_context/SalesprojectCycle_context.aod index f1613afaa8244b853f63901cb843fe9861bcc490..177964021d07eb6f5946da28cf11bf98c79e5a4c 100644 --- a/neonContext/SalesprojectCycle_context/SalesprojectCycle_context.aod +++ b/neonContext/SalesprojectCycle_context/SalesprojectCycle_context.aod @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0"> <name>SalesprojectCycle_context</name> + <description>Milestones of a salesproject</description> <majorModelMode>DISTRIBUTED</majorModelMode> <filterview>SalesprojectCycleFilter_view</filterview> <editview>SalesprojectCycleEdit_view</editview> diff --git a/neonContext/Salesproject_context/Salesproject_context.aod b/neonContext/Salesproject_context/Salesproject_context.aod index 4619a612976d4d83265083082193f6db41bd2b5e..f21df4abe418179cac97fe4561001570b999388f 100644 --- a/neonContext/Salesproject_context/Salesproject_context.aod +++ b/neonContext/Salesproject_context/Salesproject_context.aod @@ -3,6 +3,7 @@ <name>Salesproject_context</name> <title>Salesproject</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/neonContext/Salesproject_context/documentation.adoc</documentation> <mainview>SalesprojectMain_view</mainview> <filterview>SalesprojectFilter_view</filterview> <editview>SalesprojectEdit_view</editview> diff --git a/neonContext/Salesproject_context/documentation.adoc b/neonContext/Salesproject_context/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..51166614a30a5adbc4ab1d5cbfad5b0391622793 --- /dev/null +++ b/neonContext/Salesproject_context/documentation.adoc @@ -0,0 +1,18 @@ +Salesproject +============ +== Overview == +A salesproject consists of some modules: +- Salesproject itself +- Activity (former History) +- Milestones +- Competition +- Source +- Offer +- Member +- Classification +- Forecast +- Timetracking + +== Information == +Milestones are currently inserted on each change of Phase and State. +(with the processes db.onDBUpdate, db.onDBInsert) \ No newline at end of file diff --git a/neonView/DocumentList_view/DocumentList_view.aod b/neonView/DocumentList_view/DocumentList_view.aod index 004e1d313ed65799dceefb86d84ae0a6b5625322..7f3073db86821de449597ddb161670741464d8b7 100644 --- a/neonView/DocumentList_view/DocumentList_view.aod +++ b/neonView/DocumentList_view/DocumentList_view.aod @@ -9,13 +9,13 @@ </drawerLayout> </layout> <children> - <treetableViewTemplate> - <name>DocumentTreeList_view</name> + <actionListViewTemplate> + <name>ActionList_template</name> <titleField>NAME</titleField> <descriptionField>DESCRIPTION</descriptionField> <iconField>ICON</iconField> - <hideActions v="true" /> + <entryAction>downloadEntryAction</entryAction> <entityField>#ENTITY</entityField> - </treetableViewTemplate> + </actionListViewTemplate> </children> </neonView> diff --git a/neonView/OfferEdit_view/OfferEdit_view.aod b/neonView/OfferEdit_view/OfferEdit_view.aod index 3a1b2c29e204c6af09b0a5ad1a04272b7bf22d16..e8f8de7cf5ad4cf4fb0afa3d715c01d3672f3c96 100644 --- a/neonView/OfferEdit_view/OfferEdit_view.aod +++ b/neonView/OfferEdit_view/OfferEdit_view.aod @@ -59,7 +59,7 @@ </fields> </genericViewTemplate> <neonViewReference> - <name>a74af385-7088-4168-9e0a-22e4b73dd6fb</name> + <name>f84b65ca-f1dd-4dda-8321-1eef10ad0ecc</name> <entityField>OfferOfferitem_dfo</entityField> <view>OfferitemMultiEdit_view</view> </neonViewReference> diff --git a/neonView/OfferitemFilter_view/OfferitemFilter_view.aod b/neonView/OfferitemFilter_view/OfferitemFilter_view.aod index 3cd8f851ce9ae967dc4104a77345dfeb3a485a1b..9590a8698511a7517637e0717545ebf2bb63d600 100644 --- a/neonView/OfferitemFilter_view/OfferitemFilter_view.aod +++ b/neonView/OfferitemFilter_view/OfferitemFilter_view.aod @@ -46,6 +46,10 @@ <name>89fd18d0-f6ee-4323-9277-464dee6da625</name> <entityField>OPTIONAL</entityField> </neonTableColumn> + <neonTableColumn> + <name>a31fd16c-4237-4cd9-a9de-2267f186d342</name> + <entityField>INFO</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/OfferitemMultiEdit_view/OfferitemMultiEdit_view.aod b/neonView/OfferitemMultiEdit_view/OfferitemMultiEdit_view.aod index eeb2e5038d7f68a6fcfbc8320ea38cb895a54197..8d494baa95622d175a43f4bf4e8de88b9c975fdb 100644 --- a/neonView/OfferitemMultiEdit_view/OfferitemMultiEdit_view.aod +++ b/neonView/OfferitemMultiEdit_view/OfferitemMultiEdit_view.aod @@ -45,6 +45,10 @@ <name>c60f6315-5b63-4c4a-96fa-eaa99b94646e</name> <entityField>OPTIONAL</entityField> </neonTableColumn> + <neonTableColumn> + <name>a605715e-5efc-4aeb-860f-f16ff4b80321</name> + <entityField>INFO</entityField> + </neonTableColumn> </columns> </genericMultipleViewTemplate> </children> diff --git a/neonView/OfferitemPreview_view/OfferitemPreview_view.aod b/neonView/OfferitemPreview_view/OfferitemPreview_view.aod index 4d5047d3344e5142efb6fb86dcec45576ab65406..5f3cd04116445e9fd62ddbf97895509e70b16b77 100644 --- a/neonView/OfferitemPreview_view/OfferitemPreview_view.aod +++ b/neonView/OfferitemPreview_view/OfferitemPreview_view.aod @@ -12,7 +12,7 @@ <name>OfferitemPreview_header</name> <iconField>IMAGE</iconField> <titleField>ITEMNAME</titleField> - <descriptionField>DESCRIPTION</descriptionField> + <descriptionField>INFO</descriptionField> <entityField>#ENTITY</entityField> </cardViewTemplate> <genericViewTemplate> diff --git a/neonView/OrderitemFilter_view/OrderitemFilter_view.aod b/neonView/OrderitemFilter_view/OrderitemFilter_view.aod index 61e1e2af23f58a85e46b195d105e35354e27a4ab..63409f66aea785fe320183af3a09146b09c0f7b0 100644 --- a/neonView/OrderitemFilter_view/OrderitemFilter_view.aod +++ b/neonView/OrderitemFilter_view/OrderitemFilter_view.aod @@ -46,6 +46,10 @@ <name>89fd18d0-f6ee-4323-9277-464dee6da625</name> <entityField>OPTIONAL</entityField> </neonTableColumn> + <neonTableColumn> + <name>03a15cab-67d9-4e9d-b911-0d5599c87671</name> + <entityField>INFO</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/OrderitemMultiEdit_view/OrderitemMultiEdit_view.aod b/neonView/OrderitemMultiEdit_view/OrderitemMultiEdit_view.aod index f94e0a1f56bc8bda51d1b0a489f4c1dc9c8c8369..3102dd60c99fe4720a2786a2b10cc2434b8eaa06 100644 --- a/neonView/OrderitemMultiEdit_view/OrderitemMultiEdit_view.aod +++ b/neonView/OrderitemMultiEdit_view/OrderitemMultiEdit_view.aod @@ -45,6 +45,10 @@ <name>c60f6315-5b63-4c4a-96fa-eaa99b94646e</name> <entityField>OPTIONAL</entityField> </neonTableColumn> + <neonTableColumn> + <name>96f0b5bd-6187-44ad-aac0-15ac262e30a2</name> + <entityField>INFO</entityField> + </neonTableColumn> </columns> </genericMultipleViewTemplate> </children> diff --git a/neonView/OrderitemPreview_view/OrderitemPreview_view.aod b/neonView/OrderitemPreview_view/OrderitemPreview_view.aod index 04cf0c55dcfedfb148c304d86fb5789a6058c22f..f0a175961c47fb69242db3e02c25140a9f78e5f3 100644 --- a/neonView/OrderitemPreview_view/OrderitemPreview_view.aod +++ b/neonView/OrderitemPreview_view/OrderitemPreview_view.aod @@ -12,7 +12,7 @@ <name>OrderitemPreview_header</name> <iconField>IMAGE</iconField> <titleField>ITEMNAME</titleField> - <descriptionField>DESCRIPTION</descriptionField> + <descriptionField>INFO</descriptionField> <entityField>#ENTITY</entityField> </cardViewTemplate> <genericViewTemplate> diff --git a/others/db_changes/data/example_address/1535612802325_addresses.xml b/others/db_changes/data/example_address/1535612802325_addresses.xml index 579a1e18603f4e4256025ca6e88f209f7ffc5219..711d28a71b8874d90a9178a370064f09e9e9c2f9 100644 --- a/others/db_changes/data/example_address/1535612802325_addresses.xml +++ b/others/db_changes/data/example_address/1535612802325_addresses.xml @@ -1,6 +1,6 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <changeSet author="j.goderbauer" id="b8adb18b-ecc9-439b-a0bd-df86e63a413f"> + <changeSet author="j.goderbauer" id="b77db18b-ecc9-439b-a0bd-df86e63a413f"> <insert tableName="ADDRESS"> <column name="ADDRESSID" value="97d37aea-d7f8-4436-bb31-875439f5f7f1"/> <column name="USER_NEW" value="Raphael"/> @@ -8,11 +8,11 @@ <column name="RELATION_ID" value="bdb6e38a-b227-455b-ae48-f8febd622e03"/> <column name="ADDR_TYPE" valueNumeric="1"/> - <column name="ADDRESS" value="Lille Øvregaten"/> + <column name="ADDRESS" value="Musterstraße"/> <column name="BUILDINGNO" value="9"/> <column name="ZIP" value="5018"/> <column name="CITY" value="Bergen"/> - <column name="COUNTRY" value="NO"/> + <column name="COUNTRY" value="DE"/> </insert> <rollback> diff --git a/others/db_changes/data/example_org/ORG_gfk.xml b/others/db_changes/data/example_org/ORG_gfk.xml index 98d08db9ac7e8273ee2533bd1166c6f4d800338c..b1d396a2c7f60845ca1f3d443d23cd8c4ef239b1 100644 --- a/others/db_changes/data/example_org/ORG_gfk.xml +++ b/others/db_changes/data/example_org/ORG_gfk.xml @@ -19,6 +19,7 @@ <column name="ORG_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/> <column name="LANGUAGE" value="de-DE"/> <column name="STATUS" valueNumeric="1"/> + <column name="ADDRESS_ID" value="14d03432-985b-4efe-a634-da71ae482907"/> </insert> <insert tableName="COMM"> <column name="DATE_NEW" valueDate="2018-07-02T00:00:00"/> diff --git a/others/db_changes/masterChangelog.xml b/others/db_changes/masterChangelog.xml index 17b5f69cde54cd0f58bef8287a3ef840a47ab378..4059bb9fac56b9366d8df6794db77ce4f7f32f7d 100644 --- a/others/db_changes/masterChangelog.xml +++ b/others/db_changes/masterChangelog.xml @@ -25,6 +25,7 @@ <include file="struct/create_salesorderitem.xml"/> <include file="struct/create_countryinfo.xml"/> <include file="struct/create_timetracking.xml"/> + <include file="data/example_address/1535612802325_addresses.xml"/> <include file="data/example_org/ORG_privat.xml"/> <include file="data/example_org/ORG_gfk.xml"/> <include file="data/example_org/ORG_mnf.xml"/> diff --git a/others/db_changes/struct/create_offeritem.xml b/others/db_changes/struct/create_offeritem.xml index 0f62e8ccbc40eff3db151856362a6c0610a4e010..aab0341fb74fa95d36a760f19d9a06afc423f08c 100644 --- a/others/db_changes/struct/create_offeritem.xml +++ b/others/db_changes/struct/create_offeritem.xml @@ -9,7 +9,6 @@ <column name="UNIT" type="INTEGER"/> <column name="QUANTITY" type="NUMERIC(14,2)"/> <column name="GROUPCODEID" type="INTEGER"/> - <column name="DESCRIPTION" type="NCLOB"/> <column name="ASSIGNEDTO" type="CHAR(36)"> <constraints foreignKeyName="FK_OFFERITEM_ASSIGNEDTO" references="OFFERITEM(OFFERITEMID)"/> </column> @@ -25,6 +24,7 @@ </column> <column name="DISCOUNT" type="NUMERIC(14,2)"/> <column name="ITEMPOSITION" type="VARCHAR(30)"/> + <column name="INFO" type="NCLOB"/> <column name="DATE_EDIT" type="TIMESTAMP"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> diff --git a/others/db_changes/struct/create_salesorderitem.xml b/others/db_changes/struct/create_salesorderitem.xml index b622f95a622a14ce4d1eacea4310f5a63486a2aa..d17a3c62d84ca1a5b57b7426c4145cd2bb78c844 100644 --- a/others/db_changes/struct/create_salesorderitem.xml +++ b/others/db_changes/struct/create_salesorderitem.xml @@ -9,7 +9,6 @@ <column name="UNIT" type="INTEGER"/> <column name="QUANTITY" type="NUMERIC(14,2)"/> <column name="GROUPCODEID" type="INTEGER"/> - <column name="DESCRIPTION" type="NCLOB"/> <column name="ASSIGNEDTO" type="CHAR(36)"> <constraints foreignKeyName="FK_SALESORDERITEM_ASSIGNEDTO" references="SALESORDERITEM(SALESORDERITEMID)"/> </column> @@ -25,6 +24,7 @@ </column> <column name="DISCOUNT" type="NUMERIC(14,2)"/> <column name="ITEMPOSITION" type="VARCHAR(30)"/> + <column name="INFO" type="NCLOB"/> <column name="DATE_EDIT" type="TIMESTAMP"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> diff --git a/others/genJsdoc.bat b/others/genJsdoc.bat new file mode 100644 index 0000000000000000000000000000000000000000..db0775bbbb307e47f3b77efabb48da3851945d61 --- /dev/null +++ b/others/genJsdoc.bat @@ -0,0 +1,3 @@ +SET mypath=%~dp0 + +jsdoc -r %mypath:~0,-1%\..\process -d %mypath:~0,-1%\jsdocOut \ No newline at end of file diff --git a/others/guide/CreateJsDoc.adoc b/others/guide/CreateJsDoc.adoc new file mode 100644 index 0000000000000000000000000000000000000000..d428b85c65aabfc70a1247a8a3a2e443811d571d --- /dev/null +++ b/others/guide/CreateJsDoc.adoc @@ -0,0 +1,40 @@ +How to build js-doc out of the lib-comments +=========================================== +:toc2: left +:numbered: + +== installation == +1. Nodejs: +https://nodejs.org/en/ +LTS-version (aktuell 10.15.0) + +download and install + +2. install jsdoc + +open CMD +[source] +---- +npm install -g jsdoc +---- + +== generate jsdoc == + +=== manually === +1. open CMD +2. navigate into the project-folder. e.g. +[source] +---- +C: +cd C:\Users\M.Mustermann\Documents\AditoProjects\xRM-Basic5.1 +---- +3. run command +[source] +---- +jsdoc -r process -d others\jsdocOut +---- +4. Open others\jsdocOut\index.html with a webbrowser + +=== with script in designer (Windows) === +1. In the Designer right click on others\genJsdoc.bat -> "Open in System" +2. Right click on others\jsdocOut\index.html -> "View" \ No newline at end of file diff --git a/others/guide/instanceableLibExample.adoc b/others/guide/instanceableLibExample.adoc index abd31039de66886fd56f31e6fdbb14a0443324b0..66dfc0a312e467be87afcf97921691c4e8f61090 100644 --- a/others/guide/instanceableLibExample.adoc +++ b/others/guide/instanceableLibExample.adoc @@ -1,4 +1,6 @@ = Example for a instanceable Lib = +:toc2: left +:numbered: Remember to always change the comments to fit your class! + Use speaking names for ALL variables, classes and functions! diff --git a/others/guide/staticLibExample.adoc b/others/guide/staticLibExample.adoc index 8616fb76c8d39a9f0ec0e6d7da9ea08741e1e362..d48e2eba91fc0a15fd515826424dbf631ede54e4 100644 --- a/others/guide/staticLibExample.adoc +++ b/others/guide/staticLibExample.adoc @@ -1,4 +1,6 @@ = Example for a static Lib = +:toc2: left +:numbered: Remember to always change the comments to fit your class! + Use speaking names for ALL variables, classes and functions! diff --git a/others/guide/whichDatatype.adoc b/others/guide/whichDatatype.adoc index e20a42e02b95faa44b4e46d3c06672692f2f4ee3..391d8709372ab4cfddd037ec2cfb0a60e244a571 100644 --- a/others/guide/whichDatatype.adoc +++ b/others/guide/whichDatatype.adoc @@ -1,5 +1,7 @@ Overview over datatypes ======================= +:toc2: left +:numbered: This is a simple overview about when to to use which datatype. diff --git a/process/Activity_lib/process.js b/process/Activity_lib/process.js index b95c18ca620f983fd8a88fbe75ebd458c35ee6b0..f5e1edbcb11efe9b7c148136f92bed373123389b 100644 --- a/process/Activity_lib/process.js +++ b/process/Activity_lib/process.js @@ -14,7 +14,7 @@ import("Report_lib"); import("Context_lib"); /** - * Methods used by Offer. + * Methods used by for activities (former history). * Do not create an instance of this! * * @class diff --git a/process/Appointment_lib/process.js b/process/Appointment_lib/process.js index 37a89036a25943006dcd6d9f3878afc8df170f44..6a3ccc33da3cfb2d17000b9b4640eeeb01d4f7db 100644 --- a/process/Appointment_lib/process.js +++ b/process/Appointment_lib/process.js @@ -12,7 +12,7 @@ import("system.text"); function AppointmentUtils() {} /** - * Sets the partstat of the current users as given param state + * Sets the participant stats of the current users as given param state * @param {String} currentUserUri * @param {String} attendees encoded as multistring * @param {String} newState partstat @@ -54,7 +54,7 @@ AppointmentUtils.setPartStat = function (currentUserUri, attendees, newState) { { if (text.decodeMS(attendeesDecodedArray[x])[0] == currentUserUri) { - newAttendees.push(text.encodeMS( updated)) + newAttendees.push(text.encodeMS(updated)) } else { diff --git a/process/Chart_lib/process.js b/process/Chart_lib/process.js index 8cc26ccc21640ff0a219a2d52a40471416695510..f2bcf98574a9038b6c83e6f92aa5265517662659 100644 --- a/process/Chart_lib/process.js +++ b/process/Chart_lib/process.js @@ -1,5 +1,9 @@ import("system.logging"); import("system.util"); + +// TODO lib is not finished yet + + /** * * @class @@ -123,7 +127,7 @@ MultiDataChart.prototype._normalize = function(pDataSource) - + /* @@ -173,4 +177,4 @@ MultiDataChart.prototype._processCumulativeDrilldown = function(pDrilldown) -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/process/Comm_lib/process.js b/process/Comm_lib/process.js index 08093abd9c9252c9fc3521ae8243b18c74f063d9..9028be65ba9d9434890055396d5de07782253478 100644 --- a/process/Comm_lib/process.js +++ b/process/Comm_lib/process.js @@ -8,7 +8,7 @@ import("system.cti"); import("Sql_lib"); /** - * provides static methods for miscellaneous tasks + * provides static methods for Comm * do not create an instance of this * * @class diff --git a/process/Date_lib/process.js b/process/Date_lib/process.js index 8f202fd19a1e93b3f715126127cfe5d31f00dd48..bbfc15c251e6d76b1702f4eb712dc76cc8987d7f 100644 --- a/process/Date_lib/process.js +++ b/process/Date_lib/process.js @@ -56,7 +56,7 @@ DateUtils.getDateIncrementedByYears = function(pDate, pYears) { * * @result {String} translated name */ -DateUtils.getDateIncrementedByYears = function(pDate, pYears) { +DateUtils.getMonthName = function(pMonth) { var monthNames = [ translate.text("January"), translate.text("February"), @@ -73,5 +73,5 @@ DateUtils.getDateIncrementedByYears = function(pDate, pYears) { ]; - return + return monthNames[pMonth]; } \ No newline at end of file diff --git a/process/Document_lib/process.js b/process/Document_lib/process.js index e21cbad9c2284554d2d7f9c5384f2869ea0593f0..d0671dbe907823c08d07258b2bc1a9678adc599b 100644 --- a/process/Document_lib/process.js +++ b/process/Document_lib/process.js @@ -23,7 +23,8 @@ DocumentUtil.downloadSelectedDocuments = function() { var alias = db.getCurrentAlias(); // Download selected files (=not opened) - if(vars.exists("$local.uids") && vars.get("$local.rows") != '') { + if(vars.exists("$local.uids") && vars.exists("$local.rows") + && vars.get("$local.rows") != '') { var rows = JSON.parse(vars.get("$local.rows")); var uids = JSON.parse(vars.get("$local.uids")); var binaryContents = db.getBinaryContents(uids, alias); @@ -37,11 +38,21 @@ DocumentUtil.downloadSelectedDocuments = function() { neon.download(binaryContents[0], rows[0]["NAME"]); } } - // Download open file - else if(vars.exists("$field.UID") && vars.get("$field.UID") != '') { - var id = vars.get("$field.UID"); - var name = vars.get("$field.NAME"); - var binaryContent = db.getBinaryContent(id, alias); + else { + var id; + var name; + + if(vars.exists("$local.uid")) { + // Download single file (=not opened) + id = JSON.parse(vars.get("$local.uid")); + name = vars.get("$local.value"); + } else { + // Download open file + id = vars.get("$field.UID"); + name = vars.get("$field.NAME"); + } + + var binaryContent = db.getBinaryContent(id, alias); if(binaryContent != null && binaryContent != '') neon.download(binaryContent, name); } diff --git a/process/Entity_lib/process.js b/process/Entity_lib/process.js index 591abc0ab9f840b384069c48e90fdf58821764ac..17fac1f11a52cb890368e594610d8b95a1e8bab5 100644 --- a/process/Entity_lib/process.js +++ b/process/Entity_lib/process.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.result"); import("system.neon"); import("system.vars"); @@ -25,14 +24,9 @@ function ProcessHandlingUtils() {} ProcessHandlingUtils.getOnValidationValue = function(fieldValue) { if (fieldValue == undefined) { fieldValue = vars.get("$this.value"); - logging.log("$this.value " + fieldValue) - } - - if (vars.exists("$local.value")) { - logging.log("$local.value " + vars.get("$local.value")) } - return (vars.exists("$local.value") && vars.get("$local.value") != null) ? vars.get("$local.value") : fieldValue; + return (vars.exists("$local.value") && vars.get("$local.value") != null) ? vars.get("$local.value") : fieldValue; } /** @@ -53,19 +47,57 @@ ProcessHandlingUtils.initialParamToResult = function(pParamVarName) } -//TODO: comment +/** + * Workaround for detecting field changes of fields not managed by record containers. + * Should be fixed in the future: Ticket 1030023 + * + * How to use: + * 1. put this into the onValueChange of the field + * FieldChanges.setChange("$field.MY_FIELD"); + * + * 2. you may have to change onValueChangeTypes if it is called too often. + * + * 3. use this in the record container: onDBUpdate / onDBInsert / onDBDelete + * FieldChanges.assimilateChangeAndDispose("$field.MY_FIELD", function(state, value) { + * // check the state like this: + * if (state == FieldChanges.STATE_CHANGED()) + * // do something + * PersUtils.setImage(vars.get("$field.PERSID"), value); + * else + * // do something else + * PersUtils.removeImage(vars.get("$field.PERSID")); + * }); + * + * do not create an instance of this + * + * @class + */ function FieldChanges(){} +/** + * State if nothing changed + */ FieldChanges.STATE_NO_CHANGE = function (){ return "NO_CHANGE" - }; +}; + +/** + * State if field was changed + */ FieldChanges.STATE_CHANGED = function (){ return "CHANGED" - }; +}; + +/** + * State if field was deleted (set to false, null, "" etc.) + */ FieldChanges.STATE_DELETED = function (){ return "DELETED" - }; +}; +/** + * check if the state was changed. Calls the pAssimilatorFn with the parameters state and value + */ FieldChanges.assimilateChangeAndDispose = function (pFieldName, pAssimilatorFn) { var allChanges = FieldChanges._getStorage(); @@ -82,6 +114,9 @@ FieldChanges.assimilateChangeAndDispose = function (pFieldName, pAssimilatorFn) return res; }; +/** + * Call this if the field changed. + */ FieldChanges.setChange = function(pFieldName) { var allChanges = FieldChanges._getStorage(); @@ -97,14 +132,22 @@ FieldChanges.setChange = function(pFieldName) FieldChanges._setStorage(allChanges); }; +/** + * get the changes from a image variable + * @ignore + */ FieldChanges._getStorage = function() { - if (!vars.exists("$image.FieldChanges")) + if (!vars.exists("$context.FieldChanges")) return {}; - return vars.get("$image.FieldChanges"); + return vars.get("$context.FieldChanges"); }; +/** + * save the field changes in a image variable + * @ignore + */ FieldChanges._setStorage = function(pAllChanges) { - return vars.set("$image.FieldChanges", pAllChanges); + return vars.set("$context.FieldChanges", pAllChanges); }; \ No newline at end of file diff --git a/process/Keyword_lib/process.js b/process/Keyword_lib/process.js index e8ba33c9876af40c879affa9f783061de91df315..059b246bec191d3b9571315e9a0bf10942bb02b6 100644 --- a/process/Keyword_lib/process.js +++ b/process/Keyword_lib/process.js @@ -451,6 +451,7 @@ function KeywordUtils(){ return { /** * toArray + * @ignore */ toArray: _toArrayFn ,getPropForKey: _getPropForKeyFn diff --git a/process/Neon_lib/process.js b/process/Neon_lib/process.js index a07ab5e149fecd5637ee78d2ce4dc3dd881d54f3..ad01679e4100203a2b21eed295cc3bb1feddf8a8 100644 --- a/process/Neon_lib/process.js +++ b/process/Neon_lib/process.js @@ -1,3 +1,9 @@ +import("system.vars"); +import("system.datetime"); +import("system.util"); +import("system.db"); +import("system.project"); +import("system.neon"); /** * Class containing utility functions for copying modules * do not create an instance of this diff --git a/process/OfferOrder_lib/process.js b/process/OfferOrder_lib/process.js index a1dde7990a75c953ba34523ac9641752507a8f45..c75347a393fae5e6c04f3ab793c1e33421cae87c 100644 --- a/process/OfferOrder_lib/process.js +++ b/process/OfferOrder_lib/process.js @@ -244,17 +244,21 @@ ItemUtils.prototype.roundPrice = function(price) { /** * Inserts parts list of the passed product into database. * - * @param {String[]} columns req Array of Item DB Columns + * @param {String[]} columns req Array of Item DB Columns * @param {String} productId req UID of root product (selected product) * @param {String} assignedTo opt UID of parent item * @param {String} currency opt currency for price list to use * @param {String} relationId opt relationid for price list to use (custom price list) + * @param {String[][]} additionalProductInfo additional product info, which has to be copied from the product. (e.g. INFO field is only used by offer) + * has to be in the form: [["DESTINATION-DB-FIELD", "PRODUCT-DB-FIELD"], ...] * * @return {String[]} Array of inserted ItemIDs * * @abstract */ -ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, relationId) { +ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, relationId, additionalProductInfo) { + if (additionalProductInfo == undefined) { additionalProductInfo = [] } + var insertedItemIds = []; //save address for this here to call methods in recursive sub function __itemInsertStatement var self = this; @@ -274,6 +278,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c var statements = []; + columns = columns.concat(additionalProductInfo.map(function(item) {return item[0]})); var colTypes = db.getColumnTypes(table, columns); __itemInsertStatement(partsList.root, assignedTo, currency, relationId); @@ -295,8 +300,11 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c var p2pid = partsListObj.ids[i]; var P2pObject = partsList[p2pid]; var prodid = partsList[p2pid].sourceid; - var ProductDetails = ProductUtils.getProductDetails(prodid, { currency: currency, quantity: P2pObject.quantity, relationId: relationId } ) - + var ProductDetails = ProductUtils.getProductDetails( + prodid, + { currency: currency, quantity: P2pObject.quantity, relationId: relationId }, + additionalProductInfo.map(function(item) {return item[1]})); + var price = ""; var vat = ""; if (P2pObject.takeprice && ProductDetails.productId && ProductDetails.PriceListToUse) { @@ -318,7 +326,9 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c , pos , itemsort , datetime.date() - , vars.get("$sys.user")]; + , vars.get("$sys.user")] + // add aditional details + .concat(additionalProductInfo.map(function(item) {return ProductDetails[item[1]]})); statements.push([table, columns, colTypes, vals]); insertedItemIds.push(newid); diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index e2b726be18c0bf434de03f6234bdacba000bb32a..262fa6e2427217803de7cacce851dc2c1ddd44da 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -12,6 +12,7 @@ import("Keyword_lib"); import("Product_lib"); import("Report_lib"); import("OfferOrder_lib"); +import("PostalAddress_lib"); /** * Methods used by Offer. @@ -62,7 +63,7 @@ OfferUtils.isEditable = function(status) { } /** - * Create a new offer + * Create a new offer and open the offer context in NEW-mode */ OfferUtils.createNewOffer = function(pSalesprojectId, pRelationId) { @@ -93,7 +94,7 @@ OfferUtils.openOfferReport = function(pOfferID) // TODO: OFFER.ADDRESS var fields = [/*"OFFER.ADDRESS"*/ "''", "OFFER.RELATION_ID", "OFFER.LANGUAGE", /*"OFFER.PAYMENTTERMS"*/ "'DUMMY_OFFER.PAYMENTTERMS'", //0 - 3 /*"OFFER.DELIVERYTERMS"*/ "'DUMMY_OFFER.DELIVERYTERMS'", "OFFER.OFFERCODE", "OFFER.CURRENCY", "OFFER.OFFERDATE", // 4 - 7 - "OFFER.OFFERID", "OFFERITEM.OFFER_ID", "OFFERITEM.DESCRIPTION", "OFFERITEM.ASSIGNEDTO", // 11 + "OFFER.OFFERID", "OFFERITEM.OFFER_ID", "OFFERITEM.INFO", "OFFERITEM.ASSIGNEDTO", // 11 "OFFERITEM.PRODUCT_ID","OFFERITEM.ITEMNAME" , // 13 "OFFERITEM.OPTIONAL", "OFFERITEM.ITEMPOSITION", // 15 "PRODUCT.PRODUCTCODE", "PRODUCT.PRODUCTID", "OFFER.FOOTER", "OFFER.HEADER", "OFFERITEM.UNIT", "OFFER.VAT", // 21 @@ -183,9 +184,11 @@ OfferUtils.openOfferReport = function(pOfferID) params["Gesamt"] = translate.text("Gesamt", language); params["Summe"] = translate.text("Summe", language); params["zzglUMST"] = translate.text("zzgl. Summe UmSt", language); - params["OFFERAddr"] = rptdata[0][0]; + + // TODO: OFFER.ADDRESS + params["OFFERAddr"] = AddressUtils.getAddress(relid).toString(); //rptdata[0][0]; // TODO: AddrObject implementieren - params["OFFERPers"] = ""; //addrobj.formatAddress("{ls},"); + params["OFFERPers"] = (AddressUtils.getLetterSalutation() + ",").toString(); //addrobj.formatAddress("{ls},"); // TODO: payment / delivery-Terms implement (if needed) params["OFFERPay"] = ""//getKeyName(rptdata[0][3] , "PAYMENTTERMS", "KEYNAME1", language); @@ -219,7 +222,7 @@ OfferUtils.openOfferReport = function(pOfferID) rptdata[i][24], rptdata[i][25], rptdata[i][26], rptdata[i][27], rptdata[i][28], rptdata[i][29]]; } // 0 1 2 3 4 - offerReport.setReportData(ReportData.begin(["OFFER_CURRENCY", "OFFER_OFFERDATE", "OFFER_OFFERID", "OFFERITEM_DESCRIPTION", "OFFERITEM_ASSIGNEDTO", + offerReport.setReportData(ReportData.begin(["OFFER_CURRENCY", "OFFER_OFFERDATE", "OFFER_OFFERID", "OFFERITEM_INFO", "OFFERITEM_ASSIGNEDTO", "OFFERITEM_ITEMNAME" , "OFFERITEM_OPTIONAL", "OFFERITEM_ITEMPOSITION", "PRODUCT_PRODUCTCODE", "OFFER_FOOTER", "OFFER_HEADER", // 10 "OFFERITEM_QUANTITY", "OFFERITEM_PRICE", "OFFERITEM_DISCOUNT", "OFFER_VERSNR", "OFFER_OFFERCODE", "OFFERITEM_VAT", "ITEMSUM", // 17 "OFFERITEM_UNITTEXT"]) // 18 @@ -283,7 +286,7 @@ OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCu , "DATE_NEW" , "USER_NEW"]; - return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId]); + return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId, [["INFO", "INFO"]]]); } OfferItemUtils.prototype.deletePartsList = function(pItemId) { diff --git a/process/PostalAddress_lib/process.js b/process/PostalAddress_lib/process.js index 36923c785f0ddf4129c61e9801e7cd1f72d91cdb..d3e6ed3ff18d3fe08539288c6d64e6b0e80d20ec 100644 --- a/process/PostalAddress_lib/process.js +++ b/process/PostalAddress_lib/process.js @@ -1,8 +1,28 @@ import("system.db"); import("Sql_lib"); +import("Relation_lib"); +/** + * Methods for addresses. + * Todo: evtl. übernahme / anpassung der Adresslib aus altem Basic. 1030856 + * + * Do not create an instance of this! + * + * @class + */ function AddressUtils(){} +/** + * format the Address in one line + * + * @param {String} pCountry + * @param {String} pAddressLine + * @param {String} pBuildingNo + * @param {String} pZipCode + * @param {String} pCity + * + * @return {String} + */ AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZipCode, pCity) { var country = pCountry || ""; @@ -18,25 +38,106 @@ AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZip .join(", "); }; +/** + * Returns the formatted standard address for the relation. + * + * TODO: Dummy method! Ãœbernahme der Adresslib aus altem Basic + * + * @return {String} + */ +AddressUtils.getAddress = function(pRelationId) { + var address = db.array(db.ROW, SqlCondition.begin().andPrepare("RELATION.RELATIONID", pRelationId).buildSelect('select RELATIONID, ADDRESS, BUILDINGNO, ZIP, CITY, "NAME", FIRSTNAME, LASTNAME, TITLE from' + RelationUtils.getFullRelationFromString(), "1=0")); + + // TODO: currently there are some relations without standard address. Use Hardcoded one. + if (!address[1]) { + var dummyAddress = db.array(db.ROW, SqlCondition.begin().andPrepare("ADDRESS.ADDRESSID", '97d37aea-d7f8-4436-bb31-875439f5f7f1').buildSelect('select ADDRESS, BUILDINGNO, ZIP, CITY from ADDRESS', "1=0")); + address[1] = dummyAddress[0]; + address[2] = dummyAddress[1]; + address[3] = dummyAddress[2]; + address[4] = dummyAddress[3]; + + } + var type = RelationUtils.getRelationTypeByRelation(pRelationId); + + var resultAddr = ""; + // 1 if organisation <br> + // 2 if privat person <br> + // 3 if person of an organisation <br>*/ + switch (type) + { + case 1: + resultAddr = address[5] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4]; + break; + case 2: + resultAddr = address[8] + " " + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4]; + break; + case 3: + resultAddr = address[5] + "\n" + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4]; + break; + } + + return resultAddr; +} + +/** + * Returns a letter salutation. + * + * TODO: Dummy method! Ãœbernahme der Adresslib aus altem Basic + * + * @return {String} + */ +AddressUtils.getLetterSalutation = function() { + return "Sehr geehrte Damen und Herren"; +} + +/** + * Methods for validating addresses. + * + * Do not create an instance of this! + * + * @class + */ function AddressValidationUtils(){} +/** + * loads COUNTRYINFO.REQUIRED_FIELDS from db + * + * @param {String} countryCode + * + * @return {String} A string containing all mandatory fieldCodes + * + * @ignore + */ AddressValidationUtils._getRequiredFields = function(countryCode) { if (!countryCode) return ""; - var cond = new SqlCondition(); - cond.andPrepare("COUNTRYINFO.ISO2", countryCode ); - var stmt = cond.buildSelect("select COUNTRYINFO.REQUIRED_FIELDS from COUNTRYINFO"); - var requiredFields = db.cell(stmt); + var requiredFields = db.cell(SqlCondition.begin().andPrepare("COUNTRYINFO.ISO2", countryCode) + .buildSelect("select COUNTRYINFO.REQUIRED_FIELDS from COUNTRYINFO")); return requiredFields; }; +/** + * check if the requested field is a mandatory field + * + * @param {String} countryCode + * @param {String} fieldCode + * + * @return {Boolean} + */ AddressValidationUtils.isMandatoryField = function(countryCode, fieldCode) { var requiredFields = this._getRequiredFields(countryCode); return requiredFields == "" || requiredFields.search(fieldCode) != -1; }; +/** + * load the regexp for zip validation from the database + * + * @param {String} countryCode + * + * @return {String} the regexp + */ AddressValidationUtils._getZipValidationRegEx = function(countryCode) { if (!countryCode) @@ -47,6 +148,14 @@ AddressValidationUtils._getZipValidationRegEx = function(countryCode) return db.cell(stmt); }; +/** + * check if the zip code is valid + * + * @param {String} countryCode + * @param {String} zipCode + * + * return {Boolean} + */ AddressValidationUtils.isValidZip = function(countryCode, zipCode) { if (zipCode == "") diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index 9b1d043f5dd8759d598fb46ed8e5694dd732ec50..6122cd8b2bafdc3cbcf50b05377e89c9ac0b6ebd 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.util"); import("system.SQLTYPES"); import("system.datetime"); @@ -88,6 +87,8 @@ ProductUtils.getStockCount = function(pid) { * * @param {String} pid req ProductID * @param {Object} priceListFilter opt { currency: "currencyValue", quantity: "quantityValue", relationId: "relationIdValue (for custom price lists)" } + * @param {String[]} additionalProductInfoFields additional fields from Product + * They are added to the result with the Fieldname as key. e.g. if the array is ["INFO"] the result will contain the key "INFO" * * @example //Product_entity, Field: PRODUCT_ID, Process: onValueChange * var pid = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.PRODUCT_ID")); @@ -95,7 +96,7 @@ ProductUtils.getStockCount = function(pid) { * var relid = vars.exists("$param.RelationId_param") ? vars.get("$param.RelationId_param") : ""; * var pUtils = new ProductUtils(); * var PriceListFilter = { currency: curr, quantity: vars.get("$field.QUANTITY"), relationId: relid }; - * var ProductDetails = pUtils.getProductDetails(pid, PriceListFilter); + * var ProductDetails = pUtils.getProductDetails(pid, PriceListFilter, ["INFO"]); * * @return {Object} { <br> * productId: "productid" <br> @@ -137,15 +138,20 @@ ProductUtils.getStockCount = function(pid) { * , buySell: "SP" / "PP" <br> * , fromQuantity: "fromquantity" <br> * , currency: "keyvalue of keyword 'CURRENCY'" <br> - * } } <br> + * } }, <br> + * INFO: "the productinfo" * } */ -ProductUtils.getProductDetails = function(pid, priceListFilter) +ProductUtils.getProductDetails = function(pid, priceListFilter, additionalProductInfoFields) { + if (additionalProductInfoFields == undefined) {additionalProductInfoFields = []} var ProductDetails = {}; var cols = []; var colsProduct = ["PRODUCT.PRODUCTID", "PRODUCT.PRODUCTNAME", "PRODUCT.GROUPCODEID", "PRODUCT.UNIT"]; + var defaultProductFieldCount = colsProduct.length; + colsProduct = colsProduct.concat(additionalProductInfoFields.map(function(item) {return "PRODUCT." + item})); + cols = cols.concat(colsProduct); var joins = []; @@ -190,7 +196,7 @@ ProductUtils.getProductDetails = function(pid, priceListFilter) .buildSelect("select " + cols.join(", ") + " from PRODUCT " + joins.join(" "), "1 = 2", "order by " + orderby.join(", ")) -logging.log(ProductDataSql.toSource()) + var ProductData = db.table(ProductDataSql); for (var i = 0; i < ProductData.length; i++) @@ -207,6 +213,14 @@ logging.log(ProductDataSql.toSource()) , CurrentValidPriceLists: {} , PriceListToUse: null }; + + // add additional fields to the details + var countPos = defaultProductFieldCount; + additionalProductInfoFields.forEach(function(productField) + { + this[productField] = ProductData[i][countPos]; + countPos++; + }, ProductDetails); } //Pricelist (all) var colIdx = colsProduct.length; diff --git a/process/Relation_lib/process.js b/process/Relation_lib/process.js index 47de7d6eab942a3c474b2bac75ca53d32a26f0f9..b28903b7dbe11d3f043ca17568be9e20707f37b4 100644 --- a/process/Relation_lib/process.js +++ b/process/Relation_lib/process.js @@ -169,13 +169,13 @@ RelationUtils.getNameByPersOrgWithRelationId = function(pRelationId) */ RelationUtils.getFullRelationFromString = function() { - return "RELATION join ORG on ORG.ORGID = RELATION.ORG_ID" + return " RELATION join ORG on ORG.ORGID = RELATION.ORG_ID" + " left join PERS on PERS.PERSID = RELATION.PERS_ID" + " left join ADDRESS on ADDRESS.ADDRESSID = RELATION.ADDRESS_ID"; } /** - * returns the from string for the relation joined with org, pers, address + * returns the select string for the relation joined with org, pers, address * * @param {String} pIdField field used as id * @@ -186,7 +186,9 @@ RelationUtils.getFullRelationSelectString = function(pIdField) if(pIdField == undefined) pIdField = "RELATIONID"; - return pIdField + "," - + concat( [ concat(["SALUTATION", "TITLE", "FIRSTNAME", "LASTNAME"]) , "ORGNAME"], " - " ) + " as anzeige, " - + "CUSTOMERCODE, ORGNAME, ZIP, CITY, TITLE, FIRSTNAME, LASTNAME, RELTITLE"; + var maskingUtils = new SqlMaskingUtils(); + + return " " + pIdField + "," + + maskingUtils.concat( [ maskingUtils.concat(["SALUTATION", "TITLE", "FIRSTNAME", "LASTNAME"]) , "NAME"], " - " ) + " as anzeige, " + + "CUSTOMERCODE, NAME, ZIP, CITY, TITLE, FIRSTNAME, LASTNAME "; } \ No newline at end of file diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 92f470e057539726b13de29bb84deb2bd063fd14..bd7e326623e92e422f6b6f8dc04171ffc04f53fc 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -423,10 +423,12 @@ SqlCondition.equalsNot = function(pField, pValue, pAlternativeCond, pAlias) { } /** - provides functions for masking sql functions -* -* @param {String} [alias=currentAlias] database alias, you can specify null if you have no alias available and you can manually set the dbType property -*/ + *provides functions for masking sql functions + * + * @param {String} [alias=currentAlias] database alias, you can specify null if you have no alias available and you can manually set the dbType property + * + * @class + */ function SqlMaskingUtils(alias) { this.alias = null; Object.defineProperty(this, "alias", { @@ -1028,7 +1030,7 @@ SqlUtils.getSystemAlias = function() * * @return {String} SQL condition: where VALS in (1,2,3) */ -this.getSqlInStatement = function(pFieldname, pData, pQuoteSymbol) { +SqlUtils.getSqlInStatement = function(pFieldname, pData, pQuoteSymbol) { if (pData.length == 0) return " 1 = 2 "; diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index 11f3366f5d24aaa5042d8ab2a5e1136567e0c4ef..b27d5d9c3c802b1d8449e4b6e2f3e15f6520cdd9 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -406,48 +406,3 @@ NumberSequencingUtils.getMaxUniqueNumber = function(pColumn, pTable, pCondition) var maxNum = db.cell("select max(" + pColumn + ") from " + pTable + condition); return maxNum == "" ? "0" : maxNum; } - -/** - * Class containing miscellaneous utiltiy function extending JDito - * @class - * @deprecated - * @todo: remove - */ -function JDitoUtils() -{ - /** - * Returns a list of aliasNames with a given type - * ignores errors when an alias is not confgiured (empty) - * - * @param {project.DATASOURCE_} pAliasType opt the type of the aliases to load - * - * @return {String[]} Array of aliasNames - */ - this.getAliasListByType = function(pAliasType) - { - pAliasType = pAliasType || project.DATASOURCE_DB; - - var allDbAliases = project.getDataModels(project.DATAMODEL_KIND_ALIAS); - var dbAliases = []; - - for (var i = 0, j = allDbAliases.length; i < j; i++) - { - var aliasName = allDbAliases[i][0]; - var alias = null; - try - { - alias = project.getAliasModel(aliasName); - } - catch(ex) - { - logging.log(translate.withArguments("Der Alias \"%0\" konnte nicht geladen werden. Eventuell wurde er nicht konfiguriert", [aliasName])); - logging.log(ex); - } - - if (alias != null && alias[project.ALIAS_DATASOURCETYPE] == pAliasType) - dbAliases.push(aliasName); - } - - return dbAliases; - } -} diff --git a/report/RPTJ_OFFER/reportData.jrxml b/report/RPTJ_OFFER/reportData.jrxml index 2b578c6935ffb030da751a7c8e6b050aefe0f6d9..89e47eafda47286a7704ab88cde4d276a7cddb24 100644 --- a/report/RPTJ_OFFER/reportData.jrxml +++ b/report/RPTJ_OFFER/reportData.jrxml @@ -41,7 +41,7 @@ <field name="OFFER_CURRENCY" class="java.lang.String"/> <field name="OFFER_OFFERDATE" class="java.lang.String"/> <field name="OFFER_OFFERID" class="java.lang.String"/> - <field name="OFFERITEM_DESCRIPTION" class="java.lang.String"/> + <field name="OFFERITEM_INFO" class="java.lang.String"/> <field name="OFFERITEM_ASSIGNEDTO" class="java.lang.String"/> <field name="OFFERITEM_VAT" class="java.lang.String"/> <field name="OFFERITEM_ITEMNAME" class="java.lang.String"/> @@ -447,7 +447,7 @@ <textElement> <font fontName="Segoe UI" size="8"/> </textElement> - <textFieldExpression><![CDATA[$F{OFFERITEM_DESCRIPTION}]]></textFieldExpression> + <textFieldExpression><![CDATA[$F{OFFERITEM_INFO}]]></textFieldExpression> </textField> </band> </detail>