diff --git a/entity/DistrictResponsible_entity/DistrictResponsible_entity.aod b/entity/DistrictResponsible_entity/DistrictResponsible_entity.aod index 0bc19e1860b19c39da9a5ee87e326ecd9b5d3749..bffe4b62579551292476806217a2fc719a0d038d 100644 --- a/entity/DistrictResponsible_entity/DistrictResponsible_entity.aod +++ b/entity/DistrictResponsible_entity/DistrictResponsible_entity.aod @@ -87,6 +87,7 @@ <name>DistrictResponsibles</name> <lookupIdfield>DISTRICTRESPONSIBLEID</lookupIdfield> <documentation>%aditoprj%/entity/DistrictResponsible_entity/entityfields/districtresponsibles/documentation.adoc</documentation> + <titlePlural>Responsibles</titlePlural> <dependencies> <entityDependency> <name>ef26fdb6-5fcf-416e-bcc8-380b5751b523</name> @@ -151,6 +152,8 @@ </entityField> <entityProvider> <name>OrganisationResponsibles</name> + <targetContextField>targetContext</targetContextField> + <targetIdField>EMPLOYEE_CONTACT_ID</targetIdField> <documentation>%aditoprj%/entity/DistrictResponsible_entity/entityfields/organisationresponsibles/documentation.adoc</documentation> <dependencies> <entityDependency> @@ -188,6 +191,10 @@ <name>PHONE</name> <title>Phone</title> </entityField> + <entityField> + <name>targetContext</name> + <valueProcess>%aditoprj%/entity/DistrictResponsible_entity/entityfields/targetcontext/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/DistrictResponsible_entity/entityfields/targetcontext/valueProcess.js b/entity/DistrictResponsible_entity/entityfields/targetcontext/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8ba819b0b1d3a291ac31d270ec48c009ccf047e0 --- /dev/null +++ b/entity/DistrictResponsible_entity/entityfields/targetcontext/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("Person"); \ No newline at end of file diff --git a/entity/District_entity/District_entity.aod b/entity/District_entity/District_entity.aod index a469cee1fb639cec9b8d3f561baf78477d8a45df..b42efad4e68bafa72d38edb18b943f212ed145da 100644 --- a/entity/District_entity/District_entity.aod +++ b/entity/District_entity/District_entity.aod @@ -94,6 +94,10 @@ <name>ExcludedDistrictIds_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>DistrictsByContactId_param</name> + <mandatory v="true" /> + </entityParameter> </children> </entityProvider> <entityConsumer> @@ -193,6 +197,7 @@ </entityField> <entityParameter> <name>DistrictsByContactId_param</name> + <valueProcess>%aditoprj%/entity/District_entity/entityfields/districtsbycontactid_param/valueProcess.js</valueProcess> <expose v="true" /> </entityParameter> <entityField> diff --git a/entity/District_entity/entityfields/districtsbycontactid_param/valueProcess.js b/entity/District_entity/entityfields/districtsbycontactid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..289f9107d46f3fabb9daf28ea42318b124ba98ea --- /dev/null +++ b/entity/District_entity/entityfields/districtsbycontactid_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("$$$###ignore_param###$$$");//dummy value, for special treatment in the conditionProcess \ No newline at end of file diff --git a/entity/District_entity/entityfields/totalturnover/valueProcess.js b/entity/District_entity/entityfields/totalturnover/valueProcess.js index a73247c1abfa2741041c920fcfbfacf2ee0107c2..40d9732b34a8c3e73b89f860524abb9f55fd77ef 100644 --- a/entity/District_entity/entityfields/totalturnover/valueProcess.js +++ b/entity/District_entity/entityfields/totalturnover/valueProcess.js @@ -22,13 +22,13 @@ if (appliedFilter) .join("ORGANISATION", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") .leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = CONTACT.CONTACTID") - .where("SALESORDER.SALESORDERDATE", DateUtils.getCurrentYear(), SqlBuilder.YEAR_EQUALS(), SQLTYPES.INTEGER) - .and(db.toFilterCondition(appliedFilter, "Organisation_entity")) + .where(db.toFilterCondition(appliedFilter, "Organisation_entity")) + //.and("SALESORDER.SALESORDERDATE", DateUtils.getCurrentYear(), SqlBuilder.YEAR_EQUALS(), SQLTYPES.INTEGER) .cell(); } if (districtTurnover) - text.formatDouble(districtTurnover, "#,##0.00"); + districtTurnover = text.formatDouble(districtTurnover, "#,##0.00", true); else districtTurnover = "0"; diff --git a/entity/District_entity/recordcontainers/db/conditionProcess.js b/entity/District_entity/recordcontainers/db/conditionProcess.js index 550838ae029373b7934da4637623f0dcfc9505c8..8329757ab9cf0a152de9c68fc67fcb16ffcb921e 100644 --- a/entity/District_entity/recordcontainers/db/conditionProcess.js +++ b/entity/District_entity/recordcontainers/db/conditionProcess.js @@ -6,12 +6,23 @@ var onlyResponsibleParam = vars.get("$param.DistrictsByContactId_param"); var cond = newWhere(); if (onlyResponsibleParam) { - var responsibleDistricts = newSelect("DISTRICTRESPONSIBLE.DISTRICT_ID") - .from("DISTRICTRESPONSIBLE") - .where("DISTRICTRESPONSIBLE.EMPLOYEE_CONTACT_ID", onlyResponsibleParam) - .arrayColumn(); - - cond.and("DISTRICT.DISTRICTID", responsibleDistricts, SqlBuilder.IN()); + //dummy value, if the dummy value is here, we can safely ignore that param, otherwise we need to filter the district list + if (onlyResponsibleParam != "$$$###ignore_param###$$$") + { + var responsibleDistricts = newSelect("DISTRICTRESPONSIBLE.DISTRICT_ID") + .from("DISTRICTRESPONSIBLE") + .where("DISTRICTRESPONSIBLE.EMPLOYEE_CONTACT_ID", onlyResponsibleParam) + .arrayColumn(); + + cond.and("DISTRICT.DISTRICTID", responsibleDistricts, SqlBuilder.IN()); + } +} +else +{ + //this will happen if the param was specified but is empty. This happen when you use the consumer "ResponsibleDistricts" because the + //parameter "DistrictsByContactId_param" is mandatory in that case. If the value is empty we must not return any data because we would see all + //districts otherwise + cond.and("1 = 2"); } diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 63484e094c132e5453e3fead8d7c36a0924d48f2..2cc3bad53c18a04bc9c309a28b3e2aa98ad384d7 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1320,8 +1320,8 @@ </dependency> <children> <entityParameter> - <name>OnlyResponsibleDistricts</name> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/districts/children/onlyresponsibledistricts/valueProcess.js</valueProcess> + <name>DistrictsByContactId_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/districts/children/districtsbycontactid_param/valueProcess.js</valueProcess> </entityParameter> </children> </entityConsumer> diff --git a/entity/Person_entity/entityfields/districts/children/onlyresponsibledistricts/valueProcess.js b/entity/Person_entity/entityfields/districts/children/districtsbycontactid_param/valueProcess.js similarity index 78% rename from entity/Person_entity/entityfields/districts/children/onlyresponsibledistricts/valueProcess.js rename to entity/Person_entity/entityfields/districts/children/districtsbycontactid_param/valueProcess.js index e1c2fe5e6971340baf7fc0dcfe3a0f00e5cd0427..e32550b2a4545aad0e9ae8c08bcc5ee36bbda80a 100644 --- a/entity/Person_entity/entityfields/districts/children/onlyresponsibledistricts/valueProcess.js +++ b/entity/Person_entity/entityfields/districts/children/districtsbycontactid_param/valueProcess.js @@ -2,9 +2,8 @@ import("system.vars"); import("system.result"); import("Employee_lib"); - var contactId = vars.get("$field.CONTACTID"); - -if (EmployeeUtils.isUser(contactId)) { +if (EmployeeUtils.isUser(contactId)) +{ result.string(contactId); } \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index c72543f26b8afa78b846380a11f2a329bb9896d3..a819b773060688e04f4d446fffcf227d25ea929f 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -9325,7 +9325,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Responsibles</key> - <value>Gebietsverantwortliche</value> + <value>Verantwortliche</value> </entry> <entry> <key>Districts</key> diff --git a/neonView/DistrictFilter_view/DistrictFilter_view.aod b/neonView/DistrictFilter_view/DistrictFilter_view.aod index 55eac41d3591ccfe862d13dd14d7dba7229bf7e2..0ae033d2346776a6bb816ef83e21f016045031e5 100644 --- a/neonView/DistrictFilter_view/DistrictFilter_view.aod +++ b/neonView/DistrictFilter_view/DistrictFilter_view.aod @@ -20,6 +20,10 @@ <element>DISTRICT_NUMBER</element> </linkedColumns> <columns> + <neonTreeTableColumn> + <name>923c5603-ed8f-4924-8a1d-9f6cc0d170e6</name> + <entityField>#ICON</entityField> + </neonTreeTableColumn> <neonTreeTableColumn> <name>9f8e99dc-cfb3-4038-b949-27571f787db2</name> <entityField>DISTRICT_NAME</entityField> diff --git a/neonView/DistrictList_view/DistrictList_view.aod b/neonView/DistrictList_view/DistrictList_view.aod index 4525f95ab63f63f63563bb6b985716a92d409f55..161c81303a534d682d1517acae5abfef351e9904 100644 --- a/neonView/DistrictList_view/DistrictList_view.aod +++ b/neonView/DistrictList_view/DistrictList_view.aod @@ -13,6 +13,7 @@ <name>treeTableViewTemplate</name> <parentField>PARENTDISTRICT_DISTRICTID</parentField> <hideActions v="true" /> + <showChildrenCount v="false" /> <entityField>#ENTITY</entityField> <linkedColumns /> <defaultGroupFields /> @@ -22,6 +23,10 @@ <isDeletable v="false" /> <isEditable v="false" /> <columns> + <neonTreeTableColumn> + <name>6c3d52d5-8a51-4fd5-9b26-a54485c8f5a6</name> + <entityField>#ICON</entityField> + </neonTreeTableColumn> <neonTreeTableColumn> <name>15a66360-dff7-4d21-b4e1-f48102f0bda1</name> <entityField>DISTRICT_NAME</entityField> diff --git a/neonView/DistrictResponsibleList_view/DistrictResponsibleList_view.aod b/neonView/DistrictResponsibleList_view/DistrictResponsibleList_view.aod index 9a9327680d9ae00bb76c9c916f0eccf2b7b1ca09..2d6c800894abe07282d9c453e96878b9c08f11c4 100644 --- a/neonView/DistrictResponsibleList_view/DistrictResponsibleList_view.aod +++ b/neonView/DistrictResponsibleList_view/DistrictResponsibleList_view.aod @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> <name>DistrictResponsibleList_view</name> - <title>Responsibles</title> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> <noneLayout> diff --git a/neonView/DistrictResponsibleMultiEdit_view/DistrictResponsibleMultiEdit_view.aod b/neonView/DistrictResponsibleMultiEdit_view/DistrictResponsibleMultiEdit_view.aod index 5446115f96b50fc2b2ff9c4600e45c678bac3c68..b03d4f16698d46b9d49d7b844dc0ece1d1f27b2b 100644 --- a/neonView/DistrictResponsibleMultiEdit_view/DistrictResponsibleMultiEdit_view.aod +++ b/neonView/DistrictResponsibleMultiEdit_view/DistrictResponsibleMultiEdit_view.aod @@ -12,7 +12,6 @@ <genericMultipleViewTemplate> <name>genericViewTemplate</name> <entityField>#ENTITY</entityField> - <title>Responsible</title> <columns> <neonGenericMultipleTableColumn> <name>e1988e26-68a4-4a96-a484-4d9f7506505d</name> diff --git a/neonView/DistrictResponsiblePreviewList_view/DistrictResponsiblePreviewList_view.aod b/neonView/DistrictResponsiblePreviewList_view/DistrictResponsiblePreviewList_view.aod index d04097450b6219bbaeadd253491c0c6fb4fcb0d6..7e50b1a7240dcc1ac96b3236f2c5811c2b31a705 100644 --- a/neonView/DistrictResponsiblePreviewList_view/DistrictResponsiblePreviewList_view.aod +++ b/neonView/DistrictResponsiblePreviewList_view/DistrictResponsiblePreviewList_view.aod @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> <name>DistrictResponsiblePreviewList_view</name> - <title>Contactperson</title> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> <noneLayout> diff --git a/neonView/PersonMain_view/PersonMain_view.aod b/neonView/PersonMain_view/PersonMain_view.aod index 1151edfebd004c1cee595613ef88ce19e857afd0..918eaa3936a5af858592aa56b8461d4f9ed0dbfe 100644 --- a/neonView/PersonMain_view/PersonMain_view.aod +++ b/neonView/PersonMain_view/PersonMain_view.aod @@ -49,6 +49,11 @@ <entityField>Documents</entityField> <view>DocumentFilter_view</view> </neonViewReference> + <neonViewReference> + <name>f826f154-bf7f-4c7e-9ce2-3105cc629851</name> + <entityField>#ENTITY</entityField> + <view>PersonDistricts_view</view> + </neonViewReference> <neonViewReference> <name>5754fc3a-c81c-42ba-90ea-2859b10bb391</name> <entityField>LogHistories</entityField> @@ -64,10 +69,5 @@ <entityField>SelfDuplicatesUncached</entityField> <view>PersonFilter_view</view> </neonViewReference> - <neonViewReference> - <name>f826f154-bf7f-4c7e-9ce2-3105cc629851</name> - <entityField>#ENTITY</entityField> - <view>PersonDistricts_view</view> - </neonViewReference> </children> </neonView>