using System; using System.Collections.Generic; using BeWo.Service.Invoicing; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; namespace OwnSoftTest5Mrd.Invoicing { public class CustomInvoiceFactory : InvoiceFactory { public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) { foreach (var list in supportConcepts2ServiceRecords.Values) { foreach (var sr in list) { var cat = sr.ServiceDescription.Category; if (sr.CostBearer != null && !sr.CostBearer.Name.Contains("LWL") && !sr.CostBearer.Name.Contains("LVR") && !String.IsNullOrEmpty(cat.Name) && cat.Name.ToLower().Contains("soziotherapie")) { return new SoziotherapieInvoiceCreation(); } } } return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords); } } }