38 lines
1.2 KiB
C#
38 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.Extensions;
|
|
using BS.Shared.Services;
|
|
|
|
namespace LebenshilfeStade.Invoicing
|
|
{
|
|
public class CustomInvoiceFactory : InvoiceFactory
|
|
{
|
|
|
|
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
|
{
|
|
|
|
foreach (var list in supportConcepts2ServiceRecords.Values)
|
|
{
|
|
if (list != null && list.Count > 0)
|
|
{
|
|
foreach (var sr in list)
|
|
{
|
|
if (sr.CostBearer != null)
|
|
{
|
|
if (!sr.CostBearer.Function.IsNullOrEmpty() && sr.CostBearer.Function.ToLower().Contains("fls 50"))
|
|
{
|
|
return new CustomInvoiceCreation();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return new InvoiceCreation();
|
|
}
|
|
}
|
|
}
|