MH: Arche Tecklenburg Rundung in ZE für LWL Inklusionsamt
SupportOID=167253
This commit is contained in:
@@ -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>
|
||||
|
||||
32
ReportImp/ArcheTecklenburg/Service/CustomSaveInterceptor.cs
Normal file
32
ReportImp/ArcheTecklenburg/Service/CustomSaveInterceptor.cs
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user