29 lines
854 B
C#
29 lines
854 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.Invoicing;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
|
|
namespace TeamPfeil.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.Name.Contains("Modellprojekt") || (sr.CostBearer.Name.Contains("Schwaben") || sr.CostBearer.Name.Contains("Berkmann") && sr.Start >= new DateTime(2023, 6, 1)))
|
|
{
|
|
return new CustomInvoiceCreation();
|
|
}
|
|
}
|
|
}
|
|
return new DefaultInvoiceCreation();
|
|
}
|
|
}
|
|
}
|