Wabe/Invoicing/CollectiveInvoiceCreation.cs - letzter Betreuungstag ohne Abrechnung

This commit is contained in:
2024-10-11 12:50:13 +02:00
parent 2bffd4a38d
commit 30072258a0

View File

@@ -101,13 +101,30 @@ namespace Wabe.Invoicing
DateTime start;
DateTime ende;
if (scap.StartDate <= serviceInvoicePeriod.Start)
{
start = serviceInvoicePeriod.Start.Value;
}
else
{
start = (DateTime)scap.StartDate; //Einzugstag wird mit abgerechnet
if (scap.EndDate >= serviceInvoicePeriod.End)
ende = serviceInvoicePeriod.End.Value;
}
if (cb2sc.SupportConcept.Customer.TerminationDate.HasValue &&
cb2sc.SupportConcept.Customer.TerminationDate.Value <= scap.EndDate.Value
&& cb2sc.SupportConcept.Customer.TerminationDate >= scap.StartDate.Value)
{
ende = cb2sc.SupportConcept.Customer.TerminationDate.Value.AddDays(-1); // finaler Auszugstag wird NICHT abgerechnet
}
else
ende = (DateTime)scap.EndDate.Value.AddDays(-1); //Auszugstag wird NICHT abgerechnet
{
if (scap.EndDate >= serviceInvoicePeriod.End)
{
ende = serviceInvoicePeriod.End.Value;
}
else
{
ende = (DateTime)scap.EndDate.Value;
}
}
decimal tagessatz = 0;
var crList = scap.ServiceCategory.CostRatePeriods;