From bd3afab769efd98ae9f7eaa4fed4a1282efcc1ea Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Tue, 5 Sep 2023 16:14:50 +0200 Subject: [PATCH] MH: Christopherushaus Resturlaub deaktiviert --- .../ChristopherusHaus.csproj | 1 + .../Service/CustomVacationService.cs | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ReportImp/ChristopherusHaus/Service/CustomVacationService.cs diff --git a/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj b/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj index e2764020e..52cea5249 100644 --- a/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj +++ b/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj @@ -90,6 +90,7 @@ ServicesOverviewReport.cs + Component diff --git a/ReportImp/ChristopherusHaus/Service/CustomVacationService.cs b/ReportImp/ChristopherusHaus/Service/CustomVacationService.cs new file mode 100644 index 000000000..2e1624fe7 --- /dev/null +++ b/ReportImp/ChristopherusHaus/Service/CustomVacationService.cs @@ -0,0 +1,29 @@ +using BeWo.Service.Plugins; +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ChristopherusHaus.Service +{ + public class CustomVacationService : VacationService + { + public override DateTime GetExpirationDate(int year) + { + return new DateTime(year, 1, 1, 0, 0, 0); + } + public override List BerechneUrlaubskontoZurDarstellung(EmployeeDC emp, int year) + { + var konto = base.BerechneUrlaubskontoZurDarstellung(emp, year); + for (int i = konto.Count - 1; i >= 0; i--) + { + var zeile = konto[i]; + if (zeile.Erlaeuterung.Contains("Resturlaub aus") || zeile.Erlaeuterung.Contains("verfallen")) + konto.RemoveAt(i); + } + return konto; + } + } +}