46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Service.Core;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using Utils = BS.Shared.Core.Utils;
|
|
|
|
namespace CaritasAhlen.Service
|
|
{
|
|
public class CustomVacationService : VacationService
|
|
{
|
|
public override List<FeiertagDC> GetFeiertage(int year, String bundesland)
|
|
{
|
|
List<FeiertagDC> list = base.GetFeiertage(year, bundesland);
|
|
if (year > 2024)
|
|
{
|
|
list.Add(new FeiertagDC { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
|
|
}
|
|
if (year == 2024 || year == 2025)
|
|
{
|
|
DateTime osterSonntag = GetOsterSonntag(year);
|
|
list.Add(new FeiertagDC { Datum = osterSonntag.AddDays(-48), Name = "Rosenmontag - Halber Tag" });
|
|
}
|
|
|
|
return list;
|
|
}
|
|
|
|
public override decimal GetFeiertagsFaktor(DateTime start)
|
|
{
|
|
//CB 26.02.2024: Darf nicht über den VacationService gehen, sonst werden die im CustomMitarbeiterstundenkontoBerechnung hinterlegten Feiertage ignoriert
|
|
//return vacationService.GetFeiertagsFaktor(start);
|
|
if (start.Year== 2024 || start.Year == 2025)
|
|
{
|
|
DateTime osterSonntag = GetOsterSonntag(start.Year);
|
|
if (start.Date == osterSonntag.AddDays(-48).Date)
|
|
{
|
|
return 0.5m;
|
|
}
|
|
}
|
|
|
|
return base.GetFeiertagsFaktor(start);
|
|
}
|
|
}
|
|
}
|