BeWoRichter: Heiligabend und Silvester (ab 2025) als halbe Arbeitstage behandeln

This commit is contained in:
2025-11-06 18:50:40 +01:00
parent eb79d409be
commit 677c9dd8fc
2 changed files with 19 additions and 2 deletions

View File

@@ -92,6 +92,14 @@ namespace BeWoRichter
return sum;
}
public override decimal GetFeiertagsFaktor(DateTime start)
{
if (start.Month == 12 && (start.Day == 24 || start.Day == 31))
return 0.5m;
return base.GetFeiertagsFaktor(start);
}
}
}
}

View File

@@ -2,7 +2,8 @@
using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BeWoRichter.Service
{
public class CustomVacationService : VacationService
@@ -15,6 +16,14 @@ namespace BeWoRichter.Service
DateTime osterSonntag = GetOsterSonntag(year);
feiertage.Add(new FeiertagDC { Datum = osterSonntag.AddDays(-48), Name = "Rosenmontag" });
}
if (year >= 2025)
{
var weihnachten = feiertage.FirstOrDefault(f => f.Name == "Heilig Abend");
if (weihnachten != null)
feiertage.Remove(weihnachten);
}
return feiertage;
}