42 lines
1.3 KiB
C#
42 lines
1.3 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 BeWo.Service.Plugins;
|
|
using BeWo.Service.ServiceImplementations;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using Service.Invoicing;
|
|
|
|
namespace TabulaRasa.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 sc = DAOFactory.GenericDAO.LoadByID<SupportConcept>(csc.SupportConceptOid);
|
|
|
|
foreach (var cb2sc in sc.CostBearer2SupportConceptList)
|
|
{
|
|
if (cb2sc.CostBearer.Organisation != null && cb2sc.CostBearer.Organisation.Name.Replace(" ", "").Contains("§67"))
|
|
{
|
|
return new TabulaRasa.Invoicing.BeWo67InvoiceCreation();
|
|
}
|
|
}
|
|
}
|
|
|
|
return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
|
|
|
|
}
|
|
|
|
}
|
|
}
|