70 lines
2.2 KiB
C#
70 lines
2.2 KiB
C#
using System;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.Core;
|
|
|
|
|
|
namespace SozialeDienstleistungenBeckerReports
|
|
{
|
|
[IDSpecificClass(Identifier = "MitarbeiterstundenkontoJahr")]
|
|
public partial class MitarbeiterstundenkontoJahr : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<MitarbeiterstundenkontoMonateRO>
|
|
{
|
|
|
|
|
|
public MitarbeiterstundenkontoJahr()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(MitarbeiterstundenkontoMonateRO pRO)
|
|
{
|
|
var msb = new MitarbeiterstundenkontoBerechnungMonate();
|
|
msb.CreateReport(pRO);
|
|
|
|
decimal allesGesamt = 0;
|
|
decimal flsGesamt = 0;
|
|
foreach (var info in pRO.EmployeeInfoList)
|
|
{
|
|
foreach (var ed in info.EmployeeDetails)
|
|
{
|
|
flsGesamt += ed.EmployeeDetail.FlsIst;
|
|
allesGesamt += ed.EmployeeDetail.FlsIst + ed.EmployeeDetail.MittelbarIst;
|
|
|
|
//if (ed.EmployeeDetail.StundenSollOhneUrlaubKrankheit != 0)
|
|
//{
|
|
|
|
|
|
// ed.EmployeeDetail.StundenGesamtIst = (Math.Round(ed.EmployeeDetail.FlsIst, 2, MidpointRounding.AwayFromZero) / Math.Round(ed.EmployeeDetail.StundenSollOhneUrlaubKrankheit, 2, MidpointRounding.AwayFromZero)) * 100;
|
|
//}
|
|
//else
|
|
//{
|
|
// ed.EmployeeDetail.StundenGesamtIst = 100;
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
decimal gesamtProzent = 100;
|
|
|
|
if (allesGesamt != 0)
|
|
{
|
|
gesamtProzent = (Math.Round(flsGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(allesGesamt, 2, MidpointRounding.AwayFromZero)) * 100;
|
|
|
|
}
|
|
|
|
cellGesamtProzent.Text = String.Format("{0:0.0}%", gesamtProzent);
|
|
//if (pRO. SollGesamt != 0)
|
|
//{
|
|
// pRO.StundenGesamt = (Math.Round(pRO.FlsIstGesamt, 2, MidpointRounding.AwayFromZero) / Math.Round(pRO.SollGesamt, 2, MidpointRounding.AwayFromZero)) * 100;
|
|
//}
|
|
//else
|
|
//{
|
|
// pRO.StundenGesamt = 100;
|
|
//}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
}
|
|
}
|