diff --git a/ReportImp/Club74/Club74.csproj b/ReportImp/Club74/Club74.csproj index 0c57b4e6d..912a84c44 100644 --- a/ReportImp/Club74/Club74.csproj +++ b/ReportImp/Club74/Club74.csproj @@ -88,6 +88,7 @@ Mitarbeiterauslastung.cs + Component diff --git a/ReportImp/Club74/Club74MitarbeiterstundenkontoBerechnung.cs b/ReportImp/Club74/Club74MitarbeiterstundenkontoBerechnung.cs index 80c91f661..22741900d 100644 --- a/ReportImp/Club74/Club74MitarbeiterstundenkontoBerechnung.cs +++ b/ReportImp/Club74/Club74MitarbeiterstundenkontoBerechnung.cs @@ -12,11 +12,13 @@ namespace BeWo.Club74 { public override bool AddServiceRecordToDuration(ServiceRecord item) { - if (item.Start >= new DateTime(2020, 10, 1)) + if (item.Start >= new DateTime(2026, 05, 01)) + return base.AddServiceRecordToDuration(item); + else if (item.Start >= new DateTime(2020, 10, 1)) { if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null) { - + if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit") { return true; @@ -49,34 +51,37 @@ namespace BeWo.Club74 public override void HandleServiceRecord(MitarbeiterstundenkontoRO.EmployeeDetail emp, ServiceRecord item) { - if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null) + if (item.Start >= new DateTime(2026, 05, 01)) + base.HandleServiceRecord(emp, item); + else { - decimal duration = 0; - if (item.GroupRoundedDuration.HasValue) + if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null) { - duration = item.GroupRoundedDuration.Value; - } - else - { - duration = item.RoundedDuration; - } + decimal duration = 0; + if (item.GroupRoundedDuration.HasValue) + { + duration = item.GroupRoundedDuration.Value; + } + else + { + duration = item.RoundedDuration; + } - if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit") - { - emp.Custom3 += duration / 60; + if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit") + { + emp.Custom3 += duration / 60; + } + else if (item.ServiceDescription.ServiceCategory.Name.ToLower().Contains("mittelbar")) + { + emp.Custom2 += duration / 60; + } + else if (item.ServiceDescription.ServiceCategory.Name.ToLower().StartsWith("direkt")) + { + emp.Custom1 += duration / 60; + } } - else if (item.ServiceDescription.ServiceCategory.Name.ToLower().Contains("mittelbar")) - { - emp.Custom2 += duration / 60; - } - else if (item.ServiceDescription.ServiceCategory.Name.ToLower().StartsWith("direkt")) - { - emp.Custom1 += duration / 60; - } - - - } + } public override List GetFeiertage(int year) diff --git a/ReportImp/Club74/Club74ReportCreator.cs b/ReportImp/Club74/Club74ReportCreator.cs index da3ecd729..06a7b1aed 100644 --- a/ReportImp/Club74/Club74ReportCreator.cs +++ b/ReportImp/Club74/Club74ReportCreator.cs @@ -122,6 +122,44 @@ namespace BeWo.Club74 return roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList(); } + public override XtraReport CreateEmployeeHourReport(long? employeeOid, IList teamOids, DateTime startDate, DateTime endDate, int ansicht) + { + IBeWoReport report; + + if (ansicht == 1) + { + report = FindReportImp("Mitarbeiterarbeitszeitkonto"); + } + else if (ansicht == 2) + { + var reportjahr = FindReportImp("MitarbeiterstundenkontoJahr"); + var jahrStart = new DateTime(startDate.Year, 1, 1); + var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null); + + reportjahr.SetReportDataSource(ds); + + return reportjahr as XtraReport; + } + else + { + if (teamOids != null && teamOids.Count > 0) + { + report = FindReportImp("Teamstundenkonto"); + } + else + { + if (startDate >= new DateTime(2026, 05, 01)) + report = new BeWo.Report.DefaultReports.Mitarbeiterstundenkonto(); + else + report = FindReportImp("Mitarbeiterstundenkonto"); + } + } + + var reportObject = MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null); + report.SetReportDataSource(reportObject); + + return report as XtraReport; + } //public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay) //{ diff --git a/ReportImp/Club74/Service/CustomVacationService.cs b/ReportImp/Club74/Service/CustomVacationService.cs new file mode 100644 index 000000000..f959f10d5 --- /dev/null +++ b/ReportImp/Club74/Service/CustomVacationService.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; +using BeWo.Service.Plugins; +using BS.Shared; +using BS.Shared.Core; +using BS.Shared.DataContracts; +using BS.Shared.DataContracts.Compact; +using BS.Shared.Extensions; +using BS.Shared.Services; + +namespace Club74.Service +{ + public class CustomVacationService : VacationService + { + public override List GetFeiertage(int year, string bundesland) + { + var list = base.GetFeiertage(year, bundesland); + + if (year >= 2026) + { + list.Add(new FeiertagDC() { Datum = new DateTime(2026, 12, 24), Name = "Heilig Abend" }); + list.Add(new FeiertagDC() { Datum = new DateTime(2026, 12, 31), Name = "Silvester" }); + } + + return list; + } + } +} \ No newline at end of file