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("AttributeRegistry_basic");
import("Util_lib");
......@@ -63,10 +64,12 @@ VisitPlanningUtils.openRoute = function (pIsDayRoute)
}
var childAddresses = newSelect(["ADDRESS", "BUILDINGNO", "ZIP", "CITY", "COUNTRY"])
.from("ADDRESS")
.leftJoin("VISITPLANENTRY", newWhere("ADDRESS.ADDRESSID", newSelect("ADDRESS_ID")
.from("CONTACT")
.where("CONTACT.CONTACTID = VISITPLANENTRY.ORGANISATION_CONTACT_ID")))
.from("VISITPLANENTRY")
.join("CONTACT", newWhere("VISITPLANENTRY.CONTACT_ID = CONTACT.CONTACTID")
.and("VISITPLANENTRY.ORGANISATION_CONTACT_ID", OrgUtils.getPrivateOrganisationId())
.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)
.orderBy("VISITPLANENTRY.BEGIN_TIME ASC")
.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