From 6f1adf0910446d79e408a714059ced180aafd5e9 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 30 Apr 2025 15:27:05 +0200 Subject: [PATCH] =?UTF-8?q?CaritasverbandDuerenJuelichEV/Mitarbeiterauslas?= =?UTF-8?q?tung.cs=20-=20MinutesFreePerWeekStatisticDate=20-=20Ganze=20Anp?= =?UTF-8?q?assung=20raus,=20wird=20jetzt=20in=20sch=C3=B6n=20im=20Standard?= =?UTF-8?q?=20gemacht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mitarbeiterauslastung.cs | 161 +++++++++--------- .../Mitarbeiterauslastung.designer.cs | 4 +- 2 files changed, 86 insertions(+), 79 deletions(-) diff --git a/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.cs b/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.cs index b4ce43ee9..c20c9ef4b 100644 --- a/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.cs +++ b/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.cs @@ -26,86 +26,93 @@ namespace CaritasverbandDuerenJuelichEV { AuslastungBerechnung b = new AuslastungBerechnung(); b.CreateReport(pRO); - decimal flsSoll = 0; - decimal flsPlusMinus = 0; - decimal flsIst = 0; - AnalysisServiceImp analysisService = new AnalysisServiceImp(); - foreach (var ed in pRO.EmployeeDetailList) - { - if (ed.SupportConceptDetailList != null) - { - foreach (var sc in ed.SupportConceptDetailList) - { - if (sc.CostBearer2SupportConcept != null) - { - // Der Standard ist bei denen, dass die Bewilligung nicht übertragbar per Monat läuft - so etwas genauer, wegen Rundung in Bewilligung - if (sc.SupportConceptApprovalPeriod != null && sc.SupportConceptApprovalPeriod.IsApprovedBEShifting == false - && sc.SupportConceptApprovalPeriod.ApprovedBEInterval == BS.Shared.SupportConceptApprovalInterval.Monthly - && sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue) - { - flsSoll = sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value; - flsIst = CreateIst(sc, pRO.ReportStartDate, pRO.ReportEndDate) / 60; - if (sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee != null && - sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Count > 1) - { - var scapAnteil = sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Where(e => e.Employee.Oid == ed.Employee.Oid).FirstOrDefault(); - if (scapAnteil.Employee.Oid == ed.Employee.Oid) - { - var anteil = scapAnteil.Betreuungsschluessel / 100; - flsPlusMinus = Math.Round(flsSoll * anteil - flsIst * anteil, 2, MidpointRounding.AwayFromZero); - sc.FreiProMonat = flsPlusMinus; - sc.MinutesSoll = Math.Round(flsSoll * anteil, 2, MidpointRounding.AwayFromZero); - } - } - else - { - flsPlusMinus = flsSoll - flsIst; - sc.FreiProMonat = flsPlusMinus; - sc.MinutesSoll = flsSoll; - } - } - else - { - sc.MinutesSoll = sc.ApprovedHoursPerWeek *4.33m; - } - } - } - } - } - this.bindingSource1.DataSource = pRO; + // Übernahme in Standard + //decimal flsSoll = 0; + //decimal flsPlusMinus = 0; + //decimal flsIst = 0; + + //AnalysisServiceImp analysisService = new AnalysisServiceImp(); + // foreach (var ed in pRO.EmployeeDetailList) + // { + // if (ed.SupportConceptDetailList != null) + // { + // foreach (var sc in ed.SupportConceptDetailList) + // { + // if (sc.CostBearer2SupportConcept != null) + // { + // if (sc.Customer.Person.FirstName == "Ilona ") + // { + // int test = 0; + // } + // flsIst = CreateIst(sc, pRO.ReportStartDate, pRO.ReportEndDate) / 60; + + // // Der Standard ist bei denen, dass die Bewilligung nicht übertragbar per Monat läuft - so etwas genauer, wegen Rundung in Bewilligung + // if (sc.SupportConceptApprovalPeriod != null && sc.SupportConceptApprovalPeriod.IsApprovedBEShifting == false + // && sc.SupportConceptApprovalPeriod.ApprovedBEInterval == BS.Shared.SupportConceptApprovalInterval.Monthly + // && sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue) + // { + // flsSoll = sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value; + // if (sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee != null && + // sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Count > 1) + // { + // var scapAnteil = sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Where(e => e.Employee.Oid == ed.Employee.Oid).FirstOrDefault(); + // if (scapAnteil.Employee.Oid == ed.Employee.Oid) + // { + // var anteil = scapAnteil.Betreuungsschluessel / 100; + // flsPlusMinus = Math.Round(flsSoll * anteil - flsIst * anteil, 2, MidpointRounding.AwayFromZero); + // sc.FreiProMonat = flsPlusMinus; + // sc.MinutesSoll = Math.Round(flsSoll * anteil, 2, MidpointRounding.AwayFromZero); + // } + // } + // else + // { + // flsPlusMinus = flsSoll - flsIst; + // sc.FreiProMonat = flsPlusMinus; + // sc.MinutesSoll = flsSoll; + // } + // } + // else + // { + // sc.MinutesSoll = sc.ApprovedHoursPerWeek * 4.33m; + // } + // } + // } + // } + // } + this.bindingSource1.DataSource = pRO; } - private decimal CreateIst(MitarbeiterauslastungRO.SupportConceptDetail sd, DateTime reportStartDate, DateTime reportEndDate) - { - if (sd.CostBearer2SupportConcept == null || !sd.CostBearer2SupportConcept.Oid.HasValue) - { - return 0; - } - decimal minutes = 0; - IList records = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDays(sd.CostBearer2SupportConcept.Oid.Value, null); - var srListMonth = records.Where(sr => sr.Start >= reportStartDate && sr.Start < reportEndDate).ToList(); - Dictionary groupOids = new Dictionary(); - Dictionary srOids = new Dictionary(); - foreach (ServiceRecord sr in srListMonth) - { - if (!srOids.ContainsKey(sr.Oid.Value)) - { - srOids.Add(sr.Oid.Value, true); - if (sr.Start.Value < reportEndDate) - { - if (!sr.GroupOid.HasValue || !groupOids.ContainsKey(sr.GroupOid.Value)) - { - if (sr.GroupOid.HasValue) - groupOids.Add(sr.GroupOid.Value, true); + //private decimal CreateIst(MitarbeiterauslastungRO.SupportConceptDetail sd, DateTime reportStartDate, DateTime reportEndDate) + //{ + // if (sd.CostBearer2SupportConcept == null || !sd.CostBearer2SupportConcept.Oid.HasValue) + // { + // return 0; + // } + // decimal minutes = 0; + // IList records = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDays(sd.CostBearer2SupportConcept.Oid.Value, null); + // var srListMonth = records.Where(sr => sr.Start >= reportStartDate && sr.Start < reportEndDate).ToList(); + // Dictionary groupOids = new Dictionary(); + // Dictionary srOids = new Dictionary(); + // foreach (ServiceRecord sr in srListMonth) + // { + // if (!srOids.ContainsKey(sr.Oid.Value)) + // { + // srOids.Add(sr.Oid.Value, true); + // if (sr.Start.Value < reportEndDate) + // { + // if (!sr.GroupOid.HasValue || !groupOids.ContainsKey(sr.GroupOid.Value)) + // { + // if (sr.GroupOid.HasValue) + // groupOids.Add(sr.GroupOid.Value, true); - if (sr.ServiceDescription.ServiceCategory.IsBillable) - minutes += sr.RoundedDuration; - } - } - } - } + // if (sr.ServiceDescription.ServiceCategory.IsBillable) + // minutes += sr.RoundedDuration; + // } + // } + // } + // } - return minutes; - } + // return minutes; + //} } } \ No newline at end of file diff --git a/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.designer.cs b/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.designer.cs index 1726c24c7..0d828c3ea 100644 --- a/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.designer.cs +++ b/ReportImp/CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.designer.cs @@ -191,7 +191,7 @@ namespace CaritasverbandDuerenJuelichEV // xrTableCell28 // this.xrTableCell28.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.MinutesSoll", "{0:0.00}")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.ApprovedHoursPerMonth", "{0:0.00}")}); this.xrTableCell28.Name = "xrTableCell28"; this.xrTableCell28.Text = "xrTableCell28"; this.xrTableCell28.Weight = 0.090171325518485085D; @@ -365,7 +365,7 @@ namespace CaritasverbandDuerenJuelichEV // cellSollGesamt // this.cellSollGesamt.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.MinutesSoll")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.ApprovedHoursPerMonth")}); this.cellSollGesamt.Name = "cellSollGesamt"; xrSummary1.Running = DevExpress.XtraReports.UI.SummaryRunning.Group; this.cellSollGesamt.Summary = xrSummary1;