52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Service.Dienstplanung;
|
|
|
|
|
|
namespace BeWoHeinsberg
|
|
{
|
|
public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung
|
|
{
|
|
|
|
public override void HandleServiceRecord(MitarbeiterstundenkontoRO.EmployeeDetail emp, StundenkontoServiceRecord item)
|
|
{
|
|
if (item.ServiceDescription != null)
|
|
{
|
|
decimal duration = 0;
|
|
if (item.GroupRoundedDuration.HasValue)
|
|
{
|
|
duration = item.GroupRoundedDuration.Value;
|
|
}
|
|
else
|
|
{
|
|
duration = item.RoundedDuration;
|
|
}
|
|
|
|
var cat = item.ServiceDescription.Category.Name.ToLower();
|
|
|
|
if (cat.Contains("mittelbar"))
|
|
{
|
|
emp.Custom2 += duration / 60;
|
|
}
|
|
else if (cat.Contains("indirekt"))
|
|
{
|
|
emp.Custom3 += duration / 60;
|
|
}
|
|
else
|
|
{
|
|
decimal prozent = 100;
|
|
if (item.ServiceDescription.ProzentStundenkonto.HasValue)
|
|
{
|
|
prozent = item.ServiceDescription.ProzentStundenkonto.Value;
|
|
}
|
|
duration *= prozent / 100;
|
|
emp.Custom1 += (duration / 60) ;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|