From cff83a14b2e920713e46e82d055dac57be293f0d Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 26 Jan 2026 14:14:37 +0100 Subject: [PATCH] AuswegHeikePuetz/Invoicing/CustomInvoiceFactory - Bugfix richtige Auswahl AssistenzInvoiceCreation --- .../Invoicing/CustomInvoiceFactory.cs | 22 +++++-------------- .../Invoicing/CustomInvoiceFactory.cs | 20 +++-------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/ReportImp/AuswegHeikePuetz/Invoicing/CustomInvoiceFactory.cs b/ReportImp/AuswegHeikePuetz/Invoicing/CustomInvoiceFactory.cs index 69c448e94..a2e538f35 100644 --- a/ReportImp/AuswegHeikePuetz/Invoicing/CustomInvoiceFactory.cs +++ b/ReportImp/AuswegHeikePuetz/Invoicing/CustomInvoiceFactory.cs @@ -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 } } diff --git a/ReportImp/MitMenschenWuppertal/Invoicing/CustomInvoiceFactory.cs b/ReportImp/MitMenschenWuppertal/Invoicing/CustomInvoiceFactory.cs index c7fbb0b65..b2c27c3b6 100644 --- a/ReportImp/MitMenschenWuppertal/Invoicing/CustomInvoiceFactory.cs +++ b/ReportImp/MitMenschenWuppertal/Invoicing/CustomInvoiceFactory.cs @@ -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 } }