From 04f6e22db095bcb1ecfabb125a3839b62fd508fa Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 11 Nov 2024 10:49:12 +0100 Subject: [PATCH] =?UTF-8?q?MalteserJohanniterJohanneshaus/RechnungBesWohnf?= =?UTF-8?q?ormen=20-=205.=20Kostenstelle=20erg=C3=A4nzt,=20monats=C3=BCber?= =?UTF-8?q?greifende=20Abw=20getunt=20MalteserJohanniterJohanneshaus/Datev?= =?UTF-8?q?/DatevExporter.cs=20-=20f=C3=BCr=20andere=20Kostentr=C3=A4ger?= =?UTF-8?q?=20erweitert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Datev/DatevExporter.cs | 2 +- .../Invoicing/CollectiveInvoiceCreation.cs | 38 +++++++++++++------ .../RechnungBesWohnformen.cs | 5 +++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ReportImp/MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs b/ReportImp/MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs index 2c93d4c36..bdbd74085 100644 --- a/ReportImp/MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs +++ b/ReportImp/MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs @@ -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 "; diff --git a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs index 066de7873..1fb934675 100644 --- a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs +++ b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs @@ -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 GenerateServiceInvoices(long costBearerOid, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords) @@ -38,6 +42,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing Dictionary> TeamKaldauen = new Dictionary>(); Dictionary> TeamRoisdorf = new Dictionary>(); Dictionary> TeamSiegburg = new Dictionary>(); + Dictionary> TeamSiegburgDWP = new Dictionary>(); Dictionary> TeamWitter = new Dictionary>(); 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>(); - 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)) { diff --git a/ReportImp/MalteserJohanniterJohanneshaus/RechnungBesWohnformen.cs b/ReportImp/MalteserJohanniterJohanneshaus/RechnungBesWohnformen.cs index bfbb95a89..4cf75221d 100644 --- a/ReportImp/MalteserJohanniterJohanneshaus/RechnungBesWohnformen.cs +++ b/ReportImp/MalteserJohanniterJohanneshaus/RechnungBesWohnformen.cs @@ -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; }