SPZRatingen/Calculations/CustomDurationCalculator - Rundung Soziotherapie
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace SpzRatingen
|
||||
{
|
||||
public class CustomDurationCalculator : ServiceRecordDurationCalculator
|
||||
{
|
||||
public override void CalculateRoundedDuration(ServiceRecord sr)
|
||||
{
|
||||
if (sr.CostBearer2SupportConcept != null && sr.ServiceDescription.ServiceCategory != null &&
|
||||
sr.ServiceDescription.ServiceCategory.IsBillable && sr.ServiceDescription.ServiceCategory.Name == "Soziotherapie")
|
||||
{
|
||||
var durationInMinutes = (decimal)sr.End.Value.Subtract(sr.Start.Value).TotalMinutes;
|
||||
|
||||
decimal lRoundedDuration = durationInMinutes;
|
||||
lRoundedDuration = durationInMinutes % 25 != 0
|
||||
? durationInMinutes + (25 - (durationInMinutes % 25))
|
||||
: durationInMinutes;
|
||||
|
||||
sr.RoundedDuration = (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.CalculateRoundedDuration(sr);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CalculateRoundedDuration(ServiceRecordDC sr)
|
||||
{
|
||||
if (sr.ServiceDescription.Category != null && sr.ServiceDescription.Category.IsBillable && sr.ServiceDescription.Category.Name == "Soziotherapie")
|
||||
{
|
||||
var durationInMinutes = (decimal)sr.End.Value.Subtract(sr.Start.Value).TotalMinutes;
|
||||
|
||||
decimal lRoundedDuration = durationInMinutes;
|
||||
lRoundedDuration = durationInMinutes % 25 != 0
|
||||
? durationInMinutes + (25 - (durationInMinutes % 25))
|
||||
: durationInMinutes;
|
||||
|
||||
sr.RoundedDuration = (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.CalculateRoundedDuration(sr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calculations\CustomDurationCalculator.cs" />
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="InvoiceCustomerReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
|
||||
Reference in New Issue
Block a user