From 40313909e67ca0e46e4cce7f77fba4e876bc686b Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 8 Jan 2025 09:36:32 +0100 Subject: [PATCH] InternationalesFamilienzentrum/Statistics/CustomServiceRecordStatisticFactory.cs && SupportConceptReport.cs Min und Max Stunden in jeweiliger Leistungskategorie --- .../CustomServiceRecordStatisticFactory.cs | 137 ++++++++++-- .../SupportConceptReport.Designer.cs | 207 +++++++++--------- .../SupportConceptReport.cs | 69 ++++++ 3 files changed, 294 insertions(+), 119 deletions(-) diff --git a/ReportImp/InternationalesFamilienzentrum/Statistics/CustomServiceRecordStatisticFactory.cs b/ReportImp/InternationalesFamilienzentrum/Statistics/CustomServiceRecordStatisticFactory.cs index a972eb080..b05b32bb6 100644 --- a/ReportImp/InternationalesFamilienzentrum/Statistics/CustomServiceRecordStatisticFactory.cs +++ b/ReportImp/InternationalesFamilienzentrum/Statistics/CustomServiceRecordStatisticFactory.cs @@ -1,4 +1,5 @@ -using System; + +using System; using System.Collections.Generic; using BeWo.Data.Access; using BeWo.Data.Entities; @@ -12,28 +13,29 @@ using BS.Shared.Services; namespace InternationalesFamilienzentrum.Statistics { - public class CustomServiceRecordStatisticFactory : ServiceRecordStatisticFactory - { + public class CustomServiceRecordStatisticFactory : ServiceRecordStatisticFactory + { public override ServiceRecordStatisticsInfoDC GetServiceRecordStatisticInfo(long costBearer2SupportConceptOid, DateTime statisticsDate) { var stats = CreateSupportConceptStatisticsImpl(costBearer2SupportConceptOid, statisticsDate); - var dc = new ServiceRecordStatisticsInfoDC(); - dc.Header = new string[4]; + dc.Header = new string[6]; dc.Header[0] = "Bewilligungszeitraum:"; dc.Header[1] = "Bewilligt diesen Monat/Gesamt:"; - dc.Header[2] = "Geleistet diesen Monat/Gesamt:"; - dc.Header[3] = "Frei diesen Monat/Gesamt:"; + dc.Header[2] = "Minimum pro Woche/Gesamt:"; + dc.Header[3] = "Maximum pro Woche/Gesamt:"; + dc.Header[4] = "Geleistet diesen Monat/Gesamt:"; + dc.Header[5] = "Frei diesen Monat/Gesamt:"; - dc.ForegroundColor = new string[4]; + dc.ForegroundColor = new string[6]; dc.ForegroundColor[0] = "#FF2B508B"; dc.ForegroundColor[1] = "#FF2B508B"; dc.ForegroundColor[2] = "#FF2B508B"; dc.ForegroundColor[3] = "#FF2B508B"; - + dc.ForegroundColor[4] = "#FF2B508B"; + dc.ForegroundColor[5] = "#FF2B508B"; dc.PeriodStatisticInfos = new List(); - if (stats != null) { if (stats.PeriodStatistics.Count > 1 && !TimeSpanIsEqual(stats)) @@ -67,8 +69,7 @@ namespace InternationalesFamilienzentrum.Statistics public ServiceRecordPeriodStatisticsInfoDC CreateServiceRecordPeriodStatisticsInfo(SupportConceptStatisticsDC stats, SupportConceptPeriodStatisticsDC periodStats, DateTime statisticsDate) { - var dc = CreateDefaultServiceRecordPeriodStatisticsInfo(4); - + var dc = CreateDefaultServiceRecordPeriodStatisticsInfo(6); if (periodStats.SupportConceptApprovalPeriod != null) { if (periodStats.SupportConceptApprovalPeriod.ServiceCategory != null) @@ -77,26 +78,130 @@ namespace InternationalesFamilienzentrum.Statistics periodStats.SupportConceptApprovalPeriod.ServiceCategory.Name, periodStats.SupportConceptApprovalPeriod.StartDate, periodStats.SupportConceptApprovalPeriod.EndDate); + //Berechnung der Minimum/Maximumwerte für den Hilfeplan, eigentlich sollte immer die Leistungsgruppe gesetzt sein, das glaube ich aber nur bedingt + BerechneAuslastungNachLeistungsgruppen(periodStats); } else { dc.LeftValues[0] = String.Format("{0:dd.MM.yy} - {1:dd.MM.yy}", periodStats.SupportConceptApprovalPeriod.StartDate, periodStats.SupportConceptApprovalPeriod.EndDate); + //Berechnung der Minimum/Maximumwerte für den Hilfeplan, hilfsweise aus bewilligten Minuten + BerechneAuslastungNachBewilligtenMin(periodStats); } } dc.LeftValues[1] = String.Format("{0:0.00}", periodStats.MinutesApprovedPerMonth / 60); dc.RightValues[1] = String.Format("{0:0.00}", periodStats.MinutesApprovedTotal / 60); - dc.LeftValues[2] = String.Format("{0:0.00}", periodStats.MinutesProvidedThisMonth / 60); - dc.RightValues[2] = String.Format("{0:0.00}", periodStats.MinutesProvidedTotalRounded / 60); + var ratio = periodStats.MinutesApprovedTotal / periodStats.MinutesApprovedPerWeek; + dc.LeftValues[2] = String.Format("{0:0.00}", Math.Round(periodStats.Custom1.Value / 60, 2, MidpointRounding.AwayFromZero)); + dc.RightValues[2] = String.Format("{0:0.00}", Math.Round(periodStats.Custom1.Value * ratio / 60, 2, MidpointRounding.AwayFromZero)); - dc.LeftValues[3] = String.Format("{0:0.00}", (periodStats.MinutesApprovedPerMonth - periodStats.MinutesProvidedThisMonth) / 60); - dc.RightValues[3] = String.Format("{0:0.00}", (periodStats.MinutesApprovedTotal - periodStats.MinutesProvidedTotalRounded) / 60); + dc.LeftValues[3] = String.Format("{0:0.00}", Math.Round(periodStats.Custom2.Value / 60, 2, MidpointRounding.AwayFromZero)); + dc.RightValues[3] = String.Format("{0:0.00}", Math.Round(periodStats.Custom2.Value * ratio / 60, 2, MidpointRounding.AwayFromZero)); + + dc.LeftValues[4] = String.Format("{0:0.00}", periodStats.MinutesProvidedThisMonth / 60); + dc.RightValues[4] = String.Format("{0:0.00}", periodStats.MinutesProvidedTotalRounded / 60); + + dc.LeftValues[5] = String.Format("{0:0.00}", (periodStats.MinutesApprovedPerMonth - periodStats.MinutesProvidedThisMonth) / 60); + dc.RightValues[5] = String.Format("{0:0.00}", (periodStats.MinutesApprovedTotal - periodStats.MinutesProvidedTotalRounded) / 60); return dc; } + private void BerechneAuslastungNachLeistungsgruppen(SupportConceptPeriodStatisticsDC period) + { + period.Custom1 = 0; // Min-wert zu leisten in der LG + period.Custom2 = 0; // Max-wert zu leisten in der LG + + if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 1")) + { + period.Custom1 += 8; + period.Custom2 = 90; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 2")) + { + period.Custom1 += 91; + period.Custom2 = 150; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 3")) + { + period.Custom1 += 151; + period.Custom2 = 210; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 4")) + { + period.Custom1 += 211; + period.Custom2 = 270; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 5")) + { + period.Custom1 += 271; + period.Custom2 = 390; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 6")) + { + period.Custom1 += 391; + period.Custom2 = 510; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 7")) + { + period.Custom1 += 511; + period.Custom2 = 750; + } + else if (period.SupportConceptApprovalPeriod.ServiceCategory.Name.Contains("LG 8")) + { + period.Custom1 += 751; + period.Custom2 = 1050; + } + } + + private void BerechneAuslastungNachBewilligtenMin(SupportConceptPeriodStatisticsDC period) + { + period.Custom1 = 0; // Min-wert zu leisten in der LG + period.Custom2 = 0; // Max-wert zu leisten in der LG + + if (period.MinutesApprovedPerWeek < 91) + { + period.Custom1 += 8; + period.Custom2 = 90; + } + else if (period.MinutesApprovedPerWeek * 60 < 151) + { + period.Custom1 += 91; + period.Custom2 = 150; + } + else if (period.MinutesApprovedPerWeek < 211) + { + period.Custom1 += 151; + period.Custom2 = 210; + } + else if (period.MinutesApprovedPerWeek < 271) + { + period.Custom1 += 211; + period.Custom2 = 270; + } + else if (period.MinutesApprovedPerWeek < 391) + { + period.Custom1 += 271; + period.Custom2 = 390; + } + else if (period.MinutesApprovedPerWeek < 511) + { + period.Custom1 += 391; + period.Custom2 = 510; + } + else if (period.MinutesApprovedPerWeek < 751) + { + period.Custom1 += 511; + period.Custom2 = 750; + } + else if (period.MinutesApprovedPerWeek < 1051) + { + period.Custom1 += 751; + period.Custom2 = 1050; + } + } } } diff --git a/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.Designer.cs b/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.Designer.cs index 0d4c225bb..5278c7be9 100644 --- a/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.Designer.cs +++ b/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.Designer.cs @@ -65,6 +65,7 @@ namespace InternationalesFamilienzentrum this.xrTableCell34 = new DevExpress.XtraReports.UI.XRTableCell(); this.ruleNotApprovedAndExpiringNext4Months = new DevExpress.XtraReports.UI.FormattingRule(); this.ruleNotApprovedAndExpiringNext8Months = new DevExpress.XtraReports.UI.FormattingRule(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.PageHeader = new DevExpress.XtraReports.UI.PageHeaderBand(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); @@ -112,20 +113,19 @@ namespace InternationalesFamilienzentrum this.xrTableCell52 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell53 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell54 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell55 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell56 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell57 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell58 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell59 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell60 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell61 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell62 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell63 = new DevExpress.XtraReports.UI.XRTableCell(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.xrTableCell64 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell65 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell66 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell67 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell68 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell69 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell70 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell71 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell72 = new DevExpress.XtraReports.UI.XRTableCell(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // Detail @@ -189,7 +189,7 @@ namespace InternationalesFamilienzentrum this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 0, 100F); this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow2}); - this.xrTable2.SizeF = new System.Drawing.SizeF(1315F, 20F); + this.xrTable2.SizeF = new System.Drawing.SizeF(1259F, 20F); this.xrTable2.StylePriority.UseBackColor = false; this.xrTable2.StylePriority.UseBorders = false; this.xrTable2.StylePriority.UseFont = false; @@ -203,19 +203,19 @@ namespace InternationalesFamilienzentrum this.xrTableCell36, this.xrTableCell20, this.xrTableCell21, + this.xrTableCell65, this.xrTableCell22, this.xrTableCell23, + this.xrTableCell70, + this.xrTableCell69, this.xrTableCell24, this.xrTableCell25, this.xrTableCell26, this.xrTableCell27, this.xrTableCell28, this.xrTableCell29, - this.xrTableCell62, this.xrTableCell30, this.xrTableCell31, - this.xrTableCell58, - this.xrTableCell57, this.xrTableCell32, this.xrTableCell33, this.xrTableCell34}); @@ -419,6 +419,10 @@ namespace InternationalesFamilienzentrum this.ruleNotApprovedAndExpiringNext8Months.Formatting.BackColor = System.Drawing.Color.LightBlue; this.ruleNotApprovedAndExpiringNext8Months.Name = "ruleNotApprovedAndExpiringNext8Months"; // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.SupportConceptListRO); + // // PageHeader // this.PageHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { @@ -438,7 +442,7 @@ namespace InternationalesFamilienzentrum this.xrTable1.Name = "xrTable1"; this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow1}); - this.xrTable1.SizeF = new System.Drawing.SizeF(1315F, 42F); + this.xrTable1.SizeF = new System.Drawing.SizeF(1259F, 42F); this.xrTable1.StylePriority.UseBackColor = false; this.xrTable1.StylePriority.UseBorders = false; this.xrTable1.StylePriority.UseFont = false; @@ -453,19 +457,19 @@ namespace InternationalesFamilienzentrum this.xrTableCell35, this.xrTableCell3, this.xrTableCell4, + this.xrTableCell64, this.xrTableCell5, this.xrTableCell6, + this.xrTableCell68, + this.xrTableCell67, this.xrTableCell7, this.xrTableCell8, this.xrTableCell9, this.xrTableCell10, this.xrTableCell11, this.xrTableCell12, - this.xrTableCell61, this.xrTableCell13, this.xrTableCell14, - this.xrTableCell56, - this.xrTableCell55, this.xrTableCell15, this.xrTableCell16, this.xrTableCell17}); @@ -637,7 +641,7 @@ namespace InternationalesFamilienzentrum this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 0, 100F); this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow3}); - this.xrTable3.SizeF = new System.Drawing.SizeF(1315F, 20F); + this.xrTable3.SizeF = new System.Drawing.SizeF(1259F, 20F); this.xrTable3.StylePriority.UseBackColor = false; this.xrTable3.StylePriority.UseBorders = false; this.xrTable3.StylePriority.UseFont = false; @@ -651,19 +655,19 @@ namespace InternationalesFamilienzentrum this.xrTableCell39, this.xrTableCell40, this.xrTableCell41, + this.xrTableCell66, this.xrTableCell42, this.xrTableCell43, + this.xrTableCell72, + this.xrTableCell71, this.xrTableCell44, this.xrTableCell45, this.xrTableCell46, this.xrTableCell47, this.xrTableCell48, this.xrTableCell49, - this.xrTableCell63, this.xrTableCell50, this.xrTableCell51, - this.xrTableCell60, - this.xrTableCell59, this.xrTableCell52, this.xrTableCell53, this.xrTableCell54}); @@ -862,84 +866,81 @@ namespace InternationalesFamilienzentrum this.xrTableCell54.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; this.xrTableCell54.Weight = 0.13525699097924734D; // - // xrTableCell55 + // xrTableCell64 // - this.xrTableCell55.Multiline = true; - this.xrTableCell55.Name = "xrTableCell55"; - this.xrTableCell55.Text = "Differenz Korridor Max in %"; - this.xrTableCell55.Weight = 0.18935977902718335D; + this.xrTableCell64.Multiline = true; + this.xrTableCell64.Name = "xrTableCell64"; + this.xrTableCell64.Text = "Leistungs-gruppe"; + this.xrTableCell64.Weight = 0.13525698632089916D; // - // xrTableCell56 + // xrTableCell65 // - this.xrTableCell56.Multiline = true; - this.xrTableCell56.Name = "xrTableCell56"; - this.xrTableCell56.Text = "Differenz Korridor Min in %"; - this.xrTableCell56.Weight = 0.18935977902718335D; - // - // xrTableCell57 - // - this.xrTableCell57.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "SupportConceptDetailList.Custom3")}); - this.xrTableCell57.Multiline = true; - this.xrTableCell57.Name = "xrTableCell57"; - this.xrTableCell57.StylePriority.UseTextAlignment = false; - this.xrTableCell57.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell57.Weight = 0.1893597790271834D; - // - // xrTableCell58 - // - this.xrTableCell58.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "SupportConceptDetailList.Custom2")}); - this.xrTableCell58.Multiline = true; - this.xrTableCell58.Name = "xrTableCell58"; - this.xrTableCell58.StylePriority.UseTextAlignment = false; - this.xrTableCell58.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell58.Weight = 0.1893597790271834D; - // - // xrTableCell59 - // - this.xrTableCell59.Multiline = true; - this.xrTableCell59.Name = "xrTableCell59"; - this.xrTableCell59.StylePriority.UseTextAlignment = false; - this.xrTableCell59.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell59.Weight = 0.1893597790271834D; - // - // xrTableCell60 - // - this.xrTableCell60.Multiline = true; - this.xrTableCell60.Name = "xrTableCell60"; - this.xrTableCell60.StylePriority.UseTextAlignment = false; - this.xrTableCell60.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell60.Weight = 0.1893597790271834D; - // - // xrTableCell61 - // - this.xrTableCell61.Multiline = true; - this.xrTableCell61.Name = "xrTableCell61"; - this.xrTableCell61.Text = "Leistungs-gruppe"; - this.xrTableCell61.Weight = 0.17853922903987912D; - // - // xrTableCell62 - // - this.xrTableCell62.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + this.xrTableCell65.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "SupportConceptDetailList.Custom1")}); - this.xrTableCell62.Multiline = true; - this.xrTableCell62.Name = "xrTableCell62"; - this.xrTableCell62.StylePriority.UseTextAlignment = false; - this.xrTableCell62.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell62.Weight = 0.17853922903987909D; + this.xrTableCell65.Multiline = true; + this.xrTableCell65.Name = "xrTableCell65"; + this.xrTableCell65.StylePriority.UseTextAlignment = false; + this.xrTableCell65.Text = "xrTableCell65"; + this.xrTableCell65.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell65.Weight = 0.13525698632089914D; // - // xrTableCell63 + // xrTableCell66 // - this.xrTableCell63.Multiline = true; - this.xrTableCell63.Name = "xrTableCell63"; - this.xrTableCell63.StylePriority.UseTextAlignment = false; - this.xrTableCell63.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrTableCell63.Weight = 0.17853922903987909D; + this.xrTableCell66.Multiline = true; + this.xrTableCell66.Name = "xrTableCell66"; + this.xrTableCell66.StylePriority.UseTextAlignment = false; + this.xrTableCell66.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell66.Weight = 0.13525698632089914D; // - // bindingSource1 + // xrTableCell67 // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.SupportConceptListRO); + this.xrTableCell67.Multiline = true; + this.xrTableCell67.Name = "xrTableCell67"; + this.xrTableCell67.Text = "Max Std / Laufzeit HP"; + this.xrTableCell67.Weight = 0.135256986233857D; + // + // xrTableCell68 + // + this.xrTableCell68.Multiline = true; + this.xrTableCell68.Name = "xrTableCell68"; + this.xrTableCell68.Text = "Min Std / Laufzeit HP"; + this.xrTableCell68.Weight = 0.135256986233857D; + // + // xrTableCell69 + // + this.xrTableCell69.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "SupportConceptDetailList.Custom3")}); + this.xrTableCell69.Multiline = true; + this.xrTableCell69.Name = "xrTableCell69"; + this.xrTableCell69.StylePriority.UseTextAlignment = false; + this.xrTableCell69.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell69.Weight = 0.135256986233857D; + // + // xrTableCell70 + // + this.xrTableCell70.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "SupportConceptDetailList.Custom2")}); + this.xrTableCell70.Multiline = true; + this.xrTableCell70.Name = "xrTableCell70"; + this.xrTableCell70.StylePriority.UseTextAlignment = false; + this.xrTableCell70.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell70.Weight = 0.135256986233857D; + // + // xrTableCell71 + // + this.xrTableCell71.Multiline = true; + this.xrTableCell71.Name = "xrTableCell71"; + this.xrTableCell71.StylePriority.UseTextAlignment = false; + this.xrTableCell71.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell71.Weight = 0.135256986233857D; + // + // xrTableCell72 + // + this.xrTableCell72.Multiline = true; + this.xrTableCell72.Name = "xrTableCell72"; + this.xrTableCell72.StylePriority.UseTextAlignment = false; + this.xrTableCell72.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrTableCell72.Weight = 0.135256986233857D; // // Hilfeplanuebersicht // @@ -967,9 +968,9 @@ namespace InternationalesFamilienzentrum xrWatermark1.Id = "Watermark1"; this.Watermarks.Add(xrWatermark1); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } @@ -1052,14 +1053,14 @@ namespace InternationalesFamilienzentrum private DevExpress.XtraReports.UI.XRTableCell xrTableCell52; private DevExpress.XtraReports.UI.XRTableCell xrTableCell53; private DevExpress.XtraReports.UI.XRTableCell xrTableCell54; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell58; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell57; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell56; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell55; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell60; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell59; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell62; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell61; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell63; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell65; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell70; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell69; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell64; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell68; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell67; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell66; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell72; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell71; } } diff --git a/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.cs b/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.cs index 2ca58930c..89549b076 100644 --- a/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.cs +++ b/ReportImp/InternationalesFamilienzentrum/SupportConceptReport.cs @@ -6,6 +6,8 @@ using DevExpress.XtraReports.UI; using BS.Shared.Extensions; using BeWo.Report.ReportObjects; using BeWo.Report; +using BeWo.Data.Access; +using BeWo.Data.Entities; namespace InternationalesFamilienzentrum { @@ -28,6 +30,73 @@ namespace InternationalesFamilienzentrum } private void BerechneAuslastungNachLeistungsgruppen(SupportConceptListRO pRO) + { + foreach (var sc in pRO.SupportConceptDetailList) + { + sc.Custom1 = "KEINE"; + sc.Custom2 = ""; // Auslastung LG in % Min-wert + sc.Custom3 = ""; // Auslastung LG in % Max-wert + + if (sc.CostBearer2SupportConceptOid > 0) + { + var c2s = DAOFactory.GenericDAO.LoadByID(sc.CostBearer2SupportConceptOid); + foreach (var scap in c2s.ApprovalPeriodList) + { + if (scap.ServiceCategory != null) + { + sc.Custom1 = scap.ServiceCategory.Name; // Leistungsgruppe + } + } + } + decimal ratio = 1; + if (sc.FLSPerWeekSoll != 0) + { + ratio = sc.FLSTotal / sc.FLSPerWeekSoll; + } + if (sc.Custom1.Contains("LG 1")) + { + sc.Custom2 = Math.Round(8 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(90 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 2")) + { + sc.Custom2 = Math.Round(91 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(150 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 3")) + { + sc.Custom2 = Math.Round(151 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(210 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 4")) + { + sc.Custom2 = Math.Round(211 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(270 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 5")) + { + sc.Custom2 = Math.Round(271 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(390 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 6")) + { + sc.Custom2 = Math.Round(391 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(510 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 7")) + { + sc.Custom2 = Math.Round(511 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(750 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + else if (sc.Custom1.Contains("LG 8")) + { + sc.Custom2 = Math.Round(751 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + sc.Custom3 = Math.Round(1050 * ratio / 60, 2, MidpointRounding.AwayFromZero).ToString(); + } + } + } + + private void BerechneAuslastungNachLeistungsgruppenOld(SupportConceptListRO pRO) { foreach (var sc in pRO.SupportConceptDetailList) {