MH: Kollegium halbe Urlaubstage raus

This commit is contained in:
2023-12-28 10:04:59 +01:00
parent 04ccc91309
commit 6fd9654740
3 changed files with 41 additions and 0 deletions

View File

@@ -116,6 +116,7 @@
<Compile Include="RechnungAssistenzstunden.Designer.cs">
<DependentUpon>RechnungAssistenzstunden.cs</DependentUpon>
</Compile>
<Compile Include="Service\CustomVacationService.cs" />
<Compile Include="SettlementReport2.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -0,0 +1,33 @@
using BeWo.Service.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KollegiumEv.Service
{
public class CustomVacationService: VacationService
{
public override decimal UrlaubstageRunden(decimal urlaubstage)
{
if (urlaubstage - (int)urlaubstage <= 0.1m)
{
urlaubstage = Math.Round(urlaubstage, MidpointRounding.AwayFromZero);
}
else if (urlaubstage - (int)urlaubstage <= 0.5m)
{
decimal digits = urlaubstage - (int)urlaubstage;
// aufrunden auf halbe Tage rausgenommen
urlaubstage = urlaubstage - digits;
}
else if (urlaubstage - (int)urlaubstage <= 1.0m)
{
urlaubstage = Math.Ceiling(urlaubstage);
}
return urlaubstage;
}
}
}

View File

@@ -1012,6 +1012,13 @@ namespace BeWo.Service.Plugins
}
// Runden
urlaubstage = UrlaubstageRunden(urlaubstage);
return urlaubstage;
}
public virtual decimal UrlaubstageRunden(decimal urlaubstage)
{
if (urlaubstage - (int)urlaubstage <= 0.1m)
{
urlaubstage = Math.Round(urlaubstage, MidpointRounding.AwayFromZero);