From 41bd70180ce1801d0db25a684e849a858c812f29 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 18 Jun 2026 10:59:57 +0200 Subject: [PATCH] LH Frankfurt Oder, Bugfix Ersteller Infos wurden nicht auf den Rechnungen angezeigt --- .../Invoicing/AbwInvoiceCreation.cs | 38 +++++++++++-- .../BesondereWohnformInvoiceCreation.cs | 38 +++++++++++-- .../EinzelfallhilfeInvoiceCreation.cs | 42 +++++++++++++-- .../Invoicing/FudInvoiceCreation.cs | 53 ++++++++++++++++--- .../Invoicing/HortInvoiceCreation.cs | 32 ++++++++++- .../LebenshilfeFrankfurtOder/RechnungFud.cs | 3 -- 6 files changed, 185 insertions(+), 21 deletions(-) diff --git a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/AbwInvoiceCreation.cs b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/AbwInvoiceCreation.cs index cc33d5a98..9e2c6fc2a 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/AbwInvoiceCreation.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/AbwInvoiceCreation.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using BeWo.Data; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.DCEntityMapper; using BeWo.Service.Invoicing; using BeWo.Service.Plugins; +using BeWo.Service.ServiceImplementations; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; +using System; +using System.Collections.Generic; +using System.Linq; namespace LebenshilfeFrankfurtOder.Invoicing { @@ -101,6 +103,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing return result; } + public override void SetSenderInformation(ServiceInvoice serviceInvoice) + { + ApplicationUser user = null; + if (LoggedInUserOperationContextExt.Current != null) + { + user = LoggedInUserOperationContextExt.Current.User; + } + else + { + user = SessionFacade.LoggedInUser; + } + + var mandator = new OperationsServiceImp().GetMandator2(false); + serviceInvoice.InvoiceBase.SenderAddress = new Address + { + Street = mandator.Street, + PostalCode = mandator.PostalCode, + Town = mandator.Town, + State = mandator.State + }; + + if (user != null) + { + serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName; + serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName; + serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList(); + + } + } + private void SetzeCategory(ServiceInvoice i, List records) { foreach (var sr in records) diff --git a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/BesondereWohnformInvoiceCreation.cs b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/BesondereWohnformInvoiceCreation.cs index 3501e4678..97ff50d9e 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/BesondereWohnformInvoiceCreation.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/BesondereWohnformInvoiceCreation.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using BeWo.Data; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.DCEntityMapper; using BeWo.Service.Invoicing; using BeWo.Service.Plugins; +using BeWo.Service.ServiceImplementations; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; +using System; +using System.Collections.Generic; +using System.Linq; namespace LebenshilfeFrankfurtOder.Invoicing { @@ -100,6 +102,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList); } + public override void SetSenderInformation(ServiceInvoice serviceInvoice) + { + ApplicationUser user = null; + if (LoggedInUserOperationContextExt.Current != null) + { + user = LoggedInUserOperationContextExt.Current.User; + } + else + { + user = SessionFacade.LoggedInUser; + } + + var mandator = new OperationsServiceImp().GetMandator2(false); + serviceInvoice.InvoiceBase.SenderAddress = new Address + { + Street = mandator.Street, + PostalCode = mandator.PostalCode, + Town = mandator.Town, + State = mandator.State + }; + + if (user != null) + { + serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName; + serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName; + serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList(); + + } + } + public override void SetServiceInvoicePeriods(ServiceInvoice invoice, CostBearer2SupportConcept costBearer2SupportConcept, DateTimeSpan invoicePeriod, List serviceRecords) { diff --git a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/EinzelfallhilfeInvoiceCreation.cs b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/EinzelfallhilfeInvoiceCreation.cs index 2231d362b..44af51875 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/EinzelfallhilfeInvoiceCreation.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/EinzelfallhilfeInvoiceCreation.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using BeWo.Data; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.DCEntityMapper; using BeWo.Service.Invoicing; using BeWo.Service.Plugins; +using BeWo.Service.ServiceImplementations; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; +using System; +using System.Collections.Generic; +using System.Linq; namespace LebenshilfeFrankfurtOder.Invoicing { @@ -91,7 +93,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing //public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer) //{ - + // if (istSelbstzahler || brauchtExtraPrivatrechnung) // { @@ -117,9 +119,39 @@ namespace LebenshilfeFrankfurtOder.Invoicing // { // base.SetRecipientInformation(serviceInvoice, costBearer); // } - + //} + public override void SetSenderInformation(ServiceInvoice serviceInvoice) + { + ApplicationUser user = null; + if (LoggedInUserOperationContextExt.Current != null) + { + user = LoggedInUserOperationContextExt.Current.User; + } + else + { + user = SessionFacade.LoggedInUser; + } + + var mandator = new OperationsServiceImp().GetMandator2(false); + serviceInvoice.InvoiceBase.SenderAddress = new Address + { + Street = mandator.Street, + PostalCode = mandator.PostalCode, + Town = mandator.Town, + State = mandator.State + }; + + if (user != null) + { + serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName; + serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName; + serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList(); + + } + } + public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod, IList supportConceptList) { diff --git a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/FudInvoiceCreation.cs b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/FudInvoiceCreation.cs index 424cbe967..ca0594bf5 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/FudInvoiceCreation.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/FudInvoiceCreation.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using BeWo.Data; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.DCEntityMapper; using BeWo.Service.Invoicing; using BeWo.Service.Plugins; +using BeWo.Service.ServiceImplementations; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; @@ -13,6 +12,9 @@ using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; using DevExpress.Office.Drawing; +using System; +using System.Collections.Generic; +using System.Linq; namespace LebenshilfeFrankfurtOder.Invoicing { @@ -155,6 +157,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing return result; } + public override void SetSenderInformation(ServiceInvoice serviceInvoice) + { + ApplicationUser user = null; + if (LoggedInUserOperationContextExt.Current != null) + { + user = LoggedInUserOperationContextExt.Current.User; + } + else + { + user = SessionFacade.LoggedInUser; + } + + var mandator = new OperationsServiceImp().GetMandator2(false); + serviceInvoice.InvoiceBase.SenderAddress = new Address + { + Street = mandator.Street, + PostalCode = mandator.PostalCode, + Town = mandator.Town, + State = mandator.State + }; + + if (user != null) + { + serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName; + serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName; + serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList(); + + } + } + private InvoiceItem GetMaxBetragItem(ServiceInvoice invoice) { decimal? maxBetrag = null; @@ -218,7 +250,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing { foreach (var sr in records) { - if (sr.ServiceDescription.Name.Contains("Kurskosten") || sr.ServiceDescription.Name.Contains("Mittag")) + if (MussPrivatAbgerechnetWerden(sr.ServiceDescription.Name)) { return true; } @@ -231,7 +263,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing { foreach (var sr in records) { - if (!sr.ServiceDescription.Name.Contains("Kurskosten") && !sr.ServiceDescription.Name.Contains("Mittag")) + if (!MussPrivatAbgerechnetWerden(sr.ServiceDescription.Name)) { return true; } @@ -240,6 +272,15 @@ namespace LebenshilfeFrankfurtOder.Invoicing return false; } + private bool MussPrivatAbgerechnetWerden(String nameDerLeistung) + { + if (nameDerLeistung.Contains("Kurskosten") || nameDerLeistung.Contains("Mittag") || "FED Disco Verpflegung".Equals(nameDerLeistung)) + { + return true; + } + + return false; + } public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List serviceRecords) { @@ -360,7 +401,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing if (cat.Contains("§45") || cat.Contains("§42") || cat.Contains("§39")) { - if (i.ServiceDescription.Name.Contains("Kurskosten") || i.ServiceDescription.Name.Contains("Mittag")) + if (MussPrivatAbgerechnetWerden(i.ServiceDescription.Name)) { valid = istPrivatrechnung; } diff --git a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/HortInvoiceCreation.cs b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/HortInvoiceCreation.cs index 15c1f19fa..515dff58c 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/Invoicing/HortInvoiceCreation.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/Invoicing/HortInvoiceCreation.cs @@ -83,7 +83,37 @@ namespace LebenshilfeFrankfurtOder.Invoicing return result; } - private List CreatePrivatRechnungen(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC sc, List serviceRecords) + public override void SetSenderInformation(ServiceInvoice serviceInvoice) + { + ApplicationUser user = null; + if (LoggedInUserOperationContextExt.Current != null) + { + user = LoggedInUserOperationContextExt.Current.User; + } + else + { + user = SessionFacade.LoggedInUser; + } + + var mandator = new OperationsServiceImp().GetMandator2(false); + serviceInvoice.InvoiceBase.SenderAddress = new Address + { + Street = mandator.Street, + PostalCode = mandator.PostalCode, + Town = mandator.Town, + State = mandator.State + }; + + if (user != null) + { + serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName; + serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName; + serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList(); + + } + } + + private List CreatePrivatRechnungen(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC sc, List serviceRecords) { IList defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Customer); diff --git a/ReportImp/LebenshilfeFrankfurtOder/RechnungFud.cs b/ReportImp/LebenshilfeFrankfurtOder/RechnungFud.cs index e50cd9c9e..4474a4fd6 100644 --- a/ReportImp/LebenshilfeFrankfurtOder/RechnungFud.cs +++ b/ReportImp/LebenshilfeFrankfurtOder/RechnungFud.cs @@ -20,7 +20,6 @@ namespace LebenshilfeFrankfurtOder public void SetReportDataSource(ServiceInvoiceRO pRO) { - CheckLastschriftAndAnschrift(pRO); if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail)) @@ -36,9 +35,7 @@ namespace LebenshilfeFrankfurtOder pRO.SenderContactPersonFax = pRO.SenderContactPersonFax.Replace("Fax:", "").Trim(); } - StringBuilder sb = new StringBuilder(); - if (!String.IsNullOrEmpty(pRO.RecipientOrganisation)) {