AuswegHeikePuetz/Invoicing/CustomInvoiceFactory - Bugfix richtige Auswahl AssistenzInvoiceCreation

This commit is contained in:
2026-01-26 14:14:37 +01:00
parent e350d585a8
commit cff83a14b2
2 changed files with 9 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
@@ -14,25 +15,14 @@ namespace Ausweg.Invoicing
{
foreach (var sr in list)
{
var sd = sr.ServiceDescription.Category;
var ic = GetInvoiceCreatorForCategory(sd);
if (ic != null)
return ic;
if (sr.CostBearer != null && (sr.CostBearer.Name.Contains("LVR") || sr.CostBearer.Name.Contains("LWL"))
&& list.Any(s => s.ServiceDescription.Category.Name.ToLower().Contains("assistenz")))
{
return new CustomAssistenzInvoiceCreation(); // Klassischer Filter für Abrechnung Assistenz in Sammelrg und FLS in Spitzabrechnung für LVR
}
}
}
return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
}
private InvoiceCreation GetInvoiceCreatorForCategory(ServiceCategoryDC sd)
{
if (sd != null && !String.IsNullOrEmpty(sd.Name))
{
String cat = sd.Name.ToLower().Trim();
if (cat.IndexOf("assistenz") >= 0)
{
return new CustomAssistenzInvoiceCreation(); // Klassischer Filter für Abrechnung Assistenz in Sammelrg und FLS in Spitzabrechnung für LVR
}
}
return new CustomJugendamtInvoiceCreation(); // Abrechnung mit JA geht über FLS in Sammelrechnung, aber die Abwesenheiten spielen keine Rolle
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
@@ -14,27 +15,12 @@ namespace MitMenschenWuppertal.Invoicing
{
foreach (var list in supportConcepts2ServiceRecords.Values)
{
foreach (var sr in list)
{
var sd = sr.ServiceDescription.Category;
var ic = GetInvoiceCreatorForCategory(sd);
if (ic != null)
return ic;
}
}
return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
}
private InvoiceCreation GetInvoiceCreatorForCategory(ServiceCategoryDC sd)
{
if (sd != null && !String.IsNullOrEmpty(sd.Name))
{
String cat = sd.Name.ToLower().Trim();
if (cat.IndexOf("assistenz") >= 0)
if (list.Any(s => s.ServiceDescription.Category.Name.ToLower().Contains("assistenz")))
{
return new CustomAssistenzInvoiceCreation(); // Klassischer Filter für Abrechnung Assistenz in Sammelrg und FLS in Spitzabrechnung für LVR
}
}
return new CustomInvoiceCreation(); // war vorher eine Anpassung, wollte die nicht überschreiben
}
}