AbwKlassen Abwesenheiten

This commit is contained in:
2023-05-26 13:41:40 +02:00
parent 506b9eaf47
commit a71074bae5
5 changed files with 147 additions and 14 deletions

View File

@@ -81,18 +81,18 @@
<Compile Include="ServicesOverviewReport.Designer.cs">
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
</Compile>
<Compile Include="SettlementReport2.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SettlementReport2.Designer.cs">
<DependentUpon>SettlementReport2.cs</DependentUpon>
</Compile>
<Compile Include="SettlementReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SettlementReport.Designer.cs">
<DependentUpon>SettlementReport.cs</DependentUpon>
</Compile>
<Compile Include="SettlementReport2.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SettlementReport2.Designer.cs">
<DependentUpon>SettlementReport2.cs</DependentUpon>
</Compile>
<Compile Include="Teamstundenkonto.cs">
<SubType>Component</SubType>
</Compile>
@@ -118,12 +118,12 @@
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SettlementReport2.resx">
<DependentUpon>SettlementReport2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SettlementReport.resx">
<DependentUpon>SettlementReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SettlementReport2.resx">
<DependentUpon>SettlementReport2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Teamstundenkonto.resx">
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -1,5 +1,5 @@
using BeWo.Report.ReportObjects;
namespace AbwKlassen
namespace AbwKlassen.Alt
{
partial class Spitzabrechnung
{

View File

@@ -5,8 +5,11 @@ using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using System.Text;
namespace AbwKlassen
namespace AbwKlassen.Alt
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
{
@@ -78,7 +81,72 @@ namespace AbwKlassen
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
ErstelleAbwesenheiten(pRO);
this.bindingSource1.DataSource = pRO;
}
private void ErstelleAbwesenheiten(SettlementRO pRo)
{
pRo.AbsenceTimes = "";
if (pRo.CostBearer2SupportConceptOid < 1)
return;
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRo.CostBearer2SupportConceptOid);
var c = cb2sc.SupportConcept.Customer;
if (c.AbsenceTimes != null)
{
var sb = new StringBuilder();
foreach (var at in c.AbsenceTimes)
{
if (at.AbsenceSpan != null)
{
if (at.Start != null && at.Start <= pRo.AccountingEndDate && ((at.End != null && at.End >= pRo.AccountingStartDate) || at.End == null))
{
DateTime start = at.Start.Value.AddDays(1);
DateTime end = DateTime.MaxValue;
if (at.End.HasValue)
{
end = at.End.Value.AddDays(-1);
}
if (end.Subtract(start).TotalDays > 0)
{
if (sb.Length > 0)
{
sb.Append(", ");
}
sb.Append(string.Format("{0:dd.MM.yyyy}", start));
sb.Append(" - ");
if (end == DateTime.MaxValue)
{
sb.Append("unbekannt");
}
else
{
sb.Append(string.Format("{0:dd.MM.yyyy}", end));
}
sb.Append(" ");
sb.Append(at.AbsenceReason.Description);
}
}
}
}
if (sb.Length > 0)
{
pRo.AbsenceTimes = "Abwesenheitszeiten: " + sb;
}
}
}
}
}

View File

@@ -1,5 +1,5 @@
using BeWo.Report.ReportObjects;
namespace AbwKlassen.Neu
namespace AbwKlassen
{
partial class Spitzabrechnung
{

View File

@@ -7,8 +7,11 @@ using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared.Extensions;
using System.Text.RegularExpressions;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using System.Text;
namespace AbwKlassen.Neu
namespace AbwKlassen
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
@@ -39,7 +42,69 @@ namespace AbwKlassen.Neu
}
}
pRO.RateFactor = (double)rateFactor;
this.bindingSource1.DataSource = pRO;
ErstelleAbwesenheiten(pRO);
this.bindingSource1.DataSource = pRO;
}
private void ErstelleAbwesenheiten(Settlement2RO pRo)
{
pRo.AbsenceTimes = "";
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(pRo.InvoiceBaseOid.Value);
var c = ib.CostBearer2SupportConcept.SupportConcept.Customer;
if (c.AbsenceTimes != null)
{
var sb = new StringBuilder();
foreach (var at in c.AbsenceTimes)
{
if (at.AbsenceSpan != null)
{
if (at.Start != null && at.Start <= pRo.AccountingEndDate && ((at.End != null && at.End >= pRo.AccountingStartDate) || at.End == null))
{
DateTime start = at.Start.Value.AddDays(1);
DateTime end = DateTime.MaxValue;
if (at.End.HasValue)
{
end = at.End.Value.AddDays(-1);
}
if (end.Subtract(start).TotalDays > 0)
{
if (sb.Length > 0)
{
sb.Append(", ");
}
sb.Append(string.Format("{0:dd.MM.yyyy}", start));
sb.Append(" - ");
if (end == DateTime.MaxValue)
{
sb.Append("unbekannt");
}
else
{
sb.Append(string.Format("{0:dd.MM.yyyy}", end));
}
sb.Append(" ");
sb.Append(at.AbsenceReason.Description);
}
}
}
}
if (sb.Length > 0)
{
pRo.AbsenceTimes = "Abwesenheitszeiten: " + sb;
}
}
}
}
}