PerspektivenEV/Invoicing/diverse Bugs aus Finanzauswertung gefixt (leere HPs etc)

This commit is contained in:
2025-03-06 08:05:10 +01:00
parent 4e8ca74f2f
commit 673636fdad
3 changed files with 22 additions and 12 deletions

View File

@@ -148,7 +148,7 @@ namespace PerspektivenEV.Invoicing
decimal LG = 1;
var cat = supportConceptApprovalPeriod.ServiceCategory;
if (cat != null)
if (cat != null && cat.Abbreviation != null && cat.Abbreviation.Length > 4)
{
var ii = new InvoiceItem
{
@@ -195,7 +195,7 @@ namespace PerspektivenEV.Invoicing
}
}
// Gesondert Vorgehaltene Flächen - Extrabetrag aus Leistungskategorie pro Kalendertag
else if (cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
else if (cat.Abbreviation != null && cat.Abbreviation.Length > 3 && cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
{
ii.Notice = "1";
ii.AmountPerUnit = data[0].AmountTotal;
@@ -304,7 +304,10 @@ namespace PerspektivenEV.Invoicing
ii.GrossAmountTotal = ii.AmountTotal;
serviceInvoicePeriod.InvoiceItemList.Add(ii);
var test = supportConceptApprovalPeriod.StartDate.Value.AddMonths(13);
if (supportConceptApprovalPeriod.StartDate.HasValue)
{
var test = supportConceptApprovalPeriod.StartDate.Value.AddMonths(13);
}
// ToDo!!! alle 12 Monate und letzter Monat wird bei Kompensatorischer Assistenz spitzabgerechnet!!!
if (cat.Abbreviation.Substring(cat.Abbreviation.Length - 2) == "KA" && (supportConceptApprovalPeriod.EndDate.Value <= accountingPeriodEnd.Value.AddMonths(1)

View File

@@ -107,7 +107,7 @@ namespace PerspektivenEV.Invoicing
public override void SetServiceInvoicePeriods(ServiceInvoice invoice, CostBearer2SupportConcept costBearer2SupportConcept, DateTimeSpan invoicePeriod, List<ServiceRecordDC> serviceRecords)
{
if (serviceRecords.Any(s => s.ServiceDescription.Category.Abbreviation.Contains("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW")))
if (serviceRecords.Any(s => s.ServiceDescription.Category.Abbreviation != null && s.ServiceDescription.Category.Abbreviation.Contains("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW")))
{
//var serviceRecordsTS = serviceRecords.Where(s => s.ServiceDescription.Category.Abbreviation.Contains("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW") && !s.ServiceDescription.Category.Abbreviation.Contains("TS")).ToList();
serviceRecords = serviceRecords.Where(s => s.ServiceDescription.Category.Abbreviation.Contains("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW") || !s.ServiceDescription.Category.Abbreviation.Contains("TS")).ToList();
@@ -176,7 +176,7 @@ namespace PerspektivenEV.Invoicing
public override bool ShouldCreateFixedAmounts(ServiceInvoicePeriod serviceInvoicePeriod, SupportConceptApprovalPeriodDC supportConceptApprovalPeriod, CostBearer2SupportConcept cb2sc)
{
if (cb2sc.CostBearer.Organisation.Name.Contains("SELBSTZAHLER") && supportConceptApprovalPeriod.ServiceCategory.Abbreviation.Contains("TS"))
if (cb2sc.CostBearer.Organisation.Name.Contains("SELBSTZAHLER") && supportConceptApprovalPeriod.ServiceCategory.Abbreviation != null && supportConceptApprovalPeriod.ServiceCategory.Abbreviation.Contains("TS"))
{
return false;
}
@@ -193,7 +193,7 @@ namespace PerspektivenEV.Invoicing
var cat = supportConceptApprovalPeriod.ServiceCategory;
if (cb2sc.CostBearer.Organisation.Function != null && cb2sc.CostBearer.Organisation.Function.Value.Contains("BTHG") && cb2sc.CostBearer.Organisation.Name == "SELBSTZAHLER")
{
if (cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
if (cat.Abbreviation != null && cat.Abbreviation.Length > 2 && cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
{
DateTime start = accountingPeriodStart.Value;
DateTime end = accountingPeriodEnd.Value;
@@ -269,7 +269,7 @@ namespace PerspektivenEV.Invoicing
public override IList<InvoiceItem> CreateInvoiceItems(List<ServiceRecordDC> serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc)
{
IList<InvoiceItem> list = new List<InvoiceItem>();
if (serviceRecordsInPeriod.Any(s => s.ServiceDescription.Category.Abbreviation.StartsWith("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW")))
if (serviceRecordsInPeriod.Any(s => s.ServiceDescription.Category.Abbreviation != null && s.ServiceDescription.Category.Abbreviation.StartsWith("TS") && s.ServiceDescription.Category.Abbreviation.Contains("ANW")))
{
var tsitem = CreateInvoiceItemsTagesstaette(serviceRecordsInPeriod, invoicePeriod, scap, calc);
if (tsitem != null)
@@ -321,7 +321,7 @@ namespace PerspektivenEV.Invoicing
var data = calc.GetFixedBillingData(scapDC, invoicePeriod.StartDate, invoicePeriod.EndDate);
var cat = scap.ServiceCategory;
if (cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
if (cat.Abbreviation != null && cat.Abbreviation.Substring(cat.Abbreviation.Length - 3) == "GVF")
{
DateTime start = accountingPeriodStart.Value;
DateTime end = accountingPeriodEnd.Value;

View File

@@ -19,7 +19,7 @@ namespace PerspektivenEV.Invoicing
{
if (sr.CostBearer != null)
{
if ((!sr.CostBearer.Function.IsNullOrEmpty() && sr.CostBearer.Function.ToLower().Contains("pfk")))
if (!sr.CostBearer.Function.IsNullOrEmpty() && sr.CostBearer.Function.ToLower().Contains("pfk"))
{
if (sr.Start < new DateTime(2025, 01, 01))
{
@@ -53,14 +53,21 @@ namespace PerspektivenEV.Invoicing
{
foreach (var item in supportConcepts2ServiceRecords.Keys)
{
if (item.CostBearerList[0].OrganisationName.Contains("SELBSTZAHLER") || item.CostBearerList[0].OrganisationName.Contains("EIGENANTEIL") || item.CostBearerList[0].Organisation.Function.ToLower().Contains("pfk"))
if (item != null && item.CostBearerList != null && item.CostBearerList.Count > 0)
{
return new CustomInvoiceCreation();
if (item.CostBearerList[0].OrganisationName.Contains("SELBSTZAHLER") || item.CostBearerList[0].OrganisationName.Contains("EIGENANTEIL"))
{
return new CustomInvoiceCreation();
}
if (item.CostBearerList[0].Organisation.Function.ToLower().Contains("pfk"))
{
return new CustomPfkInvoiceCreation();
}
}
}
}
}
return new CollectiveInvoiceCreationBthg(); // zur Zeit für alle Fälle mit Fahrkosten, Anfahrten oder Handgeld etabliert
return new CollectiveInvoiceCreationBthg();
}
}
}