41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.Invoicing;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using DevExpress.Utils;
|
|
|
|
namespace WahlEv.Invoicing
|
|
{
|
|
public class CustomInvoiceFactory : InvoiceFactory
|
|
{
|
|
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
|
{
|
|
DateTime stichtag = DateTime.Now;
|
|
foreach (var list in supportConcepts2ServiceRecords.Values)
|
|
{
|
|
foreach (var sr in list)
|
|
{
|
|
if (sr.Start.HasValue && sr.Start < stichtag)
|
|
{
|
|
stichtag = sr.Start.Value;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (stichtag < new DateTime(2020, 4, 1))
|
|
{
|
|
return new CustomInvoiceCreation();
|
|
}
|
|
return new InvoiceCreationNachStunden();
|
|
}
|
|
|
|
}
|
|
}
|