68 lines
2.3 KiB
C#
68 lines
2.3 KiB
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using BS.Shared.Core;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace ApiBerlin
|
|
{
|
|
[IDSpecificClass(Identifier = "Mitarbeiterarbeitszeitkonto")]
|
|
public partial class Mitarbeiterarbeitszeitkonto : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<MitarbeiterstundenkontoRO>
|
|
{
|
|
|
|
public Mitarbeiterarbeitszeitkonto()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(MitarbeiterstundenkontoRO pRO)
|
|
{
|
|
var msb = new ApiMitarbeiterstundenkontoBerechnungTagesansicht();
|
|
msb.CreateReport(pRO);
|
|
|
|
foreach (var ed in pRO.EmployeeDetailList)
|
|
{
|
|
ed.Employee.Schutzstufe = null;
|
|
var c = ed.Employee.GetValidContractForDate(pRO.ReportStartDate);
|
|
if (c != null)
|
|
{
|
|
if (c.MonthlyTotalHours.HasValue)
|
|
{
|
|
ed.Regelarbeitszeit = String.Format("{0:0.00} Stunden im Monat", c.MonthlyTotalHours);
|
|
}
|
|
else if (c.WeeklyTotalHours.HasValue)
|
|
{
|
|
ed.Regelarbeitszeit = String.Format("{0:0.00} Stunden pro Woche", c.WeeklyTotalHours);
|
|
}
|
|
}
|
|
foreach (var d in ed.Days)
|
|
{
|
|
if (d.ServiceRecords != null && d.ServiceRecords.Count > 0)
|
|
foreach (var sr in d.ServiceRecords)
|
|
{
|
|
if (sr.ServiceDescription.Category.Name.Contains("Arbeitszeit Sonstiges") && sr.ServiceDescription.Name.Contains("Pause"))
|
|
{
|
|
if (d.Custom8 != null && d.Custom8.Length != 0)
|
|
d.Custom8 += ", ";
|
|
d.Custom8 += String.Format("{0:HH:mm} - {1:HH:mm}", sr.Start, sr.End);
|
|
}
|
|
else if (sr.ServiceDescription.Category.Name == "Arbeitszeit Sonstiges" && sr.ServiceDescription.Name.Contains("Test C19"))
|
|
d.Custom9 = "x";
|
|
else if (sr.ServiceDescription.Category.Name.Contains("Arbeitszeit Sonstiges") && sr.ServiceDescription.Name.Contains("Supervision"))
|
|
{
|
|
if (ed.Employee.Schutzstufe != null && ed.Employee.Schutzstufe.Length != 0)
|
|
ed.Employee.Schutzstufe += ", ";
|
|
ed.Employee.Schutzstufe += String.Format("am {0:dd.MM.yyyy} - {1:0.##} Minuten", sr.Start, sr.RoundedDuration);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|