BeWoDarmstadt/Teamuebersicht und Zeitzuschlagsbeleg für LWV Bthg angepasst

This commit is contained in:
2024-06-29 12:55:46 +02:00
parent d5d1c59bd5
commit 4cfa602b9d
3 changed files with 61 additions and 4 deletions

View File

@@ -13,8 +13,6 @@ namespace BeWoDarmstadt.Calculation
{
public override void CalculateGroupDuration(ServiceRecordGroup group)
{
var hatGruppenLeistung = group.ServiceRecordList.Any(s => GetMaxDuration(s.ServiceDescription.Name).HasValue);
if (hatGruppenLeistung)
{

View File

@@ -1,9 +1,12 @@
using System;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Service.DCEntityMapper;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using BS.Shared.Services;
namespace BeWoDarmstadt
@@ -45,7 +48,7 @@ namespace BeWoDarmstadt
var cb2sc = scRo.Costbearer2Supportconcept;
var costRateDcs = cb2sc.CostBearer.CostRatePeriods;
var calc = BS.Shared.Services.Calculations.GetInstance(cb2sc.CostBearer.CostBearerID);
scRo.ApprovedHours = calc.GetApprovedHoursForPeriod(cb2sc, monthStart, end);
scRo.ApprovedHours = GetApprovedHoursOhneFahrzeitForPeriod(cb2sc, monthStart, end);
scRo.BillableHours = 0;
scRo.AmountPaid = 0;
@@ -85,5 +88,60 @@ namespace BeWoDarmstadt
}
return scRo.Costbearer2Supportconcept.SupportConcept.Customer.RelatedTeams;
}
private decimal GetApprovedHoursOhneFahrzeitForPeriod(SupportConceptCostBearerRelDC relDC,
DateTime pStart,
DateTime pEnd)
{
var costRatePeriods = relDC.CostBearer.CostRatePeriods;
decimal approvedHours = 0;
DateTime start = pStart;
DateTime end = pEnd;
if (relDC.SupportConcept.CustomerFullName.Contains("Sanna"))
{
int test = 0;
}
foreach (var scap in relDC.ApprovalPeriodList)
{
if (start.InBetween(scap.Span, true) && scap.ServiceCategory != null && !scap.ServiceCategory.Name.ToLower().Contains("fahrzeit"))
{
while (start <= end)
{
if (scap != null)
{
if (scap.EndDate.HasValue && scap.EndDate.Value < end)
end = scap.EndDate.Value;
var periodInDays = end.Subtract(start).Days + 1;
var calc = BS.Shared.Services.Calculations.GetInstance(relDC.CostBearer.CostBearerID);
approvedHours += (calc.GetApprovedHoursPerDay(scap, costRatePeriods) ?? 0) * periodInDays;
}
else
{
DateTime minStart = DateTime.MaxValue;
foreach (var period in relDC.ApprovalPeriodList)
{
if (period.StartDate.HasValue && period.EndDate.HasValue)
{
if (period.StartDate.Value > start && period.StartDate.Value <= pEnd && period.StartDate.Value < minStart)
{
minStart = period.StartDate.Value;
}
}
}
end = minStart.AddDays(-1);
}
start = end.AddDays(1);
}
}
}
return approvedHours;
}
}
}

View File

@@ -320,7 +320,8 @@ namespace BeWoDarmstadt
zv.minutenLeistung = CheckUhrzeiten(datum, 0, 24, (double)duration);
if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("eingliederungshilfe") || sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("jugendhilfe")
|| sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("fachleistungsstunde")) // FLS nach Debug entfernen
|| sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("qualifizierte assistenz")
|| sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("kompensatorische assistenz"))
{
if (sr.ServiceDescription.Name.ToLower().StartsWith("indirekte"))
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[2], indirekteBetr2Minuten);