BeWoAmrath/CustomMitarbeiterstundenkontoBerechnung.cs
This commit is contained in:
@@ -9,8 +9,8 @@ using BeWo.Service.ServiceImplementations;
|
||||
|
||||
namespace BeWo.BeWoAmrath
|
||||
{
|
||||
public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung
|
||||
{
|
||||
public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung
|
||||
{
|
||||
public override void CreateEmployeeDetails(MitarbeiterstundenkontoRO ro)
|
||||
{
|
||||
foreach (var empDetail in ro.EmployeeDetailList)
|
||||
@@ -151,7 +151,7 @@ namespace BeWo.BeWoAmrath
|
||||
if (prozent != 100)
|
||||
{
|
||||
flsIstFK = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace BeWo.BeWoAmrath
|
||||
flsIstAndere += duration;
|
||||
flsIstFKAndere += flsIstFK;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
mittelbarIst += duration;
|
||||
@@ -271,7 +271,7 @@ namespace BeWo.BeWoAmrath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flsIstLWL /= 60m;
|
||||
flsIstAndere /= 60m;
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace BeWo.BeWoAmrath
|
||||
{
|
||||
flsIstFKLWL /= 60m;
|
||||
empDetail.StundenMittelbarIst = flsIstAndere + (flsIstLWL - flsIstFKLWL) * 1.2m + flsIstFKLWL;
|
||||
|
||||
|
||||
flsIstLWL = (flsIstLWL - flsIstFKLWL) * 1.2m + flsIstFKLWL;
|
||||
}
|
||||
else
|
||||
@@ -298,7 +298,7 @@ namespace BeWo.BeWoAmrath
|
||||
{
|
||||
flsIstAndere = flsIstAndere * 1.2m;
|
||||
}
|
||||
|
||||
|
||||
mittelbarIst /= 60m;
|
||||
|
||||
empDetail.WorkDaysThisMonth = workdaysTotal;
|
||||
@@ -323,7 +323,7 @@ namespace BeWo.BeWoAmrath
|
||||
empDetail.Bu = bu;
|
||||
empDetail.FlsIst = flsIstLWL + flsIstAndere;
|
||||
empDetail.FlsDiff = empDetail.FlsIst - empDetail.FlsSoll;
|
||||
|
||||
|
||||
empDetail.StundenGesamtIst = empDetail.FlsIst + mittelbarIst;
|
||||
if (empDetail.FlsSoll != 0)
|
||||
empDetail.RelationIstSoll = (empDetail.FlsIst / empDetail.FlsSoll) * 100m;
|
||||
@@ -405,6 +405,9 @@ namespace BeWo.BeWoAmrath
|
||||
{
|
||||
decimal flsIstLWL = 0;
|
||||
decimal flsIstAndere = 0;
|
||||
decimal flsIstFK = 0;
|
||||
decimal flsIstFKLWL = 0;
|
||||
decimal flsIstFKAndere = 0;
|
||||
decimal mittelbarIst = 0;
|
||||
decimal minutenMonat = 0;
|
||||
DateTime ende = new DateTime(start.Year, start.Month, 1).AddMonths(1);
|
||||
@@ -423,6 +426,7 @@ namespace BeWo.BeWoAmrath
|
||||
if (AddServiceRecordToDuration(item))
|
||||
{
|
||||
decimal duration = 0;
|
||||
flsIstFK = 0;
|
||||
|
||||
if (item.GroupRoundedDuration.HasValue)
|
||||
{
|
||||
@@ -434,6 +438,43 @@ namespace BeWo.BeWoAmrath
|
||||
}
|
||||
minutenMonat += duration;
|
||||
|
||||
if (item.Start > new DateTime(2023, 03, 31))
|
||||
{
|
||||
if (UseServiceDescriptionPercentage())
|
||||
{
|
||||
decimal prozent = item.ServiceDescription.ServiceCategory.ProzentStundenkonto ?? item.ServiceDescription.ServiceCategory.ProzentAbrechnung;
|
||||
if (item.ServiceDescription.ProzentStundenkonto.HasValue)
|
||||
{
|
||||
prozent = item.ServiceDescription.ProzentStundenkonto.Value;
|
||||
}
|
||||
|
||||
duration *= prozent / 100;
|
||||
if (prozent != 100)
|
||||
{
|
||||
flsIstFK = duration;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
decimal prozent = 100;
|
||||
if (item.ServiceDescription.ProzentStundenkonto.HasValue)
|
||||
{
|
||||
prozent = item.ServiceDescription.ProzentStundenkonto.Value;
|
||||
}
|
||||
else if (item.ServiceDescription.ServiceCategory.ProzentStundenkonto.HasValue)
|
||||
{
|
||||
prozent = item.ServiceDescription.ServiceCategory.ProzentStundenkonto.Value;
|
||||
}
|
||||
|
||||
|
||||
duration *= prozent / 100;
|
||||
if (prozent != 100)
|
||||
{
|
||||
flsIstFK = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.ServiceDescription != null &&
|
||||
item.ServiceDescription.ServiceCategory != null &&
|
||||
item.ServiceDescription.ServiceCategory.IsBillable)
|
||||
@@ -441,15 +482,23 @@ namespace BeWo.BeWoAmrath
|
||||
if (item.CostBearer2SupportConcept != null &&
|
||||
item.CostBearer2SupportConcept.CostBearer.Organisation.Name == "LWL")
|
||||
{
|
||||
//if (!empDetail.FullName.Contains("LWL"))
|
||||
//{
|
||||
// empDetail.FullName += " (LWL)";
|
||||
//}
|
||||
flsIstLWL += duration;
|
||||
flsIstFKLWL += flsIstFK;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (item.CostBearer2SupportConcept != null && !empDetail.FullName.Contains(item.CostBearer2SupportConcept.CostBearer.Organisation.Name))
|
||||
//{
|
||||
// empDetail.FullName += " (" + item.CostBearer2SupportConcept.CostBearer.Organisation.Name + ")";
|
||||
//}
|
||||
flsIstAndere += duration;
|
||||
flsIstFKAndere += flsIstFK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
mittelbarIst += duration;
|
||||
//recordsThisMonth.Add(item);
|
||||
@@ -493,10 +542,27 @@ namespace BeWo.BeWoAmrath
|
||||
}
|
||||
|
||||
decimal stundenMonat = minutenMonat / 60m;
|
||||
if (flsIstFKLWL > 0)
|
||||
{
|
||||
flsIstLWL = (flsIstLWL - flsIstFKLWL) * 1.2m + flsIstFKLWL;
|
||||
}
|
||||
else
|
||||
{
|
||||
flsIstLWL = flsIstLWL * 1.2m;
|
||||
}
|
||||
|
||||
var flsIst = (flsIstAndere * 1.2m) + (flsIstLWL * 1.2m);
|
||||
if (flsIstFKAndere > 0)
|
||||
{
|
||||
flsIstAndere = (flsIstAndere - flsIstFKAndere) * 1.2m + flsIstFKAndere;
|
||||
}
|
||||
else
|
||||
{
|
||||
flsIstAndere = flsIstAndere * 1.2m;
|
||||
}
|
||||
|
||||
var flsIst = flsIstAndere + flsIstLWL;
|
||||
stundenMonat = (flsIst + mittelbarIst) / 60m;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!ueberstunden.HasValue)
|
||||
@@ -551,48 +617,48 @@ namespace BeWo.BeWoAmrath
|
||||
}
|
||||
|
||||
public override List<DateTime> GetFeiertage(int year)
|
||||
{
|
||||
var list = base.GetFeiertage(year);
|
||||
{
|
||||
var list = base.GetFeiertage(year);
|
||||
|
||||
DateTime osterSonntag = GetOsterSonntag(year);
|
||||
list.Add(osterSonntag.AddDays(-3)); // , "Gründonnerstag"));
|
||||
DateTime osterSonntag = GetOsterSonntag(year);
|
||||
list.Add(osterSonntag.AddDays(-3)); // , "Gründonnerstag"));
|
||||
|
||||
if (year != 2017)
|
||||
{
|
||||
list.Add(new DateTime(year, 10, 31)); // , "Reformationstag"));
|
||||
}
|
||||
if (year != 2017)
|
||||
{
|
||||
list.Add(new DateTime(year, 10, 31)); // , "Reformationstag"));
|
||||
}
|
||||
|
||||
list.Remove(new DateTime(year, 12, 24));
|
||||
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//public override bool AddServiceRecordToDuration(ServiceRecord item)
|
||||
//{
|
||||
// if (item.CostBearer2SupportConcept != null && item.CostBearer2SupportConcept.CostBearer.Organisation.Name == "LWL")
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
//public override bool AddServiceRecordToDuration(ServiceRecord item)
|
||||
//{
|
||||
// if (item.CostBearer2SupportConcept != null && item.CostBearer2SupportConcept.CostBearer.Organisation.Name == "LWL")
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
|
||||
// public override bool AddServiceRecordToDuration(ServiceRecord item)
|
||||
// {
|
||||
// if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null)
|
||||
// {
|
||||
// var p = item.ServiceDescription.ServiceCategory.Percentage;
|
||||
// public override bool AddServiceRecordToDuration(ServiceRecord item)
|
||||
// {
|
||||
// if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null)
|
||||
// {
|
||||
// var p = item.ServiceDescription.ServiceCategory.Percentage;
|
||||
|
||||
// if (p != 100 && p > 0)
|
||||
// {
|
||||
// item.RoundedDuration *= (p / 100);
|
||||
// item.GroupRoundedDuration *= (p / 100);
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// if (p != 100 && p > 0)
|
||||
// {
|
||||
// item.RoundedDuration *= (p / 100);
|
||||
// item.GroupRoundedDuration *= (p / 100);
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user