MH: Club74 Standardstundenkonto ab 01.05.26

This commit is contained in:
2026-03-30 12:04:48 +02:00
parent d9a604b8aa
commit a72747ff0f
4 changed files with 102 additions and 25 deletions

View File

@@ -88,6 +88,7 @@
<DependentUpon>Mitarbeiterauslastung.cs</DependentUpon>
</Compile>
<Compile Include="Reporting\ClubAnnualReportFactory.cs" />
<Compile Include="Service\CustomVacationService.cs" />
<Compile Include="SpitzabrechnungAnhang.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -12,11 +12,13 @@ namespace BeWo.Club74
{
public override bool AddServiceRecordToDuration(ServiceRecord item)
{
if (item.Start >= new DateTime(2020, 10, 1))
if (item.Start >= new DateTime(2026, 05, 01))
return base.AddServiceRecordToDuration(item);
else if (item.Start >= new DateTime(2020, 10, 1))
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null)
{
if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit")
{
return true;
@@ -49,34 +51,37 @@ namespace BeWo.Club74
public override void HandleServiceRecord(MitarbeiterstundenkontoRO.EmployeeDetail emp, ServiceRecord item)
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null)
if (item.Start >= new DateTime(2026, 05, 01))
base.HandleServiceRecord(emp, item);
else
{
decimal duration = 0;
if (item.GroupRoundedDuration.HasValue)
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null)
{
duration = item.GroupRoundedDuration.Value;
}
else
{
duration = item.RoundedDuration;
}
decimal duration = 0;
if (item.GroupRoundedDuration.HasValue)
{
duration = item.GroupRoundedDuration.Value;
}
else
{
duration = item.RoundedDuration;
}
if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit")
{
emp.Custom3 += duration / 60;
if (item.ServiceDescription.ServiceCategory.Name.ToLower() == "arbeitszeit")
{
emp.Custom3 += duration / 60;
}
else if (item.ServiceDescription.ServiceCategory.Name.ToLower().Contains("mittelbar"))
{
emp.Custom2 += duration / 60;
}
else if (item.ServiceDescription.ServiceCategory.Name.ToLower().StartsWith("direkt"))
{
emp.Custom1 += duration / 60;
}
}
else if (item.ServiceDescription.ServiceCategory.Name.ToLower().Contains("mittelbar"))
{
emp.Custom2 += duration / 60;
}
else if (item.ServiceDescription.ServiceCategory.Name.ToLower().StartsWith("direkt"))
{
emp.Custom1 += duration / 60;
}
}
}
public override List<DateTime> GetFeiertage(int year)

View File

@@ -122,6 +122,44 @@ namespace BeWo.Club74
return roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
}
public override XtraReport CreateEmployeeHourReport(long? employeeOid, IList<long> teamOids, DateTime startDate, DateTime endDate, int ansicht)
{
IBeWoReport<MitarbeiterstundenkontoRO> report;
if (ansicht == 1)
{
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
}
else if (ansicht == 2)
{
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterstundenkontoJahr");
var jahrStart = new DateTime(startDate.Year, 1, 1);
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
reportjahr.SetReportDataSource(ds);
return reportjahr as XtraReport;
}
else
{
if (teamOids != null && teamOids.Count > 0)
{
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
}
else
{
if (startDate >= new DateTime(2026, 05, 01))
report = new BeWo.Report.DefaultReports.Mitarbeiterstundenkonto();
else
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
}
}
var reportObject = MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
report.SetReportDataSource(reportObject);
return report as XtraReport;
}
//public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
//{

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
namespace Club74.Service
{
public class CustomVacationService : VacationService
{
public override List<FeiertagDC> GetFeiertage(int year, string bundesland)
{
var list = base.GetFeiertage(year, bundesland);
if (year >= 2026)
{
list.Add(new FeiertagDC() { Datum = new DateTime(2026, 12, 24), Name = "Heilig Abend" });
list.Add(new FeiertagDC() { Datum = new DateTime(2026, 12, 31), Name = "Silvester" });
}
return list;
}
}
}