MH: Alpha e.V. Stundenkonto FLS Quote

This commit is contained in:
2023-11-15 16:55:25 +01:00
parent ae167c31b4
commit 15ff98a0d7
4 changed files with 92 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.Core;
@@ -25,25 +26,26 @@ namespace AlphaEv
msb.CreateReport(pRO);
decimal istgesamt = 0;
decimal sollgesamt = 0;
decimal azgesamt = 0;
foreach (var ed in pRO.EmployeeDetailList)
{
if (ed.FlsSoll != 0)
var az = ed.MittelbarIst - ed.Days.Sum(d => d.PauseInMinuten) / 60;
if (az != 0)
{
ed.StundenGesamtIst = (Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(((ed.FlsSoll / 3) * 4), 2, MidpointRounding.AwayFromZero)) * 100;
}
//ed.StundenGesamtIst = (Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(((ed.FlsSoll / 3) * 4), 2, MidpointRounding.AwayFromZero)) * 100;
ed.StundenGesamtIst = Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(az, 2, MidpointRounding.AwayFromZero) * 100;
}
else
{
ed.StundenGesamtIst = -999;
}
istgesamt += ed.FlsIst;
sollgesamt += (ed.FlsSoll / 3) * 4;
azgesamt += az;
}
if (sollgesamt != 0)
if (azgesamt != 0)
{
pRO.StundenGesamt = (Math.Round(istgesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(sollgesamt, 2, MidpointRounding.AwayFromZero)) * 100;
pRO.StundenGesamt = (Math.Round(istgesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(azgesamt, 2, MidpointRounding.AwayFromZero)) * 100;
}
else
{
@@ -52,9 +54,9 @@ namespace AlphaEv
decimal gesamtProzent = 100;
if (sollgesamt != 0)
if (azgesamt != 0)
{
gesamtProzent = (Math.Round(istgesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(sollgesamt, 2, MidpointRounding.AwayFromZero)) * 100;
gesamtProzent = (Math.Round(istgesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(azgesamt, 2, MidpointRounding.AwayFromZero)) * 100;
}

View File

@@ -24,12 +24,13 @@ namespace AlphaEv
foreach (var info in pRO.EmployeeInfoList)
{
decimal sollGesamt = 0;
decimal azGesamt = 0;
decimal istGesamt = 0;
foreach (var ed in info.EmployeeDetails)
{
istGesamt += ed.EmployeeDetail.FlsIst;
sollGesamt += (ed.EmployeeDetail.FlsSoll / 3) *4;
//sollGesamt += (ed.EmployeeDetail.FlsSoll / 3) *4;
azGesamt += ed.EmployeeDetail.StundenGesamtIst;
decimal flsfactor = 0.75m;
decimal diffBeWoArbeitszeit = 0;
@@ -45,10 +46,11 @@ namespace AlphaEv
ed.EmployeeDetail.StundenMittelbarIst -= diffBeWoArbeitszeit;
if (ed.EmployeeDetail.FlsSoll != 0)
if (ed.EmployeeDetail.StundenGesamtIst != 0)
{
ed.EmployeeDetail.Custom10 = (Math.Round(ed.EmployeeDetail.FlsIst, 2, MidpointRounding.AwayFromZero) * 100) / ((ed.EmployeeDetail.FlsSoll / 3) * 4);
}
//ed.EmployeeDetail.Custom10 = (Math.Round(ed.EmployeeDetail.FlsIst, 2, MidpointRounding.AwayFromZero) * 100) / ((ed.EmployeeDetail.FlsSoll / 3) * 4);
ed.EmployeeDetail.Custom10 = (Math.Round(ed.EmployeeDetail.FlsIst, 2, MidpointRounding.AwayFromZero) * 100) / ed.EmployeeDetail.StundenGesamtIst;
}
else
{
ed.EmployeeDetail.Custom10 = 100;
@@ -58,9 +60,9 @@ namespace AlphaEv
ed.EmployeeDetail.Custom9 = ed.EmployeeDetail.FlsDiff * 1.25m;
decimal gesamtProzent = 100;
if (sollGesamt != 0)
if (azGesamt != 0)
{
gesamtProzent = (Math.Round(istGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(sollGesamt, 2, MidpointRounding.AwayFromZero)) * 100;
gesamtProzent = (Math.Round(istGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(azGesamt, 2, MidpointRounding.AwayFromZero)) * 100;
}

View File

@@ -23,17 +23,34 @@ namespace AlphaEv
foreach (var td in pRO.TeamDetailList)
{
decimal azGesamt = 0;
decimal flsGesamt = 0;
foreach (var ed in td.EmployeeDetailList)
{
if (ed.StundenSollOhneUrlaubKrankheit != 0)
azGesamt += ed.StundenGesamtIst;
flsGesamt += ed.FlsIst;
if (ed.StundenGesamtIst != 0)
{
ed.StundenGesamtIst = (Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(ed.StundenSollOhneUrlaubKrankheit, 2, MidpointRounding.AwayFromZero)) * 100;
ed.Custom10 = (Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(ed.StundenGesamtIst, 2, MidpointRounding.AwayFromZero)) * 100;
}
else
{
ed.StundenGesamtIst = -999;
}
}
if (ed.StundenSollOhneUrlaubKrankheit != 0)
{
ed.StundenGesamtIst = (Math.Round(ed.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(ed.StundenSollOhneUrlaubKrankheit, 2, MidpointRounding.AwayFromZero)) * 100;
}
else
{
ed.StundenGesamtIst = -999;
}
}
if (azGesamt != 0)
{
lblQuoteGesamt.Text = string.Format("{0:0.0}%", (Math.Round(flsGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(azGesamt, 2, MidpointRounding.AwayFromZero)) * 100);
}
if (td.SollGesamt != 0)
{
td.StundenGesamt = (Math.Round(td.FlsIstGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(td.SollGesamt, 2, MidpointRounding.AwayFromZero)) * 100;

View File

@@ -100,9 +100,13 @@ namespace AlphaEv
this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.ReportFooter1 = new DevExpress.XtraReports.UI.ReportFooterBand();
this.fieldRelationSollIst = new DevExpress.XtraReports.UI.CalculatedField();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell();
this.lblQuoteGesamt = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.fieldFLSQuote = new DevExpress.XtraReports.UI.CalculatedField();
((System.ComponentModel.ISupportInitialize)(this.xrTableDetail)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableHeader)).BeginInit();
@@ -127,7 +131,7 @@ namespace AlphaEv
this.xrTableDetail.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrTableDetail.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRowDetail});
this.xrTableDetail.SizeF = new System.Drawing.SizeF(1010F, 25F);
this.xrTableDetail.SizeF = new System.Drawing.SizeF(1100F, 25F);
this.xrTableDetail.StylePriority.UseBorders = false;
this.xrTableDetail.StylePriority.UseFont = false;
this.xrTableDetail.StylePriority.UsePadding = false;
@@ -146,6 +150,7 @@ namespace AlphaEv
this.xrTableCell23,
this.xrTableCell21,
this.xrTableCell24,
this.xrTableCell12,
this.xrTableCell26});
this.xrTableRowDetail.Name = "xrTableRowDetail";
this.xrTableRowDetail.Weight = 1D;
@@ -518,7 +523,7 @@ namespace AlphaEv
this.xrTableHeader.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrTableHeader.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRowHeader});
this.xrTableHeader.SizeF = new System.Drawing.SizeF(1010F, 40F);
this.xrTableHeader.SizeF = new System.Drawing.SizeF(1100F, 40F);
this.xrTableHeader.StylePriority.UseBorders = false;
this.xrTableHeader.StylePriority.UseFont = false;
this.xrTableHeader.StylePriority.UsePadding = false;
@@ -537,6 +542,7 @@ namespace AlphaEv
this.xrTableCell45,
this.xrTableCell46,
this.xrTableCell49,
this.xrTableCell6,
this.xrTableCell50});
this.xrTableRowHeader.Name = "xrTableRowHeader";
this.xrTableRowHeader.Weight = 1.6D;
@@ -626,7 +632,7 @@ namespace AlphaEv
this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow3});
this.xrTable3.SizeF = new System.Drawing.SizeF(1010F, 25F);
this.xrTable3.SizeF = new System.Drawing.SizeF(1100F, 25F);
this.xrTable3.StylePriority.UseBorders = false;
this.xrTable3.StylePriority.UseFont = false;
this.xrTable3.StylePriority.UsePadding = false;
@@ -643,6 +649,7 @@ namespace AlphaEv
this.xrTableCell10,
this.xrTableCell11,
this.xrTableCell14,
this.lblQuoteGesamt,
this.xrTableCell15});
this.xrTableRow3.Name = "xrTableRow3";
this.xrTableRow3.Weight = 1D;
@@ -716,10 +723,6 @@ namespace AlphaEv
this.xrTableCell15.Name = "xrTableCell15";
this.xrTableCell15.Weight = 0.0811541929666366D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO);
//
// ReportFooter1
//
this.ReportFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
@@ -734,6 +737,35 @@ namespace AlphaEv
this.fieldRelationSollIst.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal;
this.fieldRelationSollIst.Name = "fieldRelationSollIst";
//
// xrTableCell6
//
this.xrTableCell6.Multiline = true;
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.Text = "FLS/Arbeitsz.\r\nQuote";
this.xrTableCell6.Weight = 0.081154192808111425D;
//
// xrTableCell12
//
this.xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "TeamDetailList.EmployeeDetailList.fieldFLSQuote", "{0:0.0}%")});
this.xrTableCell12.Name = "xrTableCell12";
this.xrTableCell12.Weight = 0.081154192966636618D;
//
// lblQuoteGesamt
//
this.lblQuoteGesamt.Name = "lblQuoteGesamt";
this.lblQuoteGesamt.Weight = 0.081154192966636618D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO);
//
// fieldFLSQuote
//
this.fieldFLSQuote.DataMember = "TeamDetailList.EmployeeDetailList";
this.fieldFLSQuote.Expression = "Iif([Custom10] > 0, [Custom10], ?)";
this.fieldFLSQuote.Name = "fieldFLSQuote";
//
// Teamstundenkonto
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -746,10 +778,11 @@ namespace AlphaEv
this.ReportFooter1});
this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] {
this.fieldFLS,
this.fieldRelationSollIst});
this.fieldRelationSollIst,
this.fieldFLSQuote});
this.DataSource = this.bindingSource1;
this.Landscape = true;
this.Margins = new System.Drawing.Printing.Margins(75, 75, 50, 30);
this.Margins = new System.Drawing.Printing.Margins(40, 12, 50, 30);
this.PageHeight = 827;
this.PageWidth = 1169;
this.PaperKind = System.Drawing.Printing.PaperKind.A4;
@@ -839,5 +872,9 @@ namespace AlphaEv
private DevExpress.XtraReports.UI.XRTableCell xrTableCell49;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell50;
private DevExpress.XtraReports.UI.CalculatedField fieldRelationSollIst;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell12;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRTableCell lblQuoteGesamt;
private DevExpress.XtraReports.UI.CalculatedField fieldFLSQuote;
}
}