Files
BeWoPlaner/ReportImp/SozialbueroSchuesslerWilckens/Invoicing/CustomInvoiceFactory.cs
2022-07-15 13:59:13 +02:00

33 lines
822 B
C#

using System;
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
namespace SozialbueroSchuesslerWilckens.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)
{
if (sr.CostBearer != null && sr.CostBearer.Name.ToLower() == "selbstzahler")
{
return new SelbstzahlerInvoiceCreation();
}
}
}
return new InvoiceCreation();
}
}
}