diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index 686d8185ca5631b2840fd118f4f98eb97201c4f3..8c6928fa285ae44b140f3b72d33ae808414d434e 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -67,10 +67,14 @@ <entityField> <name>DISTRICT</name> <title>District</title> + <dropDownProcess>%aditoprj%/entity/Address_entity/entityfields/district/dropDownProcess.js</dropDownProcess> + <textInputAllowed v="true" /> </entityField> <entityField> <name>REGION</name> <title>Region</title> + <dropDownProcess>%aditoprj%/entity/Address_entity/entityfields/region/dropDownProcess.js</dropDownProcess> + <textInputAllowed v="true" /> <state>INVISIBLE</state> <stateProcess>%aditoprj%/entity/Address_entity/entityfields/region/stateProcess.js</stateProcess> </entityField> diff --git a/entity/Address_entity/entityfields/district/dropDownProcess.js b/entity/Address_entity/entityfields/district/dropDownProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c7e3f04405984fa07f727cf4fe232f5e5ff18f51 --- /dev/null +++ b/entity/Address_entity/entityfields/district/dropDownProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +result.object( + newSelect("distinct DISTRICT, DISTRICT") + .where("ADDRESS.DISTRICT is not null") + .from("ADDRESS").table() +); diff --git a/entity/Address_entity/entityfields/region/dropDownProcess.js b/entity/Address_entity/entityfields/region/dropDownProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1627eb6de24739eb56fa8f7ec5fc0a4f205cd1c1 --- /dev/null +++ b/entity/Address_entity/entityfields/region/dropDownProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +result.object( + newSelect("distinct REGION, REGION") + .where("ADDRESS.REGION is not null") + .from("ADDRESS").table() +); diff --git a/entity/Turnover_entity/Turnover_entity.aod b/entity/Turnover_entity/Turnover_entity.aod index 2cd511e1128dee22ee5fd0a3ce3f2bd903876012..15f90bdf6838e017035f25a5481e72c296f3d28f 100644 --- a/entity/Turnover_entity/Turnover_entity.aod +++ b/entity/Turnover_entity/Turnover_entity.aod @@ -334,6 +334,7 @@ <name>OrgDistrict_filter</name> <title>Organisation District</title> <contentType>TEXT</contentType> + <filterValuesProcess>%aditoprj%/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgdistrict_filter/filterValuesProcess.js</filterValuesProcess> <filtertype>BASIC</filtertype> </filterExtension> <filterExtension> @@ -358,6 +359,7 @@ <name>OrgRegion_filter</name> <title>Organisation Region</title> <contentType>TEXT</contentType> + <filterValuesProcess>%aditoprj%/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgregion_filter/filterValuesProcess.js</filterValuesProcess> <filtertype>BASIC</filtertype> </filterExtension> <filterExtension> @@ -394,6 +396,19 @@ <filterValuesProcess>%aditoprj%/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/salesproject_filter/filterValuesProcess.js</filterValuesProcess> <filtertype>BASIC</filtertype> </filterExtension> + <filterExtension> + <name>DistrictName_filter</name> + <title>District: Name</title> + <contentType>TEXT</contentType> + <filterValuesProcess>%aditoprj%/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/districtname_filter/filterValuesProcess.js</filterValuesProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>DistrictDistrictnumber_filter</name> + <title>District: Number</title> + <contentType>NUMBER</contentType> + <filtertype>BASIC</filtertype> + </filterExtension> </filterExtensions> </jDitoRecordContainer> </recordContainers> diff --git a/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/districtname_filter/filterValuesProcess.js b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/districtname_filter/filterValuesProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3195439a60db8e1b3e8dfed5695cd363637468e5 --- /dev/null +++ b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/districtname_filter/filterValuesProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("Sql_lib"); + +result.object( + newSelect(["DISTRICT_NAME", "DISTRICT_NAME"]) + .from("DISTRICT").table() +); diff --git a/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgdistrict_filter/filterValuesProcess.js b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgdistrict_filter/filterValuesProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c7e3f04405984fa07f727cf4fe232f5e5ff18f51 --- /dev/null +++ b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgdistrict_filter/filterValuesProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +result.object( + newSelect("distinct DISTRICT, DISTRICT") + .where("ADDRESS.DISTRICT is not null") + .from("ADDRESS").table() +); diff --git a/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgregion_filter/filterValuesProcess.js b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgregion_filter/filterValuesProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1627eb6de24739eb56fa8f7ec5fc0a4f205cd1c1 --- /dev/null +++ b/entity/Turnover_entity/recordcontainers/jditodynamicmultidatachart/filterextensions/orgregion_filter/filterValuesProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +result.object( + newSelect("distinct REGION, REGION") + .where("ADDRESS.REGION is not null") + .from("ADDRESS").table() +); diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index a33b7f4b477c68a7b44479641dfe1b4488f1312c..850599eff300102cbfb7864ed319bab56bde134e 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -11348,6 +11348,14 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Global Cases </key> </entry> + <entry> + <key>District: Name</key> + <value>Gebiet: Name</value> + </entry> + <entry> + <key>District: Number</key> + <value>Gebiet: Nummer</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/process/Turnover_lib/process.js b/process/Turnover_lib/process.js index 3193c9e50383991bc57913d6d2d7467179e3a7fe..cdce5cdbe55f3923c72b41938c758d90a6b7dc32 100644 --- a/process/Turnover_lib/process.js +++ b/process/Turnover_lib/process.js @@ -459,6 +459,32 @@ TurnoverDynamicChart.getFilterMapping = function (pKind) } }; + for(var key in filterMapping) + { + filterMapping[key]["#EXTENSION.DistrictName_filter.DistrictName_filter#TEXT"] + = function (pValue, pOperator) { + var districtFilter = newSelect("DISTRICT_FILTER").from("DISTRICT") + .where("DISTRICT.DISTRICT_NAME", pValue).cell(); + if(!districtFilter) + { + return "0=1"; + } + var filterJson = JSON.stringify(JSON.parse(districtFilter).filter); + return db.toFilterCondition(filterJson, "Organisation_entity"); + }; + filterMapping[key]["#EXTENSION.DistrictDistrictnumber_filter.DistrictDistrictnumber_filter#NUMBER"] + = function (pValue, pOperator) { + var districtFilter = newSelect("DISTRICT_FILTER").from("DISTRICT") + .where("DISTRICT.DISTRICT_NUMBER", pValue).cell(); + if(!districtFilter) + { + return "0=1"; + } + var filterJson = JSON.stringify(JSON.parse(districtFilter).filter); + return db.toFilterCondition(filterJson, "Organisation_entity"); + }; + } + filterMapping = TurnoverDynamicChart.addOrganisationFiltersToFilterMapping(filterMapping); filterMapping = TurnoverDynamicChart.addClassificationGroupFilterToFilterMapping(filterMapping); filterMapping = TurnoverDynamicChart.addClassificationTypeFilterToFilterMapping(filterMapping);