AWOMuensterlandRecklinghausen/Mitarbeiterarbeitszeitkonto
This commit is contained in:
@@ -37,6 +37,10 @@ namespace AWOMuensterlandRecklinghausen
|
||||
}
|
||||
|
||||
var d1 = sr.Start.Value;
|
||||
if (sr.Start.Value > new DateTime(2023,05,19))
|
||||
{
|
||||
string test = "jep";
|
||||
}
|
||||
|
||||
var baseDate = new DateTime(d1.Year, d1.Month, d1.Day);
|
||||
|
||||
@@ -49,17 +53,65 @@ namespace AWOMuensterlandRecklinghausen
|
||||
var saturdayStart = new DateTime(saturday.Year, saturday.Month, saturday.Day, 14, 0, 0);
|
||||
var saturdayEnd = new DateTime(saturday.Year, saturday.Month, saturday.Day, 23, 0, 0);
|
||||
|
||||
dd.HoursSunday += (decimal)d1.GetIntersectingMinutes(unroundedEnd, sunday, sunday.AddHours(23).AddMinutes(59).AddSeconds(59)) / 60;
|
||||
dd.HoursSunday += (decimal)d1.GetIntersectingMinutes(unroundedEnd, sunday, sunday.AddHours(23).AddMinutes(59).AddSeconds(59));
|
||||
//if (dd.HoursSunday > 0)
|
||||
//{
|
||||
// sr.RoundedDuration += dd.HoursSunday * (decimal)0.25;
|
||||
//}
|
||||
|
||||
//dd.HoursHoliday2 += (decimal)d1.GetIntersectingMinutes(unroundedEnd, christmasEve, christmasEve.AddHours(23).AddMinutes(59).AddSeconds(59).AddMilliseconds(999)) / 60;
|
||||
//dd.HoursHoliday2 += (decimal)d1.GetIntersectingMinutes(unroundedEnd, newYearsEve, newYearsEve.AddHours(23).AddMinutes(59).AddSeconds(59).AddMilliseconds(999)) / 60;
|
||||
|
||||
if (IstFeiertag(d1))
|
||||
{
|
||||
dd.HoursHoliday += duration / 60;
|
||||
dd.HoursHoliday += duration;
|
||||
}
|
||||
|
||||
dd.HoursSaturday += (decimal)d1.GetIntersectingMinutes(unroundedEnd, saturdayStart, saturdayEnd) / 60;
|
||||
dd.HoursSaturday += (decimal)d1.GetIntersectingMinutes(unroundedEnd, saturdayStart, saturdayEnd);
|
||||
//if (dd.HoursSaturday > 0)
|
||||
//{
|
||||
// sr.RoundedDuration += dd.HoursSaturday * (decimal)0.2;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
public override void HandleServiceRecord(MitarbeiterstundenkontoRO.EmployeeDetail emp, ServiceRecord item)
|
||||
{
|
||||
decimal duration = 0;
|
||||
|
||||
if (item.GroupRoundedDuration.HasValue)
|
||||
{
|
||||
duration = item.GroupRoundedDuration.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
duration = item.RoundedDuration;
|
||||
}
|
||||
|
||||
var d1 = item.Start.Value;
|
||||
if (item.Start.Value > new DateTime(2023, 05, 19))
|
||||
{
|
||||
string test = "jep";
|
||||
}
|
||||
|
||||
var baseDate = new DateTime(d1.Year, d1.Month, d1.Day);
|
||||
var saturday = d1.GetNextDayOfWeek(DayOfWeek.Saturday);
|
||||
var sunday = d1.GetNextDayOfWeek(DayOfWeek.Sunday);
|
||||
var unroundedEnd = d1.AddMinutes((double)duration);
|
||||
var saturdayStart = new DateTime(saturday.Year, saturday.Month, saturday.Day, 14, 0, 0);
|
||||
var saturdayEnd = new DateTime(saturday.Year, saturday.Month, saturday.Day, 23, 0, 0);
|
||||
|
||||
var HoursSunday = (decimal)d1.GetIntersectingMinutes(unroundedEnd, sunday, sunday.AddHours(23).AddMinutes(59).AddSeconds(59));
|
||||
if (HoursSunday > 0)
|
||||
{
|
||||
duration += HoursSunday * (decimal)0.25;
|
||||
}
|
||||
var HoursSaturday = (decimal)d1.GetIntersectingMinutes(unroundedEnd, saturdayStart, saturdayEnd);
|
||||
if (HoursSaturday > 0)
|
||||
{
|
||||
duration += HoursSaturday * (decimal)0.2;
|
||||
}
|
||||
|
||||
item.RoundedDuration = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace AWOMuensterlandRecklinghausen
|
||||
// für Sortierung) erzeugen, wo in Custom1 dann "Gesamt steht" und die summierten Wochenstunden drin stehen, restlichen Datenfelder können dann leer sein.
|
||||
decimal sbStunden = 0;
|
||||
decimal aaStunden = 0;
|
||||
decimal MinutesTotal = 0;
|
||||
|
||||
var daysInMonth = ed.Days.Count;
|
||||
List<MitarbeiterstundenkontoRO.DayDetail> wochenSummaries = new List<MitarbeiterstundenkontoRO.DayDetail>();
|
||||
@@ -60,73 +61,55 @@ namespace AWOMuensterlandRecklinghausen
|
||||
if (day.ServiceRecords != null && day.ServiceRecords[0].ServiceDescription != null)
|
||||
{
|
||||
day.Custom1 = "AA";
|
||||
day.Custom2 = null;
|
||||
if (day.ServiceRecords[0].ServiceDescription.ServiceCategory.IsBillable)
|
||||
{
|
||||
day.Custom1 = "SB";
|
||||
sbStunden += day.MinutesTotal / 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
aaStunden += day.MinutesTotal / 60;
|
||||
}
|
||||
|
||||
// Bemerkungen in Custom2 setzen (Doku aus Zeiterfassung)
|
||||
day.Custom2 = !string.IsNullOrEmpty(day.ServiceRecords[0].Notice) ? day.ServiceRecords[0].Notice : "";
|
||||
if (day.Custom1 == "AA")
|
||||
{
|
||||
day.Custom2 = day.ServiceRecords[0].ServiceDescription.Name;
|
||||
}
|
||||
if (day.Custom2 != null)
|
||||
{
|
||||
day.Custom2 += " - ";
|
||||
}
|
||||
day.Custom2 += !string.IsNullOrEmpty(day.ServiceRecords[0].Notice) ? day.ServiceRecords[0].Notice : "";
|
||||
|
||||
if (day.HoursSaturday > 0)
|
||||
{
|
||||
day.Custom4 = String.Format("{0:0.00}", day.HoursSaturday / 12 * 2 / 60);
|
||||
}
|
||||
if (day.HoursSunday > 0)
|
||||
{
|
||||
day.Custom4 = String.Format("{0:0.00}", day.HoursSunday / 120 * 25 / 60);
|
||||
}
|
||||
}
|
||||
if (abwesend)
|
||||
day.MinutesTotal = day.SollStunden;
|
||||
else
|
||||
day.MinutesTotal = day.MinutesTotal / 60;
|
||||
// Überstunden
|
||||
|
||||
//MinutesTotal += day.MinutesTotal;
|
||||
day.MinutesTotal = day.MinutesTotal / 60;
|
||||
|
||||
decimal ueberstunden = 0;
|
||||
if (!day.IstSamstag && !day.IstSonntag)
|
||||
{
|
||||
ueberstunden = day.MinutesTotal - day.SollStunden;
|
||||
}
|
||||
else if (day.IstSamstag || day.IstSonntag)
|
||||
{
|
||||
ueberstunden += day.MinutesTotal;
|
||||
}
|
||||
if (abwesend && ueberstunden > 0)
|
||||
day.Custom3 = string.Format("{0:0.00}", ueberstunden);
|
||||
else if (!abwesend)
|
||||
day.Custom3 = string.Format("{0:0.00}", ueberstunden);
|
||||
else
|
||||
day.Custom3 = "0,00";
|
||||
|
||||
ueberstunden = day.MinutesTotal - day.SollStunden;
|
||||
//hier Dictionary für Überstunden bei mehreren Einträgen bauen
|
||||
|
||||
|
||||
|
||||
// // Wochen- und Gesamtstunden
|
||||
// wochenstunden += day.MinutesTotal;
|
||||
// gesamtstunden += day.MinutesTotal;
|
||||
|
||||
|
||||
// // Gesamtübersicht für Woche
|
||||
// if (day.IstSonntag || day.Date.Day == daysInMonth)
|
||||
// {
|
||||
// var summary = new MitarbeiterstundenkontoRO.DayDetail();
|
||||
// summary.Date = new DateTime(day.Date.Year, day.Date.Month, day.Date.Day, 18, 0, 0);
|
||||
// summary.Custom1 = "Gesamt";
|
||||
// summary.Custom2 = string.Format("{0:0.00}", wochensoll);
|
||||
// summary.SollStunden = wochensoll;
|
||||
// summary.Custom3 = string.Format("{0:0.00}", wochenstunden - wochensoll);
|
||||
// summary.MinutesTotal = wochenstunden;
|
||||
// wochenSummaries.Add(summary);
|
||||
// wochenstunden = 0;
|
||||
// wochenueberstunden = 0;
|
||||
// wochensoll = 0;
|
||||
// }
|
||||
day.Custom3 = string.Format("{0:0.00}", ueberstunden);
|
||||
}
|
||||
//ed.Custom1 = gesamtstunden;
|
||||
//ed.Custom2 = Convert.ToDecimal(ed.Custom1) - ed.StundenSollOhneUrlaubKrankheit;
|
||||
|
||||
//foreach (var s in wochenSummaries)
|
||||
// ed.Days.Add(s);
|
||||
//ed.Days = ed.Days.OrderBy(d => d.Date).ToList();
|
||||
//ed.StundenGesamtIst = MinutesTotal/60;
|
||||
//ed.Ueberstunden = ed.StundenSollMax - ed.StundenGesamtIst;
|
||||
lblAA.Text = string.Format("{0:0.00}", aaStunden);
|
||||
lblSB.Text = string.Format("{0:0.00}", sbStunden);
|
||||
|
||||
}
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user