From deaf03d8fbbb641eb63a0403c32a6a3827cc4e4a Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Wed, 24 Apr 2024 12:14:17 +0200 Subject: [PATCH] MH: Schubkraft QB Bewilligungsdaten --- .../Quittierungsbeleg.Designer.cs | 2 +- .../Quittierungsbeleg.cs | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.Designer.cs b/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.Designer.cs index 383b92837..743826eb7 100644 --- a/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.Designer.cs +++ b/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.Designer.cs @@ -861,7 +861,7 @@ namespace ABCBetreuungenReports this.xrLabel25.StylePriority.UseForeColor = false; this.xrLabel25.StylePriority.UsePadding = false; this.xrLabel25.StylePriority.UseTextAlignment = false; - this.xrLabel25.Text = "Beginn 6 Monatszeitraum (\"flexible Leistungserbringung\")"; + this.xrLabel25.Text = "Beginn 12 Monatszeitraum (\"flexible Leistungserbringung\")"; this.xrLabel25.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; // // lblBewilligtFls diff --git a/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.cs b/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.cs index 5cde406ef..671f6c3d6 100644 --- a/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.cs +++ b/ReportImp/ABCBetreuungenReports/Quittierungsbeleg.cs @@ -116,24 +116,28 @@ namespace ABCBetreuungenReports decimal gesamtBewilligtProWoche = 0; foreach (var scap in dc.ApprovalPeriodList) { - - if (scap.ApprovedBEPerInterval.HasValue && scap.ApprovedBEInterval.HasValue) + if (scap.StartDate.Value >= pRO.StartDate && scap.StartDate.Value <= pRO.EndDate || scap.EndDate.Value >= pRO.StartDate && scap.EndDate.Value <= pRO.EndDate || + scap.StartDate.Value <= pRO.StartDate && scap.EndDate.Value >= pRO.EndDate) { - if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Weekly) - gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value; - else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Monthly) - gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month) * 7; - else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.HalfYearly) - gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / 26; - else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Yearly) - gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / 52; + if (scap.ApprovedBEPerInterval.HasValue && scap.ApprovedBEInterval.HasValue) + { + if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Weekly) + gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value; + else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Monthly) + gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month) * 7; + else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.HalfYearly) + gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / 26; + else if (scap.ApprovedBEInterval == SupportConceptApprovalInterval.Yearly) + gesamtBewilligtProWoche += scap.ApprovedBEPerInterval.Value / 52; - lblBewilligtFls.Text = String.Format("{0:0.00}", scap.ApprovedBEPerInterval.Value); - pRO.ApprovedFLSTotal = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).TotalDays / 7) * scap.ApprovedBEPerInterval.Value; + lblBewilligtFls.Text = String.Format("{0:0.00}", scap.ApprovedBEPerInterval.Value); + } + else + lblBewilligtFls.Text = string.Format("{0:0.00}", pRO.ApprovedFLSPerWeekTotal); } - else - lblBewilligtFls.Text = string.Format("{0:0.00}", pRO.ApprovedFLSPerWeekTotal); + //if (scap.EndDate.HasValue && scap.StartDate.HasValue && scap.ApprovedBEPerInterval.HasValue && scap.ApprovedBEInterval.HasValue) + //pRO.ApprovedFLSTotal += Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).TotalDays / 7) * scap.ApprovedBEPerInterval.Value; } if (gesamtBewilligtProWoche != 0) lblBewilligtFls.Text = string.Format("{0:0.00}", gesamtBewilligtProWoche);