From ae27f0394251c9da576058730c95f791fa90dc4c Mon Sep 17 00:00:00 2001 From: Alexandra Date: Tue, 10 Oct 2023 13:48:36 +0200 Subject: [PATCH] =?UTF-8?q?AidshilfeEssen/Service/CustomGroupDurationCalcu?= =?UTF-8?q?lator=20Anpassung=20f=C3=BCr=2067er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AidshilfeEssen/AidshilfeEssen.csproj | 1 + .../Service/CustomGroupDurationCalculator.cs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 ReportImp/AidshilfeEssen/Service/CustomGroupDurationCalculator.cs diff --git a/ReportImp/AidshilfeEssen/AidshilfeEssen.csproj b/ReportImp/AidshilfeEssen/AidshilfeEssen.csproj index b1b6354d2..07643356e 100644 --- a/ReportImp/AidshilfeEssen/AidshilfeEssen.csproj +++ b/ReportImp/AidshilfeEssen/AidshilfeEssen.csproj @@ -63,6 +63,7 @@ ServiceInvoiceReport.cs + Component diff --git a/ReportImp/AidshilfeEssen/Service/CustomGroupDurationCalculator.cs b/ReportImp/AidshilfeEssen/Service/CustomGroupDurationCalculator.cs new file mode 100644 index 000000000..c58de2fbe --- /dev/null +++ b/ReportImp/AidshilfeEssen/Service/CustomGroupDurationCalculator.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using BeWo.Data.Entities; +using BeWo.Service.Plugins; +using BS.Shared.Core; +using BS.Shared.DataContracts; + +namespace AidshilfeEssen.Calculations +{ + public class CustomGroupDurationCalculator : GroupDurationCalculator + { + public override void CalculateGroupDuration(ServiceRecordGroup group) + { + base.CalculateGroupDuration(group); + + foreach (var sr in group.ServiceRecordList) + { + if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("67") && (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("lvr") || sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("lwl"))) + { + sr.RoundedDuration = Math.Floor(sr.RoundedDuration / 10) * 10; + } + } + } + } +}