From 15cf8f8a6f0073071d4326fcfa50cfa5dac8a28e Mon Sep 17 00:00:00 2001 From: HirschleM Date: Tue, 10 Mar 2026 12:37:18 +0100 Subject: [PATCH] MH: LebenshilfeCoburg WohnheimInvoiceCreation NullPointer verhindert --- .../LhCoburgWohnheimInvoiceCreation.cs | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ReportImp/LebenshilfeCoburg/Invoicing/LhCoburgWohnheimInvoiceCreation.cs b/ReportImp/LebenshilfeCoburg/Invoicing/LhCoburgWohnheimInvoiceCreation.cs index a032bfcc8..2fc85e093 100644 --- a/ReportImp/LebenshilfeCoburg/Invoicing/LhCoburgWohnheimInvoiceCreation.cs +++ b/ReportImp/LebenshilfeCoburg/Invoicing/LhCoburgWohnheimInvoiceCreation.cs @@ -310,20 +310,23 @@ namespace LebenshilfeCoburg.Invoicing private InvoiceItem ErstelleInvoiceItemBasierendAufLeistungskategorie(SupportConceptApprovalPeriodDC leistung, List bookings, List serviceRecords, SupportConcept supportConcept, WohnheimDC wohnheim) { - if (leistung.ServiceCategory.Name == "ind. P/B FK") - return ErstelleIndPBFKInvoiceItem(leistung, bookings, supportConcept); - else if (leistung.ServiceCategory.Name == "NW FK") - return ErstelleNWFKInvoiceItem(leistung, bookings, serviceRecords, supportConcept.Customer); - else if (leistung.ServiceCategory.Name == "NW HK") - return ErstelleNWHKInvoiceItem(leistung, bookings, serviceRecords, supportConcept.Customer); - else if (leistung.ServiceCategory.Name == "Gem FK") - return ErstelleGemFKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); - else if (leistung.ServiceCategory.Name == "Gem HK") - return ErstelleGemHKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); - else if (leistung.ServiceCategory.Name == "ind. Begl. HK") - return ErstelleIndBeglHKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); - else if (leistung.ServiceCategory.Name == "HW") - return ErstelleHWInvoiceItem(leistung, bookings, supportConcept); + if (leistung != null && leistung.ServiceCategory != null) + { + if (leistung.ServiceCategory.Name == "ind. P/B FK") + return ErstelleIndPBFKInvoiceItem(leistung, bookings, supportConcept); + else if (leistung.ServiceCategory.Name == "NW FK") + return ErstelleNWFKInvoiceItem(leistung, bookings, serviceRecords, supportConcept.Customer); + else if (leistung.ServiceCategory.Name == "NW HK") + return ErstelleNWHKInvoiceItem(leistung, bookings, serviceRecords, supportConcept.Customer); + else if (leistung.ServiceCategory.Name == "Gem FK") + return ErstelleGemFKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); + else if (leistung.ServiceCategory.Name == "Gem HK") + return ErstelleGemHKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); + else if (leistung.ServiceCategory.Name == "ind. Begl. HK") + return ErstelleIndBeglHKInvoiceItem(leistung, bookings, serviceRecords, wohnheim, supportConcept.Customer); + else if (leistung.ServiceCategory.Name == "HW") + return ErstelleHWInvoiceItem(leistung, bookings, supportConcept); + } return null; }