From 8dbfe0441a8cc694ffef3c29b8545afc180ff82f Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 10 Mar 2025 14:38:21 +0100 Subject: [PATCH] FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceCreation.cs - Keine Aggregierung der Leistungen --- .../FlexibleJugendarbeitFrankfurtEV.csproj | 3 ++ .../Invoicing/CustomInvoiceCreation.cs | 31 ++++++++++++ .../Invoicing/CustomInvoiceFactory.cs | 48 +++++++++++++++++++ .../ServiceInvoiceReport.Designer.cs | 32 +++++++------ 4 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceCreation.cs create mode 100644 ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceFactory.cs diff --git a/ReportImp/FlexibleJugendarbeitFrankfurtEV/FlexibleJugendarbeitFrankfurtEV.csproj b/ReportImp/FlexibleJugendarbeitFrankfurtEV/FlexibleJugendarbeitFrankfurtEV.csproj index 652ee7584..0b9642797 100644 --- a/ReportImp/FlexibleJugendarbeitFrankfurtEV/FlexibleJugendarbeitFrankfurtEV.csproj +++ b/ReportImp/FlexibleJugendarbeitFrankfurtEV/FlexibleJugendarbeitFrankfurtEV.csproj @@ -58,6 +58,8 @@ + + Component @@ -142,5 +144,6 @@ Designer + \ No newline at end of file diff --git a/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceCreation.cs b/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceCreation.cs new file mode 100644 index 000000000..0d636462f --- /dev/null +++ b/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceCreation.cs @@ -0,0 +1,31 @@ +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; +using BeWo.Service.Invoicing; +using BS.Shared; +using BS.Shared.Core; +using BS.Shared.DataContracts; +using BS.Shared.Extensions; +using BS.Shared.Services; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FlexibleJugendarbeitFrankfurtEV.Invoicing +{ + public class CustomInvoiceCreation : InvoiceCreation + { + public override string GetSummaryItemKey(SupportConceptApprovalPeriod scap, InvoiceItem iitem, bool summaryPerMonth) + { + String key = String.Format("{0:0.0000}_{1}_{2}", iitem.AmountPerUnit, iitem.RateFactor, iitem.ItemDescription); + if (summaryPerMonth) + { + key = String.Format("{0:0.0000}_{1}_{2}_{3:yyyyMM}", iitem.AmountPerUnit, iitem.RateFactor, iitem.ItemDescription, iitem.ItemPeriodStart); + } + + return key; + } + } +} diff --git a/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceFactory.cs b/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceFactory.cs new file mode 100644 index 000000000..bf837244f --- /dev/null +++ b/ReportImp/FlexibleJugendarbeitFrankfurtEV/Invoicing/CustomInvoiceFactory.cs @@ -0,0 +1,48 @@ +using BeWo.Service.Invoicing; +using BS.Shared.DataContracts; +using BS.Shared.DataContracts.Compact; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FlexibleJugendarbeitFrankfurtEV.Invoicing +{ + public class CustomInvoiceFactory : InvoiceFactory + { + public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) + { + foreach (var list in supportConcepts2ServiceRecords.Values) + { + if (list != null && list.Count > 0) + { + foreach (var sr in list) + { + if (sr.CostBearer != null) + { + if (sr.CostBearer.Name.Contains("Amt für Jugend und Soziales Frankfurt (Oder)")) + { + return new CustomInvoiceCreation(); + } + } + } + } + else + { + foreach (var item in supportConcepts2ServiceRecords.Keys) + { + if (item != null && item.CostBearerList != null && item.CostBearerList.Count > 0) + { + if (item.CostBearerList[0].OrganisationName.Contains("Amt für Jugend und Soziales Frankfurt(Oder)")) + { + return new CustomInvoiceCreation(); + } + } + } + } + } + return new InvoiceCreation(); + } + } +} diff --git a/ReportImp/FlexibleJugendarbeitFrankfurtEV/ServiceInvoiceReport.Designer.cs b/ReportImp/FlexibleJugendarbeitFrankfurtEV/ServiceInvoiceReport.Designer.cs index 8c4efae4b..3840f88bb 100644 --- a/ReportImp/FlexibleJugendarbeitFrankfurtEV/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/FlexibleJugendarbeitFrankfurtEV/ServiceInvoiceReport.Designer.cs @@ -40,6 +40,7 @@ namespace FlexibleJugendarbeitFrankfurtEV this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.xrRichText1 = new DevExpress.XtraReports.UI.XRRichText(); this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); this.lblAdresse = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); @@ -76,7 +77,6 @@ namespace FlexibleJugendarbeitFrankfurtEV this.xrLabel11 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); - this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); ((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); @@ -176,6 +176,20 @@ namespace FlexibleJugendarbeitFrankfurtEV this.Page1.Name = "Page1"; this.Page1.StylePriority.UseFont = false; // + // xrLabel1 + // + this.xrLabel1.BackColor = System.Drawing.Color.Transparent; + this.xrLabel1.CanShrink = true; + this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Arial", 11F); + this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 191.0417F); + this.xrLabel1.Name = "xrLabel1"; + this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel1.SizeF = new System.Drawing.SizeF(650F, 20F); + this.xrLabel1.StylePriority.UseBackColor = false; + this.xrLabel1.StylePriority.UseFont = false; + this.xrLabel1.Text = "Kennzahl Flexible Jugendarbeit: [DebitorNumber]"; + this.xrLabel1.WordWrap = false; + // // lblAdresse // this.lblAdresse.Font = new DevExpress.Drawing.DXFont("Arial", 11F); @@ -468,6 +482,8 @@ namespace FlexibleJugendarbeitFrankfurtEV this.xrTable6}); this.Detail3.HeightF = 25F; this.Detail3.Name = "Detail3"; + this.Detail3.SortFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] { + new DevExpress.XtraReports.UI.GroupField("HourlyRate", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)}); // // xrTable6 // @@ -651,20 +667,6 @@ namespace FlexibleJugendarbeitFrankfurtEV // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); // - // xrLabel1 - // - this.xrLabel1.BackColor = System.Drawing.Color.Transparent; - this.xrLabel1.CanShrink = true; - this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Arial", 11F); - this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 191.0417F); - this.xrLabel1.Name = "xrLabel1"; - this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel1.SizeF = new System.Drawing.SizeF(650F, 20F); - this.xrLabel1.StylePriority.UseBackColor = false; - this.xrLabel1.StylePriority.UseFont = false; - this.xrLabel1.Text = "Kennzahl Flexible Jugendarbeit: [DebitorNumber]"; - this.xrLabel1.WordWrap = false; - // // ServiceInvoiceReport // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {