From c8c46fda293dff8f38fd1c5cef3c171ee0006792 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Thu, 12 Feb 2026 16:39:52 +0100 Subject: [PATCH] HshCologne/ServiceInvoiceReport - finetuning --- ReportImp/HshCologne/CustomReportCreator.cs | 4 +- .../ServiceInvoiceReport.Designer.cs | 73 +++++++-------- ReportImp/HshCologne/ServiceInvoiceReport.cs | 92 ++++++++++++------- .../HshCologne/ServiceInvoiceReportFLS.cs | 9 +- 4 files changed, 105 insertions(+), 73 deletions(-) diff --git a/ReportImp/HshCologne/CustomReportCreator.cs b/ReportImp/HshCologne/CustomReportCreator.cs index 382876466..9eb74e911 100644 --- a/ReportImp/HshCologne/CustomReportCreator.cs +++ b/ReportImp/HshCologne/CustomReportCreator.cs @@ -163,8 +163,8 @@ namespace HshCologne { foreach (ServicesOverviewRO.ServiceDetail s in ro.Services) { - if (s.ServiceCategory.ToLower().Contains("familien")) - { + if (s.ServiceCategory.ToLower().Contains("familien") || s.ServiceCategory.ToLower().Contains("außerschulische") || s.ServiceCategory.ToLower() == "fam") + { spfhRo.Services.Add(s); } else if (s.ServiceCategory.ToLower().Contains("schulbegleitung")) diff --git a/ReportImp/HshCologne/ServiceInvoiceReport.Designer.cs b/ReportImp/HshCologne/ServiceInvoiceReport.Designer.cs index a717442b9..467ccdaac 100644 --- a/ReportImp/HshCologne/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/HshCologne/ServiceInvoiceReport.Designer.cs @@ -49,12 +49,12 @@ namespace HshCologne this.xrTableCell28 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell29 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell30 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell31 = new DevExpress.XtraReports.UI.XRTableCell(); + this.lblHeaderBewilligung = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableRow11 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell34 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell38 = new DevExpress.XtraReports.UI.XRTableCell(); this.lblHauptbetreuung = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell41 = new DevExpress.XtraReports.UI.XRTableCell(); + this.lblBewilligung = new DevExpress.XtraReports.UI.XRTableCell(); this.ruleRateFactorNull = new DevExpress.XtraReports.UI.FormattingRule(); this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand(); this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox(); @@ -88,9 +88,9 @@ namespace HshCologne this.xrTableCell33 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell35 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell46 = new DevExpress.XtraReports.UI.XRTableCell(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.xrSubreport1 = new DevExpress.XtraReports.UI.XRSubreport(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable8)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable9)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); @@ -245,7 +245,7 @@ namespace HshCologne this.xrTableCell28, this.xrTableCell29, this.xrTableCell30, - this.xrTableCell31}); + this.lblHeaderBewilligung}); this.xrTableRow9.Font = new DevExpress.Drawing.DXFont("Calibri", 11F, DevExpress.Drawing.DXFontStyle.Bold); this.xrTableRow9.Name = "xrTableRow9"; this.xrTableRow9.StylePriority.UseFont = false; @@ -296,21 +296,21 @@ namespace HshCologne this.xrTableCell30.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; this.xrTableCell30.Weight = 1.374920436411744D; // - // xrTableCell31 + // lblHeaderBewilligung // - this.xrTableCell31.BackColor = System.Drawing.Color.Gainsboro; - this.xrTableCell31.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + this.lblHeaderBewilligung.BackColor = System.Drawing.Color.Gainsboro; + this.lblHeaderBewilligung.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) | DevExpress.XtraPrinting.BorderSide.Right))); - this.xrTableCell31.Font = new DevExpress.Drawing.DXFont("Calibri", 11F); - this.xrTableCell31.Multiline = true; - this.xrTableCell31.Name = "xrTableCell31"; - this.xrTableCell31.StylePriority.UseBackColor = false; - this.xrTableCell31.StylePriority.UseBorders = false; - this.xrTableCell31.StylePriority.UseFont = false; - this.xrTableCell31.StylePriority.UseTextAlignment = false; - this.xrTableCell31.Text = "Bew. FLS/Woche"; - this.xrTableCell31.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; - this.xrTableCell31.Weight = 1.0222974208584734D; + this.lblHeaderBewilligung.Font = new DevExpress.Drawing.DXFont("Calibri", 11F); + this.lblHeaderBewilligung.Multiline = true; + this.lblHeaderBewilligung.Name = "lblHeaderBewilligung"; + this.lblHeaderBewilligung.StylePriority.UseBackColor = false; + this.lblHeaderBewilligung.StylePriority.UseBorders = false; + this.lblHeaderBewilligung.StylePriority.UseFont = false; + this.lblHeaderBewilligung.StylePriority.UseTextAlignment = false; + this.lblHeaderBewilligung.Text = "Bew. FLS"; + this.lblHeaderBewilligung.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; + this.lblHeaderBewilligung.Weight = 1.0222974208584734D; // // xrTableRow11 // @@ -318,7 +318,7 @@ namespace HshCologne this.xrTableCell34, this.xrTableCell38, this.lblHauptbetreuung, - this.xrTableCell41}); + this.lblBewilligung}); this.xrTableRow11.Name = "xrTableRow11"; this.xrTableRow11.Weight = 1D; // @@ -366,24 +366,19 @@ namespace HshCologne this.lblHauptbetreuung.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; this.lblHauptbetreuung.Weight = 1.3749204364117442D; // - // xrTableCell41 + // lblBewilligung // - this.xrTableCell41.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + this.lblBewilligung.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell41.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.CostBearer2SupportConcept.ApprovalPeriodList.ApprovedBEPerI" + - "nterval")}); - this.xrTableCell41.Font = new DevExpress.Drawing.DXFont("Calibri", 11F); - this.xrTableCell41.Multiline = true; - this.xrTableCell41.Name = "xrTableCell41"; - this.xrTableCell41.StylePriority.UseBorders = false; - this.xrTableCell41.StylePriority.UseFont = false; - this.xrTableCell41.StylePriority.UseTextAlignment = false; - this.xrTableCell41.Text = "xrTableCell14"; - this.xrTableCell41.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; - this.xrTableCell41.TextFormatString = "{0:0.00}"; - this.xrTableCell41.Weight = 1.0222974208584734D; + this.lblBewilligung.Font = new DevExpress.Drawing.DXFont("Calibri", 11F); + this.lblBewilligung.Multiline = true; + this.lblBewilligung.Name = "lblBewilligung"; + this.lblBewilligung.StylePriority.UseBorders = false; + this.lblBewilligung.StylePriority.UseFont = false; + this.lblBewilligung.StylePriority.UseTextAlignment = false; + this.lblBewilligung.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; + this.lblBewilligung.Weight = 1.0222974208584734D; // // ruleRateFactorNull // @@ -770,10 +765,6 @@ namespace HshCologne this.xrTableCell46.TextFormatString = "{0:C2}"; this.xrTableCell46.Weight = 0.57828633439123656D; // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); - // // GroupHeader1 // this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { @@ -788,6 +779,10 @@ namespace HshCologne this.xrSubreport1.ReportSource = new HshCologne.ServiceInvoiceReportFLS(); this.xrSubreport1.SizeF = new System.Drawing.SizeF(650F, 90F); // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); + // // ServiceInvoiceReport // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -852,12 +847,12 @@ namespace HshCologne private DevExpress.XtraReports.UI.XRTableCell xrTableCell28; private DevExpress.XtraReports.UI.XRTableCell xrTableCell29; private DevExpress.XtraReports.UI.XRTableCell xrTableCell30; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell31; + private DevExpress.XtraReports.UI.XRTableCell lblHeaderBewilligung; private DevExpress.XtraReports.UI.XRTableRow xrTableRow11; private DevExpress.XtraReports.UI.XRTableCell xrTableCell34; private DevExpress.XtraReports.UI.XRTableCell xrTableCell38; private DevExpress.XtraReports.UI.XRTableCell lblHauptbetreuung; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell41; + private DevExpress.XtraReports.UI.XRTableCell lblBewilligung; private DevExpress.XtraReports.UI.XRTable xrTable1; private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; diff --git a/ReportImp/HshCologne/ServiceInvoiceReport.cs b/ReportImp/HshCologne/ServiceInvoiceReport.cs index 18292ec0e..5c6f1c07b 100644 --- a/ReportImp/HshCologne/ServiceInvoiceReport.cs +++ b/ReportImp/HshCologne/ServiceInvoiceReport.cs @@ -25,16 +25,8 @@ namespace HshCologne { DateTime start = pRO.AccountingPeriodStart; DateTime end = pRO.AccountingPeriodEnd; - //if (start.Month == end.Month && start.Year == end.Year) - //{ - // lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Monat {0:MMMM yyyy} folgende erbrachte Tätigkeiten:", start); - //} - //else - //{ - // lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end); - //} - SetzeAdresse(pRO); + if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0) { var c = DAOFactory.GenericDAO.LoadByID(pRO.ServiceInvoicePeriods[0].Customer.Oid.Value); @@ -72,28 +64,51 @@ namespace HshCologne // Daten für Bewilligungsumfang setzen -// foreach (var sip in pRO.ServiceInvoicePeriods) -// { -// string periode = ""; -// var scap = cb2sc.ApprovalPeriodList.Where(ap => ap.ServiceCategory != null && ap.ServiceCategory.Name.Contains("Interne") && -//ap.StartDate < pRO.AccountingPeriodEnd && ap.EndDate > pRO.AccountingPeriodStart).FirstOrDefault(); - -// if (sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval != null && sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval != 0) -// { - //switch (sip.SupportConceptApprovalPeriod.ApprovedBEInterval) - //{ - // case BS.Shared.SupportConceptApprovalInterval.Daily: periode = "Tag"; break; - // case BS.Shared.SupportConceptApprovalInterval.Weekly: periode = "Woche"; break; - // case BS.Shared.SupportConceptApprovalInterval.Monthly: periode = "Monat"; break; - // case BS.Shared.SupportConceptApprovalInterval.HalfYearly: periode = "Halbjahr"; break; - // case BS.Shared.SupportConceptApprovalInterval.Yearly: periode = "Jahr"; break; - // case BS.Shared.SupportConceptApprovalInterval.Fortnightly: periode = "Pauschal"; break; - - //} - - // var test = string.Format("{0:0.00}", sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval) + " FLS / " + periode + " bis " + string.Format("{0:dd.MM.yyyy}", sip.SupportConceptApprovalPeriod.EndDate) + "\n"; - // } - //} + string periode = ""; + var sipMitFLS = pRO.ServiceInvoicePeriods.Where(sip => sip.SupportConceptApprovalPeriod?.ApprovedBEPerInterval is decimal value && value != 0m).ToList(); + if (sipMitFLS != null && sipMitFLS.Count > 0 && sipMitFLS.Count == 1) //sollte der Standard sein, dass es nur eine aktuelle Bewilligung gibt + { + periode = GetIntervalType(sipMitFLS[0].SupportConceptApprovalPeriod.ApprovedBEInterval); + lblHeaderBewilligung.Text += "/ " + periode; + lblBewilligung.Text = sipMitFLS[0].SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value.ToString("n2"); + } + else if (sipMitFLS != null && sipMitFLS.Count > 1) //wenn mehr als eine Bewilligung, können Bewilligungsintervalle unterschiedlich sein + { + string anteil = ""; + string fls = ""; + bool periodenWechsel = false; // falls die Bewilligungsintervalle unterschiedlich sind, wird das Interval nicht in Überschrift ausgewiesen + foreach (var sip in sipMitFLS) + { + anteil = GetIntervalType(sip.SupportConceptApprovalPeriod.ApprovedBEInterval); + decimal bew = sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value; + if (periode == "") + { + periode = anteil; + } + else if (!periode.Contains(anteil) && !periodenWechsel) // eine weitere Bewilligung + { + periodenWechsel = true; + fls += "/" + periode + "\n" + bew.ToString("n2") + "/" + anteil; + } + else if (periodenWechsel) // noch mehr Bewilligungen + { + fls += "\n" + bew.ToString("n2") + "/" + anteil; + } + if (fls == "") + { + fls = bew.ToString("n2"); + } + else if (!periodenWechsel) + { + fls += "\n" + bew.ToString("n2"); + } + } + if (!periodenWechsel) + { + lblHeaderBewilligung.Text += "/" + periode; + } + lblBewilligung.Text = fls; + } if (pRO.ServiceInvoicePeriods.All(sip => sip.ServiceInvoiceItems != null)) { @@ -121,6 +136,21 @@ namespace HshCologne this.bindingSource1.DataSource = pRO; } + private string GetIntervalType(SupportConceptApprovalInterval? interval) + { + string periode = ""; + switch (interval) + { + case BS.Shared.SupportConceptApprovalInterval.Daily: periode = "Tag"; break; + case BS.Shared.SupportConceptApprovalInterval.Weekly: periode = "Woche"; break; + case BS.Shared.SupportConceptApprovalInterval.Monthly: periode = "Monat"; break; + case BS.Shared.SupportConceptApprovalInterval.HalfYearly: periode = "Halbjahr"; break; + case BS.Shared.SupportConceptApprovalInterval.Yearly: periode = "Jahr"; break; + case BS.Shared.SupportConceptApprovalInterval.Fortnightly: periode = "Pauschal"; break; + } + return periode; + } + private void CopyServiceInvoicePeriod(ServiceInvoicePeriodRO existingSip, ServiceInvoicePeriodRO copySip) { copySip.ApprovalPeriod = existingSip.ApprovalPeriod; diff --git a/ReportImp/HshCologne/ServiceInvoiceReportFLS.cs b/ReportImp/HshCologne/ServiceInvoiceReportFLS.cs index 739f468ce..92aae6445 100644 --- a/ReportImp/HshCologne/ServiceInvoiceReportFLS.cs +++ b/ReportImp/HshCologne/ServiceInvoiceReportFLS.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using BeWo.Data.Access; @@ -56,7 +57,7 @@ namespace HshCologne festeKm = true; } } - if (sip.ServiceInvoiceItems.Any(ii => ii.ServiceDescription == "Tagessatz")) + if (sip.ServiceInvoiceItems.Any(ii => ii.UnitDescription == "Tagessatz")) { sip.ServiceInvoiceItems = sip.ServiceInvoiceItems.Where(ii => ii.UnitDescription != "Tagessatz").ToList(); } @@ -94,6 +95,12 @@ namespace HshCologne } } } + else // sehr uncool - ServiceRecord ist gelöscht + { + string old = ii.Duration.Substring(0, 8); + DateTime date = DateTime.ParseExact(old, "dd.MM.yy", CultureInfo.GetCultureInfo("de-DE")); + ii.Duration = string.Format(CultureInfo.GetCultureInfo("de-DE"), "{0:ddd}./{0:dd.MM}", date); + } } } }