From e00d6ec8a2badff916ea4853d6367f7923a60077 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 11 May 2026 10:48:38 +0200 Subject: [PATCH] Bugfix Team Pfeil im ServiceRecordValidator --- BeWoPlanerMobil/Controllers/MainController.cs | 6 ++- .../Validation/ServiceRecordValidator.cs | 41 ++++++++++--------- Service/Plugins/PluginLoader.cs | 4 +- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 2864d0fca..50c3c675f 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -1532,7 +1532,11 @@ namespace BeWoPlanerMobil.Controllers { //if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m)) //{ - var valRes = OperationsService.ValidateServiceRecord(Model.NewServiceRecord, null, 0, null, null); + var dummystats = new SupportConceptStatisticsDC(); + dummystats.PeriodStatistics = new List(); + var valRes = OperationsService.ValidateServiceRecord(Model.NewServiceRecord, dummystats, 0, null, null); + + var doppelt = valRes.Count > 0 && valRes.FirstOrDefault(v => v.ResultType == DoppelterEintrag) != null; if(!doppelt) diff --git a/ReportImp/TeamPfeil/Validation/ServiceRecordValidator.cs b/ReportImp/TeamPfeil/Validation/ServiceRecordValidator.cs index 620e7a043..c3c630d6e 100644 --- a/ReportImp/TeamPfeil/Validation/ServiceRecordValidator.cs +++ b/ReportImp/TeamPfeil/Validation/ServiceRecordValidator.cs @@ -32,27 +32,13 @@ namespace TeamPfeil.Validation }); } - SupportConceptPeriodStatisticsDC periodStat = GetStatisticsForServiceRecord(statistics, newServiceRecord); - if (periodStat == null && newServiceRecord.ServiceDescription.CategoryName.Contains("Qualifikationsniveau")) + if (statistics != null) { - if (!statistics.PeriodStatistics.Any(s => s.SupportConceptApprovalPeriod.ServiceCategory.Name == newServiceRecord.ServiceDescription.CategoryName)) - { - String handlungsOption = "Möchten Sie trotzdem Speichern?"; - bool hatDasRechtTrotzdemZuSpeichern = true; - - list.Add(new ServiceRecordValidationResultDC + SupportConceptPeriodStatisticsDC periodStat = GetStatisticsForServiceRecord(statistics, newServiceRecord); + if (periodStat == null && newServiceRecord.ServiceDescription.CategoryName.Contains("Qualifikationsniveau")) + { + if (!statistics.PeriodStatistics.Any(s => s.SupportConceptApprovalPeriod.ServiceCategory.Name == newServiceRecord.ServiceDescription.CategoryName)) { - ResultType = ServiceRecordValidationResult.Custom, - Message = "Achtung für Ihr Qualifikationsniveau gibt in diesem Hilfeplan keine passende Bewilligung." + - " \nBitte anderes Qualifikationsniveau als Leistungskategorie wählen.\n" + handlungsOption, - Allow = hatDasRechtTrotzdemZuSpeichern - }); - } - else - { - var aplist = statistics.PeriodStatistics.Where(s => s.SupportConceptApprovalPeriod.ServiceCategory.Name == newServiceRecord.ServiceDescription.CategoryName).ToList(); - if (aplist == null && !aplist.Any(a => a.SupportConceptApprovalPeriod.StartDate <= newServiceRecord.Start && a.SupportConceptApprovalPeriod.EndDate >= newServiceRecord.Start)) - { String handlungsOption = "Möchten Sie trotzdem Speichern?"; bool hatDasRechtTrotzdemZuSpeichern = true; @@ -64,6 +50,23 @@ namespace TeamPfeil.Validation Allow = hatDasRechtTrotzdemZuSpeichern }); } + else + { + var aplist = statistics.PeriodStatistics.Where(s => s.SupportConceptApprovalPeriod.ServiceCategory.Name == newServiceRecord.ServiceDescription.CategoryName).ToList(); + if (aplist == null && !aplist.Any(a => a.SupportConceptApprovalPeriod.StartDate <= newServiceRecord.Start && a.SupportConceptApprovalPeriod.EndDate >= newServiceRecord.Start)) + { + String handlungsOption = "Möchten Sie trotzdem Speichern?"; + bool hatDasRechtTrotzdemZuSpeichern = true; + + list.Add(new ServiceRecordValidationResultDC + { + ResultType = ServiceRecordValidationResult.Custom, + Message = "Achtung für Ihr Qualifikationsniveau gibt in diesem Hilfeplan keine passende Bewilligung." + + " \nBitte anderes Qualifikationsniveau als Leistungskategorie wählen.\n" + handlungsOption, + Allow = hatDasRechtTrotzdemZuSpeichern + }); + } + } } } return list; diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs index 64ab4aba8..38f287607 100644 --- a/Service/Plugins/PluginLoader.cs +++ b/Service/Plugins/PluginLoader.cs @@ -83,7 +83,7 @@ namespace BeWo.Service.Plugins //t = "7282396774"; // Caritas Unna //t = "6884855402"; // IBP //t = "4867997795"; // ADiK Kleve - t = "3184859776"; // Sergej Becker + //t = "3184859776"; // Sergej Becker //t = "7752610643"; // BWK Gbr //t = "3785623125"; // Betreuwo //t = "7130228334"; // LH Borken @@ -270,7 +270,7 @@ namespace BeWo.Service.Plugins //t = "2998118179"; // BeWo Plus //t = "9254115251"; // Praunheimer Werkstätten 2.DB //t = "5880845152"; // Bewegt Systemische Beratung und Begleitung (Kathrin Lilly) - //t = "5798370140"; // Team Pfeil + t = "5798370140"; // Team Pfeil //t = "8242644560"; // Bewolonia - Fr. Sultan Schulz //t = "4817284046"; // Verein für Sozialmedizin Stade e.V. //t = "6323001211"; // ASB Faßbacher Hof gGmbH