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

37 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
namespace LebensWert.Invoicing
{
public class CustomInvoiceFactory : InvoiceFactory
{
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
{
foreach (var item in supportConcepts2ServiceRecords)
{
var csc = item.Key;
if (csc.CostBearer.Contains("Nienburg"))
{
return new CustomInvoiceCreationNI();
}
else if (csc.CostBearer.ToLower() == "landeshauptstadt hannover" || csc.CostBearer.ToLower().Contains("stadt hannover") || csc.CostBearer.ToLower().Contains("region hannover"))
{
return new CustomInvoiceCreationHA();
}
else if (csc.CostBearer.Contains("Hildesheim"))
{
return new CustomInvoiceCreationHI();
}
}
return new InvoiceCreation();
}
}
}