MalteserJohanniterJohanneshaus/RechnungBesWohnformen - 5. Kostenstelle ergänzt, monatsübergreifende Abw getunt

MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs - für andere Kostenträger erweitert
This commit is contained in:
2024-11-11 10:49:12 +01:00
parent a7af08e199
commit 04f6e22db0
3 changed files with 33 additions and 12 deletions

View File

@@ -236,7 +236,7 @@ order by ib.invoicenumber
join supportconcept sc on sc.customeroid = c.oid
inner join costbearer2supportconcept c2s on c2s.supportconceptoid = sc.oid
WHERE ib.`AccountingPeriodEnd` >= ':Monat_Start' AND ib.`AccountingPeriodEnd` < ':Monat_End' AND ib.IsActive = 1
AND ib.RecipientOrganisationOid = 147
AND ib.RecipientOrganisation like '%besW%'
ORDER BY c.DebitorNumber
";

View File

@@ -28,6 +28,10 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
invoice.InvoiceBase.InvoiceTypeText = "RgBesWohnformen";
}
// die haben 5 Standorte, die über Kostenstellen unter Notiz im Hilfeplan identifiziert werden
// Es werden grundsätzlich volle Tagessätze aus der Verwaltung abgerechnet, bei Abwesenheiten > 3 Tage,
// werden alle Abwesenheitstage nur mit 75 % berechnet
public override List<ServiceInvoiceDC> GenerateServiceInvoices(long costBearerOid,
DateTimeSpan invoicePeriod,
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
@@ -38,6 +42,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> TeamKaldauen = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> TeamRoisdorf = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> TeamSiegburg = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> TeamSiegburgDWP = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> TeamWitter = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
foreach (var sc in supportConcepts2ServiceRecords.Keys)
@@ -49,7 +54,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
}
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("15"))
{
TeamSiegburg.Add(sc, supportConcepts2ServiceRecords[sc]);
TeamSiegburgDWP.Add(sc, supportConcepts2ServiceRecords[sc]);
}
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("20"))
{
@@ -59,8 +64,18 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
{
TeamRoisdorf.Add(sc, supportConcepts2ServiceRecords[sc]);
}
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("40"))
{
TeamSiegburg.Add(sc, supportConcepts2ServiceRecords[sc]);
}
}
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamKaldauen);
if (invoice != null)
invoiceList.Add(invoice);
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamSiegburgDWP);
if (invoice != null)
invoiceList.Add(invoice);
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamWitter);
if (invoice != null)
invoiceList.Add(invoice);
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamRoisdorf);
@@ -69,10 +84,6 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamSiegburg);
if (invoice != null)
invoiceList.Add(invoice);
invoice = CreateCollectiveBilling2(costBearer, invoicePeriod, TeamWitter);
if (invoice != null)
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;
@@ -83,7 +94,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
var invoice = new ServiceInvoice();
var newDict = new Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>>();
foreach (var sc2sr in supportConcepts2ServiceRecords)
foreach (var sc2sr in supportConcepts2ServiceRecords) // Abrechnung erfolgt auch wenn nur beantragt
{
if (sc2sr.Key.IsApproved)
newDict.Add(sc2sr.Key, sc2sr.Value);
@@ -95,7 +106,6 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
SetCollectiveBillingBaseData(0, invoice, costBearer, invoicePeriod, newDict);
SetCollectiveBillingServiceInvoicePeriods(invoice, invoicePeriod, newDict);
SetServiceInvoicePeriodAmounts(invoice);
SetAmountAdvancePayments(invoice);
return invoice;
@@ -136,15 +146,21 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
DateTime start;
DateTime ende;
if (scap.StartDate <= serviceInvoicePeriod.Start)
{
start = serviceInvoicePeriod.Start.Value;
}
else
start = (DateTime)scap.StartDate;
{
start = (DateTime)scap.StartDate;
}
if (scap.EndDate >= serviceInvoicePeriod.End)
{
ende = serviceInvoicePeriod.End.Value;
}
else
{
ende = (DateTime)scap.EndDate.Value;
}
decimal tagessatz = 0;
var crList = scap.ServiceCategory.CostRatePeriods;
@@ -180,7 +196,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
}
else
{
endAbw = ende.AddDays(-1);
endAbw = ende;
}
if (startAbw.HasValue && startAbw.Value < monatEnde && (!endAbw.HasValue || endAbw.Value >= monatStart))
{

View File

@@ -76,6 +76,7 @@ namespace MalteserJohanniterJohanneshaus
}
}
ErstelleAbwesenheitenTabelle(pRO);
pRO.ServiceInvoicePeriods = pRO.ServiceInvoicePeriods.OrderBy(s => s.Customer.LastNameFirstName).ToList();
this.bindingSource1.DataSource = pRO;
}
@@ -101,6 +102,10 @@ namespace MalteserJohanniterJohanneshaus
{
team = "Johanneshaus Roisdorf";
}
else if (c2s.Notice.IsNotNullOrEmpty() && c2s.Notice.Contains("40"))
{
team = "Johanneshaus Siegburg";
}
lblAdresse.Text = team;
}