From ac83723e2170ecc2f97f054d231fcad615fb4612 Mon Sep 17 00:00:00 2001 From: Kojo Date: Wed, 18 Dec 2024 19:02:31 +0100 Subject: [PATCH] =?UTF-8?q?ZukunftLeben:=20Wegen=20NPE=20in=20Sozio-Invoic?= =?UTF-8?q?eCreation=20jetzt=20alles=20in=20CreateHausbesuchspauschale=20a?= =?UTF-8?q?uf=20Null=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Invoicing/SoziotherapieInvoiceCreation.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ReportImp/ZukunftLeben/Invoicing/SoziotherapieInvoiceCreation.cs b/ReportImp/ZukunftLeben/Invoicing/SoziotherapieInvoiceCreation.cs index e9f1764f7..44499378b 100644 --- a/ReportImp/ZukunftLeben/Invoicing/SoziotherapieInvoiceCreation.cs +++ b/ReportImp/ZukunftLeben/Invoicing/SoziotherapieInvoiceCreation.cs @@ -130,11 +130,14 @@ namespace ZukunftLeben.Invoicing { IList items = new List(); decimal hausbesuchspauschale = 8.53m; - hausbesuchspauschale = GetHausbesuchspauschale(scap.CostBearer2SupportConcept, invoicePeriod.StartDate); + if (scap != null && invoicePeriod != null) + { + hausbesuchspauschale = GetHausbesuchspauschale(scap.CostBearer2SupportConcept, invoicePeriod.StartDate); + } int countHausbesuch = 0; foreach (var sr in serviceRecordsInPeriod) { - if (sr.ServiceDescription.Name.ToLower().Contains("aufsuchend")) + if (sr.ServiceDescription != null && sr.ServiceDescription.Name != null && sr.ServiceDescription.Name.ToLower().Contains("aufsuchend")) { countHausbesuch++; } @@ -149,8 +152,11 @@ namespace ZukunftLeben.Invoicing invoiceItem.AmountPerUnit = hausbesuchspauschale; invoiceItem.UnitCount = anzahlHausbesuche; invoiceItem.AmountTotal = anzahlHausbesuche * hausbesuchspauschale; - invoiceItem.ItemPeriodStart = invoicePeriod.StartDate; - invoiceItem.ItemPeriodEnd = invoicePeriod.EndDate; + if (invoicePeriod != null) + { + invoiceItem.ItemPeriodStart = invoicePeriod.StartDate; + invoiceItem.ItemPeriodEnd = invoicePeriod.EndDate; + } invoiceItem.RateFactor = null; invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal; invoiceItem.ItemDescription = "Hausbesuchspauschale";