From 3103c9bbb205117f9170803e91c0addbbe9d4748 Mon Sep 17 00:00:00 2001 From: HirschleM Date: Tue, 7 Oct 2025 16:59:53 +0200 Subject: [PATCH] =?UTF-8?q?MH:=20Haus=20D=C3=BClken=200=20Min=20SR=20verbi?= =?UTF-8?q?eten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Validation/ServiceRecordValidator.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ReportImp/HausDuelken/Validation/ServiceRecordValidator.cs b/ReportImp/HausDuelken/Validation/ServiceRecordValidator.cs index 743c27333..23cb69af7 100644 --- a/ReportImp/HausDuelken/Validation/ServiceRecordValidator.cs +++ b/ReportImp/HausDuelken/Validation/ServiceRecordValidator.cs @@ -27,6 +27,25 @@ namespace KetteReports.Validation return new[] { "Arbeitszeit", "Pause" }; } + public override List ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, IList employeeOids, IList cb2scOids) + { + var results = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids); + + if (newServiceRecord.RoundedDuration == 0) + { + results.Add(new ServiceRecordValidationResultDC() + { + Allow = false, + CustomerName = newServiceRecord.Customer != null ? newServiceRecord.Customer.LastNameFirstName : "", + EmployeeName = newServiceRecord.Employee != null ? newServiceRecord.Employee.FirstNameLastName : "", + Message = "Einträge mit einer Dauer von 0 Minuten können nicht gespeichert werden.", + ResultType = ServiceRecordValidationResult.Custom, + }); + } + + return results; + } + public override ServiceRecordValidationResultDC CheckOverlappingCustomerServiceRecords(ServiceRecordDC newServiceRecord, DateTime start, IList allCustomerRecords, bool isGroupRecord, decimal roundedDuration) {