66 lines
2.4 KiB
C#
66 lines
2.4 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 TemplateNeuKunde.Invoicing
|
|
{
|
|
public class CustomInvoiceFactory : InvoiceFactory
|
|
{
|
|
// public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
|
// {
|
|
////Hier einkommentieren, wenn die Rechnungserstellung von einer bestimmten Kategorie einer Bewilligung abhängt
|
|
//foreach (var item in supportConcepts2ServiceRecords)
|
|
//{
|
|
// var csc = item.Key;
|
|
// var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(csc.CostBearerRelOids[0]);
|
|
|
|
// foreach (var scap in cb2sc.ApprovalPeriodList)
|
|
// {
|
|
// if (scap.ServiceCategory != null)
|
|
// {
|
|
// var ic = GetInvoiceCreatorForCategory(scap.ServiceCategory.Name);
|
|
// if (ic != null)
|
|
// return ic;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
////Hier einkommentieren, wenn die Rechnungserstellung von einer bestimmten Kategorie oder Organisation eines ServiceRecords abhängt
|
|
//foreach (var list in supportConcepts2ServiceRecords.Values)
|
|
// {
|
|
// foreach (var sr in list)
|
|
// {
|
|
// //Hier wird Kategorie geprüft
|
|
// var ic = GetInvoiceCreatorForCategory(sr.ServiceDescription.Category.Name);
|
|
// if (ic != null)
|
|
// return ic;
|
|
|
|
// //Hier wird Organisation geprüft
|
|
// if (sr.CostBearer.Name.ToLower().Contains("selbstzahler"))
|
|
// {
|
|
// return new CustomInvoiceCreation();
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
|
|
// }
|
|
|
|
// private InvoiceCreation GetInvoiceCreatorForCategory(String catName)
|
|
// {
|
|
// if (!String.IsNullOrEmpty(catName))
|
|
// {
|
|
// String cat = catName.ToLower().Trim();
|
|
// if (cat.IndexOf("assistenz") >= 0)
|
|
// return new CustomInvoiceCreation();
|
|
// }
|
|
// return null;
|
|
// }
|
|
}
|
|
}
|