38 lines
1.1 KiB
C#
38 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 KetteReports.Invoicing
|
|
{
|
|
public class CustomInvoiceFactory : InvoiceFactory
|
|
{
|
|
|
|
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
|
{
|
|
|
|
foreach (var item in supportConcepts2ServiceRecords)
|
|
{
|
|
var csc = item.Key;
|
|
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(csc.CostBearerRelOids[0]);
|
|
|
|
var org = cb2sc.CostBearer.Organisation;
|
|
|
|
if (org.Function != null && (org.Function.Value.Contains("Privat") || org.Function.Value.Contains("Priavat")))
|
|
{
|
|
return new SelbstzahlerInvoiceCreation();
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
|
|
}
|
|
|
|
}
|
|
}
|