Skip to content
Snippets Groups Projects
Commit d4ff9b1c authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch 'sales_1080885_FixVisitPlanPrivatContact' into '2021.2.0'

[Projekt: xRM-Sales][TicketNr.: 1080885][Besuchsplanung - Adresse von...

See merge request xrm/basic!1256
parents d5079a82 1b00b849
No related branches found
No related tags found
No related merge requests found
import("Organisation_lib");
import("system.entities"); import("system.entities");
import("AttributeRegistry_basic"); import("AttributeRegistry_basic");
import("Util_lib"); import("Util_lib");
...@@ -63,10 +64,12 @@ VisitPlanningUtils.openRoute = function (pIsDayRoute) ...@@ -63,10 +64,12 @@ VisitPlanningUtils.openRoute = function (pIsDayRoute)
} }
var childAddresses = newSelect(["ADDRESS", "BUILDINGNO", "ZIP", "CITY", "COUNTRY"]) var childAddresses = newSelect(["ADDRESS", "BUILDINGNO", "ZIP", "CITY", "COUNTRY"])
.from("ADDRESS") .from("VISITPLANENTRY")
.leftJoin("VISITPLANENTRY", newWhere("ADDRESS.ADDRESSID", newSelect("ADDRESS_ID") .join("CONTACT", newWhere("VISITPLANENTRY.CONTACT_ID = CONTACT.CONTACTID")
.from("CONTACT") .and("VISITPLANENTRY.ORGANISATION_CONTACT_ID", OrgUtils.getPrivateOrganisationId())
.where("CONTACT.CONTACTID = VISITPLANENTRY.ORGANISATION_CONTACT_ID"))) .or(newWhere("VISITPLANENTRY.ORGANISATION_CONTACT_ID = CONTACT.CONTACTID")
.and("VISITPLANENTRY.ORGANISATION_CONTACT_ID", OrgUtils.getPrivateOrganisationId(), SqlBuilder.NOT_EQUAL())))
.join("ADDRESS", "CONTACT.ADDRESS_ID = ADDRESS.ADDRESSID")
.where(cond) .where(cond)
.orderBy("VISITPLANENTRY.BEGIN_TIME ASC") .orderBy("VISITPLANENTRY.BEGIN_TIME ASC")
.table(); .table();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment