PraxisPusteblume: Behandlungsnachweis robuster gemacht (wg. NPE beim Kunden)

This commit is contained in:
2023-06-01 16:01:49 +02:00
parent 979934182c
commit bebf1d39cf
2 changed files with 7 additions and 10 deletions

View File

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

View File

@@ -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 =