MalteserJohanniterJohanneshaus/Invoicing/AnwesenheitenZeiterfassungRO.cs und InvoiceTSH Teilarbeit
SupportOID=162787
This commit is contained in:
@@ -54,7 +54,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
|
||||
var c2aodList = new Dictionary<CompactCustomerDC, string[]>();
|
||||
|
||||
var alleHilfeplaene = DAOFactory.GenericDAO.GetAllActive<SupportConcept>();
|
||||
var hpsTsh = alleHilfeplaene.SelectMany(sc => sc.CostBearer2SupportConceptList.Where(c2s => c2s.StartDate < end && c2s.CostBearer.Oid == 1
|
||||
var hpsTsh = alleHilfeplaene.SelectMany(sc => sc.CostBearer2SupportConceptList.Where(c2s => c2s.StartDate < end
|
||||
&& c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains(kostenstelle))).ToList();
|
||||
|
||||
foreach (var c2s in hpsTsh)
|
||||
|
||||
@@ -28,47 +28,99 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
|
||||
invoice.InvoiceBase.InvoiceTypeText = "RgTSH";
|
||||
}
|
||||
|
||||
// die haben 2 Standorte für TSH, die über Kostenstellen unter Notiz im Hilfeplan identifiziert werden
|
||||
// Es werden grundsätzlich volle Tagessätze aus der Verwaltung abgerechnet
|
||||
// die haben 2 Standorte f<EFBFBD>r TSH, die <EFBFBD>ber Kostenstellen unter Notiz im Hilfeplan identifiziert werden
|
||||
// Es werden grunds<EFBFBD>tzlich volle Tagess<EFBFBD>tze aus der Verwaltung abgerechnet
|
||||
// alle Abwesenheitstage werden nur mit 75 % berechnet
|
||||
public override List<ServiceInvoiceDC> GenerateServiceInvoices(long costBearerOid,
|
||||
DateTimeSpan invoicePeriod,
|
||||
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
||||
{
|
||||
var costBearer = DAOFactory.GenericDAO.LoadByID<CostBearer>(costBearerOid);
|
||||
//FuegeAbgelaufeneHilfeplaeneMitAktuellenBewilligungenHinzu(costBearer, invoicePeriod, supportConcepts2ServiceRecords);
|
||||
var invoiceList = new List<ServiceInvoice>();
|
||||
ServiceInvoice invoice;
|
||||
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> Aulholf = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
|
||||
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> Hannes = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
|
||||
|
||||
bool isLvr = costBearer.Organisation.Name != null && costBearer.Organisation.Name.Contains("LVR");
|
||||
|
||||
if (isLvr)
|
||||
{
|
||||
invoiceList.AddRange(GenerateLvrSammelrechnungen(costBearer, invoicePeriod, supportConcepts2ServiceRecords));
|
||||
}
|
||||
else
|
||||
{
|
||||
invoiceList.AddRange(GenerateEinzelrechnungen(costBearer, invoicePeriod, supportConcepts2ServiceRecords));
|
||||
}
|
||||
|
||||
var result = invoiceList.Select(item => MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(item)).ToList();
|
||||
return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result;
|
||||
}
|
||||
|
||||
private List<ServiceInvoice> GenerateLvrSammelrechnungen(CostBearer costBearer, DateTimeSpan invoicePeriod,
|
||||
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
||||
{
|
||||
var invoiceList = new List<ServiceInvoice>();
|
||||
var aulholf = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
|
||||
var hannes = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
|
||||
|
||||
foreach (var sc in supportConcepts2ServiceRecords.Keys)
|
||||
{
|
||||
var c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(sc.CostBearerRelOids[0]);
|
||||
if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("45"))
|
||||
{
|
||||
Aulholf.Add(sc, supportConcepts2ServiceRecords[sc]);
|
||||
aulholf.Add(sc, supportConcepts2ServiceRecords[sc]);
|
||||
}
|
||||
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("50"))
|
||||
{
|
||||
Hannes.Add(sc, supportConcepts2ServiceRecords[sc]);
|
||||
hannes.Add(sc, supportConcepts2ServiceRecords[sc]);
|
||||
}
|
||||
}
|
||||
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, Aulholf);
|
||||
|
||||
var invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, aulholf);
|
||||
if (invoice != null)
|
||||
{
|
||||
invoice.InvoiceBase.InvoiceTypeText = "KSt.45";
|
||||
invoiceList.Add(invoice);
|
||||
}
|
||||
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, Hannes);
|
||||
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, hannes);
|
||||
if (invoice != null)
|
||||
{
|
||||
invoice.InvoiceBase.InvoiceTypeText = "KSt.50";
|
||||
invoiceList.Add(invoice);
|
||||
}
|
||||
|
||||
var result = invoiceList.Select(item => MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(item)).ToList();
|
||||
return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result;
|
||||
return invoiceList;
|
||||
}
|
||||
|
||||
private List<ServiceInvoice> GenerateEinzelrechnungen(CostBearer costBearer, DateTimeSpan invoicePeriod,
|
||||
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
||||
{
|
||||
var invoiceList = new List<ServiceInvoice>();
|
||||
var invoiceCounter = 0;
|
||||
|
||||
foreach (var sc in supportConcepts2ServiceRecords.Keys)
|
||||
{
|
||||
var c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(sc.CostBearerRelOids[0]);
|
||||
string kostenstelle = null;
|
||||
if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("45"))
|
||||
{
|
||||
kostenstelle = "KSt.45";
|
||||
}
|
||||
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("50"))
|
||||
{
|
||||
kostenstelle = "KSt.50";
|
||||
}
|
||||
|
||||
var invoice = CreateSingleInvoice(invoiceCounter, costBearer, invoicePeriod, sc, supportConcepts2ServiceRecords[sc]);
|
||||
if (invoice != null)
|
||||
{
|
||||
if (kostenstelle != null)
|
||||
{
|
||||
invoice.InvoiceBase.InvoiceTypeText = kostenstelle;
|
||||
}
|
||||
invoiceList.Add(invoice);
|
||||
invoiceCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
return invoiceList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user