LebenshilfeBadKreuznach/Validation/ServiceRecordValidator.cs - entfernt, da Gesamtbew jetzt relevant ist
SupportOID=167711
This commit is contained in:
@@ -89,7 +89,6 @@
|
||||
<DependentUpon>ServiceInvoiceReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Statistics\CustomServiceRecordStatisticFactory.cs" />
|
||||
<Compile Include="Validation\ServiceRecordValidator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Data\Data.csproj">
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace LebenshilfeBadKreuznach.Validation
|
||||
{
|
||||
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);
|
||||
var newResult = new List<ServiceRecordValidationResultDC>();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.ResultType != ServiceRecordValidationResult.ApprovedFLSOverspending && (String.IsNullOrEmpty(item.Message) || !item.Message.Contains("liegt außerhalb des Hilfeplanzeitraums")))
|
||||
{
|
||||
newResult.Add(item);
|
||||
}
|
||||
}
|
||||
if (statistics != null && statistics.PeriodStatistics != null)
|
||||
{
|
||||
foreach (var stat in statistics.PeriodStatistics)
|
||||
{
|
||||
if (stat.SupportConceptApprovalPeriod != null && stat.SupportConceptApprovalPeriod.ServiceCategory != null)
|
||||
{
|
||||
if (stat.SupportConceptApprovalPeriod.ServiceCategory.ServiceCategoryOid == newServiceRecord.ServiceDescription.Category.ServiceCategoryOid)
|
||||
{
|
||||
decimal newMinutes = newServiceRecord.RoundedDuration;
|
||||
|
||||
if (newMinutes + stat.MinutesProvidedThisMonth > stat.MinutesApprovedPerMonth)
|
||||
{
|
||||
var klient = "diesen Hilfeplan";
|
||||
if (newServiceRecord.Customer != null)
|
||||
{
|
||||
klient = BS.Shared.Translation.Translator.Translate("Klient/in") + " " + newServiceRecord.Customer.LastNameFirstName;
|
||||
}
|
||||
|
||||
var msg = string.Format("Die für {2} genehmigten FLS ({0:N}) werden mit diesem Eintrag ({1:N}) überschritten.", stat.MinutesApprovedPerMonth / 60, newMinutes / 60, klient);
|
||||
|
||||
var dc = new ServiceRecordValidationResultDC
|
||||
{
|
||||
ResultType = ServiceRecordValidationResult.Custom,
|
||||
Message = msg,
|
||||
Allow = false
|
||||
};
|
||||
|
||||
newResult.Add(dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user