AwoDortmund/SonderFinanzauswertung.cs - Nullpointer aus Differenzrechnung gefixt

This commit is contained in:
2025-05-13 17:08:51 +02:00
parent 5acdc77232
commit ffb483d754

View File

@@ -110,7 +110,7 @@ namespace BeWo.Report.DefaultReports
scRo.ApprovedHoursInReportTimeSpan = 0;
scRo.BillableHoursInReportTimeSpanWithFactor = 0;
scRo.BillableAmountInReportTimeSpan = (decimal)ii.GetTotalClaim();
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList.Count > 0 && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
{
scRo.BillableHoursInReportTimeSpan = ii.ServiceInvoicePeriodList[0].InvoiceItemList[0].UnitCount ?? 0;
scRo.HourlyRate = ii.ServiceInvoicePeriodList[0].InvoiceItemList[0].AmountPerUnit ?? 0;
@@ -127,7 +127,7 @@ namespace BeWo.Report.DefaultReports
ro.Custom5 = scRo.Custom5;
ro.Custom1 = ii.InvoiceBase.InvoiceNumber.ToString();
ro.BillableAmountInReportTimeSpan = (decimal)ii.GetTotalClaim();
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList.Count > 0 && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
{
ro.BillableHoursInReportTimeSpan = ii.ServiceInvoicePeriodList[0].InvoiceItemList[0].UnitCount ?? 0;
ro.HourlyRate = ii.ServiceInvoicePeriodList[0].InvoiceItemList[0].AmountPerUnit ?? 0;
@@ -146,7 +146,7 @@ namespace BeWo.Report.DefaultReports
scRo.Custom1 = ii.InvoiceBase.InvoiceNumber.ToString();
if (!String.IsNullOrEmpty(kst) && kst.Contains("610905"))
{
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
if (ii.ServiceInvoicePeriodList != null && ii.ServiceInvoicePeriodList.Count > 0 && ii.ServiceInvoicePeriodList[0].InvoiceItemList != null)
{
scRo.HourlyRate = ii.ServiceInvoicePeriodList[0].InvoiceItemList[0].AmountPerUnit ?? 0;
}