diff --git a/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml b/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml new file mode 100644 index 0000000000000000000000000000000000000000..0603638910cfef98114adef301c6cffd487b4260 --- /dev/null +++ b/.liquibase/Data_alias/basic/2020.1.2/VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml @@ -0,0 +1,11 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet id="3d7f038c-04f1-45a2-9a1c-73c1a8666fea" author="b.ulrich" > + <renameColumn + columnDataType="CHAR(36)" + newColumnName="ORGANISATION_CONTACT_ID" + oldColumnName="ORGANISATION_ID" + tableName="VISITPLANENTRY"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2020.1.2/changelog.xml b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml index 204b6bbe8b4734d4b5e4a190aca20e9254fbca9d..7696526b5b01d5485e47a5a69bbade95aa0c6317 100644 --- a/.liquibase/Data_alias/basic/2020.1.2/changelog.xml +++ b/.liquibase/Data_alias/basic/2020.1.2/changelog.xml @@ -2,6 +2,7 @@ <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <include file="AlterDatatypeOfKeyColumnsToChar/changelog.xml" relativeToChangelogFile="true"/> + <include file="VisitPlanEntry/rename_VisitPlanEntry_ORGANISATION_ID.xml" relativeToChangelogFile="true"/> <include file="AddNullableToDateNew.xml" relativeToChangelogFile="true" /> <include file="AlterButtonLabelTitles/AlterButtonLabelTitles.xml" relativeToChangelogFile="true" /> </databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml index af7e5d06f6b435f4ed23b000313f51c786bc0dfc..76b2a507a6cc1d7a3a10c71d177fcffa55ad4d8d 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml @@ -15,7 +15,7 @@ <column name="ENTRYDATE" valueDate="2020-05-18"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> + <column name="ORGANISATION_CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> <column name ="CONTACT_ID" value="6c612f91-0160-4f09-9103-dccee7f7a6b7"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -25,7 +25,7 @@ <column name="ENTRYDATE" valueDate="2020-05-19"/> <column name="BEGIN_TIME" value="14:00"/> <column name="END_TIME" value="17:00"/> - <column name="ORGANISATION_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/> + <column name="ORGANISATION_CONTACT_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/> <column name ="CONTACT_ID" value="45635aca-7971-43df-a683-c80c86cb58cc"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -35,7 +35,7 @@ <column name="ENTRYDATE" valueDate="2020-05-19"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/> + <column name="ORGANISATION_CONTACT_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/> <column name ="CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -45,7 +45,7 @@ <column name="ENTRYDATE" valueDate="2020-05-20"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="8707accf-b1fd-4bde-97b1-ab44b75f66f9"/> + <column name="ORGANISATION_CONTACT_ID" value="8707accf-b1fd-4bde-97b1-ab44b75f66f9"/> <column name ="CONTACT_ID" value="79ce56fc-0022-4d5c-91b1-080c0f1e2191"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> @@ -64,7 +64,7 @@ <column name="ENTRYDATE" valueDate="2020-05-25"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> + <column name="ORGANISATION_CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> @@ -73,7 +73,7 @@ <column name="ENTRYDATE" valueDate="2020-05-26"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="fd082db5-be43-4219-a705-588f9c06e59b"/> + <column name="ORGANISATION_CONTACT_ID" value="fd082db5-be43-4219-a705-588f9c06e59b"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> @@ -82,7 +82,7 @@ <column name="ENTRYDATE" valueDate="2020-05-27"/> <column name="BEGIN_TIME" value="10:00"/> <column name="END_TIME" value="11:00"/> - <column name="ORGANISATION_ID" value="a3fd3c23-12e1-4820-b76e-2cd70103d94d"/> + <column name="ORGANISATION_CONTACT_ID" value="a3fd3c23-12e1-4820-b76e-2cd70103d94d"/> <column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/> <column name="STATUS" value="VISITSTATUSPLANNED "/> </insert> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index dbe878d7be0c6e3f4b7dd8c645fcb4547262337b..6e685b98b76ffee42644c33a1e7fe269291ca42a 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -8237,9 +8237,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -8272,9 +8272,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -8382,13 +8382,13 @@ <entityFieldDb> <name>DOCUMENTTEMPLATEID</name> <dbName></dbName> - <primaryKey v="true" /> + <primaryKey v="false" /> <columnType v="1" /> <size v="36" /> <scale v="0" /> - <notNull v="true" /> - <isUnique v="true" /> - <index v="true" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> <documentation></documentation> <title></title> <description></description> @@ -8529,9 +8529,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -8557,9 +8557,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -8647,9 +8647,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -8696,9 +8696,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -8835,9 +8835,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -8954,9 +8954,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -9267,9 +9267,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -9309,9 +9309,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -11573,9 +11573,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -11601,9 +11601,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> @@ -11885,9 +11885,9 @@ <name>DATE_EDIT</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="false" /> <isUnique v="false" /> <index v="false" /> @@ -11920,9 +11920,9 @@ <name>DATE_NEW</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> - <scale v="0" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> <notNull v="true" /> <isUnique v="false" /> <index v="false" /> diff --git a/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js b/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js index 460b39849d5d34bac95e4b987d28a665b732e860..25f85ab3968071cfcfc4df692b11e5b3cc4f168b 100644 --- a/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js +++ b/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js @@ -3,7 +3,7 @@ import("system.db"); import("system.vars"); import("Contact_lib"); -var organisationId = vars.get("$field.ORGANISATION_ID"); -var res = OrganisationUtils.getNameByOrganisationId(organisationId); +var organisationContactId = vars.get("$field.ORGANISATION_CONTACTID"); +var res = OrganisationUtils.getNameByContactId(organisationContactId); result.string(res); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod index 46740270752b5207fb8b62d480d5ebf3c57259e9..1af833e9b8e4f3713455bea35ac9402bc3d1e732 100644 --- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod +++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod @@ -30,14 +30,14 @@ <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js</displayValueProcess> </entityField> <entityField> - <name>ORGANISATION_ID</name> - <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc</documentation> + <name>ORGANISATION_CONTACT_ID</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc</documentation> <title>Organisation</title> <consumer>Organisations</consumer> <mandatory v="true" /> - <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js</stateProcess> - <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>ENTRYDATE</name> @@ -247,10 +247,10 @@ <name>END_TIME.value</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> - <name>ORGANISATION_ID.value</name> + <name>ORGANISATION_CONTACT_ID.value</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> - <name>ORGANISATION_ID.displayValue</name> + <name>ORGANISATION_CONTACT_ID.displayValue</name> </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>CONTACT_ID.value</name> diff --git a/entity/VisitPlanEntry_entity/documentation.adoc b/entity/VisitPlanEntry_entity/documentation.adoc index fe840f04ecae1b740eca60633420ce2d1f362c95..13c58c22da0edc3d1657fcdc58b7043705a181e2 100644 --- a/entity/VisitPlanEntry_entity/documentation.adoc +++ b/entity/VisitPlanEntry_entity/documentation.adoc @@ -2,7 +2,8 @@ For storing Visitentries with their information(date, time, contact, and most importantly: it's Status). Linked to VisitPlanEmployeeWeek_entity so you only see the entries in the chosen week. -ORGANISATION_ID is used to store the company that's being visited, CONTACT_ID to Store the Point-of-Contact, +ORGANISATION_CONTACT_ID is used to store the company that's being visited, +CONTACT_ID to Store the Point-of-Contact, since you are normally visiting one specific person. Keep in mind, that only the organization is important for the visitRecommendations and not the Point of Contact. \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js index 03f6b8014252f4c2405882dda74d4955d797c27f..bf3542dc528bf679b61175ff20d1e2cec67e3e60 100644 --- a/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js @@ -3,7 +3,7 @@ import("system.result"); import("Contact_lib"); import("system.vars"); -var orgId = vars.get("$field.ORGANISATION_ID"); +var orgId = vars.get("$field.ORGANISATION_CONTACT_ID"); var contactId = vars.get("$field.CONTACT_ID"); var orgContactId = ContactUtils.getPersOrgIds(contactId)[2]; diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js index fe203ca7a71f6d00e5a41fc9b1d2447822c43177..0c443c043435687de4551ffd16df721652c159e0 100644 --- a/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js @@ -12,6 +12,6 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.v .from("CONTACT") .where("CONTACT.CONTACTID", contactId) .cell(); - neon.setFieldValue("$field.ORGANISATION_ID", orgId); + neon.setFieldValue("$field.ORGANISATION_CONTACT_ID", orgId); result.string(vars.get("$param.ContactId_param")); } \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js index 0af8e295e63255fb7540147e6904e87cc65eb4fa..5fdb3779fc2b8699a502c17353bbf34ff9a59bb1 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js @@ -17,7 +17,7 @@ var pointOfContact = newSelect("CONTACT.CONTACTID", db.getCurrentAlias()) .leftJoin("AB_ATTRIBUTE", "AB_ATTRIBUTE.AB_ATTRIBUTEID = AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID") .leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") .where("AB_ATTRIBUTE.AB_ATTRIBUTEID", $AttributeRegistry.visitPlanPointOfContact()) - .and("CONTACT.CONTACTID", vars.get("$field.ORGANISATION_ID")) + .and("CONTACT.CONTACTID", vars.get("$field.ORGANISATION_CONTACT_ID")) .cell(); var context; @@ -25,7 +25,7 @@ if(pointOfContact) links.push([ContactUtils.getContextByContactId(pointOfContact), pointOfContact]); else { - var contactId = vars.get("$field.ORGANISATION_ID"); + var contactId = vars.get("$field.ORGANISATION_CONTACT_ID"); context = ContactUtils.getContextByContactId(contactId); if(context == 'Person') { diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js index e9a7e5846d28fb6ffb8fcd6d7878ff3ea199d5f9..12468e7c64aa2eb7b2f20bf1ea259b0843a594ef 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js @@ -40,8 +40,8 @@ var entryDateAsLong = selectionRowData[0].ENTRYDATE; var entryDate = datetime.toDate(entryDateAsLong, "dd-MM-yyyy"); var startTime = selectionRowData[0].BEGIN_TIME; var endTime = selectionRowData[0].END_TIME; -var organisation_id = selectionRowData[0].ORGANISATION_ID; -var organisationName = OrganisationUtils.getNameByOrganisationId(organisation_id); +var organisationContact_id = selectionRowData[0].ORGANISATION_CONTACT_ID; +var organisationName = OrganisationUtils.getNameByContactId(organisationContact_id); var contact_id = selectionRowData[0].CONTACT_ID; var contactName = ContactUtils.getFullTitleByContactId(contact_id); var contactMail = CommUtil.getStandardSubSqlMail(contact_id) @@ -53,9 +53,9 @@ var department = contactData[0]; var contactRole = contactData[1]; var addressId = newSelect("CONTACT.ADDRESS_ID") .from("CONTACT") - .where("CONTACT.CONTACTID", organisation_id) + .where("CONTACT.CONTACTID", organisationContact_id) .cell(); -var organisationAddress = new AddrObject(organisation_id); +var organisationAddress = new AddrObject(organisationContact_id); var organisationAddressFormatted = organisationAddress.getFormattedAddress(false, "{salutation_name}\n {street} {buildingno}\n {country_short} - {zip} {city}"); var contactCommunication = newSelect("COMMUNICATION.MEDIUM_ID, COMMUNICATION.ADDR") .from("COMMUNICATION") @@ -105,7 +105,7 @@ columnTypes = db.getColumnTypes("AB_APPOINTMENTLINK", columns, db.getCurrentAlia values = [util.getNewUUID(), uidAppointment[0], "Organisation", - organisation_id] + organisationContact_id] insert = db.insertData("AB_APPOINTMENTLINK", columns, columnTypes, values) values = [util.getNewUUID(), diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js index b926fc89ff6515951fc64f5cec927a60f8434174..dc5b0f07067f9de2b8ea08deebdb04d1940ce157 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js @@ -59,7 +59,7 @@ if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) var childAddresses = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") .from("ADDRESS") .leftJoin("VISITPLANENTRY", "ADDRESS.ADDRESSID = (select ADDRESS_ID from CONTACT where CONTACT.CONTACTID \n\ - = VISITPLANENTRY.ORGANISATION_ID)") + = VISITPLANENTRY.ORGANISATION_CONTACT_ID)") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", entryid) .and("VISITPLANENTRY.ENTRYDATE", entrydateDB) .table(); diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js similarity index 74% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js index 4a069cec9dd05ddca04014ff4a5a534e07aff0fc..a5833c922a458e88908fd9b6a1f529d12ed6f498 100644 --- a/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/displayValueProcess.js @@ -3,7 +3,7 @@ import("system.db"); import("system.vars"); import("Contact_lib"); -var contactid = vars.get("$field.ORGANISATION_ID"); +var contactid = vars.get("$field.ORGANISATION_CONTACT_ID"); var res = ContactUtils.getFullTitleByContactId(contactid); result.string(res); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/documentation.adoc diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/stateProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js rename to entity/VisitPlanEntry_entity/entityfields/organisation_contact_id/valueProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js index ec94b86401b566ada90ac2bd3f2d2c43bf78c950..e6afefc86171adad8a87dcf4e7570253fa9faa66 100644 --- a/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js @@ -4,6 +4,6 @@ import("Sql_lib"); var contactIdArray = newSelect("CONTACT.CONTACTID") .from("CONTACT") - .where("CONTACT.ORGANISATION_ID", vars.get("$field.ORGANISATION_ID"), SqlBuilder.NOT_EQUAL()) + .where("CONTACT.ORGANISATION_ID", vars.get("$field.ORGANISATION_CONTACT_ID"), SqlBuilder.NOT_EQUAL()) .arrayColumn() result.object(contactIdArray) \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js index 9711f6208cf7dff928ac21b7b0a8cfc89f4b57e1..ce8bb62314fa0a0ae0023f81b31d95a3871bd812 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js @@ -16,7 +16,7 @@ var items = []; var group = []; var entryData = ""; -var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_ID, CONTACT_ID,STATUS, VISITPLANEMPLOYEEWEEK_ID, APPOINTMENT_ID") +var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_CONTACT_ID, CONTACT_ID,STATUS, VISITPLANEMPLOYEEWEEK_ID, APPOINTMENT_ID") .from("VISITPLANENTRY"); if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) @@ -46,11 +46,11 @@ if(entryData.length > 0) { for(var i = 0; i < entryData.length; i++) { - var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid; - [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid] = entryData[i] + var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisationContact_id, contact_id, status, visitplanemployeeweek_id, appointmentid; + [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisationContact_id, contact_id, status, visitplanemployeeweek_id, appointmentid] = entryData[i] var contactname = db.cell(PersUtils.getResolvingDisplaySubSql("'" + contact_id + "'")); - var orgname = OrganisationUtils.getNameByOrganisationId(organisation_id); + var orgname = OrganisationUtils.getNameByContactId(organisationContact_id); var parentName = translate.text(datetime.toDate(entryDateRaw, "EEEE")); entryDate = datetime.toDate(entryDateRaw, "dd.MM.yyyy"); @@ -58,7 +58,7 @@ if(entryData.length > 0) var alias = SqlUtils.getSystemAlias(); items.push([visitPlanEntryId, false, parentName + "#" + entryDate, "", beginn_time - , end_time, organisation_id, orgname, contact_id, contactname, entryDateRaw, status, visitplanemployeeweek_id, appointmentid, statusDisplay]); + , end_time, organisationContact_id, orgname, contact_id, contactname, entryDateRaw, status, visitplanemployeeweek_id, appointmentid, statusDisplay]); if(!vars.get("$local.idvalues")) { diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js index c0f1048f2920e1035145fc0c8ac1dfb49f915cc3..16ad70016e8c50f71299875fd494e3da997b71ec 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js @@ -58,7 +58,7 @@ var valuesEntry = [ rowData["ENTRYDATE.value"], rowData["BEGIN_TIME.value"], rowData["END_TIME.value"], - rowData["ORGANISATION_ID.value"], + rowData["ORGANISATION_CONTACT_ID.value"], rowData["CONTACT_ID.value"], visitPlanEmployeeWeekID, rowData["STATUS.value"] @@ -69,7 +69,7 @@ var columnsEntry = [ "ENTRYDATE", "BEGIN_TIME", "END_TIME", - "ORGANISATION_ID", + "ORGANISATION_CONTACT_ID", "CONTACT_ID", "VISITPLANEMPLOYEEWEEK_ID", "STATUS" diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js index 412b3644103fb32f8c640a802d03e2c8ef5782da..fd92c0fd0b725e26423a818adff2f2e87f7e66ad 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js @@ -10,7 +10,7 @@ var values = [ rowData["ENTRYDATE.value"], rowData["BEGIN_TIME.value"], rowData["END_TIME.value"], - rowData["ORGANISATION_ID.value"], + rowData["ORGANISATION_CONTACT_ID.value"], rowData["STATUS"] ]; @@ -18,7 +18,7 @@ var columns = [ "ENTRYDATE", "BEGIN_TIME", "END_TIME", - "ORGANISATION_ID", + "ORGANISATION_CONTACT_ID", "STATUS" ]; diff --git a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js index 26a88f95717ce53ce1723ca71443089d0e3a1540..4ec4a7d08e7f192053d1446f0a3ed507f8bde9ae 100644 --- a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js @@ -47,12 +47,12 @@ if(idValues == false) "visitPlanFrequency.ID_VALUE", "'VISITFREQUENCY '", activitySubQuery, "CONTACTID", newSelect("min(ENTRYDATE)") .from("VISITPLANENTRY") - .where("CONTACT.CONTACTID", "VISITPLANENTRY.ORGANISATION_ID") + .where("CONTACT.CONTACTID", "VISITPLANENTRY.ORGANISATION_CONTACT_ID") .and(newWhere("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged())) .and("VISITPLANENTRY.ENTRYDATE", newSelect("min(vp.ENTRYDATE)") .from("VISITPLANENTRY", "vp") - .where(["VISITPLANENTRY", "ORGANISATION_ID", "vp"], "visitplanentry.ORGANISATION_ID") + .where(["VISITPLANENTRY", "ORGANISATION_CONTACT_ID", "vp"], "visitplanentry.ORGANISATION_CONTACT_ID") .and(["VISITPLANENTRY", "ENTRYDATE", "vp"], datetime.today()) .and(newWhere(["VISITPLANENTRY", "STATUS", "vp"], $KeywordRegistry.visitPlanEntryStatus$planned()) @@ -80,7 +80,7 @@ var recommendationSQLData = newSelect(["VISITRECOMMENDATIONID", "VISITRECOMMENDA newSelect("min(ENTRYDATE)") .from("VISITPLANENTRY") - .where("VISITPLANENTRY.ORGANISATION_ID", "VISITRECOMMENDATION.CONTACT_ID") + .where("VISITPLANENTRY.ORGANISATION_CONTACT_ID = VISITRECOMMENDATION.CONTACT_ID") .and("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()) .and("VISITPLANENTRY.entrydate", datetime.today(), SqlBuilder.GREATER()) @@ -89,7 +89,7 @@ var recommendationSQLData = newSelect(["VISITRECOMMENDATIONID", "VISITRECOMMENDA newSelect("VISITRECOMMENDATION.CONTACT_ID") .from("VISITPLANEMPLOYEEWEEK, VISITPLANENTRY") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", "VISITPLANEMPLOYEEWEEKID") - .and("VISITRECOMMENDATION.CONTACT_ID", "VISITPLANENTRY.ORGANISATION_ID") + .and("VISITRECOMMENDATION.CONTACT_ID = VISITPLANENTRY.ORGANISATION_CONTACT_ID") .and(newWhere("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) .or("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged())) .and("VISITPLANENTRY.entrydate", newSelect("min(vp.entrydate)")