Files
BeWoPlaner/ReportImp/AwoDortmund/Invoicing/CustomInvoiceFactory.cs

38 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
namespace AwoDortmund.Invoicing
{
public class CustomInvoiceFactory : InvoiceFactory
{
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
{
foreach (var list in supportConcepts2ServiceRecords.Values)
{
foreach (var sr in list)
{
var cat = sr.ServiceDescription.Category;
if (!sr.CostBearer.Name.Contains("LWL") && !sr.CostBearer.Name.Contains("LVR") &&
!String.IsNullOrEmpty(cat.Name) && cat.Name.ToLower().Contains("soziotherapie")
|| cat.Name.ToLower().Contains("assistenzleistung nach § 45")
|| cat.Name.ToLower().Contains("assistenzleistung hauswirtschaft")
|| cat.Name.ToLower().Contains("weiterführung des haushalts §70"))
{
// der Datenaufruf der Einzelrechnungen der SoziotherapieInvoiceCreation funktioniert nicht für Finanzauswertung
if (specificId != null && specificId == "Finanzauswertung")
return new SoziotherapieFinanceROCreation();
else
return new SoziotherapieInvoiceCreation();
}
}
}
return new DefaultInvoiceCreation();
}
}
}