MH: Arche Tecklenburg Rundung in ZE für LWL Inklusionsamt

SupportOID=167253
This commit is contained in:
2026-07-07 16:51:24 +02:00
parent 5817b485b0
commit 08252bdd6a
2 changed files with 33 additions and 0 deletions

View File

@@ -107,6 +107,7 @@
<DependentUpon>RosterReport.cs</DependentUpon>
</Compile>
<Compile Include="Service\CustomAccountingService.cs" />
<Compile Include="Service\CustomSaveInterceptor.cs" />
<Compile Include="Teamstundenkonto.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -0,0 +1,32 @@
using BeWo.Data.Entities;
using BeWo.Service.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ArcheTecklenburg.Service
{
public class CustomSaveInterceptor : SaveInterceptor
{
public override void BeforeSaveServiceRecord(ServiceRecord sr)
{
if (sr.CostBearer2SupportConcept != null && sr.CostBearer2SupportConcept.CostBearer.Organisation.Name.Contains("LWL Inklusionsamt"))
{
if (sr.DurationMinutes < 5)
{
sr.RoundedDuration = Convert.ToDecimal(sr.DurationMinutes); // Nicht runden solange nicht >= 5 Min
}
else
{
int rest = Convert.ToInt32(sr.DurationMinutes) % 10;
sr.RoundedDuration = Convert.ToInt32(sr.DurationMinutes) + (10 - rest); // Auf das nächste Vielfache von 10 aufrunden
}
}
}
}
}