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

40 lines
1.1 KiB
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;
namespace MobileEV.Invoicing
{
public class CustomInvoiceFactory : InvoiceFactory
{
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
{
foreach (var sc2sr in supportConcepts2ServiceRecords)
{
if (sc2sr.Key.CostBearer.Contains("Stadt Dortmund") || sc2sr.Key.CostBearer.Contains("Stadt Bergkamen"))
{
return new CustomInvoiceCreation();
}
}
foreach (var list in supportConcepts2ServiceRecords.Values)
{
foreach (var sr in list)
{
if (sr.CostBearer != null)
{
if (sr.CostBearer.Name.Contains("Selbstzahler"))
{
return new SelbstzahlerInvoiceCreation();
}
}
}
}
return new InvoiceCreation();
}
}
}