MH: LebenshilfeCoburg WohnheimInvoiceCreation NullPointer verhindert

This commit is contained in:
2026-03-10 12:37:18 +01:00
parent 67622c6c00
commit 15cf8f8a6f

View File

@@ -310,20 +310,23 @@ namespace LebenshilfeCoburg.Invoicing
private InvoiceItem ErstelleInvoiceItemBasierendAufLeistungskategorie(SupportConceptApprovalPeriodDC leistung, List<AdditionalServiceBooking> bookings, List<ServiceRecordDC> 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;
}