BetreuwoWesel/CustomMitarbeiterstundenkontoBerechnung - Samstagszuschläge und Trennung So/Feiertage

This commit is contained in:
2024-08-02 12:48:11 +02:00
parent 4d7c237b79
commit bb70faa9fa
2 changed files with 151 additions and 49 deletions

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Entities;
using BeWo.Report.ReportObjects;
using BS.Shared.Extensions;
namespace BetreuWoWesel
{
@@ -58,7 +58,25 @@ namespace BetreuWoWesel
return dd;
}
public override void CalculateAbsenceTimesForDay(MitarbeiterstundenkontoRO.DayDetail dd,
public override void CalculateSpecialHours(MitarbeiterstundenkontoRO.DayDetail dd, ServiceRecord sr, decimal duration)
{
base.CalculateSpecialHours(dd, sr, duration);
var d1 = sr.Start.Value;
if (d1 >= new DateTime(2024, 07, 01))
{
var saturday = d1.GetNextDayOfWeek(DayOfWeek.Saturday);
var unroundedEnd = d1.AddMinutes((double)duration);
var saturdayStart = new DateTime(saturday.Year, saturday.Month, saturday.Day, 13, 0, 0);
var saturdayEnd = new DateTime(saturday.Year, saturday.Month, saturday.Day, 21, 0, 0);
dd.HoursSaturday += Math.Round((decimal)d1.GetIntersectingMinutes(unroundedEnd, saturdayStart, saturdayEnd) / 60, 2, MidpointRounding.AwayFromZero);
}
}
public override void CalculateAbsenceTimesForDay(MitarbeiterstundenkontoRO.DayDetail dd,
MitarbeiterstundenkontoRO.EmployeeDetail ed)
{
//do nothing

View File

@@ -31,8 +31,10 @@ namespace BetreuWoWesel
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Mitarbeiterstundenkonto));
DevExpress.XtraReports.UI.XRSummary xrSummary2 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRSummary xrSummary3 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRSummary xrSummary4 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRSummary xrSummary5 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRSummary xrSummary2 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRSummary xrSummary1 = new DevExpress.XtraReports.UI.XRSummary();
DevExpress.XtraReports.UI.XRWatermark xrWatermark1 = new DevExpress.XtraReports.UI.XRWatermark();
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
@@ -89,10 +91,13 @@ namespace BetreuWoWesel
this.lblSaldo5 = new DevExpress.XtraReports.UI.XRLabel();
this.lblSaldo1 = new DevExpress.XtraReports.UI.XRLabel();
this.Footer2 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.lblKommenAusFrei = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel7 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.Title = new DevExpress.XtraReports.UI.XRControlStyle();
this.FieldCaption = new DevExpress.XtraReports.UI.XRControlStyle();
this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle();
@@ -113,9 +118,10 @@ namespace BetreuWoWesel
this.fieldNightHours = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldSalaryDiff = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldMinutenGesamtIst = new DevExpress.XtraReports.UI.CalculatedField();
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
this.lblKommenAusFrei = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel11 = new DevExpress.XtraReports.UI.XRLabel();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit();
@@ -752,22 +758,60 @@ namespace BetreuWoWesel
// Footer2
//
this.Footer2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel10,
this.xrLabel11,
this.xrLabel5,
this.xrLabel6,
this.lblKommenAusFrei,
this.xrLabel3,
this.xrLabel15,
this.xrLabel17,
this.xrLabel8,
this.xrLabel7});
this.Footer2.HeightF = 80.00011F;
this.Footer2.HeightF = 126.4583F;
this.Footer2.Level = 3;
this.Footer2.Name = "Footer2";
//
// lblKommenAusFrei
//
this.lblKommenAusFrei.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.lblKommenAusFrei.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Regelarbeitszeit")});
this.lblKommenAusFrei.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.lblKommenAusFrei.LocationFloat = new DevExpress.Utils.PointFloat(350F, 100.0001F);
this.lblKommenAusFrei.Name = "lblKommenAusFrei";
this.lblKommenAusFrei.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.lblKommenAusFrei.SizeF = new System.Drawing.SizeF(102.0833F, 20F);
this.lblKommenAusFrei.StylePriority.UseBorders = false;
this.lblKommenAusFrei.StylePriority.UseFont = false;
this.lblKommenAusFrei.StylePriority.UsePadding = false;
this.lblKommenAusFrei.StylePriority.UseTextAlignment = false;
xrSummary3.FormatString = "{0:0.00}";
this.lblKommenAusFrei.Summary = xrSummary3;
this.lblKommenAusFrei.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// xrLabel3
//
this.xrLabel3.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Arial", 10F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 100.0001F);
this.xrLabel3.Name = "xrLabel3";
this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel3.SizeF = new System.Drawing.SizeF(350F, 20F);
this.xrLabel3.StylePriority.UseBorders = false;
this.xrLabel3.StylePriority.UseFont = false;
this.xrLabel3.StylePriority.UsePadding = false;
this.xrLabel3.StylePriority.UseTextAlignment = false;
this.xrLabel3.Text = "Su. Kommen aus frei (25€ pro Kommen)";
this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
//
// xrLabel15
//
this.xrLabel15.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Top | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.fieldSonnUndFeiertage")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.HoursHoliday")});
this.xrLabel15.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(350F, 20.00001F);
this.xrLabel15.Name = "xrLabel15";
@@ -777,9 +821,9 @@ namespace BetreuWoWesel
this.xrLabel15.StylePriority.UseFont = false;
this.xrLabel15.StylePriority.UsePadding = false;
this.xrLabel15.StylePriority.UseTextAlignment = false;
xrSummary2.FormatString = "{0:0.00}";
xrSummary2.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel15.Summary = xrSummary2;
xrSummary4.FormatString = "{0:0.00}";
xrSummary4.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel15.Summary = xrSummary4;
this.xrLabel15.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// xrLabel17
@@ -788,7 +832,7 @@ namespace BetreuWoWesel
this.xrLabel17.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.fieldNightHours")});
this.xrLabel17.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(350F, 40.00022F);
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(350F, 80.00005F);
this.xrLabel17.Name = "xrLabel17";
this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel17.SizeF = new System.Drawing.SizeF(102.0833F, 20F);
@@ -796,9 +840,9 @@ namespace BetreuWoWesel
this.xrLabel17.StylePriority.UseFont = false;
this.xrLabel17.StylePriority.UsePadding = false;
this.xrLabel17.StylePriority.UseTextAlignment = false;
xrSummary3.FormatString = "{0:0.00}";
xrSummary3.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel17.Summary = xrSummary3;
xrSummary5.FormatString = "{0:0.00}";
xrSummary5.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel17.Summary = xrSummary5;
this.xrLabel17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// xrLabel8
@@ -806,7 +850,7 @@ namespace BetreuWoWesel
this.xrLabel8.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel8.Font = new DevExpress.Drawing.DXFont("Arial", 10F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 40.00009F);
this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 80.00005F);
this.xrLabel8.Name = "xrLabel8";
this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel8.SizeF = new System.Drawing.SizeF(350F, 20F);
@@ -831,9 +875,13 @@ namespace BetreuWoWesel
this.xrLabel7.StylePriority.UseFont = false;
this.xrLabel7.StylePriority.UsePadding = false;
this.xrLabel7.StylePriority.UseTextAlignment = false;
this.xrLabel7.Text = "Su. Sonn-/Feiertagszuschläge / Leistungsmonat";
this.xrLabel7.Text = "Su. Feiertagszuschläge / Leistungsmonat";
this.xrLabel7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO);
//
// Title
//
this.Title.BackColor = System.Drawing.Color.White;
@@ -984,43 +1032,75 @@ namespace BetreuWoWesel
this.fieldMinutenGesamtIst.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal;
this.fieldMinutenGesamtIst.Name = "fieldMinutenGesamtIst";
//
// xrLabel3
// xrLabel5
//
this.xrLabel3.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
this.xrLabel5.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Arial", 10F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 60.0001F);
this.xrLabel3.Name = "xrLabel3";
this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel3.SizeF = new System.Drawing.SizeF(350F, 20F);
this.xrLabel3.StylePriority.UseBorders = false;
this.xrLabel3.StylePriority.UseFont = false;
this.xrLabel3.StylePriority.UsePadding = false;
this.xrLabel3.StylePriority.UseTextAlignment = false;
this.xrLabel3.Text = "Su. Kommen aus frei (25€ pro Kommen)";
this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrLabel5.Font = new DevExpress.Drawing.DXFont("Arial", 10F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 40.00003F);
this.xrLabel5.Name = "xrLabel5";
this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel5.SizeF = new System.Drawing.SizeF(350F, 20F);
this.xrLabel5.StylePriority.UseBorders = false;
this.xrLabel5.StylePriority.UseFont = false;
this.xrLabel5.StylePriority.UsePadding = false;
this.xrLabel5.StylePriority.UseTextAlignment = false;
this.xrLabel5.Text = "Su. Sonntagszuschläge / Leistungsmonat";
this.xrLabel5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
//
// lblKommenAusFrei
// xrLabel6
//
this.lblKommenAusFrei.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.lblKommenAusFrei.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Regelarbeitszeit")});
this.lblKommenAusFrei.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.lblKommenAusFrei.LocationFloat = new DevExpress.Utils.PointFloat(350F, 60.0001F);
this.lblKommenAusFrei.Name = "lblKommenAusFrei";
this.lblKommenAusFrei.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.lblKommenAusFrei.SizeF = new System.Drawing.SizeF(102.0833F, 20F);
this.lblKommenAusFrei.StylePriority.UseBorders = false;
this.lblKommenAusFrei.StylePriority.UseFont = false;
this.lblKommenAusFrei.StylePriority.UsePadding = false;
this.lblKommenAusFrei.StylePriority.UseTextAlignment = false;
this.xrLabel6.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel6.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.HoursSunday")});
this.xrLabel6.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.xrLabel6.LocationFloat = new DevExpress.Utils.PointFloat(350F, 40.00003F);
this.xrLabel6.Name = "xrLabel6";
this.xrLabel6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel6.SizeF = new System.Drawing.SizeF(102.0833F, 20F);
this.xrLabel6.StylePriority.UseBorders = false;
this.xrLabel6.StylePriority.UseFont = false;
this.xrLabel6.StylePriority.UsePadding = false;
this.xrLabel6.StylePriority.UseTextAlignment = false;
xrSummary2.FormatString = "{0:0.00}";
xrSummary2.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel6.Summary = xrSummary2;
this.xrLabel6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// xrLabel10
//
this.xrLabel10.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel10.Font = new DevExpress.Drawing.DXFont("Arial", 10F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(0F, 60.00004F);
this.xrLabel10.Name = "xrLabel10";
this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel10.SizeF = new System.Drawing.SizeF(350F, 20F);
this.xrLabel10.StylePriority.UseBorders = false;
this.xrLabel10.StylePriority.UseFont = false;
this.xrLabel10.StylePriority.UsePadding = false;
this.xrLabel10.StylePriority.UseTextAlignment = false;
this.xrLabel10.Text = "Su. Samstagszuschläge / Leistungsmonat";
this.xrLabel10.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
//
// xrLabel11
//
this.xrLabel11.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.HoursSaturday")});
this.xrLabel11.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.xrLabel11.LocationFloat = new DevExpress.Utils.PointFloat(350F, 60.00004F);
this.xrLabel11.Name = "xrLabel11";
this.xrLabel11.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel11.SizeF = new System.Drawing.SizeF(102.0833F, 20F);
this.xrLabel11.StylePriority.UseBorders = false;
this.xrLabel11.StylePriority.UseFont = false;
this.xrLabel11.StylePriority.UsePadding = false;
this.xrLabel11.StylePriority.UseTextAlignment = false;
xrSummary1.FormatString = "{0:0.00}";
this.lblKommenAusFrei.Summary = xrSummary1;
this.lblKommenAusFrei.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO);
xrSummary1.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrLabel11.Summary = xrSummary1;
this.xrLabel11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// Mitarbeiterstundenkonto
//
@@ -1154,5 +1234,9 @@ namespace BetreuWoWesel
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.XRLabel lblKommenAusFrei;
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
private DevExpress.XtraReports.UI.XRLabel xrLabel10;
private DevExpress.XtraReports.UI.XRLabel xrLabel11;
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
private DevExpress.XtraReports.UI.XRLabel xrLabel6;
}
}