KcmGmbH/Service/ServiceRecordValidator.cs - Startzeit bei IsBilling verpflichtend
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
<Compile Include="ServiceInvoiceReport.Designer.cs">
|
||||
<DependentUpon>ServiceInvoiceReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\ServiceRecordValidator.cs" />
|
||||
<Compile Include="SettlementReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
29
ReportImp/KcmGmbH/Service/ServiceRecordValidator.cs
Normal file
29
ReportImp/KcmGmbH/Service/ServiceRecordValidator.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace KcmGmbH.Service
|
||||
{
|
||||
public class CustomServiceRecordValidator : ServiceRecordValidator
|
||||
{
|
||||
public override List<ServiceRecordValidationResultDC> ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
|
||||
{
|
||||
var list = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
|
||||
DateTime start = newServiceRecord.Start.Value;
|
||||
bool noTime = (start.Hour == 0 && start.Minute == 0 && start.Second == 1); //Keine Zeit angegeben
|
||||
var duration = (decimal)newServiceRecord.End.Value.Subtract(newServiceRecord.Start.Value).TotalMinutes;
|
||||
if (noTime && duration != 0 && newServiceRecord.ServiceDescription.Category.IsBillable)
|
||||
{
|
||||
list.Add(new ServiceRecordValidationResultDC
|
||||
{
|
||||
ResultType = ServiceRecordValidationResult.Custom,
|
||||
Message = "Der Zeiterfassungseintrag muss eine Startzeit haben."
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user