ArcheTecklenburg/CustomHomeContentGenerator.cs - HPs für Admin auf Startseite,

ArcheTecklenburg/Invoicing/CollectiveInvoiceCreation.cs - nochmal die doofen Abwesenheiten
This commit is contained in:
2025-02-11 16:46:15 +01:00
parent 223d67fc11
commit c652278a65
3 changed files with 71 additions and 3 deletions

View File

@@ -98,6 +98,7 @@
<Compile Include="RechnungBesWohnformen.Designer.cs">
<DependentUpon>RechnungBesWohnformen.cs</DependentUpon>
</Compile>
<Compile Include="CustomHomeContentGenerator.cs" />
<Compile Include="Teamstundenkonto.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared.DataContracts.Compact;
namespace ArcheTecklenburg
{
class SDNHomeContentGenerator : HomeContentGenerator
{
public override List<CompactSupportConceptDC> GetExpiringSupportConcepts(long? employeeOid, DateTime expiredUntil)
{
bool showAll = false;
ApplicationUser user = null;
Employee emp = null;
if (employeeOid.HasValue)
{
emp = DAOFactory.GenericDAO.LoadByID<Employee>(employeeOid.Value);
user = DAOFactory.SearchDAO.FindUserForEmployee(emp);
if (user != null)
{
foreach (var ug in user.UserGroups)
{
if (ug.Name == "Administratoren")
{
showAll = true;
}
else if (ug.Name == "Büro")
{
showAll = true;
}
else if (ug.Name == "Leitungen")
{
showAll = true;
}
}
}
}
IEnumerable<SupportConcept> result = null;
if (showAll)
{
result = DAOFactory.SearchDAO.FindExpiringSupportConcepts(null, DateTime.Now.Date, expiredUntil);
}
else
{
result = DAOFactory.SearchDAO.FindExpiringSupportConcepts(employeeOid, DateTime.Now.Date, expiredUntil);
}
List<SupportConcept> liste = new List<SupportConcept>();
foreach (var sc in result)
{
//if (!sc.RenewalSendDate.HasValue)
//{
liste.Add(sc);
//}
}
return MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDCs(liste);
}
}
}

View File

@@ -191,8 +191,8 @@ namespace ArcheTecklenburg.Invoicing
{
DateTime? startAbw = at.Start;
DateTime? endAbw = at.End;
if (at.Start.HasValue && (at.End.HasValue && at.End.Value.Date.Subtract(at.Start.Value.Date).TotalDays > 3)
|| (!at.End.HasValue && ende.Subtract(at.Start.Value.Date).TotalDays > 3))
if (at.Start.HasValue && (at.End.HasValue && at.End.Value.Date.Subtract(at.Start.Value.Date).TotalDays > 4)
|| (!at.End.HasValue && ende.Subtract(at.Start.Value.Date).TotalDays > 4))
{
if (at.End.HasValue)
{
@@ -215,7 +215,7 @@ namespace ArcheTecklenburg.Invoicing
abwEnd = endAbw.Value;
}
DateTime dt = abwStart;
while (dt <= abwEnd)
while (dt < abwEnd)
{
tageAbwesenheit++;
tageAbwesendImMonat++;