diff --git a/ReportImp/TranskulturellesBetreuungsbuero/CustomReportCreator.cs b/ReportImp/TranskulturellesBetreuungsbuero/CustomReportCreator.cs index a9dd8a196..89c86ecfa 100644 --- a/ReportImp/TranskulturellesBetreuungsbuero/CustomReportCreator.cs +++ b/ReportImp/TranskulturellesBetreuungsbuero/CustomReportCreator.cs @@ -4,6 +4,7 @@ using BeWo.Report; using BeWo.Report.ReportObjects; using BS.Shared.Core; using BS.Shared.DataContracts; +using BS.Shared.Extensions; using DevExpress.Emf; using DevExpress.XtraReports.UI; using System; @@ -208,23 +209,34 @@ namespace TranskulturellesBetreuungsbuero { if (emp.Employee2CustomerList != null && emp.Employee2CustomerList.Count > 0) { - var e2c = emp.Employee2CustomerList.FirstOrDefault(e => e.CustomerOid == sr.CustomerOid); - if (e2c != null) + var e2cList = emp.Employee2CustomerList.Where(e => e.CustomerOid == sr.CustomerOid).ToList(); + + if (e2cList != null) { - if (e2c.ValueList != null) + foreach (var e2c in e2cList) { - foreach (var entry in e2c.ValueList) + if (e2c.StartDate.HasValue && e2c.EndDate.HasValue) { - if (entry.Entry.Type == BS.Shared.ValueListEntryType.StaffRoleType) - { - if (entry.Entry.SystemEntryID != null && entry.Entry.SystemEntryID == BS.Shared.SystemEntryID.EmployeeRoleMainAttendant) - detail.CustomValue1 = "X"; - else - detail.CustomValue2 = "X"; + if (!ro.ReportStartDate.Value.InBetween(e2c.StartDate.Value, e2c.EndDate.Value, true) && + !ro.ReportEndDate.Value.InBetween(e2c.StartDate.Value, e2c.EndDate.Value, true)) + continue; + } + if (e2c.ValueList != null) + { + foreach (var entry in e2c.ValueList) + { + if (entry.Entry.Type == BS.Shared.ValueListEntryType.StaffRoleType) + { + if (entry.Entry.SystemEntryID != null && entry.Entry.SystemEntryID == BS.Shared.SystemEntryID.EmployeeRoleMainAttendant) + detail.CustomValue1 = "X"; + else + detail.CustomValue2 = "X"; + } } } - } + } + } }