Humanitas: Heiligabend und Silvester (ab 2025) als volle Arbeitstage behandeln (in Mitarbeiterstundenkonto + Urlaubskonto)
This commit is contained in:
@@ -1,44 +1,18 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Report.ReportObjects;
|
||||
|
||||
|
||||
namespace Humanitas
|
||||
{
|
||||
public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung
|
||||
{
|
||||
public override decimal GetFeiertagsFaktor(DateTime start)
|
||||
{
|
||||
var list = GetFeiertage(start.Year);
|
||||
var osterSonntag = GetOsterSonntag(start.Year);
|
||||
if (start.Date == osterSonntag.AddDays(-52))
|
||||
{
|
||||
// Weiberfastnacht und Rosenmontag halbe Arbeitstage
|
||||
var osterSonntag = GetOsterSonntag(start.Year);
|
||||
if (start.Date == osterSonntag.AddDays(-52) || start.Date == osterSonntag.AddDays(-48))
|
||||
return 0.5m;
|
||||
}
|
||||
if (start.Date == osterSonntag.AddDays(-48))
|
||||
{
|
||||
return 0.5m;
|
||||
}
|
||||
return base.GetFeiertagsFaktor(start);
|
||||
}
|
||||
|
||||
public override List<DateTime> GetFeiertage(int year)
|
||||
{
|
||||
var list = base.GetFeiertage(year);
|
||||
|
||||
if (year <= 2024)
|
||||
{
|
||||
list.Add(new DateTime(year, 12, 31));
|
||||
}
|
||||
|
||||
var osterSonntag = GetOsterSonntag(year);
|
||||
list.Add(osterSonntag.AddDays(-48)); // "Rosenmontag"
|
||||
|
||||
list.Add(osterSonntag.AddDays(-52)); // "Weiberfastnacht"
|
||||
|
||||
return list;
|
||||
return base.GetFeiertagsFaktor(start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
<Compile Include="ServicesOverviewReport.Designer.cs">
|
||||
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\CustomVacationService.cs" />
|
||||
<Compile Include="SettlementReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
42
ReportImp/Humanitas/Service/CustomVacationService.cs
Normal file
42
ReportImp/Humanitas/Service/CustomVacationService.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared.DataContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Humanitas.Service
|
||||
{
|
||||
public class CustomVacationService : VacationService
|
||||
{
|
||||
public override List<FeiertagDC> GetFeiertage(int year, string bundesland)
|
||||
{
|
||||
var feiertage = base.GetFeiertage(year, bundesland);
|
||||
|
||||
if (year >= 2025)
|
||||
{
|
||||
var heiligabend = feiertage.FirstOrDefault(f => f.Name == "Heilig Abend");
|
||||
if (heiligabend != null)
|
||||
feiertage.Remove(heiligabend);
|
||||
}
|
||||
|
||||
if (year <= 2024)
|
||||
feiertage.Add(new FeiertagDC { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
|
||||
|
||||
return feiertage;
|
||||
}
|
||||
|
||||
public override decimal GetFeiertagsFaktor(DateTime start)
|
||||
{
|
||||
if (start.Year > 2025)
|
||||
{
|
||||
DateTime osterSonntag = GetOsterSonntag(start.Year);
|
||||
if (start.Date == osterSonntag.AddDays(-52).Date || start.Date == osterSonntag.AddDays(-48).Date)
|
||||
{
|
||||
return 0.5m;
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetFeiertagsFaktor(start);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user