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; }