From bebf1d39cf50712b81335ad0fdbf76d7f4e5b3ee Mon Sep 17 00:00:00 2001 From: Kojo Date: Thu, 1 Jun 2023 16:01:49 +0200 Subject: [PATCH] PraxisPusteblume: Behandlungsnachweis robuster gemacht (wg. NPE beim Kunden) --- ReportImp/PraxisPusteblume/Behandlungsnachweis.cs | 13 +++++-------- .../BehandlungsnachweisHerrHerzog.cs | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ReportImp/PraxisPusteblume/Behandlungsnachweis.cs b/ReportImp/PraxisPusteblume/Behandlungsnachweis.cs index 709a97fab..99dbfbaea 100644 --- a/ReportImp/PraxisPusteblume/Behandlungsnachweis.cs +++ b/ReportImp/PraxisPusteblume/Behandlungsnachweis.cs @@ -142,16 +142,14 @@ namespace PraxisPusteblume foreach (var i in p.ServiceInvoiceItems) { - if (i.UnitCount.HasValue) + if (i.UnitCount != null && i.UnitCount.HasValue) { i.UnitCountString = InvoiceHelper.GetUnitString(i.UnitCount); } - - - if (i.ServiceDescription.Contains("Gruppe")) + if (i.ServiceDescription != null && i.ServiceDescription.Contains("Gruppe")) { - if (i.HourlyRate.HasValue && i.Hours.HasValue) + if (i.HourlyRate != null && i.HourlyRate.HasValue && i.HourlyRate != null && i.Hours.HasValue) { if (!gruppenHours.ContainsKey(i.ServiceDescription)) { @@ -164,13 +162,12 @@ namespace PraxisPusteblume gruppenClaim[i.ServiceDescription] += (i.Hours.Value * (i.HourlyRate ?? 0)); } - i.UnitDescription = i.ServiceDescription; i.UnitDescription = i.UnitDescription.Replace("Gruppe mit", "").Replace("Kindern", "").Trim(); } else { - if (i.HourlyRate.HasValue) + if (i.HourlyRate != null && i.HourlyRate.HasValue) { hourlyRate = i.HourlyRate.Value; @@ -184,7 +181,7 @@ namespace PraxisPusteblume //} } - if (i.Hours.HasValue) + if (i.Hours != null && i.Hours.HasValue) { hours += i.Hours.Value; diff --git a/ReportImp/PraxisPusteblume/BehandlungsnachweisHerrHerzog.cs b/ReportImp/PraxisPusteblume/BehandlungsnachweisHerrHerzog.cs index 40de5a2c6..b785360bf 100644 --- a/ReportImp/PraxisPusteblume/BehandlungsnachweisHerrHerzog.cs +++ b/ReportImp/PraxisPusteblume/BehandlungsnachweisHerrHerzog.cs @@ -97,9 +97,9 @@ namespace PraxisPusteblume { i.Notice = String.Format("{0:dd.MM.yyyy} / KW {1}", i.AccountingPeriodStart, InvoiceHelper.GetKW(i.AccountingPeriodStart.Value)); - if (i.UnitCount.HasValue) + if (i.UnitCount != null && i.UnitCount.HasValue) { - i.UnitCountString = String.Format("{0:0.##} Behandlungseinheit á {1:c}", i.UnitCount, + i.UnitCountString = String.Format("{0:0.##} Behandlungseinheit à {1:c}", i.UnitCount, i.AmountPerUnit); } //i.ServiceDescription =