From fd13123adc55dfc9397336fd37066baf2f129ca1 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 27 Aug 2025 16:40:13 +0200 Subject: [PATCH] =?UTF-8?q?PerspektiveSelbstst=C3=A4ndigesLeben/QueryListR?= =?UTF-8?q?eport=20-=20Erweiterung=20f=C3=BCr=20Tandembetreuung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QueryListReport.cs | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/ReportImp/PerspektiveSelbstständigesLeben/QueryListReport.cs b/ReportImp/PerspektiveSelbstständigesLeben/QueryListReport.cs index 7f10a7dd7..0625b7191 100644 --- a/ReportImp/PerspektiveSelbstständigesLeben/QueryListReport.cs +++ b/ReportImp/PerspektiveSelbstständigesLeben/QueryListReport.cs @@ -39,6 +39,8 @@ namespace PerspektiveSL { VertretungsDetailListeRO ro = new VertretungsDetailListeRO(); ro.Klient = c; + bool tandem = false; + Employee2Customer vertretung = null; sumRo.AnzahlKlienten += 1; var contact = ro.Klient.Person.Contacts.FirstOrDefault(t => t.Type == ContactType.private_MobilePhone); if (contact != null) @@ -57,18 +59,35 @@ namespace PerspektiveSL && ve.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)); if (eghFachkraft != null) { + if (eghFachkraft.ValueList[0].Entry.Value.Contains("Tandem")) + { + tandem = true; + } ro.Employee = eghFachkraft.Employee; if (!empOidDict.ContainsKey(ro.Employee.Oid.Value)) { empOidDict.Add(ro.Employee.Oid.Value, ro.Employee); } } - var vertretung = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 19 - && ve.Entry.Type == ValueListEntryType.StaffRoleType)); - if (vertretung != null) + if (tandem) { - ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName; - ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value; + vertretung = c.Employee2CustomerList.LastOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.SystemEntryID.HasValue + && ve.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)); + if (vertretung != null) + { + ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName; + ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value; + } + } + else + { + vertretung = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 19 + && ve.Entry.Type == ValueListEntryType.StaffRoleType)); + if (vertretung != null) + { + ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName; + ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value; + } } var vertretung2 = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 1429 && ve.Entry.Type == ValueListEntryType.StaffRoleType)); @@ -85,6 +104,18 @@ namespace PerspektiveSL else { result.DetailList.Add(ro); + if (tandem) + { + VertretungsDetailListeRO ro2 = new VertretungsDetailListeRO(); + ro2.Klient = ro.Klient; + ro2.Employee = vertretung.Employee; + ro2.Telefon = ro.Telefon; + ro2.Stellvertretung1 = ro.Employee.Person.LastNameFirstName; + ro2.Stellvertretung1Oid = ro.Employee.Oid.Value; + ro2.Stellvertretung2 = ro.Stellvertretung2; + ro2.Stellvertretung2Oid = ro.Stellvertretung2Oid; + result.DetailList.Add(ro2); + } } }