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) {